@lightsparkdev/lightspark-sdk 0.4.7 → 0.4.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/dist/index.cjs +5 -5
- package/dist/index.js +5 -5
- package/package.json +3 -3
- package/src/auth/AccountTokenAuthProvider.ts +2 -1
- package/src/client.ts +33 -31
- package/src/graphql/MultiNodeDashboard.ts +6 -7
- package/src/objects/Account.ts +23 -29
- package/src/objects/AccountToApiTokensConnection.ts +4 -2
- package/src/objects/AccountToChannelsConnection.ts +2 -1
- package/src/objects/AccountToNodesConnection.ts +4 -2
- package/src/objects/AccountToPaymentRequestsConnection.ts +4 -2
- package/src/objects/AccountToTransactionsConnection.ts +6 -3
- package/src/objects/AccountToWalletsConnection.ts +4 -2
- package/src/objects/ApiToken.ts +2 -2
- package/src/objects/Balances.ts +2 -1
- package/src/objects/BlockchainBalance.ts +2 -1
- package/src/objects/Channel.ts +10 -9
- package/src/objects/ChannelClosingTransaction.ts +6 -5
- package/src/objects/ChannelFees.ts +2 -1
- package/src/objects/ChannelOpeningTransaction.ts +6 -5
- package/src/objects/ChannelToTransactionsConnection.ts +2 -1
- package/src/objects/CreateApiTokenOutput.ts +2 -1
- package/src/objects/Deposit.ts +6 -5
- package/src/objects/FeeEstimate.ts +2 -1
- package/src/objects/FundNodeOutput.ts +2 -1
- package/src/objects/GraphNode.ts +6 -7
- package/src/objects/Hop.ts +4 -3
- package/src/objects/IncomingPayment.ts +8 -8
- package/src/objects/IncomingPaymentAttempt.ts +4 -3
- package/src/objects/IncomingPaymentToAttemptsConnection.ts +2 -3
- package/src/objects/Invoice.ts +7 -5
- package/src/objects/InvoiceData.ts +5 -3
- package/src/objects/LightningFeeEstimateOutput.ts +2 -1
- package/src/objects/LightningTransaction.ts +7 -5
- package/src/objects/LightsparkNode.ts +15 -16
- package/src/objects/LightsparkNodeOwner.ts +3 -2
- package/src/objects/LightsparkNodeToChannelsConnection.ts +4 -2
- package/src/objects/Node.ts +7 -7
- package/src/objects/NodeToAddressesConnection.ts +2 -1
- package/src/objects/OnChainTransaction.ts +10 -8
- package/src/objects/OutgoingPayment.ts +11 -11
- package/src/objects/OutgoingPaymentAttempt.ts +7 -7
- package/src/objects/OutgoingPaymentAttemptToHopsConnection.ts +2 -1
- package/src/objects/OutgoingPaymentToAttemptsConnection.ts +2 -3
- package/src/objects/PaymentRequest.ts +5 -4
- package/src/objects/PaymentRequestData.ts +1 -1
- package/src/objects/RoutingTransaction.ts +8 -6
- package/src/objects/SingleNodeDashboard.ts +6 -6
- package/src/objects/Transaction.ts +10 -8
- package/src/objects/TransactionUpdate.ts +2 -1
- package/src/objects/Wallet.ts +7 -5
- package/src/objects/Withdrawal.ts +6 -5
- package/src/objects/WithdrawalRequest.ts +9 -10
- package/src/objects/WithdrawalRequestToChannelClosingTransactionsConnection.ts +4 -4
- package/src/objects/WithdrawalRequestToChannelOpeningTransactionsConnection.ts +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @lightsparkdev/lightspark-sdk
|
|
2
2
|
|
|
3
|
+
## 0.4.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 6cd80d4: Fix an issue with json deserialization for lightning fee estimates
|
|
8
|
+
|
|
9
|
+
## 0.4.8
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 141d73a: Enable/fix consistent-type-imports lint rule
|
|
14
|
+
- Updated dependencies [141d73a]
|
|
15
|
+
- @lightsparkdev/core@0.3.10
|
|
16
|
+
|
|
3
17
|
## 0.4.7
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
|
@@ -1927,7 +1927,7 @@ var import_crypto = require("crypto");
|
|
|
1927
1927
|
// package.json
|
|
1928
1928
|
var package_default = {
|
|
1929
1929
|
name: "@lightsparkdev/lightspark-sdk",
|
|
1930
|
-
version: "0.4.
|
|
1930
|
+
version: "0.4.9",
|
|
1931
1931
|
description: "Lightspark JS SDK",
|
|
1932
1932
|
author: "Lightspark Inc.",
|
|
1933
1933
|
keywords: [
|
|
@@ -1999,7 +1999,7 @@ var package_default = {
|
|
|
1999
1999
|
},
|
|
2000
2000
|
license: "Apache-2.0",
|
|
2001
2001
|
dependencies: {
|
|
2002
|
-
"@lightsparkdev/core": "0.3.
|
|
2002
|
+
"@lightsparkdev/core": "0.3.10",
|
|
2003
2003
|
"auto-bind": "^5.0.1",
|
|
2004
2004
|
crypto: "^1.0.1",
|
|
2005
2005
|
"crypto-browserify": "^3.12.0",
|
|
@@ -2011,7 +2011,7 @@ var package_default = {
|
|
|
2011
2011
|
},
|
|
2012
2012
|
devDependencies: {
|
|
2013
2013
|
"@lightsparkdev/eslint-config": "*",
|
|
2014
|
-
"@lightsparkdev/gql": "0.0.
|
|
2014
|
+
"@lightsparkdev/gql": "0.0.3",
|
|
2015
2015
|
"@lightsparkdev/tsconfig": "0.0.0",
|
|
2016
2016
|
"@types/crypto-js": "^4.1.1",
|
|
2017
2017
|
"@types/jest": "^29.5.2",
|
|
@@ -7841,7 +7841,7 @@ var LightsparkClient = class {
|
|
|
7841
7841
|
}
|
|
7842
7842
|
);
|
|
7843
7843
|
return CurrencyAmountFromJson(
|
|
7844
|
-
response.lightning_fee_estimate_for_invoice.
|
|
7844
|
+
response.lightning_fee_estimate_for_invoice.lightning_fee_estimate_output_fee_estimate
|
|
7845
7845
|
);
|
|
7846
7846
|
}
|
|
7847
7847
|
/**
|
|
@@ -7862,7 +7862,7 @@ var LightsparkClient = class {
|
|
|
7862
7862
|
}
|
|
7863
7863
|
);
|
|
7864
7864
|
return CurrencyAmountFromJson(
|
|
7865
|
-
response.lightning_fee_estimate_for_node.
|
|
7865
|
+
response.lightning_fee_estimate_for_node.lightning_fee_estimate_output_fee_estimate
|
|
7866
7866
|
);
|
|
7867
7867
|
}
|
|
7868
7868
|
/**
|
package/dist/index.js
CHANGED
|
@@ -115,7 +115,7 @@ import { createHash } from "crypto";
|
|
|
115
115
|
// package.json
|
|
116
116
|
var package_default = {
|
|
117
117
|
name: "@lightsparkdev/lightspark-sdk",
|
|
118
|
-
version: "0.4.
|
|
118
|
+
version: "0.4.9",
|
|
119
119
|
description: "Lightspark JS SDK",
|
|
120
120
|
author: "Lightspark Inc.",
|
|
121
121
|
keywords: [
|
|
@@ -187,7 +187,7 @@ var package_default = {
|
|
|
187
187
|
},
|
|
188
188
|
license: "Apache-2.0",
|
|
189
189
|
dependencies: {
|
|
190
|
-
"@lightsparkdev/core": "0.3.
|
|
190
|
+
"@lightsparkdev/core": "0.3.10",
|
|
191
191
|
"auto-bind": "^5.0.1",
|
|
192
192
|
crypto: "^1.0.1",
|
|
193
193
|
"crypto-browserify": "^3.12.0",
|
|
@@ -199,7 +199,7 @@ var package_default = {
|
|
|
199
199
|
},
|
|
200
200
|
devDependencies: {
|
|
201
201
|
"@lightsparkdev/eslint-config": "*",
|
|
202
|
-
"@lightsparkdev/gql": "0.0.
|
|
202
|
+
"@lightsparkdev/gql": "0.0.3",
|
|
203
203
|
"@lightsparkdev/tsconfig": "0.0.0",
|
|
204
204
|
"@types/crypto-js": "^4.1.1",
|
|
205
205
|
"@types/jest": "^29.5.2",
|
|
@@ -1083,7 +1083,7 @@ var LightsparkClient = class {
|
|
|
1083
1083
|
}
|
|
1084
1084
|
);
|
|
1085
1085
|
return CurrencyAmountFromJson(
|
|
1086
|
-
response.lightning_fee_estimate_for_invoice.
|
|
1086
|
+
response.lightning_fee_estimate_for_invoice.lightning_fee_estimate_output_fee_estimate
|
|
1087
1087
|
);
|
|
1088
1088
|
}
|
|
1089
1089
|
/**
|
|
@@ -1104,7 +1104,7 @@ var LightsparkClient = class {
|
|
|
1104
1104
|
}
|
|
1105
1105
|
);
|
|
1106
1106
|
return CurrencyAmountFromJson(
|
|
1107
|
-
response.lightning_fee_estimate_for_node.
|
|
1107
|
+
response.lightning_fee_estimate_for_node.lightning_fee_estimate_output_fee_estimate
|
|
1108
1108
|
);
|
|
1109
1109
|
}
|
|
1110
1110
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lightsparkdev/lightspark-sdk",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.9",
|
|
4
4
|
"description": "Lightspark JS SDK",
|
|
5
5
|
"author": "Lightspark Inc.",
|
|
6
6
|
"keywords": [
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
},
|
|
73
73
|
"license": "Apache-2.0",
|
|
74
74
|
"dependencies": {
|
|
75
|
-
"@lightsparkdev/core": "0.3.
|
|
75
|
+
"@lightsparkdev/core": "0.3.10",
|
|
76
76
|
"auto-bind": "^5.0.1",
|
|
77
77
|
"crypto": "^1.0.1",
|
|
78
78
|
"crypto-browserify": "^3.12.0",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
},
|
|
85
85
|
"devDependencies": {
|
|
86
86
|
"@lightsparkdev/eslint-config": "*",
|
|
87
|
-
"@lightsparkdev/gql": "0.0.
|
|
87
|
+
"@lightsparkdev/gql": "0.0.3",
|
|
88
88
|
"@lightsparkdev/tsconfig": "0.0.0",
|
|
89
89
|
"@types/crypto-js": "^4.1.1",
|
|
90
90
|
"@types/jest": "^29.5.2",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
import { AuthProvider
|
|
3
|
+
import type { AuthProvider } from "@lightsparkdev/core";
|
|
4
|
+
import { b64encode } from "@lightsparkdev/core";
|
|
4
5
|
import autoBind from "auto-bind";
|
|
5
6
|
|
|
6
7
|
class AccountTokenAuthProvider implements AuthProvider {
|
package/src/client.ts
CHANGED
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
3
|
import autoBind from "auto-bind";
|
|
4
|
-
import Observable from "zen-observable";
|
|
4
|
+
import type Observable from "zen-observable";
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import type {
|
|
7
7
|
AuthProvider,
|
|
8
|
-
b64encode,
|
|
9
8
|
CryptoInterface,
|
|
9
|
+
KeyOrAliasType,
|
|
10
|
+
Maybe,
|
|
11
|
+
Query,
|
|
12
|
+
} from "@lightsparkdev/core";
|
|
13
|
+
import {
|
|
14
|
+
b64encode,
|
|
10
15
|
DefaultCrypto,
|
|
11
16
|
KeyOrAlias,
|
|
12
|
-
KeyOrAliasType,
|
|
13
17
|
LightsparkAuthException,
|
|
14
18
|
LightsparkException,
|
|
15
19
|
LightsparkSigningException,
|
|
16
|
-
Maybe,
|
|
17
20
|
NodeKeyCache,
|
|
18
|
-
Query,
|
|
19
21
|
Requester,
|
|
20
22
|
StubAuthProvider,
|
|
21
23
|
} from "@lightsparkdev/core";
|
|
@@ -37,10 +39,8 @@ import { DeleteApiToken } from "./graphql/DeleteApiToken.js";
|
|
|
37
39
|
import { FundNode } from "./graphql/FundNode.js";
|
|
38
40
|
import { LightningFeeEstimateForInvoice } from "./graphql/LightningFeeEstimateForInvoice.js";
|
|
39
41
|
import { LightningFeeEstimateForNode } from "./graphql/LightningFeeEstimateForNode.js";
|
|
40
|
-
import {
|
|
41
|
-
|
|
42
|
-
MultiNodeDashboard,
|
|
43
|
-
} from "./graphql/MultiNodeDashboard.js";
|
|
42
|
+
import type { AccountDashboard } from "./graphql/MultiNodeDashboard.js";
|
|
43
|
+
import { MultiNodeDashboard } from "./graphql/MultiNodeDashboard.js";
|
|
44
44
|
import { PayInvoice } from "./graphql/PayInvoice.js";
|
|
45
45
|
import { RecoverNodeSigningKey } from "./graphql/RecoverNodeSigningKey.js";
|
|
46
46
|
import { RequestWithdrawal } from "./graphql/RequestWithdrawal.js";
|
|
@@ -51,27 +51,27 @@ import { TransactionSubscription } from "./graphql/TransactionSubscription.js";
|
|
|
51
51
|
import Account from "./objects/Account.js";
|
|
52
52
|
import { ApiTokenFromJson } from "./objects/ApiToken.js";
|
|
53
53
|
import BitcoinNetwork from "./objects/BitcoinNetwork.js";
|
|
54
|
-
import CreateApiTokenOutput from "./objects/CreateApiTokenOutput.js";
|
|
55
|
-
import CurrencyAmount
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
import
|
|
59
|
-
import Invoice
|
|
60
|
-
import
|
|
54
|
+
import type CreateApiTokenOutput from "./objects/CreateApiTokenOutput.js";
|
|
55
|
+
import type CurrencyAmount from "./objects/CurrencyAmount.js";
|
|
56
|
+
import { CurrencyAmountFromJson } from "./objects/CurrencyAmount.js";
|
|
57
|
+
import type FeeEstimate from "./objects/FeeEstimate.js";
|
|
58
|
+
import { FeeEstimateFromJson } from "./objects/FeeEstimate.js";
|
|
59
|
+
import type Invoice from "./objects/Invoice.js";
|
|
60
|
+
import { InvoiceFromJson } from "./objects/Invoice.js";
|
|
61
|
+
import type InvoiceData from "./objects/InvoiceData.js";
|
|
62
|
+
import { InvoiceDataFromJson } from "./objects/InvoiceData.js";
|
|
61
63
|
import InvoiceType from "./objects/InvoiceType.js";
|
|
62
|
-
import OutgoingPayment
|
|
63
|
-
|
|
64
|
-
} from "./objects/OutgoingPayment.js";
|
|
64
|
+
import type OutgoingPayment from "./objects/OutgoingPayment.js";
|
|
65
|
+
import { OutgoingPaymentFromJson } from "./objects/OutgoingPayment.js";
|
|
65
66
|
import Permission from "./objects/Permission.js";
|
|
66
|
-
import SingleNodeDashboard from "./objects/SingleNodeDashboard.js";
|
|
67
|
-
import Transaction
|
|
68
|
-
import
|
|
69
|
-
|
|
70
|
-
} from "./objects/TransactionUpdate.js";
|
|
71
|
-
import WithdrawalMode from "./objects/WithdrawalMode.js";
|
|
72
|
-
import WithdrawalRequest
|
|
73
|
-
|
|
74
|
-
} from "./objects/WithdrawalRequest.js";
|
|
67
|
+
import type SingleNodeDashboard from "./objects/SingleNodeDashboard.js";
|
|
68
|
+
import type Transaction from "./objects/Transaction.js";
|
|
69
|
+
import { TransactionFromJson } from "./objects/Transaction.js";
|
|
70
|
+
import type TransactionUpdate from "./objects/TransactionUpdate.js";
|
|
71
|
+
import { TransactionUpdateFromJson } from "./objects/TransactionUpdate.js";
|
|
72
|
+
import type WithdrawalMode from "./objects/WithdrawalMode.js";
|
|
73
|
+
import type WithdrawalRequest from "./objects/WithdrawalRequest.js";
|
|
74
|
+
import { WithdrawalRequestFromJson } from "./objects/WithdrawalRequest.js";
|
|
75
75
|
|
|
76
76
|
const sdkVersion = packageJson.version;
|
|
77
77
|
|
|
@@ -500,7 +500,8 @@ class LightsparkClient {
|
|
|
500
500
|
}
|
|
501
501
|
);
|
|
502
502
|
return CurrencyAmountFromJson(
|
|
503
|
-
response.lightning_fee_estimate_for_invoice
|
|
503
|
+
response.lightning_fee_estimate_for_invoice
|
|
504
|
+
.lightning_fee_estimate_output_fee_estimate
|
|
504
505
|
);
|
|
505
506
|
}
|
|
506
507
|
|
|
@@ -526,7 +527,8 @@ class LightsparkClient {
|
|
|
526
527
|
}
|
|
527
528
|
);
|
|
528
529
|
return CurrencyAmountFromJson(
|
|
529
|
-
response.lightning_fee_estimate_for_node
|
|
530
|
+
response.lightning_fee_estimate_for_node
|
|
531
|
+
.lightning_fee_estimate_output_fee_estimate
|
|
530
532
|
);
|
|
531
533
|
}
|
|
532
534
|
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
import { Maybe } from "@lightsparkdev/core";
|
|
4
|
-
import CurrencyAmount
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import NodeAddressType from "../objects/NodeAddressType.js";
|
|
3
|
+
import type { Maybe } from "@lightsparkdev/core";
|
|
4
|
+
import type CurrencyAmount from "../objects/CurrencyAmount.js";
|
|
5
|
+
import { FRAGMENT as CurrencyAmountFragment } from "../objects/CurrencyAmount.js";
|
|
6
|
+
import type LightsparkNodePurpose from "../objects/LightsparkNodePurpose.js";
|
|
7
|
+
import type LightsparkNodeStatus from "../objects/LightsparkNodeStatus.js";
|
|
8
|
+
import type NodeAddressType from "../objects/NodeAddressType.js";
|
|
10
9
|
|
|
11
10
|
export type AccountDashboard = {
|
|
12
11
|
id: string;
|
package/src/objects/Account.ts
CHANGED
|
@@ -1,35 +1,29 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
import { Query } from "@lightsparkdev/core";
|
|
3
|
+
import type { Query } from "@lightsparkdev/core";
|
|
4
4
|
import autoBind from "auto-bind";
|
|
5
|
-
import LightsparkClient from "../client.js";
|
|
6
|
-
import AccountToApiTokensConnection
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import AccountToChannelsConnection
|
|
10
|
-
|
|
11
|
-
} from "./
|
|
12
|
-
import
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
import
|
|
16
|
-
|
|
17
|
-
} from "./
|
|
18
|
-
import
|
|
19
|
-
|
|
20
|
-
} from "./
|
|
21
|
-
import
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
|
|
27
|
-
} from "./BlockchainBalance.js";
|
|
28
|
-
import CurrencyAmount, { CurrencyAmountFromJson } from "./CurrencyAmount.js";
|
|
29
|
-
import LightsparkNodeOwner from "./LightsparkNodeOwner.js";
|
|
30
|
-
import TransactionFailures from "./TransactionFailures.js";
|
|
31
|
-
import TransactionStatus from "./TransactionStatus.js";
|
|
32
|
-
import TransactionType from "./TransactionType.js";
|
|
5
|
+
import type LightsparkClient from "../client.js";
|
|
6
|
+
import type AccountToApiTokensConnection from "./AccountToApiTokensConnection.js";
|
|
7
|
+
import { AccountToApiTokensConnectionFromJson } from "./AccountToApiTokensConnection.js";
|
|
8
|
+
import type AccountToChannelsConnection from "./AccountToChannelsConnection.js";
|
|
9
|
+
import { AccountToChannelsConnectionFromJson } from "./AccountToChannelsConnection.js";
|
|
10
|
+
import type AccountToNodesConnection from "./AccountToNodesConnection.js";
|
|
11
|
+
import { AccountToNodesConnectionFromJson } from "./AccountToNodesConnection.js";
|
|
12
|
+
import type AccountToPaymentRequestsConnection from "./AccountToPaymentRequestsConnection.js";
|
|
13
|
+
import { AccountToPaymentRequestsConnectionFromJson } from "./AccountToPaymentRequestsConnection.js";
|
|
14
|
+
import type AccountToTransactionsConnection from "./AccountToTransactionsConnection.js";
|
|
15
|
+
import { AccountToTransactionsConnectionFromJson } from "./AccountToTransactionsConnection.js";
|
|
16
|
+
import type AccountToWalletsConnection from "./AccountToWalletsConnection.js";
|
|
17
|
+
import { AccountToWalletsConnectionFromJson } from "./AccountToWalletsConnection.js";
|
|
18
|
+
import type BitcoinNetwork from "./BitcoinNetwork.js";
|
|
19
|
+
import type BlockchainBalance from "./BlockchainBalance.js";
|
|
20
|
+
import { BlockchainBalanceFromJson } from "./BlockchainBalance.js";
|
|
21
|
+
import type CurrencyAmount from "./CurrencyAmount.js";
|
|
22
|
+
import { CurrencyAmountFromJson } from "./CurrencyAmount.js";
|
|
23
|
+
import type LightsparkNodeOwner from "./LightsparkNodeOwner.js";
|
|
24
|
+
import type TransactionFailures from "./TransactionFailures.js";
|
|
25
|
+
import type TransactionStatus from "./TransactionStatus.js";
|
|
26
|
+
import type TransactionType from "./TransactionType.js";
|
|
33
27
|
|
|
34
28
|
class Account implements LightsparkNodeOwner {
|
|
35
29
|
constructor(
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
import ApiToken
|
|
4
|
-
import
|
|
3
|
+
import type ApiToken from "./ApiToken.js";
|
|
4
|
+
import { ApiTokenFromJson } from "./ApiToken.js";
|
|
5
|
+
import type PageInfo from "./PageInfo.js";
|
|
6
|
+
import { PageInfoFromJson } from "./PageInfo.js";
|
|
5
7
|
|
|
6
8
|
type AccountToApiTokensConnection = {
|
|
7
9
|
/** An object that holds pagination information about the objects in this connection. **/
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
3
|
import autoBind from "auto-bind";
|
|
4
|
-
import Channel
|
|
4
|
+
import type Channel from "./Channel.js";
|
|
5
|
+
import { ChannelFromJson } from "./Channel.js";
|
|
5
6
|
|
|
6
7
|
class AccountToChannelsConnection {
|
|
7
8
|
constructor(
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
import LightsparkNode
|
|
3
|
+
import type LightsparkNode from "./LightsparkNode.js";
|
|
4
|
+
import { LightsparkNodeFromJson } from "./LightsparkNode.js";
|
|
4
5
|
import LightsparkNodePurpose from "./LightsparkNodePurpose.js";
|
|
5
|
-
import PageInfo
|
|
6
|
+
import type PageInfo from "./PageInfo.js";
|
|
7
|
+
import { PageInfoFromJson } from "./PageInfo.js";
|
|
6
8
|
|
|
7
9
|
/** A connection between an account and the nodes it manages. **/
|
|
8
10
|
type AccountToNodesConnection = {
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
import PageInfo
|
|
4
|
-
import
|
|
3
|
+
import type PageInfo from "./PageInfo.js";
|
|
4
|
+
import { PageInfoFromJson } from "./PageInfo.js";
|
|
5
|
+
import type PaymentRequest from "./PaymentRequest.js";
|
|
6
|
+
import { PaymentRequestFromJson } from "./PaymentRequest.js";
|
|
5
7
|
|
|
6
8
|
type AccountToPaymentRequestsConnection = {
|
|
7
9
|
/** The payment requests for the current page of this connection. **/
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
import CurrencyAmount
|
|
4
|
-
import
|
|
5
|
-
import
|
|
3
|
+
import type CurrencyAmount from "./CurrencyAmount.js";
|
|
4
|
+
import { CurrencyAmountFromJson } from "./CurrencyAmount.js";
|
|
5
|
+
import type PageInfo from "./PageInfo.js";
|
|
6
|
+
import { PageInfoFromJson } from "./PageInfo.js";
|
|
7
|
+
import type Transaction from "./Transaction.js";
|
|
8
|
+
import { TransactionFromJson } from "./Transaction.js";
|
|
6
9
|
|
|
7
10
|
type AccountToTransactionsConnection = {
|
|
8
11
|
/**
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
import PageInfo
|
|
4
|
-
import
|
|
3
|
+
import type PageInfo from "./PageInfo.js";
|
|
4
|
+
import { PageInfoFromJson } from "./PageInfo.js";
|
|
5
|
+
import type Wallet from "./Wallet.js";
|
|
6
|
+
import { WalletFromJson } from "./Wallet.js";
|
|
5
7
|
|
|
6
8
|
type AccountToWalletsConnection = {
|
|
7
9
|
/** An object that holds pagination information about the objects in this connection. **/
|
package/src/objects/ApiToken.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
import { Query } from "@lightsparkdev/core";
|
|
4
|
-
import Entity from "./Entity.js";
|
|
3
|
+
import type { Query } from "@lightsparkdev/core";
|
|
4
|
+
import type Entity from "./Entity.js";
|
|
5
5
|
import Permission from "./Permission.js";
|
|
6
6
|
|
|
7
7
|
type ApiToken = Entity & {
|
package/src/objects/Balances.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
import CurrencyAmount
|
|
3
|
+
import type CurrencyAmount from "./CurrencyAmount.js";
|
|
4
|
+
import { CurrencyAmountFromJson } from "./CurrencyAmount.js";
|
|
4
5
|
|
|
5
6
|
type Balances = {
|
|
6
7
|
/**
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
import CurrencyAmount
|
|
3
|
+
import type CurrencyAmount from "./CurrencyAmount.js";
|
|
4
|
+
import { CurrencyAmountFromJson } from "./CurrencyAmount.js";
|
|
4
5
|
|
|
5
6
|
/** This object provides a detailed breakdown of a `LightsparkNode`'s current balance on the Bitcoin Network. **/
|
|
6
7
|
type BlockchainBalance = {
|
package/src/objects/Channel.ts
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
import { Query } from "@lightsparkdev/core";
|
|
3
|
+
import type { Query } from "@lightsparkdev/core";
|
|
4
4
|
import autoBind from "auto-bind";
|
|
5
|
-
import LightsparkClient from "../client.js";
|
|
6
|
-
import ChannelFees
|
|
5
|
+
import type LightsparkClient from "../client.js";
|
|
6
|
+
import type ChannelFees from "./ChannelFees.js";
|
|
7
|
+
import { ChannelFeesFromJson } from "./ChannelFees.js";
|
|
7
8
|
import ChannelStatus from "./ChannelStatus.js";
|
|
8
|
-
import ChannelToTransactionsConnection
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
import
|
|
12
|
-
import Entity from "./Entity.js";
|
|
13
|
-
import TransactionType from "./TransactionType.js";
|
|
9
|
+
import type ChannelToTransactionsConnection from "./ChannelToTransactionsConnection.js";
|
|
10
|
+
import { ChannelToTransactionsConnectionFromJson } from "./ChannelToTransactionsConnection.js";
|
|
11
|
+
import type CurrencyAmount from "./CurrencyAmount.js";
|
|
12
|
+
import { CurrencyAmountFromJson } from "./CurrencyAmount.js";
|
|
13
|
+
import type Entity from "./Entity.js";
|
|
14
|
+
import type TransactionType from "./TransactionType.js";
|
|
14
15
|
|
|
15
16
|
/** An object that represents a payment channel between two nodes in the Lightning Network. **/
|
|
16
17
|
class Channel implements Entity {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
import { Query } from "@lightsparkdev/core";
|
|
4
|
-
import CurrencyAmount
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
3
|
+
import type { Query } from "@lightsparkdev/core";
|
|
4
|
+
import type CurrencyAmount from "./CurrencyAmount.js";
|
|
5
|
+
import { CurrencyAmountFromJson } from "./CurrencyAmount.js";
|
|
6
|
+
import type Entity from "./Entity.js";
|
|
7
|
+
import type OnChainTransaction from "./OnChainTransaction.js";
|
|
8
|
+
import type Transaction from "./Transaction.js";
|
|
8
9
|
import TransactionStatus from "./TransactionStatus.js";
|
|
9
10
|
|
|
10
11
|
/** The transaction on Bitcoin blockchain to close a channel on Lightning Network where the balances are allocated back to local and remote nodes. **/
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
import CurrencyAmount
|
|
3
|
+
import type CurrencyAmount from "./CurrencyAmount.js";
|
|
4
|
+
import { CurrencyAmountFromJson } from "./CurrencyAmount.js";
|
|
4
5
|
|
|
5
6
|
type ChannelFees = {
|
|
6
7
|
baseFee?: CurrencyAmount;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
import { Query } from "@lightsparkdev/core";
|
|
4
|
-
import CurrencyAmount
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
3
|
+
import type { Query } from "@lightsparkdev/core";
|
|
4
|
+
import type CurrencyAmount from "./CurrencyAmount.js";
|
|
5
|
+
import { CurrencyAmountFromJson } from "./CurrencyAmount.js";
|
|
6
|
+
import type Entity from "./Entity.js";
|
|
7
|
+
import type OnChainTransaction from "./OnChainTransaction.js";
|
|
8
|
+
import type Transaction from "./Transaction.js";
|
|
8
9
|
import TransactionStatus from "./TransactionStatus.js";
|
|
9
10
|
|
|
10
11
|
/** The transaction on Bitcoin blockchain to open a channel on Lightning Network funded by the local Lightspark node. **/
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
import CurrencyAmount
|
|
3
|
+
import type CurrencyAmount from "./CurrencyAmount.js";
|
|
4
|
+
import { CurrencyAmountFromJson } from "./CurrencyAmount.js";
|
|
4
5
|
|
|
5
6
|
type ChannelToTransactionsConnection = {
|
|
6
7
|
/**
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
import ApiToken
|
|
3
|
+
import type ApiToken from "./ApiToken.js";
|
|
4
|
+
import { ApiTokenFromJson } from "./ApiToken.js";
|
|
4
5
|
|
|
5
6
|
type CreateApiTokenOutput = {
|
|
6
7
|
/** The API Token that has been created. **/
|
package/src/objects/Deposit.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
import { Query } from "@lightsparkdev/core";
|
|
4
|
-
import CurrencyAmount
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
3
|
+
import type { Query } from "@lightsparkdev/core";
|
|
4
|
+
import type CurrencyAmount from "./CurrencyAmount.js";
|
|
5
|
+
import { CurrencyAmountFromJson } from "./CurrencyAmount.js";
|
|
6
|
+
import type Entity from "./Entity.js";
|
|
7
|
+
import type OnChainTransaction from "./OnChainTransaction.js";
|
|
8
|
+
import type Transaction from "./Transaction.js";
|
|
8
9
|
import TransactionStatus from "./TransactionStatus.js";
|
|
9
10
|
|
|
10
11
|
/** The transaction on Bitcoin blockchain to fund the Lightspark node's wallet. **/
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
import CurrencyAmount
|
|
3
|
+
import type CurrencyAmount from "./CurrencyAmount.js";
|
|
4
|
+
import { CurrencyAmountFromJson } from "./CurrencyAmount.js";
|
|
4
5
|
|
|
5
6
|
type FeeEstimate = {
|
|
6
7
|
feeFast: CurrencyAmount;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
import CurrencyAmount
|
|
3
|
+
import type CurrencyAmount from "./CurrencyAmount.js";
|
|
4
|
+
import { CurrencyAmountFromJson } from "./CurrencyAmount.js";
|
|
4
5
|
|
|
5
6
|
type FundNodeOutput = {
|
|
6
7
|
amount: CurrencyAmount;
|
package/src/objects/GraphNode.ts
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
import { Query } from "@lightsparkdev/core";
|
|
3
|
+
import type { Query } from "@lightsparkdev/core";
|
|
4
4
|
import autoBind from "auto-bind";
|
|
5
|
-
import LightsparkClient from "../client.js";
|
|
5
|
+
import type LightsparkClient from "../client.js";
|
|
6
6
|
import BitcoinNetwork from "./BitcoinNetwork.js";
|
|
7
|
-
import Node from "./Node.js";
|
|
8
|
-
import NodeAddressType from "./NodeAddressType.js";
|
|
9
|
-
import NodeToAddressesConnection
|
|
10
|
-
|
|
11
|
-
} from "./NodeToAddressesConnection.js";
|
|
7
|
+
import type Node from "./Node.js";
|
|
8
|
+
import type NodeAddressType from "./NodeAddressType.js";
|
|
9
|
+
import type NodeToAddressesConnection from "./NodeToAddressesConnection.js";
|
|
10
|
+
import { NodeToAddressesConnectionFromJson } from "./NodeToAddressesConnection.js";
|
|
12
11
|
|
|
13
12
|
/** This is a node on the Lightning Network, managed by a third party. The information about this node is public data that has been obtained by observing the Lightning Network. **/
|
|
14
13
|
class GraphNode implements Node {
|
package/src/objects/Hop.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
import { Query } from "@lightsparkdev/core";
|
|
4
|
-
import CurrencyAmount
|
|
5
|
-
import
|
|
3
|
+
import type { Query } from "@lightsparkdev/core";
|
|
4
|
+
import type CurrencyAmount from "./CurrencyAmount.js";
|
|
5
|
+
import { CurrencyAmountFromJson } from "./CurrencyAmount.js";
|
|
6
|
+
import type Entity from "./Entity.js";
|
|
6
7
|
|
|
7
8
|
/** One hop signifies a payment moving one node ahead on a payment route; a list of sequential hops defines the path from sender node to recipient node for a payment attempt. **/
|
|
8
9
|
type Hop = Entity & {
|