@lightsparkdev/lightspark-sdk 1.3.1 → 1.4.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 +7 -0
- package/dist/{BitcoinNetwork-972b1d01.d.ts → BitcoinNetwork-4f6ea015.d.ts} +2 -2
- package/dist/{chunk-Y55D3PD4.js → chunk-LCDROGA5.js} +938 -725
- package/dist/env.d.cts +1 -1
- package/dist/env.d.ts +1 -1
- package/dist/{index-a5028d74.d.ts → index-6f544cad.d.ts} +711 -714
- package/dist/index.cjs +309 -2
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +96 -2
- package/dist/objects/index.cjs +1339 -1126
- 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 +1 -1
- package/src/client.ts +77 -1
- package/src/graphql/RegisterPayment.ts +21 -0
- package/src/graphql/ScreenNode.ts +15 -0
- package/src/objects/Account.ts +98 -5
- package/src/objects/AccountToApiTokensConnection.ts +2 -3
- package/src/objects/AccountToChannelsConnection.ts +2 -3
- package/src/objects/AccountToNodesConnection.ts +2 -3
- package/src/objects/AccountToPaymentRequestsConnection.ts +2 -3
- package/src/objects/AccountToTransactionsConnection.ts +6 -7
- package/src/objects/AccountToWalletsConnection.ts +2 -3
- package/src/objects/AccountToWithdrawalRequestsConnection.ts +71 -0
- package/src/objects/ApiToken.ts +5 -6
- package/src/objects/Balances.ts +9 -12
- package/src/objects/BitcoinNetwork.ts +2 -2
- package/src/objects/Channel.ts +7 -10
- package/src/objects/ChannelClosingTransaction.ts +3 -4
- package/src/objects/ChannelOpeningTransaction.ts +3 -4
- package/src/objects/ChannelStatus.ts +5 -9
- package/src/objects/ChannelToTransactionsConnection.ts +6 -7
- package/src/objects/Connection.ts +85 -3
- package/src/objects/CreateApiTokenOutput.ts +3 -3
- package/src/objects/CreateLnurlInvoiceInput.ts +2 -3
- package/src/objects/CreateTestModePaymentInput.ts +2 -2
- package/src/objects/CreateTestModePaymentoutput.ts +2 -3
- package/src/objects/CurrencyUnit.ts +11 -17
- package/src/objects/Deposit.ts +5 -6
- package/src/objects/Entity.ts +21 -6
- package/src/objects/FeeEstimate.ts +2 -3
- package/src/objects/GraphNode.ts +10 -12
- package/src/objects/Hop.ts +5 -6
- package/src/objects/IncentivesStatus.ts +2 -3
- package/src/objects/IncomingPayment.ts +7 -7
- package/src/objects/IncomingPaymentAttempt.ts +2 -2
- package/src/objects/IncomingPaymentToAttemptsConnection.ts +2 -3
- package/src/objects/Invoice.ts +2 -2
- package/src/objects/InvoiceData.ts +4 -5
- package/src/objects/LightningTransaction.ts +5 -5
- package/src/objects/LightsparkNode.ts +8 -10
- package/src/objects/LightsparkNodeOwner.ts +2 -2
- package/src/objects/LightsparkNodeToChannelsConnection.ts +2 -3
- package/src/objects/LightsparkNodeWithOSK.ts +7 -8
- package/src/objects/LightsparkNodeWithRemoteSigning.ts +7 -8
- package/src/objects/Node.ts +9 -11
- package/src/objects/NodeToAddressesConnection.ts +2 -3
- package/src/objects/OnChainTransaction.ts +5 -6
- package/src/objects/OutgoingPayment.ts +5 -6
- package/src/objects/OutgoingPaymentAttempt.ts +12 -14
- package/src/objects/OutgoingPaymentAttemptToHopsConnection.ts +2 -3
- package/src/objects/OutgoingPaymentToAttemptsConnection.ts +2 -3
- package/src/objects/PageInfo.ts +3 -3
- package/src/objects/PaymentRequest.ts +2 -2
- package/src/objects/PaymentRequestData.ts +1 -2
- package/src/objects/RegisterPaymentInput.ts +7 -8
- package/src/objects/RequestWithdrawalInput.ts +2 -2
- package/src/objects/RiskRating.ts +1 -2
- package/src/objects/RoutingTransaction.ts +6 -8
- package/src/objects/ScreenNodeInput.ts +2 -3
- package/src/objects/SetInvoicePaymentHashInput.ts +2 -3
- package/src/objects/Signable.ts +2 -2
- package/src/objects/SignablePayload.ts +2 -2
- package/src/objects/Transaction.ts +3 -4
- package/src/objects/TransactionStatus.ts +1 -2
- package/src/objects/UmaInvitation.ts +2 -2
- package/src/objects/Wallet.ts +97 -8
- package/src/objects/WalletStatus.ts +5 -7
- package/src/objects/WalletToPaymentRequestsConnection.ts +2 -3
- package/src/objects/WalletToTransactionsConnection.ts +2 -3
- package/src/objects/WalletToWithdrawalRequestsConnection.ts +70 -0
- package/src/objects/Withdrawal.ts +5 -5
- package/src/objects/WithdrawalRequest.ts +43 -7
- package/src/objects/WithdrawalRequestToChannelClosingTransactionsConnection.ts +2 -3
- package/src/objects/WithdrawalRequestToChannelOpeningTransactionsConnection.ts +2 -3
- package/src/objects/index.ts +2 -0
package/src/objects/Channel.ts
CHANGED
|
@@ -17,15 +17,14 @@ import type Entity from "./Entity.js";
|
|
|
17
17
|
import type TransactionType from "./TransactionType.js";
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
|
-
* This is an object representing a channel on the Lightning Network.
|
|
21
|
-
*
|
|
22
|
-
* channel. *
|
|
20
|
+
* This is an object representing a channel on the Lightning Network. You can retrieve this object
|
|
21
|
+
* to get detailed information on a specific Lightning Network channel. *
|
|
23
22
|
*/
|
|
24
23
|
class Channel implements Entity {
|
|
25
24
|
constructor(
|
|
26
25
|
/**
|
|
27
|
-
* The unique identifier of this entity across all Lightspark systems.
|
|
28
|
-
*
|
|
26
|
+
* The unique identifier of this entity across all Lightspark systems. Should be treated as an
|
|
27
|
+
* opaque string.
|
|
29
28
|
**/
|
|
30
29
|
public readonly id: string,
|
|
31
30
|
/** The date and time when the entity was first created. **/
|
|
@@ -46,8 +45,7 @@ class Channel implements Entity {
|
|
|
46
45
|
/** The channel balance on the local node. **/
|
|
47
46
|
public readonly localBalance?: CurrencyAmount | undefined,
|
|
48
47
|
/**
|
|
49
|
-
* The channel balance on the local node that is currently allocated to in-progress payments.
|
|
50
|
-
* *
|
|
48
|
+
* The channel balance on the local node that is currently allocated to in-progress payments. *
|
|
51
49
|
*/
|
|
52
50
|
public readonly localUnsettledBalance?: CurrencyAmount | undefined,
|
|
53
51
|
/** The channel balance on the remote node. **/
|
|
@@ -78,9 +76,8 @@ class Channel implements Entity {
|
|
|
78
76
|
/** If known, the remote node of the channel. **/
|
|
79
77
|
public readonly remoteNodeId?: string | undefined,
|
|
80
78
|
/**
|
|
81
|
-
* The unique identifier of the channel on Lightning Network,
|
|
82
|
-
*
|
|
83
|
-
* <block-height>:<tx-index>:<tx-output>.
|
|
79
|
+
* The unique identifier of the channel on Lightning Network, which is the location in the
|
|
80
|
+
* chain that the channel was confirmed. The format is <block-height>:<tx-index>:<tx-output>.
|
|
84
81
|
**/
|
|
85
82
|
public readonly shortChannelId?: string | undefined,
|
|
86
83
|
) {
|
|
@@ -10,13 +10,12 @@ import TransactionStatus from "./TransactionStatus.js";
|
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
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.
|
|
14
|
-
* *
|
|
13
|
+
* This operation allocates balances back to the local and remote nodes. *
|
|
15
14
|
*/
|
|
16
15
|
interface ChannelClosingTransaction {
|
|
17
16
|
/**
|
|
18
|
-
* The unique identifier of this entity across all Lightspark systems.
|
|
19
|
-
*
|
|
17
|
+
* The unique identifier of this entity across all Lightspark systems. Should be treated as an
|
|
18
|
+
* opaque string.
|
|
20
19
|
**/
|
|
21
20
|
id: string;
|
|
22
21
|
|
|
@@ -10,13 +10,12 @@ import TransactionStatus from "./TransactionStatus.js";
|
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
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.
|
|
14
|
-
* *
|
|
13
|
+
* This object occurs only for channels funded by the local Lightspark node. *
|
|
15
14
|
*/
|
|
16
15
|
interface ChannelOpeningTransaction {
|
|
17
16
|
/**
|
|
18
|
-
* The unique identifier of this entity across all Lightspark systems.
|
|
19
|
-
*
|
|
17
|
+
* The unique identifier of this entity across all Lightspark systems. Should be treated as an
|
|
18
|
+
* opaque string.
|
|
20
19
|
**/
|
|
21
20
|
id: string;
|
|
22
21
|
|
|
@@ -18,26 +18,22 @@ export enum ChannelStatus {
|
|
|
18
18
|
OFFLINE = "OFFLINE",
|
|
19
19
|
/**
|
|
20
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.
|
|
22
|
-
* *
|
|
21
|
+
* so it is not balanced properly for sending funds out. *
|
|
23
22
|
*/
|
|
24
23
|
UNBALANCED_FOR_SEND = "UNBALANCED_FOR_SEND",
|
|
25
24
|
/**
|
|
26
25
|
* 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.
|
|
28
|
-
* *
|
|
26
|
+
* so it is not balanced properly for receiving funds. *
|
|
29
27
|
*/
|
|
30
28
|
UNBALANCED_FOR_RECEIVE = "UNBALANCED_FOR_RECEIVE",
|
|
31
29
|
/**
|
|
32
30
|
* The channel has been closed. Information about the channel is still available for historical
|
|
33
|
-
* purposes but the channel cannot be used anymore.
|
|
34
|
-
* *
|
|
31
|
+
* purposes but the channel cannot be used anymore. *
|
|
35
32
|
*/
|
|
36
33
|
CLOSED = "CLOSED",
|
|
37
34
|
/**
|
|
38
|
-
* Something unexpected happened and we cannot determine the status of this channel.
|
|
39
|
-
*
|
|
40
|
-
* *
|
|
35
|
+
* Something unexpected happened and we cannot determine the status of this channel. Please try
|
|
36
|
+
* again later or contact the support. *
|
|
41
37
|
*/
|
|
42
38
|
ERROR = "ERROR",
|
|
43
39
|
}
|
|
@@ -8,15 +8,14 @@ import {
|
|
|
8
8
|
|
|
9
9
|
interface ChannelToTransactionsConnection {
|
|
10
10
|
/**
|
|
11
|
-
* The total count of objects in this connection, using the current filters.
|
|
12
|
-
*
|
|
13
|
-
* field).
|
|
11
|
+
* The total count of objects in this connection, using the current filters. It is different
|
|
12
|
+
* from the number of objects returned in the current page (in the `entities` field).
|
|
14
13
|
**/
|
|
15
14
|
count: number;
|
|
16
15
|
|
|
17
16
|
/**
|
|
18
|
-
* The average fee for the transactions that transited through this channel,
|
|
19
|
-
*
|
|
17
|
+
* The average fee for the transactions that transited through this channel, according to the
|
|
18
|
+
* filters and constraints of the connection.
|
|
20
19
|
**/
|
|
21
20
|
averageFee?: CurrencyAmount | undefined;
|
|
22
21
|
|
|
@@ -27,8 +26,8 @@ interface ChannelToTransactionsConnection {
|
|
|
27
26
|
totalAmountTransacted?: CurrencyAmount | undefined;
|
|
28
27
|
|
|
29
28
|
/**
|
|
30
|
-
* The total amount of fees for the transactions that transited through this channel,
|
|
31
|
-
*
|
|
29
|
+
* The total amount of fees for the transactions that transited through this channel, according
|
|
30
|
+
* to the filters and constraints of the connection.
|
|
32
31
|
**/
|
|
33
32
|
totalFees?: CurrencyAmount | undefined;
|
|
34
33
|
}
|
|
@@ -6,6 +6,7 @@ import type AccountToNodesConnection from "./AccountToNodesConnection.js";
|
|
|
6
6
|
import type AccountToPaymentRequestsConnection from "./AccountToPaymentRequestsConnection.js";
|
|
7
7
|
import type AccountToTransactionsConnection from "./AccountToTransactionsConnection.js";
|
|
8
8
|
import type AccountToWalletsConnection from "./AccountToWalletsConnection.js";
|
|
9
|
+
import type AccountToWithdrawalRequestsConnection from "./AccountToWithdrawalRequestsConnection.js";
|
|
9
10
|
import { ApiTokenFromJson, ApiTokenToJson } from "./ApiToken.js";
|
|
10
11
|
import { ChannelFromJson } from "./Channel.js";
|
|
11
12
|
import {
|
|
@@ -36,12 +37,13 @@ import { TransactionFromJson, TransactionToJson } from "./Transaction.js";
|
|
|
36
37
|
import { WalletFromJson } from "./Wallet.js";
|
|
37
38
|
import type WalletToPaymentRequestsConnection from "./WalletToPaymentRequestsConnection.js";
|
|
38
39
|
import type WalletToTransactionsConnection from "./WalletToTransactionsConnection.js";
|
|
40
|
+
import type WalletToWithdrawalRequestsConnection from "./WalletToWithdrawalRequestsConnection.js";
|
|
41
|
+
import { WithdrawalRequestFromJson } from "./WithdrawalRequest.js";
|
|
39
42
|
|
|
40
43
|
interface Connection {
|
|
41
44
|
/**
|
|
42
|
-
* The total count of objects in this connection, using the current filters.
|
|
43
|
-
*
|
|
44
|
-
* field).
|
|
45
|
+
* The total count of objects in this connection, using the current filters. It is different
|
|
46
|
+
* from the number of objects returned in the current page (in the `entities` field).
|
|
45
47
|
**/
|
|
46
48
|
count: number;
|
|
47
49
|
|
|
@@ -130,6 +132,18 @@ export const ConnectionFromJson = (obj: any): Connection => {
|
|
|
130
132
|
typename: "AccountToWalletsConnection",
|
|
131
133
|
} as AccountToWalletsConnection;
|
|
132
134
|
}
|
|
135
|
+
if (obj["__typename"] == "AccountToWithdrawalRequestsConnection") {
|
|
136
|
+
return {
|
|
137
|
+
count: obj["account_to_withdrawal_requests_connection_count"],
|
|
138
|
+
pageInfo: PageInfoFromJson(
|
|
139
|
+
obj["account_to_withdrawal_requests_connection_page_info"],
|
|
140
|
+
),
|
|
141
|
+
entities: obj["account_to_withdrawal_requests_connection_entities"].map(
|
|
142
|
+
(e) => WithdrawalRequestFromJson(e),
|
|
143
|
+
),
|
|
144
|
+
typename: "AccountToWithdrawalRequestsConnection",
|
|
145
|
+
} as AccountToWithdrawalRequestsConnection;
|
|
146
|
+
}
|
|
133
147
|
if (obj["__typename"] == "IncomingPaymentToAttemptsConnection") {
|
|
134
148
|
return {
|
|
135
149
|
count: obj["incoming_payment_to_attempts_connection_count"],
|
|
@@ -202,6 +216,18 @@ export const ConnectionFromJson = (obj: any): Connection => {
|
|
|
202
216
|
typename: "WalletToTransactionsConnection",
|
|
203
217
|
} as WalletToTransactionsConnection;
|
|
204
218
|
}
|
|
219
|
+
if (obj["__typename"] == "WalletToWithdrawalRequestsConnection") {
|
|
220
|
+
return {
|
|
221
|
+
count: obj["wallet_to_withdrawal_requests_connection_count"],
|
|
222
|
+
pageInfo: PageInfoFromJson(
|
|
223
|
+
obj["wallet_to_withdrawal_requests_connection_page_info"],
|
|
224
|
+
),
|
|
225
|
+
entities: obj["wallet_to_withdrawal_requests_connection_entities"].map(
|
|
226
|
+
(e) => WithdrawalRequestFromJson(e),
|
|
227
|
+
),
|
|
228
|
+
typename: "WalletToWithdrawalRequestsConnection",
|
|
229
|
+
} as WalletToWithdrawalRequestsConnection;
|
|
230
|
+
}
|
|
205
231
|
throw new LightsparkException(
|
|
206
232
|
"DeserializationError",
|
|
207
233
|
`Couldn't find a concrete type for interface Connection corresponding to the typename=${obj["__typename"]}`,
|
|
@@ -293,6 +319,20 @@ export const ConnectionToJson = (obj: Connection): any => {
|
|
|
293
319
|
accountToWalletsConnection.entities.map((e) => e.toJson()),
|
|
294
320
|
};
|
|
295
321
|
}
|
|
322
|
+
if (obj.typename == "AccountToWithdrawalRequestsConnection") {
|
|
323
|
+
const accountToWithdrawalRequestsConnection =
|
|
324
|
+
obj as AccountToWithdrawalRequestsConnection;
|
|
325
|
+
return {
|
|
326
|
+
__typename: "AccountToWithdrawalRequestsConnection",
|
|
327
|
+
account_to_withdrawal_requests_connection_count:
|
|
328
|
+
accountToWithdrawalRequestsConnection.count,
|
|
329
|
+
account_to_withdrawal_requests_connection_page_info: PageInfoToJson(
|
|
330
|
+
accountToWithdrawalRequestsConnection.pageInfo,
|
|
331
|
+
),
|
|
332
|
+
account_to_withdrawal_requests_connection_entities:
|
|
333
|
+
accountToWithdrawalRequestsConnection.entities.map((e) => e.toJson()),
|
|
334
|
+
};
|
|
335
|
+
}
|
|
296
336
|
if (obj.typename == "IncomingPaymentToAttemptsConnection") {
|
|
297
337
|
const incomingPaymentToAttemptsConnection =
|
|
298
338
|
obj as IncomingPaymentToAttemptsConnection;
|
|
@@ -385,6 +425,20 @@ export const ConnectionToJson = (obj: Connection): any => {
|
|
|
385
425
|
),
|
|
386
426
|
};
|
|
387
427
|
}
|
|
428
|
+
if (obj.typename == "WalletToWithdrawalRequestsConnection") {
|
|
429
|
+
const walletToWithdrawalRequestsConnection =
|
|
430
|
+
obj as WalletToWithdrawalRequestsConnection;
|
|
431
|
+
return {
|
|
432
|
+
__typename: "WalletToWithdrawalRequestsConnection",
|
|
433
|
+
wallet_to_withdrawal_requests_connection_count:
|
|
434
|
+
walletToWithdrawalRequestsConnection.count,
|
|
435
|
+
wallet_to_withdrawal_requests_connection_page_info: PageInfoToJson(
|
|
436
|
+
walletToWithdrawalRequestsConnection.pageInfo,
|
|
437
|
+
),
|
|
438
|
+
wallet_to_withdrawal_requests_connection_entities:
|
|
439
|
+
walletToWithdrawalRequestsConnection.entities.map((e) => e.toJson()),
|
|
440
|
+
};
|
|
441
|
+
}
|
|
388
442
|
throw new LightsparkException(
|
|
389
443
|
"DeserializationError",
|
|
390
444
|
`Couldn't find a concrete type for interface Connection corresponding to the typename=${obj.typename}`,
|
|
@@ -488,6 +542,20 @@ fragment ConnectionFragment on Connection {
|
|
|
488
542
|
id
|
|
489
543
|
}
|
|
490
544
|
}
|
|
545
|
+
... on AccountToWithdrawalRequestsConnection {
|
|
546
|
+
__typename
|
|
547
|
+
account_to_withdrawal_requests_connection_count: count
|
|
548
|
+
account_to_withdrawal_requests_connection_page_info: page_info {
|
|
549
|
+
__typename
|
|
550
|
+
page_info_has_next_page: has_next_page
|
|
551
|
+
page_info_has_previous_page: has_previous_page
|
|
552
|
+
page_info_start_cursor: start_cursor
|
|
553
|
+
page_info_end_cursor: end_cursor
|
|
554
|
+
}
|
|
555
|
+
account_to_withdrawal_requests_connection_entities: entities {
|
|
556
|
+
id
|
|
557
|
+
}
|
|
558
|
+
}
|
|
491
559
|
... on IncomingPaymentToAttemptsConnection {
|
|
492
560
|
__typename
|
|
493
561
|
incoming_payment_to_attempts_connection_count: count
|
|
@@ -572,6 +640,20 @@ fragment ConnectionFragment on Connection {
|
|
|
572
640
|
id
|
|
573
641
|
}
|
|
574
642
|
}
|
|
643
|
+
... on WalletToWithdrawalRequestsConnection {
|
|
644
|
+
__typename
|
|
645
|
+
wallet_to_withdrawal_requests_connection_count: count
|
|
646
|
+
wallet_to_withdrawal_requests_connection_page_info: page_info {
|
|
647
|
+
__typename
|
|
648
|
+
page_info_has_next_page: has_next_page
|
|
649
|
+
page_info_has_previous_page: has_previous_page
|
|
650
|
+
page_info_start_cursor: start_cursor
|
|
651
|
+
page_info_end_cursor: end_cursor
|
|
652
|
+
}
|
|
653
|
+
wallet_to_withdrawal_requests_connection_entities: entities {
|
|
654
|
+
id
|
|
655
|
+
}
|
|
656
|
+
}
|
|
575
657
|
}`;
|
|
576
658
|
|
|
577
659
|
export default Connection;
|
|
@@ -8,9 +8,9 @@ interface CreateApiTokenOutput {
|
|
|
8
8
|
apiToken: ApiToken;
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
* The secret that should be used to authenticate against our API.
|
|
12
|
-
*
|
|
13
|
-
*
|
|
11
|
+
* The secret that should be used to authenticate against our API. This secret is not stored
|
|
12
|
+
* and will never be available again after this. You must keep this secret secure as it grants
|
|
13
|
+
* access to your account.
|
|
14
14
|
**/
|
|
15
15
|
clientSecret: string;
|
|
16
16
|
}
|
|
@@ -8,9 +8,8 @@ interface CreateLnurlInvoiceInput {
|
|
|
8
8
|
amountMsats: number;
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
* The SHA256 hash of the LNURL metadata payload.
|
|
12
|
-
*
|
|
13
|
-
* invoice.
|
|
11
|
+
* The SHA256 hash of the LNURL metadata payload. This will be present in the h-tag (SHA256
|
|
12
|
+
* purpose of payment) of the resulting Bolt 11 invoice.
|
|
14
13
|
**/
|
|
15
14
|
metadataHash: string;
|
|
16
15
|
|
|
@@ -8,8 +8,8 @@ interface CreateTestModePaymentInput {
|
|
|
8
8
|
encodedInvoice: string;
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
* The amount you will be paid for this invoice, expressed in msats.
|
|
12
|
-
*
|
|
11
|
+
* The amount you will be paid for this invoice, expressed in msats. It should ONLY be set when
|
|
12
|
+
* the invoice amount is zero.
|
|
13
13
|
**/
|
|
14
14
|
amountMsats?: number | undefined;
|
|
15
15
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* This is an object identifying the output of a test mode payment.
|
|
5
|
-
*
|
|
6
|
-
* *
|
|
4
|
+
* This is an object identifying the output of a test mode payment. This object can be used to
|
|
5
|
+
* retrieve the associated payment made from a Test Mode Payment call. *
|
|
7
6
|
*/
|
|
8
7
|
interface CreateTestModePaymentoutput {
|
|
9
8
|
/**
|
|
@@ -8,40 +8,34 @@ export enum CurrencyUnit {
|
|
|
8
8
|
*/
|
|
9
9
|
FUTURE_VALUE = "FUTURE_VALUE",
|
|
10
10
|
/**
|
|
11
|
-
* Bitcoin is the cryptocurrency native to the Bitcoin network.
|
|
12
|
-
*
|
|
13
|
-
* *
|
|
11
|
+
* Bitcoin is the cryptocurrency native to the Bitcoin network. It is used as the native medium
|
|
12
|
+
* for value transfer for the Lightning Network. *
|
|
14
13
|
*/
|
|
15
14
|
BITCOIN = "BITCOIN",
|
|
16
15
|
/**
|
|
17
|
-
* 0.00000001 (10e-8) Bitcoin or one hundred millionth of a Bitcoin.
|
|
18
|
-
*
|
|
19
|
-
* *
|
|
16
|
+
* 0.00000001 (10e-8) Bitcoin or one hundred millionth of a Bitcoin. This is the unit most
|
|
17
|
+
* commonly used in Lightning transactions. *
|
|
20
18
|
*/
|
|
21
19
|
SATOSHI = "SATOSHI",
|
|
22
20
|
/**
|
|
23
|
-
* 0.001 Satoshi, or 10e-11 Bitcoin. We recommend using the Satoshi unit instead when possible.
|
|
24
|
-
* *
|
|
21
|
+
* 0.001 Satoshi, or 10e-11 Bitcoin. We recommend using the Satoshi unit instead when possible. *
|
|
25
22
|
*/
|
|
26
23
|
MILLISATOSHI = "MILLISATOSHI",
|
|
27
24
|
/** United States Dollar. **/
|
|
28
25
|
USD = "USD",
|
|
29
26
|
/**
|
|
30
|
-
* 0.000000001 (10e-9) Bitcoin or a billionth of a Bitcoin.
|
|
31
|
-
*
|
|
32
|
-
* *
|
|
27
|
+
* 0.000000001 (10e-9) Bitcoin or a billionth of a Bitcoin. We recommend using the Satoshi unit
|
|
28
|
+
* instead when possible. *
|
|
33
29
|
*/
|
|
34
30
|
NANOBITCOIN = "NANOBITCOIN",
|
|
35
31
|
/**
|
|
36
|
-
* 0.000001 (10e-6) Bitcoin or a millionth of a Bitcoin.
|
|
37
|
-
*
|
|
38
|
-
* *
|
|
32
|
+
* 0.000001 (10e-6) Bitcoin or a millionth of a Bitcoin. We recommend using the Satoshi unit
|
|
33
|
+
* instead when possible. *
|
|
39
34
|
*/
|
|
40
35
|
MICROBITCOIN = "MICROBITCOIN",
|
|
41
36
|
/**
|
|
42
|
-
* 0.001 (10e-3) Bitcoin or a thousandth of a Bitcoin.
|
|
43
|
-
*
|
|
44
|
-
* *
|
|
37
|
+
* 0.001 (10e-3) Bitcoin or a thousandth of a Bitcoin. We recommend using the Satoshi unit instead
|
|
38
|
+
* when possible. *
|
|
45
39
|
*/
|
|
46
40
|
MILLIBITCOIN = "MILLIBITCOIN",
|
|
47
41
|
}
|
package/src/objects/Deposit.ts
CHANGED
|
@@ -9,15 +9,14 @@ import {
|
|
|
9
9
|
import TransactionStatus from "./TransactionStatus.js";
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
|
-
* This object represents a Deposit made to a Lightspark node wallet.
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* *
|
|
12
|
+
* This object represents a Deposit made to a Lightspark node wallet. This operation occurs for any
|
|
13
|
+
* L1 funding transaction to the wallet. You can retrieve this object to receive detailed
|
|
14
|
+
* information about the deposit. *
|
|
16
15
|
*/
|
|
17
16
|
interface Deposit {
|
|
18
17
|
/**
|
|
19
|
-
* The unique identifier of this entity across all Lightspark systems.
|
|
20
|
-
*
|
|
18
|
+
* The unique identifier of this entity across all Lightspark systems. Should be treated as an
|
|
19
|
+
* opaque string.
|
|
21
20
|
**/
|
|
22
21
|
id: string;
|
|
23
22
|
|
package/src/objects/Entity.ts
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* This interface is used by all the entities in the Lightspark system.
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* *
|
|
4
|
+
* This interface is used by all the entities in the Lightspark system. It defines a few core
|
|
5
|
+
* fields that are available everywhere. Any object that implements this interface can be queried
|
|
6
|
+
* using the `entity` query and its ID. *
|
|
8
7
|
*/
|
|
9
8
|
interface Entity {
|
|
10
9
|
/**
|
|
11
|
-
* The unique identifier of this entity across all Lightspark systems.
|
|
12
|
-
*
|
|
10
|
+
* The unique identifier of this entity across all Lightspark systems. Should be treated as an
|
|
11
|
+
* opaque string.
|
|
13
12
|
**/
|
|
14
13
|
id: string;
|
|
15
14
|
|
|
@@ -1455,6 +1454,14 @@ fragment EntityFragment on Entity {
|
|
|
1455
1454
|
withdrawal_request_id: id
|
|
1456
1455
|
withdrawal_request_created_at: created_at
|
|
1457
1456
|
withdrawal_request_updated_at: updated_at
|
|
1457
|
+
withdrawal_request_requested_amount: requested_amount {
|
|
1458
|
+
__typename
|
|
1459
|
+
currency_amount_original_value: original_value
|
|
1460
|
+
currency_amount_original_unit: original_unit
|
|
1461
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
1462
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
1463
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
1464
|
+
}
|
|
1458
1465
|
withdrawal_request_amount: amount {
|
|
1459
1466
|
__typename
|
|
1460
1467
|
currency_amount_original_value: original_value
|
|
@@ -1471,6 +1478,14 @@ fragment EntityFragment on Entity {
|
|
|
1471
1478
|
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
1472
1479
|
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
1473
1480
|
}
|
|
1481
|
+
withdrawal_request_amount_withdrawn: amount_withdrawn {
|
|
1482
|
+
__typename
|
|
1483
|
+
currency_amount_original_value: original_value
|
|
1484
|
+
currency_amount_original_unit: original_unit
|
|
1485
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
1486
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
1487
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
1488
|
+
}
|
|
1474
1489
|
withdrawal_request_bitcoin_address: bitcoin_address
|
|
1475
1490
|
withdrawal_request_withdrawal_mode: withdrawal_mode
|
|
1476
1491
|
withdrawal_request_status: status
|
|
@@ -7,9 +7,8 @@ import {
|
|
|
7
7
|
} from "./CurrencyAmount.js";
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
* This object represents the estimated L1 transaction fees for the Bitcoin network.
|
|
11
|
-
*
|
|
12
|
-
* *
|
|
10
|
+
* This object represents the estimated L1 transaction fees for the Bitcoin network. Fee estimates
|
|
11
|
+
* are separated by potential confirmation speeds for settlement. *
|
|
13
12
|
*/
|
|
14
13
|
interface FeeEstimate {
|
|
15
14
|
feeFast: CurrencyAmount;
|
package/src/objects/GraphNode.ts
CHANGED
|
@@ -11,16 +11,15 @@ import type NodeToAddressesConnection from "./NodeToAddressesConnection.js";
|
|
|
11
11
|
import { NodeToAddressesConnectionFromJson } from "./NodeToAddressesConnection.js";
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
* This object represents a node that exists on the Lightning Network,
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* *
|
|
14
|
+
* This object represents a node that exists on the Lightning Network, including nodes not managed
|
|
15
|
+
* by Lightspark. You can retrieve this object to get publicly available information about any node
|
|
16
|
+
* on the Lightning Network. *
|
|
18
17
|
*/
|
|
19
18
|
class GraphNode implements Node, Entity {
|
|
20
19
|
constructor(
|
|
21
20
|
/**
|
|
22
|
-
* The unique identifier of this entity across all Lightspark systems.
|
|
23
|
-
*
|
|
21
|
+
* The unique identifier of this entity across all Lightspark systems. Should be treated as an
|
|
22
|
+
* opaque string.
|
|
24
23
|
**/
|
|
25
24
|
public readonly id: string,
|
|
26
25
|
/** The date and time when the entity was first created. **/
|
|
@@ -37,16 +36,15 @@ class GraphNode implements Node, Entity {
|
|
|
37
36
|
/** The typename of the object **/
|
|
38
37
|
public readonly typename: string,
|
|
39
38
|
/**
|
|
40
|
-
* A name that identifies the node. It has no importance in terms of operating the node,
|
|
41
|
-
*
|
|
42
|
-
*
|
|
39
|
+
* A name that identifies the node. It has no importance in terms of operating the node, it is
|
|
40
|
+
* just a way to identify and search for commercial services or popular nodes. This alias can
|
|
41
|
+
* be changed at any time by the node operator.
|
|
43
42
|
**/
|
|
44
43
|
public readonly alias?: string | undefined,
|
|
45
44
|
/**
|
|
46
45
|
* 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,
|
|
48
|
-
*
|
|
49
|
-
* That color can be changed at any time by the node operator.
|
|
46
|
+
* white. It has no importance in terms of operating the node, it is just a way to visually
|
|
47
|
+
* differentiate nodes. That color can be changed at any time by the node operator.
|
|
50
48
|
**/
|
|
51
49
|
public readonly color?: string | undefined,
|
|
52
50
|
/**
|
package/src/objects/Hop.ts
CHANGED
|
@@ -8,15 +8,14 @@ import {
|
|
|
8
8
|
} from "./CurrencyAmount.js";
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
* This object represents a specific node that existed on a particular payment route.
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* *
|
|
11
|
+
* This object represents a specific node that existed on a particular payment route. You can
|
|
12
|
+
* retrieve this object to get information about a node on a particular payment path and all
|
|
13
|
+
* payment-relevant information for that node. *
|
|
15
14
|
*/
|
|
16
15
|
interface Hop {
|
|
17
16
|
/**
|
|
18
|
-
* The unique identifier of this entity across all Lightspark systems.
|
|
19
|
-
*
|
|
17
|
+
* The unique identifier of this entity across all Lightspark systems. Should be treated as an
|
|
18
|
+
* opaque string.
|
|
20
19
|
**/
|
|
21
20
|
id: string;
|
|
22
21
|
|
|
@@ -15,9 +15,8 @@ export enum IncentivesStatus {
|
|
|
15
15
|
/** The incentives have been validated. **/
|
|
16
16
|
VALIDATED = "VALIDATED",
|
|
17
17
|
/**
|
|
18
|
-
* This invitation is not eligible for incentives.
|
|
19
|
-
*
|
|
20
|
-
* *
|
|
18
|
+
* This invitation is not eligible for incentives. A more detailed reason can be found in the
|
|
19
|
+
* `incentives_ineligibility_reason` field. *
|
|
21
20
|
*/
|
|
22
21
|
INELIGIBLE = "INELIGIBLE",
|
|
23
22
|
}
|
|
@@ -22,15 +22,15 @@ import type Transaction from "./Transaction.js";
|
|
|
22
22
|
import TransactionStatus from "./TransactionStatus.js";
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
|
-
* This object represents any payment sent to a Lightspark node on the Lightning Network.
|
|
26
|
-
*
|
|
27
|
-
*
|
|
25
|
+
* This object represents any payment sent to a Lightspark node on the Lightning Network. You can
|
|
26
|
+
* retrieve this object to receive payment related information about a specific payment received by
|
|
27
|
+
* a Lightspark node. *
|
|
28
28
|
*/
|
|
29
29
|
class IncomingPayment implements LightningTransaction, Transaction, Entity {
|
|
30
30
|
constructor(
|
|
31
31
|
/**
|
|
32
|
-
* The unique identifier of this entity across all Lightspark systems.
|
|
33
|
-
*
|
|
32
|
+
* The unique identifier of this entity across all Lightspark systems. Should be treated as an
|
|
33
|
+
* opaque string.
|
|
34
34
|
**/
|
|
35
35
|
public readonly id: string,
|
|
36
36
|
/** The date and time when this transaction was initiated. **/
|
|
@@ -50,8 +50,8 @@ class IncomingPayment implements LightningTransaction, Transaction, Entity {
|
|
|
50
50
|
/** The hash of this transaction, so it can be uniquely identified on the Lightning Network. **/
|
|
51
51
|
public readonly transactionHash?: string | undefined,
|
|
52
52
|
/**
|
|
53
|
-
* The optional payment request for this incoming payment,
|
|
54
|
-
*
|
|
53
|
+
* The optional payment request for this incoming payment, which will be null if the payment is
|
|
54
|
+
* sent through keysend.
|
|
55
55
|
**/
|
|
56
56
|
public readonly paymentRequestId?: string | undefined,
|
|
57
57
|
/** The post transaction data which can be used in KYT payment registration. **/
|
|
@@ -15,8 +15,8 @@ import IncomingPaymentAttemptStatus from "./IncomingPaymentAttemptStatus.js";
|
|
|
15
15
|
*/
|
|
16
16
|
interface IncomingPaymentAttempt {
|
|
17
17
|
/**
|
|
18
|
-
* The unique identifier of this entity across all Lightspark systems.
|
|
19
|
-
*
|
|
18
|
+
* The unique identifier of this entity across all Lightspark systems. Should be treated as an
|
|
19
|
+
* opaque string.
|
|
20
20
|
**/
|
|
21
21
|
id: string;
|
|
22
22
|
|
|
@@ -11,9 +11,8 @@ import { PageInfoFromJson, PageInfoToJson } from "./PageInfo.js";
|
|
|
11
11
|
/** The connection from incoming payment to all attempts. **/
|
|
12
12
|
interface IncomingPaymentToAttemptsConnection {
|
|
13
13
|
/**
|
|
14
|
-
* The total count of objects in this connection, using the current filters.
|
|
15
|
-
*
|
|
16
|
-
* field).
|
|
14
|
+
* The total count of objects in this connection, using the current filters. It is different
|
|
15
|
+
* from the number of objects returned in the current page (in the `entities` field).
|
|
17
16
|
**/
|
|
18
17
|
count: number;
|
|
19
18
|
|
package/src/objects/Invoice.ts
CHANGED
|
@@ -13,8 +13,8 @@ import PaymentRequestStatus from "./PaymentRequestStatus.js";
|
|
|
13
13
|
/** This object represents a BOLT #11 invoice (https://github.com/lightning/bolts/blob/master/11-payment-encoding.md) created by a Lightspark Node. You can retrieve this object to receive relevant payment information for a specific invoice generated by a Lightspark node. **/
|
|
14
14
|
interface Invoice {
|
|
15
15
|
/**
|
|
16
|
-
* The unique identifier of this entity across all Lightspark systems.
|
|
17
|
-
*
|
|
16
|
+
* The unique identifier of this entity across all Lightspark systems. Should be treated as an
|
|
17
|
+
* opaque string.
|
|
18
18
|
**/
|
|
19
19
|
id: string;
|
|
20
20
|
|
|
@@ -10,9 +10,8 @@ import type Node from "./Node.js";
|
|
|
10
10
|
import { NodeFromJson, NodeToJson } from "./Node.js";
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
|
-
* This object represents the data associated with a BOLT #11 invoice.
|
|
14
|
-
*
|
|
15
|
-
* *
|
|
13
|
+
* This object represents the data associated with a BOLT #11 invoice. You can retrieve this object
|
|
14
|
+
* to receive the relevant data associated with a specific invoice. *
|
|
16
15
|
*/
|
|
17
16
|
interface InvoiceData {
|
|
18
17
|
encodedPaymentRequest: string;
|
|
@@ -23,8 +22,8 @@ interface InvoiceData {
|
|
|
23
22
|
paymentHash: string;
|
|
24
23
|
|
|
25
24
|
/**
|
|
26
|
-
* The requested amount in this invoice. If it is equal to 0,
|
|
27
|
-
*
|
|
25
|
+
* The requested amount in this invoice. If it is equal to 0, the sender should choose the
|
|
26
|
+
* amount to send.
|
|
28
27
|
**/
|
|
29
28
|
amount: CurrencyAmount;
|
|
30
29
|
|