@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
|
@@ -4,14 +4,14 @@ import type NodeAddress from "./NodeAddress.js";
|
|
|
4
4
|
import { NodeAddressFromJson, NodeAddressToJson } from "./NodeAddress.js";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
* A connection between a node and the addresses it has announced for itself on
|
|
8
|
-
*
|
|
7
|
+
* A connection between a node and the addresses it has announced for itself on Lightning Network.
|
|
8
|
+
* *
|
|
9
9
|
*/
|
|
10
10
|
interface NodeToAddressesConnection {
|
|
11
11
|
/**
|
|
12
12
|
* The total count of objects in this connection, using the current filters.
|
|
13
|
-
* It is different from the number of objects returned in the current page
|
|
14
|
-
*
|
|
13
|
+
* It is different from the number of objects returned in the current page (in the `entities`
|
|
14
|
+
* field).
|
|
15
15
|
**/
|
|
16
16
|
count: number;
|
|
17
17
|
|
|
@@ -13,10 +13,9 @@ import TransactionStatus from "./TransactionStatus.js";
|
|
|
13
13
|
import type Withdrawal from "./Withdrawal.js";
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
|
-
* This object represents an L1 transaction that occurred on the Bitcoin
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* your Lightspark Node.
|
|
16
|
+
* This object represents an L1 transaction that occurred on the Bitcoin Network.
|
|
17
|
+
* You can retrieve this object to receive information about a specific on-chain transaction made
|
|
18
|
+
* on the Lightning Network associated with your Lightspark Node.
|
|
20
19
|
* *
|
|
21
20
|
*/
|
|
22
21
|
interface OnChainTransaction {
|
|
@@ -39,8 +38,8 @@ interface OnChainTransaction {
|
|
|
39
38
|
amount: CurrencyAmount;
|
|
40
39
|
|
|
41
40
|
/**
|
|
42
|
-
* The height of the block that included this transaction.
|
|
43
|
-
*
|
|
41
|
+
* The height of the block that included this transaction. This will be zero for unconfirmed
|
|
42
|
+
* transactions.
|
|
44
43
|
**/
|
|
45
44
|
blockHeight: number;
|
|
46
45
|
|
|
@@ -53,28 +52,22 @@ interface OnChainTransaction {
|
|
|
53
52
|
/** The date and time when this transaction was completed or failed. **/
|
|
54
53
|
resolvedAt?: string | undefined;
|
|
55
54
|
|
|
56
|
-
/**
|
|
57
|
-
* The hash of this transaction, so it can be uniquely identified on the
|
|
58
|
-
* Lightning Network. *
|
|
59
|
-
*/
|
|
55
|
+
/** The hash of this transaction, so it can be uniquely identified on the Lightning Network. **/
|
|
60
56
|
transactionHash?: string | undefined;
|
|
61
57
|
|
|
62
58
|
/**
|
|
63
|
-
* The fees that were paid by the wallet sending the transaction to commit it
|
|
64
|
-
*
|
|
59
|
+
* The fees that were paid by the wallet sending the transaction to commit it to the Bitcoin
|
|
60
|
+
* blockchain.
|
|
65
61
|
**/
|
|
66
62
|
fees?: CurrencyAmount | undefined;
|
|
67
63
|
|
|
68
64
|
/**
|
|
69
|
-
* The hash of the block that included this transaction.
|
|
70
|
-
*
|
|
65
|
+
* The hash of the block that included this transaction. This will be null for unconfirmed
|
|
66
|
+
* transactions.
|
|
71
67
|
**/
|
|
72
68
|
blockHash?: string | undefined;
|
|
73
69
|
|
|
74
|
-
/**
|
|
75
|
-
* The number of blockchain confirmations for this transaction in real time.
|
|
76
|
-
* *
|
|
77
|
-
*/
|
|
70
|
+
/** The number of blockchain confirmations for this transaction in real time. **/
|
|
78
71
|
numConfirmations?: number | undefined;
|
|
79
72
|
}
|
|
80
73
|
|
|
@@ -29,9 +29,9 @@ import type Transaction from "./Transaction.js";
|
|
|
29
29
|
import TransactionStatus from "./TransactionStatus.js";
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
|
-
* This object represents a Lightning Network payment sent from a Lightspark
|
|
33
|
-
*
|
|
34
|
-
*
|
|
32
|
+
* This object represents a Lightning Network payment sent from a Lightspark Node.
|
|
33
|
+
* You can retrieve this object to receive payment related information about any payment sent from
|
|
34
|
+
* your Lightspark Node on the Lightning Network.
|
|
35
35
|
* *
|
|
36
36
|
*/
|
|
37
37
|
class OutgoingPayment implements LightningTransaction, Transaction, Entity {
|
|
@@ -55,31 +55,19 @@ class OutgoingPayment implements LightningTransaction, Transaction, Entity {
|
|
|
55
55
|
public readonly typename: string,
|
|
56
56
|
/** The date and time when this transaction was completed or failed. **/
|
|
57
57
|
public readonly resolvedAt?: string | undefined,
|
|
58
|
-
/**
|
|
59
|
-
* The hash of this transaction, so it can be uniquely identified on the
|
|
60
|
-
* Lightning Network. *
|
|
61
|
-
*/
|
|
58
|
+
/** The hash of this transaction, so it can be uniquely identified on the Lightning Network. **/
|
|
62
59
|
public readonly transactionHash?: string | undefined,
|
|
63
60
|
/** If known, the final recipient node this payment was sent to. **/
|
|
64
61
|
public readonly destinationId?: string | undefined,
|
|
65
62
|
/** The fees paid by the sender node to send the payment. **/
|
|
66
63
|
public readonly fees?: CurrencyAmount | undefined,
|
|
67
|
-
/**
|
|
68
|
-
* The data of the payment request that was paid by this transaction, if
|
|
69
|
-
* known. *
|
|
70
|
-
*/
|
|
64
|
+
/** The data of the payment request that was paid by this transaction, if known. **/
|
|
71
65
|
public readonly paymentRequestData?: PaymentRequestData | undefined,
|
|
72
66
|
/** If applicable, the reason why the payment failed. **/
|
|
73
67
|
public readonly failureReason?: PaymentFailureReason | undefined,
|
|
74
|
-
/**
|
|
75
|
-
* If applicable, user-facing error message describing why the payment
|
|
76
|
-
* failed. *
|
|
77
|
-
*/
|
|
68
|
+
/** If applicable, user-facing error message describing why the payment failed. **/
|
|
78
69
|
public readonly failureMessage?: RichText | undefined,
|
|
79
|
-
/**
|
|
80
|
-
* The post transaction data which can be used in KYT payment registration.
|
|
81
|
-
* *
|
|
82
|
-
*/
|
|
70
|
+
/** The post transaction data which can be used in KYT payment registration. **/
|
|
83
71
|
public readonly umaPostTransactionData?: PostTransactionData[] | undefined,
|
|
84
72
|
/** The preimage of the payment. **/
|
|
85
73
|
public readonly paymentPreimage?: string | undefined,
|
|
@@ -20,10 +20,9 @@ import type OutgoingPaymentAttemptToHopsConnection from "./OutgoingPaymentAttemp
|
|
|
20
20
|
import { OutgoingPaymentAttemptToHopsConnectionFromJson } from "./OutgoingPaymentAttemptToHopsConnection.js";
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
|
-
* This object represents an attempted Lightning Network payment sent from a
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* Lightning Network,
|
|
23
|
+
* This object represents an attempted Lightning Network payment sent from a Lightspark Node.
|
|
24
|
+
* You can retrieve this object to receive payment related information about any payment attempt
|
|
25
|
+
* sent from your Lightspark Node on the Lightning Network,
|
|
27
26
|
* including any potential reasons the payment may have failed.
|
|
28
27
|
* *
|
|
29
28
|
*/
|
|
@@ -46,14 +45,11 @@ class OutgoingPaymentAttempt implements Entity {
|
|
|
46
45
|
public readonly outgoingPaymentId: string,
|
|
47
46
|
/** The typename of the object **/
|
|
48
47
|
public readonly typename: string,
|
|
49
|
-
/**
|
|
50
|
-
* If the payment attempt failed, then this contains the Bolt #4 failure
|
|
51
|
-
* code. *
|
|
52
|
-
*/
|
|
48
|
+
/** If the payment attempt failed, then this contains the Bolt #4 failure code. **/
|
|
53
49
|
public readonly failureCode?: HtlcAttemptFailureCode | undefined,
|
|
54
50
|
/**
|
|
55
|
-
* If the payment attempt failed, then this contains the index of the hop
|
|
56
|
-
*
|
|
51
|
+
* If the payment attempt failed, then this contains the index of the hop at which the problem
|
|
52
|
+
* occurred.
|
|
57
53
|
**/
|
|
58
54
|
public readonly failureSourceIndex?: number | undefined,
|
|
59
55
|
/** The time the outgoing payment attempt failed or succeeded. **/
|
|
@@ -61,21 +57,17 @@ class OutgoingPaymentAttempt implements Entity {
|
|
|
61
57
|
/**
|
|
62
58
|
* The total amount of funds required to complete a payment over this route.
|
|
63
59
|
* This value includes the cumulative fees for each hop. As a result,
|
|
64
|
-
* the attempt extended to the first-hop in the route will need to have at
|
|
65
|
-
*
|
|
66
|
-
* node due to an insufficient amount.
|
|
60
|
+
* the attempt extended to the first-hop in the route will need to have at least this much
|
|
61
|
+
* value, otherwise the route will fail at an intermediate node due to an insufficient amount.
|
|
67
62
|
**/
|
|
68
63
|
public readonly amount?: CurrencyAmount | undefined,
|
|
69
64
|
/**
|
|
70
65
|
* The sum of the fees paid at each hop within the route of this attempt.
|
|
71
|
-
* In the case of a one-hop payment,
|
|
72
|
-
*
|
|
66
|
+
* In the case of a one-hop payment, this value will be zero as we don't need to pay a fee to
|
|
67
|
+
* ourselves.
|
|
73
68
|
**/
|
|
74
69
|
public readonly fees?: CurrencyAmount | undefined,
|
|
75
|
-
/**
|
|
76
|
-
* The channel snapshot at the time the outgoing payment attempt was made.
|
|
77
|
-
* *
|
|
78
|
-
*/
|
|
70
|
+
/** The channel snapshot at the time the outgoing payment attempt was made. **/
|
|
79
71
|
public readonly channelSnapshot?: ChannelSnapshot | undefined,
|
|
80
72
|
) {
|
|
81
73
|
autoBind(this);
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
* This is an enum of all potential statuses of a payment attempt made from a
|
|
5
|
-
* Lightspark Node. *
|
|
6
|
-
*/
|
|
3
|
+
/** This is an enum of all potential statuses of a payment attempt made from a Lightspark Node. **/
|
|
7
4
|
export enum OutgoingPaymentAttemptStatus {
|
|
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
|
|
|
@@ -6,22 +6,18 @@ import type PageInfo from "./PageInfo.js";
|
|
|
6
6
|
import { PageInfoFromJson, PageInfoToJson } from "./PageInfo.js";
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
* The connection from an outgoing payment attempt to the list of sequential
|
|
10
|
-
*
|
|
11
|
-
* *
|
|
9
|
+
* The connection from an outgoing payment attempt to the list of sequential hops that define the
|
|
10
|
+
* path from sender node to recipient node. *
|
|
12
11
|
*/
|
|
13
12
|
interface OutgoingPaymentAttemptToHopsConnection {
|
|
14
13
|
/**
|
|
15
14
|
* The total count of objects in this connection, using the current filters.
|
|
16
|
-
* It is different from the number of objects returned in the current page
|
|
17
|
-
*
|
|
15
|
+
* It is different from the number of objects returned in the current page (in the `entities`
|
|
16
|
+
* field).
|
|
18
17
|
**/
|
|
19
18
|
count: number;
|
|
20
19
|
|
|
21
|
-
/**
|
|
22
|
-
* An object that holds pagination information about the objects in this
|
|
23
|
-
* connection. *
|
|
24
|
-
*/
|
|
20
|
+
/** An object that holds pagination information about the objects in this connection. **/
|
|
25
21
|
pageInfo: PageInfo;
|
|
26
22
|
|
|
27
23
|
/** The hops for the current page of this connection. **/
|
|
@@ -9,15 +9,12 @@ import { PageInfoFromJson, PageInfoToJson } from "./PageInfo.js";
|
|
|
9
9
|
interface OutgoingPaymentToAttemptsConnection {
|
|
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
|
|
|
17
|
-
/**
|
|
18
|
-
* An object that holds pagination information about the objects in this
|
|
19
|
-
* connection. *
|
|
20
|
-
*/
|
|
17
|
+
/** An object that holds pagination information about the objects in this connection. **/
|
|
21
18
|
pageInfo: PageInfo;
|
|
22
19
|
|
|
23
20
|
/** The attempts for the current page of this connection. **/
|
package/src/objects/PageInfo.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* This is an object representing information about a page returned by the
|
|
5
|
-
*
|
|
6
|
-
* please see the “Pagination” section of our API docs for more information
|
|
4
|
+
* This is an object representing information about a page returned by the Lightspark API.
|
|
5
|
+
* For more information, please see the “Pagination” section of our API docs for more information
|
|
7
6
|
* about its usage. *
|
|
8
7
|
*/
|
|
9
8
|
interface PageInfo {
|
|
@@ -11,14 +11,14 @@ interface PayInvoiceInput {
|
|
|
11
11
|
timeoutSecs: number;
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
* The maximum amount of fees that you want to pay for this payment to be
|
|
15
|
-
*
|
|
14
|
+
* The maximum amount of fees that you want to pay for this payment to be sent, expressed in
|
|
15
|
+
* msats. *
|
|
16
16
|
*/
|
|
17
17
|
maximumFeesMsats: number;
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
|
-
* The amount you will pay for this invoice, expressed in msats.
|
|
21
|
-
*
|
|
20
|
+
* The amount you will pay for this invoice, expressed in msats. It should ONLY be set when the
|
|
21
|
+
* invoice amount is zero.
|
|
22
22
|
**/
|
|
23
23
|
amountMsats?: number | undefined;
|
|
24
24
|
}
|
|
@@ -3,9 +3,8 @@
|
|
|
3
3
|
/** This is an enum indicating the direction of the payment. **/
|
|
4
4
|
export enum PaymentDirection {
|
|
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
|
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* This is an enum of the potential reasons why an OutgoingPayment sent from a
|
|
5
|
-
*
|
|
4
|
+
* This is an enum of the potential reasons why an OutgoingPayment sent from a Lightspark Node may
|
|
5
|
+
* have failed. *
|
|
6
6
|
*/
|
|
7
7
|
export enum PaymentFailureReason {
|
|
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
|
|
|
@@ -11,10 +11,9 @@ import type PaymentRequestData from "./PaymentRequestData.js";
|
|
|
11
11
|
import PaymentRequestStatus from "./PaymentRequestStatus.js";
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
* This object contains information related to a payment request generated or
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* *
|
|
14
|
+
* This object contains information related to a payment request generated or received by a
|
|
15
|
+
* LightsparkNode. You can retrieve this object to receive payment information about a specific
|
|
16
|
+
* invoice. *
|
|
18
17
|
*/
|
|
19
18
|
interface PaymentRequest {
|
|
20
19
|
/**
|
|
@@ -10,9 +10,9 @@ import type InvoiceData from "./InvoiceData.js";
|
|
|
10
10
|
import { NodeFromJson, NodeToJson } from "./Node.js";
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
|
-
* This object is an interface of a payment request on the Lightning Network
|
|
14
|
-
*
|
|
15
|
-
*
|
|
13
|
+
* This object is an interface of a payment request on the Lightning Network (i.e., a Lightning
|
|
14
|
+
* Invoice). It contains data related to parsing the payment details of a Lightning Invoice.
|
|
15
|
+
* *
|
|
16
16
|
*/
|
|
17
17
|
interface PaymentRequestData {
|
|
18
18
|
encodedPaymentRequest: string;
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* This is an enum of the potential states that a payment request on the
|
|
5
|
-
*
|
|
4
|
+
* This is an enum of the potential states that a payment request on the Lightning Network can
|
|
5
|
+
* take. *
|
|
6
6
|
*/
|
|
7
7
|
export enum PaymentRequestStatus {
|
|
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
|
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* This is an enum of the potential permissions that a Lightspark user can have
|
|
5
|
-
*
|
|
4
|
+
* This is an enum of the potential permissions that a Lightspark user can have in regards to
|
|
5
|
+
* account management. *
|
|
6
6
|
*/
|
|
7
7
|
export enum Permission {
|
|
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
|
|
|
@@ -6,14 +6,11 @@ import {
|
|
|
6
6
|
CurrencyAmountToJson,
|
|
7
7
|
} from "./CurrencyAmount.js";
|
|
8
8
|
|
|
9
|
-
/**
|
|
10
|
-
* This object represents post-transaction data that could be used to register
|
|
11
|
-
* payment for KYT. *
|
|
12
|
-
*/
|
|
9
|
+
/** This object represents post-transaction data that could be used to register payment for KYT. **/
|
|
13
10
|
interface PostTransactionData {
|
|
14
11
|
/**
|
|
15
|
-
* The utxo of the channel over which the payment went through in the format
|
|
16
|
-
*
|
|
12
|
+
* The utxo of the channel over which the payment went through in the format of
|
|
13
|
+
* <transaction_hash>:<output_index>.
|
|
17
14
|
**/
|
|
18
15
|
utxo: string;
|
|
19
16
|
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
* The alpha-2 representation of a country, as defined by the ISO 3166-1
|
|
5
|
-
* standard. *
|
|
6
|
-
*/
|
|
3
|
+
/** The alpha-2 representation of a country, as defined by the ISO 3166-1 standard. **/
|
|
7
4
|
export enum RegionCode {
|
|
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 code representing the country of Afghanistan. **/
|
|
@@ -63,15 +59,9 @@ export enum RegionCode {
|
|
|
63
59
|
BM = "BM",
|
|
64
60
|
/** The code representing the country of Bhutan. **/
|
|
65
61
|
BT = "BT",
|
|
66
|
-
/**
|
|
67
|
-
* The code representing the country of The Plurinational State of Bolivia.
|
|
68
|
-
* *
|
|
69
|
-
*/
|
|
62
|
+
/** The code representing the country of The Plurinational State of Bolivia. **/
|
|
70
63
|
BO = "BO",
|
|
71
|
-
/**
|
|
72
|
-
* The code representing the country of Bonaire, Sint Eustatius, and Saba.
|
|
73
|
-
* *
|
|
74
|
-
*/
|
|
64
|
+
/** The code representing the country of Bonaire, Sint Eustatius, and Saba. **/
|
|
75
65
|
BQ = "BQ",
|
|
76
66
|
/** The code representing the country of Bosnia and Herzegovina. **/
|
|
77
67
|
BA = "BA",
|
|
@@ -119,10 +109,7 @@ export enum RegionCode {
|
|
|
119
109
|
KM = "KM",
|
|
120
110
|
/** The code representing the country of Congo. **/
|
|
121
111
|
CG = "CG",
|
|
122
|
-
/**
|
|
123
|
-
* The code representing the country of The Democratic Republic of the Congo.
|
|
124
|
-
* *
|
|
125
|
-
*/
|
|
112
|
+
/** The code representing the country of The Democratic Republic of the Congo. **/
|
|
126
113
|
CD = "CD",
|
|
127
114
|
/** The code representing the country of Cook Islands. **/
|
|
128
115
|
CK = "CK",
|
|
@@ -212,10 +199,7 @@ export enum RegionCode {
|
|
|
212
199
|
GY = "GY",
|
|
213
200
|
/** The code representing the country of Haiti. **/
|
|
214
201
|
HT = "HT",
|
|
215
|
-
/**
|
|
216
|
-
* The code representing the country of Heard Island and McDonald Islands.
|
|
217
|
-
* *
|
|
218
|
-
*/
|
|
202
|
+
/** The code representing the country of Heard Island and McDonald Islands. **/
|
|
219
203
|
HM = "HM",
|
|
220
204
|
/** The code representing the country of Holy See (Vatican City State). **/
|
|
221
205
|
VA = "VA",
|
|
@@ -257,10 +241,7 @@ export enum RegionCode {
|
|
|
257
241
|
KE = "KE",
|
|
258
242
|
/** The code representing the country of Kiribati. **/
|
|
259
243
|
KI = "KI",
|
|
260
|
-
/**
|
|
261
|
-
* The code representing the country of Democratic People's Republic ofKorea.
|
|
262
|
-
* *
|
|
263
|
-
*/
|
|
244
|
+
/** The code representing the country of Democratic People's Republic ofKorea. **/
|
|
264
245
|
KP = "KP",
|
|
265
246
|
/** The code representing the country of Republic of Korea. **/
|
|
266
247
|
KR = "KR",
|
|
@@ -288,10 +269,7 @@ export enum RegionCode {
|
|
|
288
269
|
LU = "LU",
|
|
289
270
|
/** The code representing the country of Macao. **/
|
|
290
271
|
MO = "MO",
|
|
291
|
-
/**
|
|
292
|
-
* The code representing the country of The Former Yugoslav Republic of
|
|
293
|
-
* Macedonia. *
|
|
294
|
-
*/
|
|
272
|
+
/** The code representing the country of The Former Yugoslav Republic of Macedonia. **/
|
|
295
273
|
MK = "MK",
|
|
296
274
|
/** The code representing the country of Madagascar. **/
|
|
297
275
|
MG = "MG",
|
|
@@ -399,10 +377,7 @@ export enum RegionCode {
|
|
|
399
377
|
RW = "RW",
|
|
400
378
|
/** The code representing the country of Saint Barthélemy. **/
|
|
401
379
|
BL = "BL",
|
|
402
|
-
/**
|
|
403
|
-
* The code representing the country of Saint Helena Ascension and Tristan
|
|
404
|
-
* da Cunha. *
|
|
405
|
-
*/
|
|
380
|
+
/** The code representing the country of Saint Helena Ascension and Tristan da Cunha. **/
|
|
406
381
|
SH = "SH",
|
|
407
382
|
/** The code representing the country of Saint Kitts and Nevis. **/
|
|
408
383
|
KN = "KN",
|
|
@@ -444,10 +419,7 @@ export enum RegionCode {
|
|
|
444
419
|
SO = "SO",
|
|
445
420
|
/** The code representing the country of South Africa. **/
|
|
446
421
|
ZA = "ZA",
|
|
447
|
-
/**
|
|
448
|
-
* The code representing the country of South Georgia and the South Sandwich
|
|
449
|
-
* Islands. *
|
|
450
|
-
*/
|
|
422
|
+
/** The code representing the country of South Georgia and the South Sandwich Islands. **/
|
|
451
423
|
GS = "GS",
|
|
452
424
|
/** The code representing the country of South Sudan. **/
|
|
453
425
|
SS = "SS",
|
|
@@ -507,10 +479,7 @@ export enum RegionCode {
|
|
|
507
479
|
GB = "GB",
|
|
508
480
|
/** The code representing the country of United States. **/
|
|
509
481
|
US = "US",
|
|
510
|
-
/**
|
|
511
|
-
* The code representing the country of United States Minor Outlying Islands.
|
|
512
|
-
* *
|
|
513
|
-
*/
|
|
482
|
+
/** The code representing the country of United States Minor Outlying Islands. **/
|
|
514
483
|
UM = "UM",
|
|
515
484
|
/** The code representing the country of Uruguay. **/
|
|
516
485
|
UY = "UY",
|
|
@@ -6,8 +6,8 @@ import PaymentDirection from "./PaymentDirection.js";
|
|
|
6
6
|
interface RegisterPaymentInput {
|
|
7
7
|
/**
|
|
8
8
|
* The compliance provider that is going to screen the node.
|
|
9
|
-
* You need to be a customer of the selected provider and store the API key
|
|
10
|
-
*
|
|
9
|
+
* You need to be a customer of the selected provider and store the API key on the Lightspark
|
|
10
|
+
* account setting page.
|
|
11
11
|
**/
|
|
12
12
|
provider: ComplianceProvider;
|
|
13
13
|
|
|
@@ -19,16 +19,12 @@ interface RegisterPaymentInput {
|
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* The public key of the counterparty lightning node,
|
|
22
|
-
* which would be the public key of the recipient node if it is to register
|
|
23
|
-
*
|
|
24
|
-
* register an incoming payment.
|
|
22
|
+
* which would be the public key of the recipient node if it is to register an outgoing
|
|
23
|
+
* payment, or the public key of the sender node if it is to register an incoming payment.
|
|
25
24
|
**/
|
|
26
25
|
nodePubkey: string;
|
|
27
26
|
|
|
28
|
-
/**
|
|
29
|
-
* Indicates whether this payment is an OutgoingPayment or an
|
|
30
|
-
* IncomingPayment. *
|
|
31
|
-
*/
|
|
27
|
+
/** Indicates whether this payment is an OutgoingPayment or an IncomingPayment. **/
|
|
32
28
|
direction: PaymentDirection;
|
|
33
29
|
}
|
|
34
30
|
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
* This is an enum of the potential sub-event types for Remote Signing webook
|
|
5
|
-
* events. *
|
|
6
|
-
*/
|
|
3
|
+
/** This is an enum of the potential sub-event types for Remote Signing webook events. **/
|
|
7
4
|
export enum RemoteSigningSubEventType {
|
|
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
|
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* This is an enum of the potential risk ratings related to a transaction made
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* This is an enum of the potential risk ratings related to a transaction made over the Lightning
|
|
5
|
+
* Network. These risk ratings are returned from the CryptoSanctionScreeningProvider.
|
|
6
|
+
* *
|
|
7
7
|
*/
|
|
8
8
|
export enum RiskRating {
|
|
9
9
|
/**
|
|
10
|
-
* This is an enum value that represents values that could be added in the
|
|
11
|
-
*
|
|
12
|
-
* added without notice.
|
|
10
|
+
* This is an enum value that represents values that could be added in the future.
|
|
11
|
+
* Clients should support unknown values as more of them could be added without notice.
|
|
13
12
|
*/
|
|
14
13
|
FUTURE_VALUE = "FUTURE_VALUE",
|
|
15
14
|
|
|
@@ -12,11 +12,10 @@ import RoutingTransactionFailureReason from "./RoutingTransactionFailureReason.j
|
|
|
12
12
|
import TransactionStatus from "./TransactionStatus.js";
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
|
-
* This object represents a transaction that was forwarded through a Lightspark
|
|
16
|
-
*
|
|
17
|
-
* You can retrieve this object to receive information about any transaction
|
|
18
|
-
*
|
|
19
|
-
* *
|
|
15
|
+
* This object represents a transaction that was forwarded through a Lightspark node on the
|
|
16
|
+
* Lightning Network, i.e., a routed transaction.
|
|
17
|
+
* You can retrieve this object to receive information about any transaction routed through your
|
|
18
|
+
* Lightspark Node. *
|
|
20
19
|
*/
|
|
21
20
|
interface RoutingTransaction {
|
|
22
21
|
/**
|
|
@@ -43,10 +42,7 @@ interface RoutingTransaction {
|
|
|
43
42
|
/** The date and time when this transaction was completed or failed. **/
|
|
44
43
|
resolvedAt?: string | undefined;
|
|
45
44
|
|
|
46
|
-
/**
|
|
47
|
-
* The hash of this transaction, so it can be uniquely identified on the
|
|
48
|
-
* Lightning Network. *
|
|
49
|
-
*/
|
|
45
|
+
/** The hash of this transaction, so it can be uniquely identified on the Lightning Network. **/
|
|
50
46
|
transactionHash?: string | undefined;
|
|
51
47
|
|
|
52
48
|
/** If known, the channel this transaction was received from. **/
|
|
@@ -57,15 +53,12 @@ interface RoutingTransaction {
|
|
|
57
53
|
|
|
58
54
|
/**
|
|
59
55
|
* The fees collected by the node when routing this transaction.
|
|
60
|
-
* We subtract the outgoing amount to the incoming amount to determine how
|
|
61
|
-
*
|
|
56
|
+
* We subtract the outgoing amount to the incoming amount to determine how much fees were
|
|
57
|
+
* collected.
|
|
62
58
|
**/
|
|
63
59
|
fees?: CurrencyAmount | undefined;
|
|
64
60
|
|
|
65
|
-
/**
|
|
66
|
-
* If applicable, user-facing error message describing why the routing
|
|
67
|
-
* failed. *
|
|
68
|
-
*/
|
|
61
|
+
/** If applicable, user-facing error message describing why the routing failed. **/
|
|
69
62
|
failureMessage?: RichText | undefined;
|
|
70
63
|
|
|
71
64
|
/** If applicable, the reason why the routing failed. **/
|