@lightsparkdev/lightspark-sdk 1.2.1 → 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 +14 -0
- package/dist/{BitcoinNetwork-a816c0be.d.ts → BitcoinNetwork-37e9f091.d.ts} +8 -3
- package/dist/{chunk-VTPDR6P4.js → chunk-NCPWHRFO.js} +353 -15
- package/dist/env.d.cts +1 -1
- package/dist/env.d.ts +1 -1
- package/dist/{index-5acc6526.d.ts → index-449c9f58.d.ts} +2089 -644
- package/dist/index.cjs +1082 -470
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +584 -302
- package/dist/objects/index.cjs +345 -5
- package/dist/objects/index.d.cts +2 -2
- package/dist/objects/index.d.ts +2 -2
- package/dist/objects/index.js +9 -1
- package/package.json +4 -4
- package/src/NodeKeyLoaderCache.ts +4 -3
- package/src/SigningKeyLoader.ts +12 -7
- package/src/client.ts +287 -60
- package/src/env.ts +3 -1
- package/src/graphql/ClaimUmaInvitation.ts +21 -0
- package/src/graphql/ClaimUmaInvitationWithIncentives.ts +25 -0
- package/src/graphql/CreateUmaInvitation.ts +19 -0
- package/src/graphql/CreateUmaInvitationWithIncentives.ts +23 -0
- package/src/graphql/FetchUmaInvitation.ts +15 -0
- 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/ClaimUmaInvitationInput.ts +26 -0
- package/src/objects/ClaimUmaInvitationOutput.ts +30 -0
- package/src/objects/ClaimUmaInvitationWithIncentivesInput.ts +44 -0
- package/src/objects/ClaimUmaInvitationWithIncentivesOutput.ts +33 -0
- 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/CreateInvitationWithIncentivesInput.ts +37 -0
- package/src/objects/CreateInvitationWithIncentivesOutput.ts +32 -0
- package/src/objects/CreateLnurlInvoiceInput.ts +3 -2
- package/src/objects/CreateTestModePaymentInput.ts +2 -2
- package/src/objects/CreateTestModePaymentoutput.ts +5 -1
- package/src/objects/CreateUmaInvitationInput.ts +22 -0
- package/src/objects/CreateUmaInvitationOutput.ts +30 -0
- 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 +21 -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 +48 -0
- package/src/objects/IncentivesStatus.ts +28 -0
- 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 +25 -7
- package/src/objects/OutgoingPaymentAttempt.ts +34 -14
- 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 +541 -0
- 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 +119 -0
- 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 +11 -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 +21 -6
- package/src/tests/integration/constants.ts +0 -3
- package/src/tests/integration/general-regtest.test.ts +178 -197
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
|
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Describes the reason for an invitation to not be eligible for incentives.
|
|
5
|
+
* *
|
|
6
|
+
*/
|
|
7
|
+
export enum IncentivesIneligibilityReason {
|
|
8
|
+
/**
|
|
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.
|
|
12
|
+
*/
|
|
13
|
+
FUTURE_VALUE = "FUTURE_VALUE",
|
|
14
|
+
/**
|
|
15
|
+
* This invitation is not eligible for incentives because it has been created
|
|
16
|
+
* outside of the incentives flow. *
|
|
17
|
+
*/
|
|
18
|
+
DISABLED = "DISABLED",
|
|
19
|
+
/**
|
|
20
|
+
* This invitation is not eligible for incentives because the sender is not
|
|
21
|
+
* eligible. *
|
|
22
|
+
*/
|
|
23
|
+
SENDER_NOT_ELIGIBLE = "SENDER_NOT_ELIGIBLE",
|
|
24
|
+
/**
|
|
25
|
+
* This invitation is not eligible for incentives because the receiver is not
|
|
26
|
+
* eligible. *
|
|
27
|
+
*/
|
|
28
|
+
RECEIVER_NOT_ELIGIBLE = "RECEIVER_NOT_ELIGIBLE",
|
|
29
|
+
/**
|
|
30
|
+
* This invitation is not eligible for incentives because the sending VASP is
|
|
31
|
+
* not part of the incentives program.
|
|
32
|
+
* *
|
|
33
|
+
*/
|
|
34
|
+
SENDING_VASP_NOT_ELIGIBLE = "SENDING_VASP_NOT_ELIGIBLE",
|
|
35
|
+
/**
|
|
36
|
+
* This invitation is not eligible for incentives because the receiving VASP
|
|
37
|
+
* is not part of the incentives program.
|
|
38
|
+
* *
|
|
39
|
+
*/
|
|
40
|
+
RECEIVING_VASP_NOT_ELIGIBLE = "RECEIVING_VASP_NOT_ELIGIBLE",
|
|
41
|
+
/**
|
|
42
|
+
* This invitation is not eligible for incentives because the sender and
|
|
43
|
+
* receiver are in the same region. *
|
|
44
|
+
*/
|
|
45
|
+
NOT_CROSS_BORDER = "NOT_CROSS_BORDER",
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export default IncentivesIneligibilityReason;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
|
+
|
|
3
|
+
/** Describes the status of the incentives for this invitation. **/
|
|
4
|
+
export enum IncentivesStatus {
|
|
5
|
+
/**
|
|
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.
|
|
9
|
+
*/
|
|
10
|
+
FUTURE_VALUE = "FUTURE_VALUE",
|
|
11
|
+
/**
|
|
12
|
+
* The invitation is eligible for incentives in its current state.
|
|
13
|
+
* When it is claimed, we will reassess.
|
|
14
|
+
* *
|
|
15
|
+
*/
|
|
16
|
+
PENDING = "PENDING",
|
|
17
|
+
/** The incentives have been validated. **/
|
|
18
|
+
VALIDATED = "VALIDATED",
|
|
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
|
+
*/
|
|
25
|
+
INELIGIBLE = "INELIGIBLE",
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export default IncentivesStatus;
|
|
@@ -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
|
|
|
@@ -24,11 +24,15 @@ import type NodeAddressType from "./NodeAddressType.js";
|
|
|
24
24
|
import type NodeToAddressesConnection from "./NodeToAddressesConnection.js";
|
|
25
25
|
import { SecretFromJson, SecretToJson } from "./Secret.js";
|
|
26
26
|
|
|
27
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* This is an object representing a node managed by Lightspark and owned by the
|
|
29
|
+
* current connected account. This object contains information about the node’s
|
|
30
|
+
* configuration, state, and metadata. *
|
|
31
|
+
*/
|
|
28
32
|
interface LightsparkNode {
|
|
29
33
|
/**
|
|
30
|
-
* The unique identifier of this entity across all Lightspark systems.
|
|
31
|
-
* string.
|
|
34
|
+
* The unique identifier of this entity across all Lightspark systems.
|
|
35
|
+
* Should be treated as an opaque string.
|
|
32
36
|
**/
|
|
33
37
|
id: string;
|
|
34
38
|
|
|
@@ -42,8 +46,9 @@ interface LightsparkNode {
|
|
|
42
46
|
bitcoinNetwork: BitcoinNetwork;
|
|
43
47
|
|
|
44
48
|
/**
|
|
45
|
-
* The name of this node in the network.
|
|
46
|
-
*
|
|
49
|
+
* The name of this node in the network.
|
|
50
|
+
* It will be the most human-readable option possible,
|
|
51
|
+
* depending on the data available for this node.
|
|
47
52
|
**/
|
|
48
53
|
displayName: string;
|
|
49
54
|
|
|
@@ -51,8 +56,8 @@ interface LightsparkNode {
|
|
|
51
56
|
ownerId: string;
|
|
52
57
|
|
|
53
58
|
/**
|
|
54
|
-
* The utxos of the channels that are connected to this node.
|
|
55
|
-
* pre-screening.
|
|
59
|
+
* The utxos of the channels that are connected to this node.
|
|
60
|
+
* This is used in uma flow for pre-screening.
|
|
56
61
|
**/
|
|
57
62
|
umaPrescreeningUtxos: string[];
|
|
58
63
|
|
|
@@ -60,34 +65,43 @@ interface LightsparkNode {
|
|
|
60
65
|
typename: string;
|
|
61
66
|
|
|
62
67
|
/**
|
|
63
|
-
* A name that identifies the node. It has no importance in terms of
|
|
64
|
-
* way to identify and search for commercial
|
|
65
|
-
* any time by the
|
|
68
|
+
* A name that identifies the node. It has no importance in terms of
|
|
69
|
+
* operating the node, it is just a way to identify and search for commercial
|
|
70
|
+
* services or popular nodes. This alias can be changed at any time by the
|
|
71
|
+
* node operator.
|
|
66
72
|
**/
|
|
67
73
|
alias?: string | undefined;
|
|
68
74
|
|
|
69
75
|
/**
|
|
70
|
-
* A hexadecimal string that describes a color. For example "#000000" is
|
|
71
|
-
* has no importance in terms of operating the
|
|
76
|
+
* A hexadecimal string that describes a color. For example "#000000" is
|
|
77
|
+
* black, "#FFFFFF" is white. It has no importance in terms of operating the
|
|
78
|
+
* node,
|
|
79
|
+
* it is just a way to visually differentiate nodes.
|
|
72
80
|
* That color can be changed at any time by the node operator.
|
|
73
81
|
**/
|
|
74
82
|
color?: string | undefined;
|
|
75
83
|
|
|
76
84
|
/**
|
|
77
|
-
* A summary metric used to capture how well positioned a node is to send,
|
|
78
|
-
*
|
|
79
|
-
*
|
|
85
|
+
* A summary metric used to capture how well positioned a node is to send,
|
|
86
|
+
* receive, or route transactions efficiently.
|
|
87
|
+
* Maximizing a node's conductivity helps a node’s transactions to be capital
|
|
88
|
+
* efficient. The value is an integer ranging between 0 and 10 (bounds
|
|
89
|
+
* included).
|
|
80
90
|
**/
|
|
81
91
|
conductivity?: number | undefined;
|
|
82
92
|
|
|
83
|
-
/**
|
|
93
|
+
/**
|
|
94
|
+
* The public key of this node. It acts as a unique identifier of this node
|
|
95
|
+
* in the Lightning Network. *
|
|
96
|
+
*/
|
|
84
97
|
publicKey?: string | undefined;
|
|
85
98
|
|
|
86
99
|
/** The current status of this node. **/
|
|
87
100
|
status?: LightsparkNodeStatus | undefined;
|
|
88
101
|
|
|
89
102
|
/**
|
|
90
|
-
* The sum of the balance on the Bitcoin Network, channel balances,
|
|
103
|
+
* The sum of the balance on the Bitcoin Network, channel balances,
|
|
104
|
+
* and commit fees on this node.
|
|
91
105
|
*
|
|
92
106
|
* @deprecated Use `balances` instead.
|
|
93
107
|
**/
|
|
@@ -101,7 +115,8 @@ interface LightsparkNode {
|
|
|
101
115
|
totalLocalBalance?: CurrencyAmount | undefined;
|
|
102
116
|
|
|
103
117
|
/**
|
|
104
|
-
* The sum of the channel balances (online only) that are available to send
|
|
118
|
+
* The sum of the channel balances (online only) that are available to send
|
|
119
|
+
* on this node.
|
|
105
120
|
*
|
|
106
121
|
* @deprecated Use `balances` instead.
|
|
107
122
|
**/
|
|
@@ -9,8 +9,8 @@ import WalletStatus from "./WalletStatus.js";
|
|
|
9
9
|
/** This is an object representing the owner of a LightsparkNode. **/
|
|
10
10
|
interface LightsparkNodeOwner {
|
|
11
11
|
/**
|
|
12
|
-
* The unique identifier of this entity across all Lightspark systems.
|
|
13
|
-
* string.
|
|
12
|
+
* The unique identifier of this entity across all Lightspark systems.
|
|
13
|
+
* Should be treated as an opaque string.
|
|
14
14
|
**/
|
|
15
15
|
id: string;
|
|
16
16
|
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
export enum LightsparkNodeStatus {
|
|
4
4
|
/**
|
|
5
|
-
* This is an enum value that represents values that could be added in the
|
|
6
|
-
* Clients should support unknown values as more of them could be
|
|
5
|
+
* This is an enum value that represents values that could be added in the
|
|
6
|
+
* future. Clients should support unknown values as more of them could be
|
|
7
|
+
* added without notice.
|
|
7
8
|
*/
|
|
8
9
|
FUTURE_VALUE = "FUTURE_VALUE",
|
|
9
10
|
|
|
@@ -7,12 +7,16 @@ import { PageInfoFromJson, PageInfoToJson } from "./PageInfo.js";
|
|
|
7
7
|
|
|
8
8
|
interface LightsparkNodeToChannelsConnection {
|
|
9
9
|
/**
|
|
10
|
-
* The total count of objects in this connection, using the current filters.
|
|
11
|
-
* number of objects returned in the current page
|
|
10
|
+
* The total count of objects in this connection, using the current filters.
|
|
11
|
+
* It is different from the number of objects returned in the current page
|
|
12
|
+
* (in the `entities` field).
|
|
12
13
|
**/
|
|
13
14
|
count: number;
|
|
14
15
|
|
|
15
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* An object that holds pagination information about the objects in this
|
|
18
|
+
* connection. *
|
|
19
|
+
*/
|
|
16
20
|
pageInfo: PageInfo;
|
|
17
21
|
|
|
18
22
|
/** The channels for the current page of this connection. **/
|