@lightsparkdev/lightspark-sdk 1.2.3 → 1.3.0
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 +13 -0
- package/dist/{BitcoinNetwork-37e9f091.d.ts → BitcoinNetwork-972b1d01.d.ts} +4 -6
- package/dist/{chunk-NCPWHRFO.js → chunk-Y55D3PD4.js} +11 -11
- package/dist/env.d.cts +1 -1
- package/dist/env.d.ts +1 -1
- package/dist/{index-449c9f58.d.ts → index-a5028d74.d.ts} +572 -943
- package/dist/index.cjs +263 -232
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +43 -12
- package/dist/objects/index.d.cts +2 -2
- package/dist/objects/index.d.ts +2 -2
- package/dist/objects/index.js +1 -1
- package/package.json +2 -2
- package/src/client.ts +18 -0
- package/src/graphql/CancelInvoice.ts +17 -0
- package/src/objects/Account.ts +2 -2
- package/src/objects/AccountToApiTokensConnection.ts +3 -6
- package/src/objects/AccountToChannelsConnection.ts +3 -3
- package/src/objects/AccountToNodesConnection.ts +3 -6
- package/src/objects/AccountToPaymentRequestsConnection.ts +3 -6
- package/src/objects/AccountToTransactionsConnection.ts +5 -8
- package/src/objects/AccountToWalletsConnection.ts +3 -6
- package/src/objects/ApiToken.ts +7 -8
- package/src/objects/Balances.ts +16 -18
- package/src/objects/BitcoinNetwork.ts +4 -6
- package/src/objects/BlockchainBalance.ts +1 -4
- package/src/objects/CancelInvoiceInput.ts +18 -0
- package/src/objects/CancelInvoiceOutput.ts +26 -0
- package/src/objects/Channel.ts +16 -25
- package/src/objects/ChannelClosingTransaction.ts +10 -17
- package/src/objects/ChannelFees.ts +1 -4
- package/src/objects/ChannelOpeningTransaction.ts +10 -17
- package/src/objects/ChannelStatus.ts +13 -19
- package/src/objects/ChannelToTransactionsConnection.ts +6 -6
- package/src/objects/ComplianceProvider.ts +2 -3
- package/src/objects/Connection.ts +3 -6
- package/src/objects/CreateApiTokenInput.ts +1 -4
- package/src/objects/CreateLnurlInvoiceInput.ts +2 -2
- package/src/objects/CreateTestModePaymentoutput.ts +2 -2
- package/src/objects/CurrencyAmount.ts +4 -6
- package/src/objects/CurrencyUnit.ts +7 -11
- package/src/objects/Deposit.ts +10 -16
- package/src/objects/Entity.ts +2 -2
- package/src/objects/FeeEstimate.ts +3 -3
- package/src/objects/GraphNode.ts +13 -20
- package/src/objects/Hop.ts +4 -7
- package/src/objects/HtlcAttemptFailureCode.ts +4 -5
- package/src/objects/IncentivesIneligibilityReason.ts +13 -25
- package/src/objects/IncentivesStatus.ts +5 -8
- package/src/objects/IncomingPayment.ts +5 -12
- package/src/objects/IncomingPaymentAttempt.ts +3 -4
- package/src/objects/IncomingPaymentAttemptStatus.ts +3 -7
- package/src/objects/IncomingPaymentToAttemptsConnection.ts +3 -6
- package/src/objects/InvoiceData.ts +2 -2
- package/src/objects/InvoiceType.ts +2 -3
- package/src/objects/LightningFeeEstimateForInvoiceInput.ts +2 -2
- package/src/objects/LightningTransaction.ts +4 -8
- package/src/objects/LightsparkNode.ts +19 -25
- package/src/objects/LightsparkNodeStatus.ts +2 -3
- package/src/objects/LightsparkNodeToChannelsConnection.ts +3 -6
- package/src/objects/LightsparkNodeWithOSK.ts +19 -27
- package/src/objects/LightsparkNodeWithRemoteSigning.ts +17 -25
- package/src/objects/Node.ts +13 -19
- package/src/objects/NodeAddressType.ts +4 -5
- package/src/objects/NodeToAddressesConnection.ts +4 -4
- package/src/objects/OnChainTransaction.ts +11 -18
- package/src/objects/OutgoingPayment.ts +7 -19
- package/src/objects/OutgoingPaymentAttempt.ts +11 -19
- package/src/objects/OutgoingPaymentAttemptStatus.ts +3 -7
- package/src/objects/OutgoingPaymentAttemptToHopsConnection.ts +5 -9
- package/src/objects/OutgoingPaymentToAttemptsConnection.ts +3 -6
- package/src/objects/PageInfo.ts +2 -3
- package/src/objects/PayInvoiceInput.ts +4 -4
- package/src/objects/PaymentDirection.ts +2 -3
- package/src/objects/PaymentFailureReason.ts +4 -5
- package/src/objects/PaymentRequest.ts +3 -4
- package/src/objects/PaymentRequestData.ts +3 -3
- package/src/objects/PaymentRequestStatus.ts +4 -5
- package/src/objects/Permission.ts +4 -5
- package/src/objects/PostTransactionData.ts +3 -6
- package/src/objects/RegionCode.ts +12 -43
- package/src/objects/RegisterPaymentInput.ts +5 -9
- package/src/objects/RemoteSigningSubEventType.ts +3 -7
- package/src/objects/RiskRating.ts +5 -6
- package/src/objects/RoutingTransaction.ts +8 -15
- package/src/objects/RoutingTransactionFailureReason.ts +4 -6
- package/src/objects/ScreenNodeInput.ts +2 -2
- package/src/objects/SendPaymentInput.ts +2 -2
- package/src/objects/SetInvoicePaymentHashInput.ts +2 -2
- package/src/objects/SignablePayload.ts +2 -2
- package/src/objects/SignablePayloadStatus.ts +2 -3
- package/src/objects/Transaction.ts +4 -9
- package/src/objects/TransactionFailures.ts +1 -4
- package/src/objects/TransactionStatus.ts +6 -11
- package/src/objects/TransactionType.ts +12 -22
- package/src/objects/UmaInvitation.ts +2 -8
- package/src/objects/Wallet.ts +3 -4
- package/src/objects/WalletStatus.ts +12 -25
- package/src/objects/WalletToPaymentRequestsConnection.ts +3 -6
- package/src/objects/WalletToTransactionsConnection.ts +3 -6
- package/src/objects/WebhookEventType.ts +4 -5
- package/src/objects/Withdrawal.ts +11 -18
- package/src/objects/WithdrawalMode.ts +3 -7
- package/src/objects/WithdrawalRequest.ts +3 -7
- package/src/objects/WithdrawalRequestStatus.ts +2 -3
- package/src/objects/WithdrawalRequestToChannelClosingTransactionsConnection.ts +4 -10
- package/src/objects/WithdrawalRequestToChannelOpeningTransactionsConnection.ts +4 -10
- package/src/objects/index.ts +2 -0
- package/src/tests/integration/general-regtest.test.ts +14 -0
package/src/objects/Channel.ts
CHANGED
|
@@ -18,8 +18,8 @@ import type TransactionType from "./TransactionType.js";
|
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* This is an object representing a channel on the Lightning Network.
|
|
21
|
-
* You can retrieve this object to get detailed information on a specific
|
|
22
|
-
*
|
|
21
|
+
* You can retrieve this object to get detailed information on a specific Lightning Network
|
|
22
|
+
* channel. *
|
|
23
23
|
*/
|
|
24
24
|
class Channel implements Entity {
|
|
25
25
|
constructor(
|
|
@@ -39,48 +39,39 @@ class Channel implements Entity {
|
|
|
39
39
|
/** The transaction that funded the channel upon channel opening. **/
|
|
40
40
|
public readonly fundingTransactionId?: string | undefined,
|
|
41
41
|
/**
|
|
42
|
-
* The total amount of funds in this channel,
|
|
43
|
-
*
|
|
44
|
-
* the channel balance on the remote node and the on-chain fees to close
|
|
45
|
-
* the channel.
|
|
42
|
+
* The total amount of funds in this channel, including the channel balance on the local node,
|
|
43
|
+
* the channel balance on the remote node and the on-chain fees to close the channel.
|
|
46
44
|
**/
|
|
47
45
|
public readonly capacity?: CurrencyAmount | undefined,
|
|
48
46
|
/** The channel balance on the local node. **/
|
|
49
47
|
public readonly localBalance?: CurrencyAmount | undefined,
|
|
50
48
|
/**
|
|
51
|
-
* The channel balance on the local node that is currently allocated to
|
|
52
|
-
*
|
|
49
|
+
* The channel balance on the local node that is currently allocated to in-progress payments.
|
|
50
|
+
* *
|
|
53
51
|
*/
|
|
54
52
|
public readonly localUnsettledBalance?: CurrencyAmount | undefined,
|
|
55
53
|
/** The channel balance on the remote node. **/
|
|
56
54
|
public readonly remoteBalance?: CurrencyAmount | undefined,
|
|
57
55
|
/**
|
|
58
|
-
* The channel balance on the remote node that is currently allocated to
|
|
59
|
-
* in-progress payments. *
|
|
60
|
-
*/
|
|
61
|
-
public readonly remoteUnsettledBalance?: CurrencyAmount | undefined,
|
|
62
|
-
/**
|
|
63
|
-
* The channel balance that is currently allocated to in-progress payments.
|
|
56
|
+
* The channel balance on the remote node that is currently allocated to in-progress payments.
|
|
64
57
|
* *
|
|
65
58
|
*/
|
|
59
|
+
public readonly remoteUnsettledBalance?: CurrencyAmount | undefined,
|
|
60
|
+
/** The channel balance that is currently allocated to in-progress payments. **/
|
|
66
61
|
public readonly unsettledBalance?: CurrencyAmount | undefined,
|
|
67
62
|
/**
|
|
68
|
-
* The total balance in this channel,
|
|
69
|
-
*
|
|
70
|
-
* *
|
|
63
|
+
* The total balance in this channel, including the channel balance on both local and remote
|
|
64
|
+
* nodes. *
|
|
71
65
|
*/
|
|
72
66
|
public readonly totalBalance?: CurrencyAmount | undefined,
|
|
73
67
|
/** The current status of this channel. **/
|
|
74
68
|
public readonly status?: ChannelStatus | undefined,
|
|
75
69
|
/**
|
|
76
|
-
* The estimated time to wait for the channel's hash timelock contract to
|
|
77
|
-
*
|
|
70
|
+
* The estimated time to wait for the channel's hash timelock contract to expire when force
|
|
71
|
+
* closing the channel. It is in unit of minutes.
|
|
78
72
|
**/
|
|
79
73
|
public readonly estimatedForceClosureWaitMinutes?: number | undefined,
|
|
80
|
-
/**
|
|
81
|
-
* The amount to be paid in fees for the current set of commitment
|
|
82
|
-
* transactions. *
|
|
83
|
-
*/
|
|
74
|
+
/** The amount to be paid in fees for the current set of commitment transactions. **/
|
|
84
75
|
public readonly commitFee?: CurrencyAmount | undefined,
|
|
85
76
|
/** The fees charged for routing payments through this channel. **/
|
|
86
77
|
public readonly fees?: ChannelFees | undefined,
|
|
@@ -88,8 +79,8 @@ class Channel implements Entity {
|
|
|
88
79
|
public readonly remoteNodeId?: string | undefined,
|
|
89
80
|
/**
|
|
90
81
|
* The unique identifier of the channel on Lightning Network,
|
|
91
|
-
* which is the location in the chain that the channel was confirmed.
|
|
92
|
-
*
|
|
82
|
+
* which is the location in the chain that the channel was confirmed. The format is
|
|
83
|
+
* <block-height>:<tx-index>:<tx-output>.
|
|
93
84
|
**/
|
|
94
85
|
public readonly shortChannelId?: string | undefined,
|
|
95
86
|
) {
|
|
@@ -9,9 +9,8 @@ import {
|
|
|
9
9
|
import TransactionStatus from "./TransactionStatus.js";
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
|
-
* This is an object representing a transaction which closes a channel on the
|
|
13
|
-
*
|
|
14
|
-
* remote nodes.
|
|
12
|
+
* This is an object representing a transaction which closes a channel on the Lightning Network.
|
|
13
|
+
* This operation allocates balances back to the local and remote nodes.
|
|
15
14
|
* *
|
|
16
15
|
*/
|
|
17
16
|
interface ChannelClosingTransaction {
|
|
@@ -34,8 +33,8 @@ interface ChannelClosingTransaction {
|
|
|
34
33
|
amount: CurrencyAmount;
|
|
35
34
|
|
|
36
35
|
/**
|
|
37
|
-
* The height of the block that included this transaction.
|
|
38
|
-
*
|
|
36
|
+
* The height of the block that included this transaction. This will be zero for unconfirmed
|
|
37
|
+
* transactions.
|
|
39
38
|
**/
|
|
40
39
|
blockHeight: number;
|
|
41
40
|
|
|
@@ -48,28 +47,22 @@ interface ChannelClosingTransaction {
|
|
|
48
47
|
/** The date and time when this transaction was completed or failed. **/
|
|
49
48
|
resolvedAt?: string | undefined;
|
|
50
49
|
|
|
51
|
-
/**
|
|
52
|
-
* The hash of this transaction, so it can be uniquely identified on the
|
|
53
|
-
* Lightning Network. *
|
|
54
|
-
*/
|
|
50
|
+
/** The hash of this transaction, so it can be uniquely identified on the Lightning Network. **/
|
|
55
51
|
transactionHash?: string | undefined;
|
|
56
52
|
|
|
57
53
|
/**
|
|
58
|
-
* The fees that were paid by the wallet sending the transaction to commit it
|
|
59
|
-
*
|
|
54
|
+
* The fees that were paid by the wallet sending the transaction to commit it to the Bitcoin
|
|
55
|
+
* blockchain.
|
|
60
56
|
**/
|
|
61
57
|
fees?: CurrencyAmount | undefined;
|
|
62
58
|
|
|
63
59
|
/**
|
|
64
|
-
* The hash of the block that included this transaction.
|
|
65
|
-
*
|
|
60
|
+
* The hash of the block that included this transaction. This will be null for unconfirmed
|
|
61
|
+
* transactions.
|
|
66
62
|
**/
|
|
67
63
|
blockHash?: string | undefined;
|
|
68
64
|
|
|
69
|
-
/**
|
|
70
|
-
* The number of blockchain confirmations for this transaction in real time.
|
|
71
|
-
* *
|
|
72
|
-
*/
|
|
65
|
+
/** The number of blockchain confirmations for this transaction in real time. **/
|
|
73
66
|
numConfirmations?: number | undefined;
|
|
74
67
|
|
|
75
68
|
/** If known, the channel this transaction is closing. **/
|
|
@@ -6,10 +6,7 @@ import {
|
|
|
6
6
|
CurrencyAmountToJson,
|
|
7
7
|
} from "./CurrencyAmount.js";
|
|
8
8
|
|
|
9
|
-
/**
|
|
10
|
-
* This represents the fee policies set for a channel on the Lightning Network.
|
|
11
|
-
* *
|
|
12
|
-
*/
|
|
9
|
+
/** This represents the fee policies set for a channel on the Lightning Network. **/
|
|
13
10
|
interface ChannelFees {
|
|
14
11
|
baseFee?: CurrencyAmount | undefined;
|
|
15
12
|
|
|
@@ -9,9 +9,8 @@ import {
|
|
|
9
9
|
import TransactionStatus from "./TransactionStatus.js";
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
|
-
* This is an object representing a transaction which opens a channel on the
|
|
13
|
-
*
|
|
14
|
-
* Lightspark node.
|
|
12
|
+
* This is an object representing a transaction which opens a channel on the Lightning Network.
|
|
13
|
+
* This object occurs only for channels funded by the local Lightspark node.
|
|
15
14
|
* *
|
|
16
15
|
*/
|
|
17
16
|
interface ChannelOpeningTransaction {
|
|
@@ -34,8 +33,8 @@ interface ChannelOpeningTransaction {
|
|
|
34
33
|
amount: CurrencyAmount;
|
|
35
34
|
|
|
36
35
|
/**
|
|
37
|
-
* The height of the block that included this transaction.
|
|
38
|
-
*
|
|
36
|
+
* The height of the block that included this transaction. This will be zero for unconfirmed
|
|
37
|
+
* transactions.
|
|
39
38
|
**/
|
|
40
39
|
blockHeight: number;
|
|
41
40
|
|
|
@@ -48,28 +47,22 @@ interface ChannelOpeningTransaction {
|
|
|
48
47
|
/** The date and time when this transaction was completed or failed. **/
|
|
49
48
|
resolvedAt?: string | undefined;
|
|
50
49
|
|
|
51
|
-
/**
|
|
52
|
-
* The hash of this transaction, so it can be uniquely identified on the
|
|
53
|
-
* Lightning Network. *
|
|
54
|
-
*/
|
|
50
|
+
/** The hash of this transaction, so it can be uniquely identified on the Lightning Network. **/
|
|
55
51
|
transactionHash?: string | undefined;
|
|
56
52
|
|
|
57
53
|
/**
|
|
58
|
-
* The fees that were paid by the wallet sending the transaction to commit it
|
|
59
|
-
*
|
|
54
|
+
* The fees that were paid by the wallet sending the transaction to commit it to the Bitcoin
|
|
55
|
+
* blockchain.
|
|
60
56
|
**/
|
|
61
57
|
fees?: CurrencyAmount | undefined;
|
|
62
58
|
|
|
63
59
|
/**
|
|
64
|
-
* The hash of the block that included this transaction.
|
|
65
|
-
*
|
|
60
|
+
* The hash of the block that included this transaction. This will be null for unconfirmed
|
|
61
|
+
* transactions.
|
|
66
62
|
**/
|
|
67
63
|
blockHash?: string | undefined;
|
|
68
64
|
|
|
69
|
-
/**
|
|
70
|
-
* The number of blockchain confirmations for this transaction in real time.
|
|
71
|
-
* *
|
|
72
|
-
*/
|
|
65
|
+
/** The number of blockchain confirmations for this transaction in real time. **/
|
|
73
66
|
numConfirmations?: number | undefined;
|
|
74
67
|
|
|
75
68
|
/** If known, the channel this transaction is opening. **/
|
|
@@ -1,48 +1,42 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
* This is an enum representing the status of a channel on the Lightning
|
|
5
|
-
* Network. *
|
|
6
|
-
*/
|
|
3
|
+
/** This is an enum representing the status of a channel on the Lightning Network. **/
|
|
7
4
|
export enum ChannelStatus {
|
|
8
5
|
/**
|
|
9
|
-
* This is an enum value that represents values that could be added in the
|
|
10
|
-
*
|
|
11
|
-
* added without notice.
|
|
6
|
+
* This is an enum value that represents values that could be added in the future.
|
|
7
|
+
* Clients should support unknown values as more of them could be added without notice.
|
|
12
8
|
*/
|
|
13
9
|
FUTURE_VALUE = "FUTURE_VALUE",
|
|
14
10
|
/** The channel is online and ready to send and receive funds. **/
|
|
15
11
|
OK = "OK",
|
|
16
12
|
/**
|
|
17
|
-
* The channel has been created, but the Bitcoin transaction that initiates
|
|
18
|
-
*
|
|
19
|
-
* *
|
|
13
|
+
* The channel has been created, but the Bitcoin transaction that initiates it still needs to be
|
|
14
|
+
* confirmed on the Bitcoin blockchain. *
|
|
20
15
|
*/
|
|
21
16
|
PENDING = "PENDING",
|
|
22
17
|
/** The channel is not available, likely because the peer is not online. **/
|
|
23
18
|
OFFLINE = "OFFLINE",
|
|
24
19
|
/**
|
|
25
|
-
* The channel is behaving properly, but its remote balance is much higher
|
|
26
|
-
*
|
|
27
|
-
* out.
|
|
20
|
+
* The channel is behaving properly, but its remote balance is much higher than its local balance
|
|
21
|
+
* so it is not balanced properly for sending funds out.
|
|
28
22
|
* *
|
|
29
23
|
*/
|
|
30
24
|
UNBALANCED_FOR_SEND = "UNBALANCED_FOR_SEND",
|
|
31
25
|
/**
|
|
32
|
-
* The channel is behaving properly, but its remote balance is much lower
|
|
33
|
-
*
|
|
26
|
+
* The channel is behaving properly, but its remote balance is much lower than its local balance
|
|
27
|
+
* so it is not balanced properly for receiving funds.
|
|
34
28
|
* *
|
|
35
29
|
*/
|
|
36
30
|
UNBALANCED_FOR_RECEIVE = "UNBALANCED_FOR_RECEIVE",
|
|
37
31
|
/**
|
|
38
|
-
* The channel has been closed. Information about the channel is still
|
|
39
|
-
*
|
|
32
|
+
* The channel has been closed. Information about the channel is still available for historical
|
|
33
|
+
* purposes but the channel cannot be used anymore.
|
|
40
34
|
* *
|
|
41
35
|
*/
|
|
42
36
|
CLOSED = "CLOSED",
|
|
43
37
|
/**
|
|
44
|
-
* Something unexpected happened and we cannot determine the status of this
|
|
45
|
-
*
|
|
38
|
+
* Something unexpected happened and we cannot determine the status of this channel.
|
|
39
|
+
* Please try again later or contact the support.
|
|
46
40
|
* *
|
|
47
41
|
*/
|
|
48
42
|
ERROR = "ERROR",
|
|
@@ -9,8 +9,8 @@ import {
|
|
|
9
9
|
interface ChannelToTransactionsConnection {
|
|
10
10
|
/**
|
|
11
11
|
* The total count of objects in this connection, using the current filters.
|
|
12
|
-
* It is different from the number of objects returned in the current page
|
|
13
|
-
*
|
|
12
|
+
* It is different from the number of objects returned in the current page (in the `entities`
|
|
13
|
+
* field).
|
|
14
14
|
**/
|
|
15
15
|
count: number;
|
|
16
16
|
|
|
@@ -21,14 +21,14 @@ interface ChannelToTransactionsConnection {
|
|
|
21
21
|
averageFee?: CurrencyAmount | undefined;
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
|
-
* The total amount transacted for the transactions that transited through
|
|
25
|
-
*
|
|
24
|
+
* The total amount transacted for the transactions that transited through this channel,
|
|
25
|
+
* according to the filters and constraints of the connection.
|
|
26
26
|
**/
|
|
27
27
|
totalAmountTransacted?: CurrencyAmount | undefined;
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
|
-
* The total amount of fees for the transactions that transited through this
|
|
31
|
-
*
|
|
30
|
+
* The total amount of fees for the transactions that transited through this channel,
|
|
31
|
+
* according to the filters and constraints of the connection.
|
|
32
32
|
**/
|
|
33
33
|
totalFees?: CurrencyAmount | undefined;
|
|
34
34
|
}
|
|
@@ -3,9 +3,8 @@
|
|
|
3
3
|
/** This is an enum identifying a type of compliance provider. **/
|
|
4
4
|
export enum ComplianceProvider {
|
|
5
5
|
/**
|
|
6
|
-
* This is an enum value that represents values that could be added in the
|
|
7
|
-
*
|
|
8
|
-
* added without notice.
|
|
6
|
+
* This is an enum value that represents values that could be added in the future.
|
|
7
|
+
* Clients should support unknown values as more of them could be added without notice.
|
|
9
8
|
*/
|
|
10
9
|
FUTURE_VALUE = "FUTURE_VALUE",
|
|
11
10
|
|
|
@@ -40,15 +40,12 @@ import type WalletToTransactionsConnection from "./WalletToTransactionsConnectio
|
|
|
40
40
|
interface Connection {
|
|
41
41
|
/**
|
|
42
42
|
* The total count of objects in this connection, using the current filters.
|
|
43
|
-
* It is different from the number of objects returned in the current page
|
|
44
|
-
*
|
|
43
|
+
* It is different from the number of objects returned in the current page (in the `entities`
|
|
44
|
+
* field).
|
|
45
45
|
**/
|
|
46
46
|
count: number;
|
|
47
47
|
|
|
48
|
-
/**
|
|
49
|
-
* An object that holds pagination information about the objects in this
|
|
50
|
-
* connection. *
|
|
51
|
-
*/
|
|
48
|
+
/** An object that holds pagination information about the objects in this connection. **/
|
|
52
49
|
pageInfo: PageInfo;
|
|
53
50
|
|
|
54
51
|
/** The typename of the object **/
|
|
@@ -3,10 +3,7 @@
|
|
|
3
3
|
import Permission from "./Permission.js";
|
|
4
4
|
|
|
5
5
|
interface CreateApiTokenInput {
|
|
6
|
-
/**
|
|
7
|
-
* An arbitrary name that the user can choose to identify the API token in a
|
|
8
|
-
* list. *
|
|
9
|
-
*/
|
|
6
|
+
/** An arbitrary name that the user can choose to identify the API token in a list. **/
|
|
10
7
|
name: string;
|
|
11
8
|
|
|
12
9
|
/** List of permissions to grant to the API token **/
|
|
@@ -9,8 +9,8 @@ interface CreateLnurlInvoiceInput {
|
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* The SHA256 hash of the LNURL metadata payload.
|
|
12
|
-
* This will be present in the h-tag (SHA256 purpose of payment) of the
|
|
13
|
-
*
|
|
12
|
+
* This will be present in the h-tag (SHA256 purpose of payment) of the resulting Bolt 11
|
|
13
|
+
* invoice.
|
|
14
14
|
**/
|
|
15
15
|
metadataHash: string;
|
|
16
16
|
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* This is an object identifying the output of a test mode payment.
|
|
5
|
-
* This object can be used to retrieve the associated payment made from a Test
|
|
6
|
-
*
|
|
5
|
+
* This object can be used to retrieve the associated payment made from a Test Mode Payment call.
|
|
6
|
+
* *
|
|
7
7
|
*/
|
|
8
8
|
interface CreateTestModePaymentoutput {
|
|
9
9
|
/**
|
|
@@ -14,16 +14,14 @@ interface CurrencyAmount {
|
|
|
14
14
|
preferredCurrencyUnit: CurrencyUnit;
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
|
-
* The rounded numeric value for this CurrencyAmount in the very base level
|
|
18
|
-
*
|
|
19
|
-
* cents.
|
|
17
|
+
* The rounded numeric value for this CurrencyAmount in the very base level of user's preferred
|
|
18
|
+
* currency. For example, for USD, the value will be in cents.
|
|
20
19
|
**/
|
|
21
20
|
preferredCurrencyValueRounded: number;
|
|
22
21
|
|
|
23
22
|
/**
|
|
24
|
-
* The approximate float value for this CurrencyAmount in the very base level
|
|
25
|
-
*
|
|
26
|
-
* cents.
|
|
23
|
+
* The approximate float value for this CurrencyAmount in the very base level of user's
|
|
24
|
+
* preferred currency. For example, for USD, the value will be in cents.
|
|
27
25
|
**/
|
|
28
26
|
preferredCurrencyValueApprox: number;
|
|
29
27
|
}
|
|
@@ -1,20 +1,16 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
* This enum identifies the unit of currency associated with a CurrencyAmount.
|
|
5
|
-
* *
|
|
6
|
-
*/
|
|
3
|
+
/** This enum identifies the unit of currency associated with a CurrencyAmount. **/
|
|
7
4
|
export enum CurrencyUnit {
|
|
8
5
|
/**
|
|
9
|
-
* This is an enum value that represents values that could be added in the
|
|
10
|
-
*
|
|
11
|
-
* added without notice.
|
|
6
|
+
* This is an enum value that represents values that could be added in the future.
|
|
7
|
+
* Clients should support unknown values as more of them could be added without notice.
|
|
12
8
|
*/
|
|
13
9
|
FUTURE_VALUE = "FUTURE_VALUE",
|
|
14
10
|
/**
|
|
15
11
|
* Bitcoin is the cryptocurrency native to the Bitcoin network.
|
|
16
|
-
* It is used as the native medium for value transfer for the Lightning
|
|
17
|
-
*
|
|
12
|
+
* It is used as the native medium for value transfer for the Lightning Network.
|
|
13
|
+
* *
|
|
18
14
|
*/
|
|
19
15
|
BITCOIN = "BITCOIN",
|
|
20
16
|
/**
|
|
@@ -24,8 +20,8 @@ export enum CurrencyUnit {
|
|
|
24
20
|
*/
|
|
25
21
|
SATOSHI = "SATOSHI",
|
|
26
22
|
/**
|
|
27
|
-
* 0.001 Satoshi, or 10e-11 Bitcoin. We recommend using the Satoshi unit
|
|
28
|
-
*
|
|
23
|
+
* 0.001 Satoshi, or 10e-11 Bitcoin. We recommend using the Satoshi unit instead when possible.
|
|
24
|
+
* *
|
|
29
25
|
*/
|
|
30
26
|
MILLISATOSHI = "MILLISATOSHI",
|
|
31
27
|
/** United States Dollar. **/
|
package/src/objects/Deposit.ts
CHANGED
|
@@ -11,8 +11,8 @@ import TransactionStatus from "./TransactionStatus.js";
|
|
|
11
11
|
/**
|
|
12
12
|
* This object represents a Deposit made to a Lightspark node wallet.
|
|
13
13
|
* This operation occurs for any L1 funding transaction to the wallet.
|
|
14
|
-
* You can retrieve this object to receive detailed information about the
|
|
15
|
-
*
|
|
14
|
+
* You can retrieve this object to receive detailed information about the deposit.
|
|
15
|
+
* *
|
|
16
16
|
*/
|
|
17
17
|
interface Deposit {
|
|
18
18
|
/**
|
|
@@ -34,8 +34,8 @@ interface Deposit {
|
|
|
34
34
|
amount: CurrencyAmount;
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
|
-
* The height of the block that included this transaction.
|
|
38
|
-
*
|
|
37
|
+
* The height of the block that included this transaction. This will be zero for unconfirmed
|
|
38
|
+
* transactions.
|
|
39
39
|
**/
|
|
40
40
|
blockHeight: number;
|
|
41
41
|
|
|
@@ -51,28 +51,22 @@ interface Deposit {
|
|
|
51
51
|
/** The date and time when this transaction was completed or failed. **/
|
|
52
52
|
resolvedAt?: string | undefined;
|
|
53
53
|
|
|
54
|
-
/**
|
|
55
|
-
* The hash of this transaction, so it can be uniquely identified on the
|
|
56
|
-
* Lightning Network. *
|
|
57
|
-
*/
|
|
54
|
+
/** The hash of this transaction, so it can be uniquely identified on the Lightning Network. **/
|
|
58
55
|
transactionHash?: string | undefined;
|
|
59
56
|
|
|
60
57
|
/**
|
|
61
|
-
* The fees that were paid by the wallet sending the transaction to commit it
|
|
62
|
-
*
|
|
58
|
+
* The fees that were paid by the wallet sending the transaction to commit it to the Bitcoin
|
|
59
|
+
* blockchain.
|
|
63
60
|
**/
|
|
64
61
|
fees?: CurrencyAmount | undefined;
|
|
65
62
|
|
|
66
63
|
/**
|
|
67
|
-
* The hash of the block that included this transaction.
|
|
68
|
-
*
|
|
64
|
+
* The hash of the block that included this transaction. This will be null for unconfirmed
|
|
65
|
+
* transactions.
|
|
69
66
|
**/
|
|
70
67
|
blockHash?: string | undefined;
|
|
71
68
|
|
|
72
|
-
/**
|
|
73
|
-
* The number of blockchain confirmations for this transaction in real time.
|
|
74
|
-
* *
|
|
75
|
-
*/
|
|
69
|
+
/** The number of blockchain confirmations for this transaction in real time. **/
|
|
76
70
|
numConfirmations?: number | undefined;
|
|
77
71
|
}
|
|
78
72
|
|
package/src/objects/Entity.ts
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* This interface is used by all the entities in the Lightspark system.
|
|
5
5
|
* It defines a few core fields that are available everywhere.
|
|
6
|
-
* Any object that implements this interface can be queried using the `entity`
|
|
7
|
-
*
|
|
6
|
+
* Any object that implements this interface can be queried using the `entity` query and its ID.
|
|
7
|
+
* *
|
|
8
8
|
*/
|
|
9
9
|
interface Entity {
|
|
10
10
|
/**
|
|
@@ -7,9 +7,9 @@ import {
|
|
|
7
7
|
} from "./CurrencyAmount.js";
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
* This object represents the estimated L1 transaction fees for the Bitcoin
|
|
11
|
-
*
|
|
12
|
-
*
|
|
10
|
+
* This object represents the estimated L1 transaction fees for the Bitcoin network.
|
|
11
|
+
* Fee estimates are separated by potential confirmation speeds for settlement.
|
|
12
|
+
* *
|
|
13
13
|
*/
|
|
14
14
|
interface FeeEstimate {
|
|
15
15
|
feeFast: CurrencyAmount;
|
package/src/objects/GraphNode.ts
CHANGED
|
@@ -12,9 +12,8 @@ import { NodeToAddressesConnectionFromJson } from "./NodeToAddressesConnection.j
|
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* This object represents a node that exists on the Lightning Network,
|
|
15
|
-
* including nodes not managed by Lightspark.
|
|
16
|
-
*
|
|
17
|
-
* node on the Lightning Network.
|
|
15
|
+
* including nodes not managed by Lightspark. You can retrieve this object to get publicly
|
|
16
|
+
* available information about any node on the Lightning Network.
|
|
18
17
|
* *
|
|
19
18
|
*/
|
|
20
19
|
class GraphNode implements Node, Entity {
|
|
@@ -31,40 +30,34 @@ class GraphNode implements Node, Entity {
|
|
|
31
30
|
/** The Bitcoin Network this node is deployed in. **/
|
|
32
31
|
public readonly bitcoinNetwork: BitcoinNetwork,
|
|
33
32
|
/**
|
|
34
|
-
* The name of this node in the network.
|
|
35
|
-
* It will be the most human-readable option possible,
|
|
33
|
+
* The name of this node in the network. It will be the most human-readable option possible,
|
|
36
34
|
* depending on the data available for this node.
|
|
37
35
|
**/
|
|
38
36
|
public readonly displayName: string,
|
|
39
37
|
/** The typename of the object **/
|
|
40
38
|
public readonly typename: string,
|
|
41
39
|
/**
|
|
42
|
-
* A name that identifies the node.
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
* popular nodes. This alias can be changed at any time by the node
|
|
46
|
-
* operator.
|
|
40
|
+
* A name that identifies the node. It has no importance in terms of operating the node,
|
|
41
|
+
* it is just a way to identify and search for commercial services or popular nodes.
|
|
42
|
+
* This alias can be changed at any time by the node operator.
|
|
47
43
|
**/
|
|
48
44
|
public readonly alias?: string | undefined,
|
|
49
45
|
/**
|
|
50
|
-
* A hexadecimal string that describes a color. For example "#000000" is
|
|
51
|
-
*
|
|
52
|
-
* the node,
|
|
46
|
+
* A hexadecimal string that describes a color. For example "#000000" is black, "#FFFFFF" is
|
|
47
|
+
* white. It has no importance in terms of operating the node,
|
|
53
48
|
* it is just a way to visually differentiate nodes.
|
|
54
49
|
* That color can be changed at any time by the node operator.
|
|
55
50
|
**/
|
|
56
51
|
public readonly color?: string | undefined,
|
|
57
52
|
/**
|
|
58
|
-
* A summary metric used to capture how well positioned a node is to send,
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
* capital efficient. The value is an integer ranging between 0 and 10
|
|
62
|
-
* (bounds included).
|
|
53
|
+
* A summary metric used to capture how well positioned a node is to send, receive, or route
|
|
54
|
+
* transactions efficiently. Maximizing a node's conductivity helps a node’s transactions to be
|
|
55
|
+
* capital efficient. The value is an integer ranging between 0 and 10 (bounds included).
|
|
63
56
|
**/
|
|
64
57
|
public readonly conductivity?: number | undefined,
|
|
65
58
|
/**
|
|
66
|
-
* The public key of this node. It acts as a unique identifier of this node
|
|
67
|
-
*
|
|
59
|
+
* The public key of this node. It acts as a unique identifier of this node in the Lightning
|
|
60
|
+
* Network. *
|
|
68
61
|
*/
|
|
69
62
|
public readonly publicKey?: string | undefined,
|
|
70
63
|
) {
|
package/src/objects/Hop.ts
CHANGED
|
@@ -8,9 +8,9 @@ import {
|
|
|
8
8
|
} from "./CurrencyAmount.js";
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
* This object represents a specific node that existed on a particular payment
|
|
12
|
-
*
|
|
13
|
-
*
|
|
11
|
+
* This object represents a specific node that existed on a particular payment route.
|
|
12
|
+
* You can retrieve this object to get information about a node on a particular payment path and
|
|
13
|
+
* all payment-relevant information for that node.
|
|
14
14
|
* *
|
|
15
15
|
*/
|
|
16
16
|
interface Hop {
|
|
@@ -41,10 +41,7 @@ interface Hop {
|
|
|
41
41
|
/** The amount that is to be forwarded to the destination node. **/
|
|
42
42
|
amountToForward?: CurrencyAmount | undefined;
|
|
43
43
|
|
|
44
|
-
/**
|
|
45
|
-
* The fees to be collected by the source node for forwarding the payment
|
|
46
|
-
* over the hop. *
|
|
47
|
-
*/
|
|
44
|
+
/** The fees to be collected by the source node for forwarding the payment over the hop. **/
|
|
48
45
|
fee?: CurrencyAmount | undefined;
|
|
49
46
|
|
|
50
47
|
/** The block height at which an unsettled HTLC is considered expired. **/
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* This is an enum representing a particular reason why an htlc sent over the
|
|
5
|
-
*
|
|
4
|
+
* This is an enum representing a particular reason why an htlc sent over the Lightning Network may
|
|
5
|
+
* have failed. *
|
|
6
6
|
*/
|
|
7
7
|
export enum HtlcAttemptFailureCode {
|
|
8
8
|
/**
|
|
9
|
-
* This is an enum value that represents values that could be added in the
|
|
10
|
-
*
|
|
11
|
-
* added without notice.
|
|
9
|
+
* This is an enum value that represents values that could be added in the future.
|
|
10
|
+
* Clients should support unknown values as more of them could be added without notice.
|
|
12
11
|
*/
|
|
13
12
|
FUTURE_VALUE = "FUTURE_VALUE",
|
|
14
13
|
|