@lightsparkdev/lightspark-sdk 1.2.2 → 1.2.3
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 +8 -0
- package/dist/{BitcoinNetwork-a816c0be.d.ts → BitcoinNetwork-37e9f091.d.ts} +8 -3
- package/dist/env.d.cts +1 -1
- package/dist/env.d.ts +1 -1
- package/dist/{index-eb604025.d.ts → index-449c9f58.d.ts} +1461 -675
- package/dist/index.cjs +341 -307
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +323 -289
- 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 +4 -4
- package/src/NodeKeyLoaderCache.ts +4 -3
- package/src/SigningKeyLoader.ts +12 -7
- package/src/client.ts +99 -65
- package/src/env.ts +3 -1
- package/src/objects/Account.ts +7 -3
- package/src/objects/AccountToApiTokensConnection.ts +7 -3
- package/src/objects/AccountToChannelsConnection.ts +3 -2
- package/src/objects/AccountToNodesConnection.ts +7 -3
- package/src/objects/AccountToPaymentRequestsConnection.ts +7 -3
- package/src/objects/AccountToTransactionsConnection.ts +13 -9
- package/src/objects/AccountToWalletsConnection.ts +7 -3
- package/src/objects/ApiToken.ts +13 -7
- package/src/objects/Balances.ts +22 -12
- package/src/objects/BitcoinNetwork.ts +8 -3
- package/src/objects/BlockchainBalance.ts +4 -1
- package/src/objects/Channel.ts +37 -14
- package/src/objects/ChannelClosingTransaction.ts +22 -11
- package/src/objects/ChannelFees.ts +4 -1
- package/src/objects/ChannelOpeningTransaction.ts +22 -11
- package/src/objects/ChannelStatus.ts +33 -8
- package/src/objects/ChannelToTransactionsConnection.ts +9 -8
- package/src/objects/ComplianceProvider.ts +3 -2
- package/src/objects/Connection.ts +7 -3
- package/src/objects/CreateApiTokenInput.ts +4 -1
- package/src/objects/CreateApiTokenOutput.ts +3 -3
- package/src/objects/CreateLnurlInvoiceInput.ts +3 -2
- package/src/objects/CreateTestModePaymentInput.ts +2 -2
- package/src/objects/CreateTestModePaymentoutput.ts +5 -1
- package/src/objects/CurrencyAmount.ts +6 -4
- package/src/objects/CurrencyUnit.ts +36 -9
- package/src/objects/Deposit.ts +22 -11
- package/src/objects/Entity.ts +8 -3
- package/src/objects/FeeEstimate.ts +5 -1
- package/src/objects/GraphNode.ts +30 -14
- package/src/objects/Hop.ts +12 -4
- package/src/objects/HtlcAttemptFailureCode.ts +7 -3
- package/src/objects/IncentivesIneligibilityReason.ts +33 -9
- package/src/objects/IncentivesStatus.ts +14 -4
- package/src/objects/IncomingPayment.ts +18 -7
- package/src/objects/IncomingPaymentAttempt.ts +8 -3
- package/src/objects/IncomingPaymentAttemptStatus.ts +7 -3
- package/src/objects/IncomingPaymentToAttemptsConnection.ts +7 -3
- package/src/objects/Invoice.ts +2 -2
- package/src/objects/InvoiceData.ts +7 -3
- package/src/objects/InvoiceType.ts +3 -2
- package/src/objects/LightningFeeEstimateForInvoiceInput.ts +2 -2
- package/src/objects/LightningTransaction.ts +12 -4
- package/src/objects/LightsparkNode.ts +33 -18
- package/src/objects/LightsparkNodeOwner.ts +2 -2
- package/src/objects/LightsparkNodeStatus.ts +3 -2
- package/src/objects/LightsparkNodeToChannelsConnection.ts +7 -3
- package/src/objects/LightsparkNodeWithOSK.ts +35 -19
- package/src/objects/LightsparkNodeWithRemoteSigning.ts +31 -18
- package/src/objects/Node.ts +28 -14
- package/src/objects/NodeAddressType.ts +7 -3
- package/src/objects/NodeToAddressesConnection.ts +7 -3
- package/src/objects/OnChainTransaction.ts +23 -11
- package/src/objects/OutgoingPayment.ts +24 -7
- package/src/objects/OutgoingPaymentAttempt.ts +28 -13
- package/src/objects/OutgoingPaymentAttemptStatus.ts +7 -3
- package/src/objects/OutgoingPaymentAttemptToHopsConnection.ts +12 -4
- package/src/objects/OutgoingPaymentToAttemptsConnection.ts +7 -3
- package/src/objects/PageInfo.ts +6 -1
- package/src/objects/PayInvoiceInput.ts +6 -3
- package/src/objects/PaymentDirection.ts +3 -2
- package/src/objects/PaymentFailureReason.ts +7 -3
- package/src/objects/PaymentRequest.ts +8 -3
- package/src/objects/PaymentRequestData.ts +5 -1
- package/src/objects/PaymentRequestStatus.ts +7 -3
- package/src/objects/Permission.ts +7 -3
- package/src/objects/PostTransactionData.ts +6 -3
- package/src/objects/RegionCode.ts +43 -12
- package/src/objects/RegisterPaymentInput.ts +12 -7
- package/src/objects/RemoteSigningSubEventType.ts +7 -3
- package/src/objects/RequestWithdrawalInput.ts +2 -2
- package/src/objects/RiskRating.ts +8 -3
- package/src/objects/RoutingTransaction.ts +20 -7
- package/src/objects/RoutingTransactionFailureReason.ts +8 -3
- package/src/objects/ScreenNodeInput.ts +3 -2
- package/src/objects/SendPaymentInput.ts +4 -1
- package/src/objects/SetInvoicePaymentHashInput.ts +3 -2
- package/src/objects/Signable.ts +2 -2
- package/src/objects/SignablePayload.ts +6 -3
- package/src/objects/SignablePayloadStatus.ts +3 -2
- package/src/objects/Transaction.ts +14 -4
- package/src/objects/TransactionFailures.ts +4 -1
- package/src/objects/TransactionStatus.ts +16 -5
- package/src/objects/TransactionType.ts +30 -8
- package/src/objects/TransactionUpdate.ts +6 -3
- package/src/objects/UmaInvitation.ts +10 -4
- package/src/objects/Wallet.ts +13 -4
- package/src/objects/WalletStatus.ts +36 -9
- package/src/objects/WalletToPaymentRequestsConnection.ts +7 -3
- package/src/objects/WalletToTransactionsConnection.ts +7 -3
- package/src/objects/WebhookEventType.ts +7 -3
- package/src/objects/Withdrawal.ts +22 -11
- package/src/objects/WithdrawalMode.ts +7 -3
- package/src/objects/WithdrawalRequest.ts +15 -6
- package/src/objects/WithdrawalRequestStatus.ts +3 -2
- package/src/objects/WithdrawalRequestToChannelClosingTransactionsConnection.ts +11 -4
- package/src/objects/WithdrawalRequestToChannelOpeningTransactionsConnection.ts +11 -4
- package/src/objects/index.ts +6 -6
- package/src/tests/integration/general-regtest.test.ts +1 -1
- /package/dist/{chunk-GLL4KTUT.js → chunk-NCPWHRFO.js} +0 -0
|
@@ -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
|
-
* invoice amount is zero.
|
|
11
|
+
* The amount you will be paid for this invoice, expressed in msats.
|
|
12
|
+
* It should ONLY be set when the invoice amount is zero.
|
|
13
13
|
**/
|
|
14
14
|
amountMsats?: number | undefined;
|
|
15
15
|
}
|
|
@@ -1,6 +1,10 @@
|
|
|
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
|
+
* This object can be used to retrieve the associated payment made from a Test
|
|
6
|
+
* Mode Payment call. *
|
|
7
|
+
*/
|
|
4
8
|
interface CreateTestModePaymentoutput {
|
|
5
9
|
/**
|
|
6
10
|
* The payment that has been sent.
|
|
@@ -14,14 +14,16 @@ interface CurrencyAmount {
|
|
|
14
14
|
preferredCurrencyUnit: CurrencyUnit;
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
|
-
* The rounded numeric value for this CurrencyAmount in the very base level
|
|
18
|
-
* currency. For example, for USD, the value will be in
|
|
17
|
+
* The rounded numeric value for this CurrencyAmount in the very base level
|
|
18
|
+
* of user's preferred currency. For example, for USD, the value will be in
|
|
19
|
+
* cents.
|
|
19
20
|
**/
|
|
20
21
|
preferredCurrencyValueRounded: number;
|
|
21
22
|
|
|
22
23
|
/**
|
|
23
|
-
* The approximate float value for this CurrencyAmount in the very base level
|
|
24
|
-
* currency. For example, for USD, the value will be in
|
|
24
|
+
* The approximate float value for this CurrencyAmount in the very base level
|
|
25
|
+
* of user's preferred currency. For example, for USD, the value will be in
|
|
26
|
+
* cents.
|
|
25
27
|
**/
|
|
26
28
|
preferredCurrencyValueApprox: number;
|
|
27
29
|
}
|
|
@@ -1,25 +1,52 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* This enum identifies the unit of currency associated with a CurrencyAmount.
|
|
5
|
+
* *
|
|
6
|
+
*/
|
|
4
7
|
export enum CurrencyUnit {
|
|
5
8
|
/**
|
|
6
|
-
* This is an enum value that represents values that could be added in the
|
|
7
|
-
* Clients should support unknown values as more of them could be
|
|
9
|
+
* This is an enum value that represents values that could be added in the
|
|
10
|
+
* future. Clients should support unknown values as more of them could be
|
|
11
|
+
* added without notice.
|
|
8
12
|
*/
|
|
9
13
|
FUTURE_VALUE = "FUTURE_VALUE",
|
|
10
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* Bitcoin is the cryptocurrency native to the Bitcoin network.
|
|
16
|
+
* It is used as the native medium for value transfer for the Lightning
|
|
17
|
+
* Network. *
|
|
18
|
+
*/
|
|
11
19
|
BITCOIN = "BITCOIN",
|
|
12
|
-
/**
|
|
20
|
+
/**
|
|
21
|
+
* 0.00000001 (10e-8) Bitcoin or one hundred millionth of a Bitcoin.
|
|
22
|
+
* This is the unit most commonly used in Lightning transactions.
|
|
23
|
+
* *
|
|
24
|
+
*/
|
|
13
25
|
SATOSHI = "SATOSHI",
|
|
14
|
-
/**
|
|
26
|
+
/**
|
|
27
|
+
* 0.001 Satoshi, or 10e-11 Bitcoin. We recommend using the Satoshi unit
|
|
28
|
+
* instead when possible. *
|
|
29
|
+
*/
|
|
15
30
|
MILLISATOSHI = "MILLISATOSHI",
|
|
16
31
|
/** United States Dollar. **/
|
|
17
32
|
USD = "USD",
|
|
18
|
-
/**
|
|
33
|
+
/**
|
|
34
|
+
* 0.000000001 (10e-9) Bitcoin or a billionth of a Bitcoin.
|
|
35
|
+
* We recommend using the Satoshi unit instead when possible.
|
|
36
|
+
* *
|
|
37
|
+
*/
|
|
19
38
|
NANOBITCOIN = "NANOBITCOIN",
|
|
20
|
-
/**
|
|
39
|
+
/**
|
|
40
|
+
* 0.000001 (10e-6) Bitcoin or a millionth of a Bitcoin.
|
|
41
|
+
* We recommend using the Satoshi unit instead when possible.
|
|
42
|
+
* *
|
|
43
|
+
*/
|
|
21
44
|
MICROBITCOIN = "MICROBITCOIN",
|
|
22
|
-
/**
|
|
45
|
+
/**
|
|
46
|
+
* 0.001 (10e-3) Bitcoin or a thousandth of a Bitcoin.
|
|
47
|
+
* We recommend using the Satoshi unit instead when possible.
|
|
48
|
+
* *
|
|
49
|
+
*/
|
|
23
50
|
MILLIBITCOIN = "MILLIBITCOIN",
|
|
24
51
|
}
|
|
25
52
|
|
package/src/objects/Deposit.ts
CHANGED
|
@@ -8,11 +8,16 @@ import {
|
|
|
8
8
|
} from "./CurrencyAmount.js";
|
|
9
9
|
import TransactionStatus from "./TransactionStatus.js";
|
|
10
10
|
|
|
11
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* This object represents a Deposit made to a Lightspark node wallet.
|
|
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
|
+
* deposit. *
|
|
16
|
+
*/
|
|
12
17
|
interface Deposit {
|
|
13
18
|
/**
|
|
14
|
-
* The unique identifier of this entity across all Lightspark systems.
|
|
15
|
-
* string.
|
|
19
|
+
* The unique identifier of this entity across all Lightspark systems.
|
|
20
|
+
* Should be treated as an opaque string.
|
|
16
21
|
**/
|
|
17
22
|
id: string;
|
|
18
23
|
|
|
@@ -29,8 +34,8 @@ interface Deposit {
|
|
|
29
34
|
amount: CurrencyAmount;
|
|
30
35
|
|
|
31
36
|
/**
|
|
32
|
-
* The height of the block that included this transaction.
|
|
33
|
-
* transactions.
|
|
37
|
+
* The height of the block that included this transaction.
|
|
38
|
+
* This will be zero for unconfirmed transactions.
|
|
34
39
|
**/
|
|
35
40
|
blockHeight: number;
|
|
36
41
|
|
|
@@ -46,22 +51,28 @@ interface Deposit {
|
|
|
46
51
|
/** The date and time when this transaction was completed or failed. **/
|
|
47
52
|
resolvedAt?: string | undefined;
|
|
48
53
|
|
|
49
|
-
/**
|
|
54
|
+
/**
|
|
55
|
+
* The hash of this transaction, so it can be uniquely identified on the
|
|
56
|
+
* Lightning Network. *
|
|
57
|
+
*/
|
|
50
58
|
transactionHash?: string | undefined;
|
|
51
59
|
|
|
52
60
|
/**
|
|
53
|
-
* The fees that were paid by the wallet sending the transaction to commit it
|
|
54
|
-
* blockchain.
|
|
61
|
+
* The fees that were paid by the wallet sending the transaction to commit it
|
|
62
|
+
* to the Bitcoin blockchain.
|
|
55
63
|
**/
|
|
56
64
|
fees?: CurrencyAmount | undefined;
|
|
57
65
|
|
|
58
66
|
/**
|
|
59
|
-
* The hash of the block that included this transaction.
|
|
60
|
-
* transactions.
|
|
67
|
+
* The hash of the block that included this transaction.
|
|
68
|
+
* This will be null for unconfirmed transactions.
|
|
61
69
|
**/
|
|
62
70
|
blockHash?: string | undefined;
|
|
63
71
|
|
|
64
|
-
/**
|
|
72
|
+
/**
|
|
73
|
+
* The number of blockchain confirmations for this transaction in real time.
|
|
74
|
+
* *
|
|
75
|
+
*/
|
|
65
76
|
numConfirmations?: number | undefined;
|
|
66
77
|
}
|
|
67
78
|
|
package/src/objects/Entity.ts
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
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
|
+
* It defines a few core fields that are available everywhere.
|
|
6
|
+
* Any object that implements this interface can be queried using the `entity`
|
|
7
|
+
* query and its ID. *
|
|
8
|
+
*/
|
|
4
9
|
interface Entity {
|
|
5
10
|
/**
|
|
6
|
-
* The unique identifier of this entity across all Lightspark systems.
|
|
7
|
-
* string.
|
|
11
|
+
* The unique identifier of this entity across all Lightspark systems.
|
|
12
|
+
* Should be treated as an opaque string.
|
|
8
13
|
**/
|
|
9
14
|
id: string;
|
|
10
15
|
|
|
@@ -6,7 +6,11 @@ import {
|
|
|
6
6
|
CurrencyAmountToJson,
|
|
7
7
|
} from "./CurrencyAmount.js";
|
|
8
8
|
|
|
9
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* This object represents the estimated L1 transaction fees for the Bitcoin
|
|
11
|
+
* network. Fee estimates are separated by potential confirmation speeds for
|
|
12
|
+
* settlement. *
|
|
13
|
+
*/
|
|
10
14
|
interface FeeEstimate {
|
|
11
15
|
feeFast: CurrencyAmount;
|
|
12
16
|
|
package/src/objects/GraphNode.ts
CHANGED
|
@@ -10,12 +10,18 @@ import type NodeAddressType from "./NodeAddressType.js";
|
|
|
10
10
|
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
|
+
* including nodes not managed by Lightspark.
|
|
16
|
+
* You can retrieve this object to get publicly available information about any
|
|
17
|
+
* node on the Lightning Network.
|
|
18
|
+
* *
|
|
19
|
+
*/
|
|
14
20
|
class GraphNode implements Node, Entity {
|
|
15
21
|
constructor(
|
|
16
22
|
/**
|
|
17
|
-
* The unique identifier of this entity across all Lightspark systems.
|
|
18
|
-
* string.
|
|
23
|
+
* The unique identifier of this entity across all Lightspark systems.
|
|
24
|
+
* Should be treated as an opaque string.
|
|
19
25
|
**/
|
|
20
26
|
public readonly id: string,
|
|
21
27
|
/** The date and time when the entity was first created. **/
|
|
@@ -25,31 +31,41 @@ class GraphNode implements Node, Entity {
|
|
|
25
31
|
/** The Bitcoin Network this node is deployed in. **/
|
|
26
32
|
public readonly bitcoinNetwork: BitcoinNetwork,
|
|
27
33
|
/**
|
|
28
|
-
* The name of this node in the network.
|
|
29
|
-
*
|
|
34
|
+
* The name of this node in the network.
|
|
35
|
+
* It will be the most human-readable option possible,
|
|
36
|
+
* depending on the data available for this node.
|
|
30
37
|
**/
|
|
31
38
|
public readonly displayName: string,
|
|
32
39
|
/** The typename of the object **/
|
|
33
40
|
public readonly typename: string,
|
|
34
41
|
/**
|
|
35
|
-
* A name that identifies the node.
|
|
36
|
-
*
|
|
37
|
-
*
|
|
42
|
+
* A name that identifies the node.
|
|
43
|
+
* It has no importance in terms of operating the node,
|
|
44
|
+
* it is just a way to identify and search for commercial services or
|
|
45
|
+
* popular nodes. This alias can be changed at any time by the node
|
|
46
|
+
* operator.
|
|
38
47
|
**/
|
|
39
48
|
public readonly alias?: string | undefined,
|
|
40
49
|
/**
|
|
41
|
-
* A hexadecimal string that describes a color. For example "#000000" is
|
|
42
|
-
* has no importance in terms of operating
|
|
50
|
+
* A hexadecimal string that describes a color. For example "#000000" is
|
|
51
|
+
* black, "#FFFFFF" is white. It has no importance in terms of operating
|
|
52
|
+
* the node,
|
|
53
|
+
* it is just a way to visually differentiate nodes.
|
|
43
54
|
* That color can be changed at any time by the node operator.
|
|
44
55
|
**/
|
|
45
56
|
public readonly color?: string | undefined,
|
|
46
57
|
/**
|
|
47
|
-
* A summary metric used to capture how well positioned a node is to send,
|
|
48
|
-
*
|
|
49
|
-
*
|
|
58
|
+
* A summary metric used to capture how well positioned a node is to send,
|
|
59
|
+
* receive, or route transactions efficiently.
|
|
60
|
+
* Maximizing a node's conductivity helps a node’s transactions to be
|
|
61
|
+
* capital efficient. The value is an integer ranging between 0 and 10
|
|
62
|
+
* (bounds included).
|
|
50
63
|
**/
|
|
51
64
|
public readonly conductivity?: number | undefined,
|
|
52
|
-
/**
|
|
65
|
+
/**
|
|
66
|
+
* The public key of this node. It acts as a unique identifier of this node
|
|
67
|
+
* in the Lightning Network. *
|
|
68
|
+
*/
|
|
53
69
|
public readonly publicKey?: string | undefined,
|
|
54
70
|
) {
|
|
55
71
|
autoBind(this);
|
package/src/objects/Hop.ts
CHANGED
|
@@ -7,11 +7,16 @@ import {
|
|
|
7
7
|
CurrencyAmountToJson,
|
|
8
8
|
} from "./CurrencyAmount.js";
|
|
9
9
|
|
|
10
|
-
/**
|
|
10
|
+
/**
|
|
11
|
+
* This object represents a specific node that existed on a particular payment
|
|
12
|
+
* route. You can retrieve this object to get information about a node on a
|
|
13
|
+
* particular payment path and all payment-relevant information for that node.
|
|
14
|
+
* *
|
|
15
|
+
*/
|
|
11
16
|
interface Hop {
|
|
12
17
|
/**
|
|
13
|
-
* The unique identifier of this entity across all Lightspark systems.
|
|
14
|
-
* string.
|
|
18
|
+
* The unique identifier of this entity across all Lightspark systems.
|
|
19
|
+
* Should be treated as an opaque string.
|
|
15
20
|
**/
|
|
16
21
|
id: string;
|
|
17
22
|
|
|
@@ -36,7 +41,10 @@ interface Hop {
|
|
|
36
41
|
/** The amount that is to be forwarded to the destination node. **/
|
|
37
42
|
amountToForward?: CurrencyAmount | undefined;
|
|
38
43
|
|
|
39
|
-
/**
|
|
44
|
+
/**
|
|
45
|
+
* The fees to be collected by the source node for forwarding the payment
|
|
46
|
+
* over the hop. *
|
|
47
|
+
*/
|
|
40
48
|
fee?: CurrencyAmount | undefined;
|
|
41
49
|
|
|
42
50
|
/** The block height at which an unsettled HTLC is considered expired. **/
|
|
@@ -1,10 +1,14 @@
|
|
|
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
|
+
* Lightning Network may have failed. *
|
|
6
|
+
*/
|
|
4
7
|
export enum HtlcAttemptFailureCode {
|
|
5
8
|
/**
|
|
6
|
-
* This is an enum value that represents values that could be added in the
|
|
7
|
-
* Clients should support unknown values as more of them could be
|
|
9
|
+
* This is an enum value that represents values that could be added in the
|
|
10
|
+
* future. Clients should support unknown values as more of them could be
|
|
11
|
+
* added without notice.
|
|
8
12
|
*/
|
|
9
13
|
FUTURE_VALUE = "FUTURE_VALUE",
|
|
10
14
|
|
|
@@ -1,23 +1,47 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* Describes the reason for an invitation to not be eligible for incentives.
|
|
5
|
+
* *
|
|
6
|
+
*/
|
|
4
7
|
export enum IncentivesIneligibilityReason {
|
|
5
8
|
/**
|
|
6
|
-
* This is an enum value that represents values that could be added in the
|
|
7
|
-
* Clients should support unknown values as more of them could be
|
|
9
|
+
* This is an enum value that represents values that could be added in the
|
|
10
|
+
* future. Clients should support unknown values as more of them could be
|
|
11
|
+
* added without notice.
|
|
8
12
|
*/
|
|
9
13
|
FUTURE_VALUE = "FUTURE_VALUE",
|
|
10
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* This invitation is not eligible for incentives because it has been created
|
|
16
|
+
* outside of the incentives flow. *
|
|
17
|
+
*/
|
|
11
18
|
DISABLED = "DISABLED",
|
|
12
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* This invitation is not eligible for incentives because the sender is not
|
|
21
|
+
* eligible. *
|
|
22
|
+
*/
|
|
13
23
|
SENDER_NOT_ELIGIBLE = "SENDER_NOT_ELIGIBLE",
|
|
14
|
-
/**
|
|
24
|
+
/**
|
|
25
|
+
* This invitation is not eligible for incentives because the receiver is not
|
|
26
|
+
* eligible. *
|
|
27
|
+
*/
|
|
15
28
|
RECEIVER_NOT_ELIGIBLE = "RECEIVER_NOT_ELIGIBLE",
|
|
16
|
-
/**
|
|
29
|
+
/**
|
|
30
|
+
* This invitation is not eligible for incentives because the sending VASP is
|
|
31
|
+
* not part of the incentives program.
|
|
32
|
+
* *
|
|
33
|
+
*/
|
|
17
34
|
SENDING_VASP_NOT_ELIGIBLE = "SENDING_VASP_NOT_ELIGIBLE",
|
|
18
|
-
/**
|
|
35
|
+
/**
|
|
36
|
+
* This invitation is not eligible for incentives because the receiving VASP
|
|
37
|
+
* is not part of the incentives program.
|
|
38
|
+
* *
|
|
39
|
+
*/
|
|
19
40
|
RECEIVING_VASP_NOT_ELIGIBLE = "RECEIVING_VASP_NOT_ELIGIBLE",
|
|
20
|
-
/**
|
|
41
|
+
/**
|
|
42
|
+
* This invitation is not eligible for incentives because the sender and
|
|
43
|
+
* receiver are in the same region. *
|
|
44
|
+
*/
|
|
21
45
|
NOT_CROSS_BORDER = "NOT_CROSS_BORDER",
|
|
22
46
|
}
|
|
23
47
|
|
|
@@ -3,15 +3,25 @@
|
|
|
3
3
|
/** Describes the status of the incentives for this invitation. **/
|
|
4
4
|
export enum IncentivesStatus {
|
|
5
5
|
/**
|
|
6
|
-
* This is an enum value that represents values that could be added in the
|
|
7
|
-
* Clients should support unknown values as more of them could be
|
|
6
|
+
* This is an enum value that represents values that could be added in the
|
|
7
|
+
* future. Clients should support unknown values as more of them could be
|
|
8
|
+
* added without notice.
|
|
8
9
|
*/
|
|
9
10
|
FUTURE_VALUE = "FUTURE_VALUE",
|
|
10
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* The invitation is eligible for incentives in its current state.
|
|
13
|
+
* When it is claimed, we will reassess.
|
|
14
|
+
* *
|
|
15
|
+
*/
|
|
11
16
|
PENDING = "PENDING",
|
|
12
17
|
/** The incentives have been validated. **/
|
|
13
18
|
VALIDATED = "VALIDATED",
|
|
14
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* This invitation is not eligible for incentives.
|
|
21
|
+
* A more detailed reason can be found in the
|
|
22
|
+
* `incentives_ineligibility_reason` field.
|
|
23
|
+
* *
|
|
24
|
+
*/
|
|
15
25
|
INELIGIBLE = "INELIGIBLE",
|
|
16
26
|
}
|
|
17
27
|
|
|
@@ -21,12 +21,17 @@ import {
|
|
|
21
21
|
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
|
|
26
|
+
* Lightning Network. You can retrieve this object to receive payment related
|
|
27
|
+
* information about a specific payment received by a Lightspark node.
|
|
28
|
+
* *
|
|
29
|
+
*/
|
|
25
30
|
class IncomingPayment implements LightningTransaction, Transaction, Entity {
|
|
26
31
|
constructor(
|
|
27
32
|
/**
|
|
28
|
-
* The unique identifier of this entity across all Lightspark systems.
|
|
29
|
-
* string.
|
|
33
|
+
* The unique identifier of this entity across all Lightspark systems.
|
|
34
|
+
* Should be treated as an opaque string.
|
|
30
35
|
**/
|
|
31
36
|
public readonly id: string,
|
|
32
37
|
/** The date and time when this transaction was initiated. **/
|
|
@@ -43,14 +48,20 @@ class IncomingPayment implements LightningTransaction, Transaction, Entity {
|
|
|
43
48
|
public readonly typename: string,
|
|
44
49
|
/** The date and time when this transaction was completed or failed. **/
|
|
45
50
|
public readonly resolvedAt?: string | undefined,
|
|
46
|
-
/**
|
|
51
|
+
/**
|
|
52
|
+
* The hash of this transaction, so it can be uniquely identified on the
|
|
53
|
+
* Lightning Network. *
|
|
54
|
+
*/
|
|
47
55
|
public readonly transactionHash?: string | undefined,
|
|
48
56
|
/**
|
|
49
|
-
* The optional payment request for this incoming payment,
|
|
50
|
-
* through keysend.
|
|
57
|
+
* The optional payment request for this incoming payment,
|
|
58
|
+
* which will be null if the payment is sent through keysend.
|
|
51
59
|
**/
|
|
52
60
|
public readonly paymentRequestId?: string | undefined,
|
|
53
|
-
/**
|
|
61
|
+
/**
|
|
62
|
+
* The post transaction data which can be used in KYT payment registration.
|
|
63
|
+
* *
|
|
64
|
+
*/
|
|
54
65
|
public readonly umaPostTransactionData?: PostTransactionData[] | undefined,
|
|
55
66
|
) {
|
|
56
67
|
autoBind(this);
|
|
@@ -8,11 +8,16 @@ import {
|
|
|
8
8
|
} from "./CurrencyAmount.js";
|
|
9
9
|
import IncomingPaymentAttemptStatus from "./IncomingPaymentAttemptStatus.js";
|
|
10
10
|
|
|
11
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* This object represents any attempted payment sent to a Lightspark node on
|
|
13
|
+
* the Lightning Network. You can retrieve this object to receive payment
|
|
14
|
+
* related information about a specific incoming payment attempt.
|
|
15
|
+
* *
|
|
16
|
+
*/
|
|
12
17
|
interface IncomingPaymentAttempt {
|
|
13
18
|
/**
|
|
14
|
-
* The unique identifier of this entity across all Lightspark systems.
|
|
15
|
-
* string.
|
|
19
|
+
* The unique identifier of this entity across all Lightspark systems.
|
|
20
|
+
* Should be treated as an opaque string.
|
|
16
21
|
**/
|
|
17
22
|
id: string;
|
|
18
23
|
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* This is an enum that enumerates all potential statuses for an incoming
|
|
5
|
+
* payment attempt. *
|
|
6
|
+
*/
|
|
4
7
|
export enum IncomingPaymentAttemptStatus {
|
|
5
8
|
/**
|
|
6
|
-
* This is an enum value that represents values that could be added in the
|
|
7
|
-
* Clients should support unknown values as more of them could be
|
|
9
|
+
* This is an enum value that represents values that could be added in the
|
|
10
|
+
* future. Clients should support unknown values as more of them could be
|
|
11
|
+
* added without notice.
|
|
8
12
|
*/
|
|
9
13
|
FUTURE_VALUE = "FUTURE_VALUE",
|
|
10
14
|
|
|
@@ -11,12 +11,16 @@ 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
|
-
* number of objects returned in the current page
|
|
14
|
+
* The total count of objects in this connection, using the current filters.
|
|
15
|
+
* It is different from the number of objects returned in the current page
|
|
16
|
+
* (in the `entities` field).
|
|
16
17
|
**/
|
|
17
18
|
count: number;
|
|
18
19
|
|
|
19
|
-
/**
|
|
20
|
+
/**
|
|
21
|
+
* An object that holds pagination information about the objects in this
|
|
22
|
+
* connection. *
|
|
23
|
+
*/
|
|
20
24
|
pageInfo: PageInfo;
|
|
21
25
|
|
|
22
26
|
/** The incoming payment attempts for the current page of this connection. **/
|
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
|
-
* string.
|
|
16
|
+
* The unique identifier of this entity across all Lightspark systems.
|
|
17
|
+
* Should be treated as an opaque string.
|
|
18
18
|
**/
|
|
19
19
|
id: string;
|
|
20
20
|
|
|
@@ -9,7 +9,11 @@ import {
|
|
|
9
9
|
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
|
+
* You can retrieve this object to receive the relevant data associated with a
|
|
15
|
+
* specific invoice. *
|
|
16
|
+
*/
|
|
13
17
|
interface InvoiceData {
|
|
14
18
|
encodedPaymentRequest: string;
|
|
15
19
|
|
|
@@ -19,8 +23,8 @@ interface InvoiceData {
|
|
|
19
23
|
paymentHash: string;
|
|
20
24
|
|
|
21
25
|
/**
|
|
22
|
-
* The requested amount in this invoice. If it is equal to 0,
|
|
23
|
-
* send.
|
|
26
|
+
* The requested amount in this invoice. If it is equal to 0,
|
|
27
|
+
* the sender should choose the amount to send.
|
|
24
28
|
**/
|
|
25
29
|
amount: CurrencyAmount;
|
|
26
30
|
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
/** This is an enum for potential invoice types. **/
|
|
4
4
|
export enum InvoiceType {
|
|
5
5
|
/**
|
|
6
|
-
* This is an enum value that represents values that could be added in the
|
|
7
|
-
* Clients should support unknown values as more of them could be
|
|
6
|
+
* This is an enum value that represents values that could be added in the
|
|
7
|
+
* future. Clients should support unknown values as more of them could be
|
|
8
|
+
* added without notice.
|
|
8
9
|
*/
|
|
9
10
|
FUTURE_VALUE = "FUTURE_VALUE",
|
|
10
11
|
/** A standard Bolt 11 invoice. **/
|
|
@@ -8,8 +8,8 @@ interface LightningFeeEstimateForInvoiceInput {
|
|
|
8
8
|
encodedPaymentRequest: string;
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
* If the invoice does not specify a payment amount,
|
|
12
|
-
* in msats.
|
|
11
|
+
* If the invoice does not specify a payment amount,
|
|
12
|
+
* then the amount that you wish to pay, expressed in msats.
|
|
13
13
|
**/
|
|
14
14
|
amountMsats?: number | undefined;
|
|
15
15
|
}
|
|
@@ -22,11 +22,16 @@ import type RoutingTransaction from "./RoutingTransaction.js";
|
|
|
22
22
|
import RoutingTransactionFailureReason from "./RoutingTransactionFailureReason.js";
|
|
23
23
|
import TransactionStatus from "./TransactionStatus.js";
|
|
24
24
|
|
|
25
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* This is an object representing a transaction made over the Lightning
|
|
27
|
+
* Network. You can retrieve this object to receive information about a
|
|
28
|
+
* specific transaction made over Lightning for a Lightspark node.
|
|
29
|
+
* *
|
|
30
|
+
*/
|
|
26
31
|
interface LightningTransaction {
|
|
27
32
|
/**
|
|
28
|
-
* The unique identifier of this entity across all Lightspark systems.
|
|
29
|
-
* string.
|
|
33
|
+
* The unique identifier of this entity across all Lightspark systems.
|
|
34
|
+
* Should be treated as an opaque string.
|
|
30
35
|
**/
|
|
31
36
|
id: string;
|
|
32
37
|
|
|
@@ -48,7 +53,10 @@ interface LightningTransaction {
|
|
|
48
53
|
/** The date and time when this transaction was completed or failed. **/
|
|
49
54
|
resolvedAt?: string | undefined;
|
|
50
55
|
|
|
51
|
-
/**
|
|
56
|
+
/**
|
|
57
|
+
* The hash of this transaction, so it can be uniquely identified on the
|
|
58
|
+
* Lightning Network. *
|
|
59
|
+
*/
|
|
52
60
|
transactionHash?: string | undefined;
|
|
53
61
|
}
|
|
54
62
|
|