@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
|
@@ -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. **/
|
|
@@ -33,8 +33,8 @@ import { SecretFromJson, SecretToJson } from "./Secret.js";
|
|
|
33
33
|
class LightsparkNodeWithOSK implements LightsparkNode, Node, Entity {
|
|
34
34
|
constructor(
|
|
35
35
|
/**
|
|
36
|
-
* The unique identifier of this entity across all Lightspark systems.
|
|
37
|
-
* string.
|
|
36
|
+
* The unique identifier of this entity across all Lightspark systems.
|
|
37
|
+
* Should be treated as an opaque string.
|
|
38
38
|
**/
|
|
39
39
|
public readonly id: string,
|
|
40
40
|
/** The date and time when the entity was first created. **/
|
|
@@ -44,43 +44,54 @@ class LightsparkNodeWithOSK implements LightsparkNode, Node, Entity {
|
|
|
44
44
|
/** The Bitcoin Network this node is deployed in. **/
|
|
45
45
|
public readonly bitcoinNetwork: BitcoinNetwork,
|
|
46
46
|
/**
|
|
47
|
-
* The name of this node in the network.
|
|
48
|
-
*
|
|
47
|
+
* The name of this node in the network.
|
|
48
|
+
* It will be the most human-readable option possible,
|
|
49
|
+
* depending on the data available for this node.
|
|
49
50
|
**/
|
|
50
51
|
public readonly displayName: string,
|
|
51
52
|
/** The owner of this LightsparkNode. **/
|
|
52
53
|
public readonly ownerId: string,
|
|
53
54
|
/**
|
|
54
|
-
* The utxos of the channels that are connected to this node.
|
|
55
|
-
* pre-screening.
|
|
55
|
+
* The utxos of the channels that are connected to this node.
|
|
56
|
+
* This is used in uma flow for pre-screening.
|
|
56
57
|
**/
|
|
57
58
|
public readonly umaPrescreeningUtxos: string[],
|
|
58
59
|
/** The typename of the object **/
|
|
59
60
|
public readonly typename: string,
|
|
60
61
|
/**
|
|
61
|
-
* A name that identifies the node.
|
|
62
|
-
*
|
|
63
|
-
*
|
|
62
|
+
* A name that identifies the node.
|
|
63
|
+
* It has no importance in terms of operating the node,
|
|
64
|
+
* it is just a way to identify and search for commercial services or
|
|
65
|
+
* popular nodes. This alias can be changed at any time by the node
|
|
66
|
+
* operator.
|
|
64
67
|
**/
|
|
65
68
|
public readonly alias?: string | undefined,
|
|
66
69
|
/**
|
|
67
|
-
* A hexadecimal string that describes a color. For example "#000000" is
|
|
68
|
-
* has no importance in terms of operating
|
|
70
|
+
* A hexadecimal string that describes a color. For example "#000000" is
|
|
71
|
+
* black, "#FFFFFF" is white. It has no importance in terms of operating
|
|
72
|
+
* the node,
|
|
73
|
+
* it is just a way to visually differentiate nodes.
|
|
69
74
|
* That color can be changed at any time by the node operator.
|
|
70
75
|
**/
|
|
71
76
|
public readonly color?: string | undefined,
|
|
72
77
|
/**
|
|
73
|
-
* A summary metric used to capture how well positioned a node is to send,
|
|
74
|
-
*
|
|
75
|
-
*
|
|
78
|
+
* A summary metric used to capture how well positioned a node is to send,
|
|
79
|
+
* receive, or route transactions efficiently.
|
|
80
|
+
* Maximizing a node's conductivity helps a node’s transactions to be
|
|
81
|
+
* capital efficient. The value is an integer ranging between 0 and 10
|
|
82
|
+
* (bounds included).
|
|
76
83
|
**/
|
|
77
84
|
public readonly conductivity?: number | undefined,
|
|
78
|
-
/**
|
|
85
|
+
/**
|
|
86
|
+
* The public key of this node. It acts as a unique identifier of this node
|
|
87
|
+
* in the Lightning Network. *
|
|
88
|
+
*/
|
|
79
89
|
public readonly publicKey?: string | undefined,
|
|
80
90
|
/** The current status of this node. **/
|
|
81
91
|
public readonly status?: LightsparkNodeStatus | undefined,
|
|
82
92
|
/**
|
|
83
|
-
* The sum of the balance on the Bitcoin Network, channel balances,
|
|
93
|
+
* The sum of the balance on the Bitcoin Network, channel balances,
|
|
94
|
+
* and commit fees on this node.
|
|
84
95
|
*
|
|
85
96
|
* @deprecated Use `balances` instead.
|
|
86
97
|
**/
|
|
@@ -92,13 +103,15 @@ class LightsparkNodeWithOSK implements LightsparkNode, Node, Entity {
|
|
|
92
103
|
**/
|
|
93
104
|
public readonly totalLocalBalance?: CurrencyAmount | undefined,
|
|
94
105
|
/**
|
|
95
|
-
* The sum of the channel balances (online only) that are available to send
|
|
106
|
+
* The sum of the channel balances (online only) that are available to send
|
|
107
|
+
* on this node.
|
|
96
108
|
*
|
|
97
109
|
* @deprecated Use `balances` instead.
|
|
98
110
|
**/
|
|
99
111
|
public readonly localBalance?: CurrencyAmount | undefined,
|
|
100
112
|
/**
|
|
101
|
-
* The sum of the channel balances that are available to receive on this
|
|
113
|
+
* The sum of the channel balances that are available to receive on this
|
|
114
|
+
* node.
|
|
102
115
|
*
|
|
103
116
|
* @deprecated Use `balances` instead.
|
|
104
117
|
**/
|
|
@@ -111,7 +124,10 @@ class LightsparkNodeWithOSK implements LightsparkNode, Node, Entity {
|
|
|
111
124
|
public readonly blockchainBalance?: BlockchainBalance | undefined,
|
|
112
125
|
/** The balances that describe the funds in this node. **/
|
|
113
126
|
public readonly balances?: Balances | undefined,
|
|
114
|
-
/**
|
|
127
|
+
/**
|
|
128
|
+
* The private key client is using to sign a GraphQL request which will be
|
|
129
|
+
* verified at server side. *
|
|
130
|
+
*/
|
|
115
131
|
public readonly encryptedSigningPrivateKey?: Secret | undefined,
|
|
116
132
|
) {
|
|
117
133
|
autoBind(this);
|
|
@@ -31,8 +31,8 @@ import { NodeToAddressesConnectionFromJson } from "./NodeToAddressesConnection.j
|
|
|
31
31
|
class LightsparkNodeWithRemoteSigning implements LightsparkNode, Node, Entity {
|
|
32
32
|
constructor(
|
|
33
33
|
/**
|
|
34
|
-
* The unique identifier of this entity across all Lightspark systems.
|
|
35
|
-
* string.
|
|
34
|
+
* The unique identifier of this entity across all Lightspark systems.
|
|
35
|
+
* Should be treated as an opaque string.
|
|
36
36
|
**/
|
|
37
37
|
public readonly id: string,
|
|
38
38
|
/** The date and time when the entity was first created. **/
|
|
@@ -42,43 +42,54 @@ class LightsparkNodeWithRemoteSigning implements LightsparkNode, Node, Entity {
|
|
|
42
42
|
/** The Bitcoin Network this node is deployed in. **/
|
|
43
43
|
public readonly bitcoinNetwork: BitcoinNetwork,
|
|
44
44
|
/**
|
|
45
|
-
* The name of this node in the network.
|
|
46
|
-
*
|
|
45
|
+
* The name of this node in the network.
|
|
46
|
+
* It will be the most human-readable option possible,
|
|
47
|
+
* depending on the data available for this node.
|
|
47
48
|
**/
|
|
48
49
|
public readonly displayName: string,
|
|
49
50
|
/** The owner of this LightsparkNode. **/
|
|
50
51
|
public readonly ownerId: string,
|
|
51
52
|
/**
|
|
52
|
-
* The utxos of the channels that are connected to this node.
|
|
53
|
-
* pre-screening.
|
|
53
|
+
* The utxos of the channels that are connected to this node.
|
|
54
|
+
* This is used in uma flow for pre-screening.
|
|
54
55
|
**/
|
|
55
56
|
public readonly umaPrescreeningUtxos: string[],
|
|
56
57
|
/** The typename of the object **/
|
|
57
58
|
public readonly typename: string,
|
|
58
59
|
/**
|
|
59
|
-
* A name that identifies the node.
|
|
60
|
-
*
|
|
61
|
-
*
|
|
60
|
+
* A name that identifies the node.
|
|
61
|
+
* It has no importance in terms of operating the node,
|
|
62
|
+
* it is just a way to identify and search for commercial services or
|
|
63
|
+
* popular nodes. This alias can be changed at any time by the node
|
|
64
|
+
* operator.
|
|
62
65
|
**/
|
|
63
66
|
public readonly alias?: string | undefined,
|
|
64
67
|
/**
|
|
65
|
-
* A hexadecimal string that describes a color. For example "#000000" is
|
|
66
|
-
* has no importance in terms of operating
|
|
68
|
+
* A hexadecimal string that describes a color. For example "#000000" is
|
|
69
|
+
* black, "#FFFFFF" is white. It has no importance in terms of operating
|
|
70
|
+
* the node,
|
|
71
|
+
* it is just a way to visually differentiate nodes.
|
|
67
72
|
* That color can be changed at any time by the node operator.
|
|
68
73
|
**/
|
|
69
74
|
public readonly color?: string | undefined,
|
|
70
75
|
/**
|
|
71
|
-
* A summary metric used to capture how well positioned a node is to send,
|
|
72
|
-
*
|
|
73
|
-
*
|
|
76
|
+
* A summary metric used to capture how well positioned a node is to send,
|
|
77
|
+
* receive, or route transactions efficiently.
|
|
78
|
+
* Maximizing a node's conductivity helps a node’s transactions to be
|
|
79
|
+
* capital efficient. The value is an integer ranging between 0 and 10
|
|
80
|
+
* (bounds included).
|
|
74
81
|
**/
|
|
75
82
|
public readonly conductivity?: number | undefined,
|
|
76
|
-
/**
|
|
83
|
+
/**
|
|
84
|
+
* The public key of this node. It acts as a unique identifier of this node
|
|
85
|
+
* in the Lightning Network. *
|
|
86
|
+
*/
|
|
77
87
|
public readonly publicKey?: string | undefined,
|
|
78
88
|
/** The current status of this node. **/
|
|
79
89
|
public readonly status?: LightsparkNodeStatus | undefined,
|
|
80
90
|
/**
|
|
81
|
-
* The sum of the balance on the Bitcoin Network, channel balances,
|
|
91
|
+
* The sum of the balance on the Bitcoin Network, channel balances,
|
|
92
|
+
* and commit fees on this node.
|
|
82
93
|
*
|
|
83
94
|
* @deprecated Use `balances` instead.
|
|
84
95
|
**/
|
|
@@ -90,13 +101,15 @@ class LightsparkNodeWithRemoteSigning implements LightsparkNode, Node, Entity {
|
|
|
90
101
|
**/
|
|
91
102
|
public readonly totalLocalBalance?: CurrencyAmount | undefined,
|
|
92
103
|
/**
|
|
93
|
-
* The sum of the channel balances (online only) that are available to send
|
|
104
|
+
* The sum of the channel balances (online only) that are available to send
|
|
105
|
+
* on this node.
|
|
94
106
|
*
|
|
95
107
|
* @deprecated Use `balances` instead.
|
|
96
108
|
**/
|
|
97
109
|
public readonly localBalance?: CurrencyAmount | undefined,
|
|
98
110
|
/**
|
|
99
|
-
* The sum of the channel balances that are available to receive on this
|
|
111
|
+
* The sum of the channel balances that are available to receive on this
|
|
112
|
+
* node.
|
|
100
113
|
*
|
|
101
114
|
* @deprecated Use `balances` instead.
|
|
102
115
|
**/
|
package/src/objects/Node.ts
CHANGED
|
@@ -20,11 +20,16 @@ import type NodeAddressType from "./NodeAddressType.js";
|
|
|
20
20
|
import type NodeToAddressesConnection from "./NodeToAddressesConnection.js";
|
|
21
21
|
import { SecretFromJson, SecretToJson } from "./Secret.js";
|
|
22
22
|
|
|
23
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* This object is an interface representing a Lightning Node on the Lightning
|
|
25
|
+
* Network, and could either be a Lightspark node or a node managed by a third
|
|
26
|
+
* party.
|
|
27
|
+
* *
|
|
28
|
+
*/
|
|
24
29
|
interface Node {
|
|
25
30
|
/**
|
|
26
|
-
* The unique identifier of this entity across all Lightspark systems.
|
|
27
|
-
* string.
|
|
31
|
+
* The unique identifier of this entity across all Lightspark systems.
|
|
32
|
+
* Should be treated as an opaque string.
|
|
28
33
|
**/
|
|
29
34
|
id: string;
|
|
30
35
|
|
|
@@ -38,8 +43,9 @@ interface Node {
|
|
|
38
43
|
bitcoinNetwork: BitcoinNetwork;
|
|
39
44
|
|
|
40
45
|
/**
|
|
41
|
-
* The name of this node in the network.
|
|
42
|
-
*
|
|
46
|
+
* The name of this node in the network.
|
|
47
|
+
* It will be the most human-readable option possible,
|
|
48
|
+
* depending on the data available for this node.
|
|
43
49
|
**/
|
|
44
50
|
displayName: string;
|
|
45
51
|
|
|
@@ -47,27 +53,35 @@ interface Node {
|
|
|
47
53
|
typename: string;
|
|
48
54
|
|
|
49
55
|
/**
|
|
50
|
-
* A name that identifies the node. It has no importance in terms of
|
|
51
|
-
* way to identify and search for commercial
|
|
52
|
-
* any time by the
|
|
56
|
+
* A name that identifies the node. It has no importance in terms of
|
|
57
|
+
* operating the node, it is just a way to identify and search for commercial
|
|
58
|
+
* services or popular nodes. This alias can be changed at any time by the
|
|
59
|
+
* node operator.
|
|
53
60
|
**/
|
|
54
61
|
alias?: string | undefined;
|
|
55
62
|
|
|
56
63
|
/**
|
|
57
|
-
* A hexadecimal string that describes a color. For example "#000000" is
|
|
58
|
-
* has no importance in terms of operating the
|
|
64
|
+
* A hexadecimal string that describes a color. For example "#000000" is
|
|
65
|
+
* black, "#FFFFFF" is white. It has no importance in terms of operating the
|
|
66
|
+
* node,
|
|
67
|
+
* it is just a way to visually differentiate nodes.
|
|
59
68
|
* That color can be changed at any time by the node operator.
|
|
60
69
|
**/
|
|
61
70
|
color?: string | undefined;
|
|
62
71
|
|
|
63
72
|
/**
|
|
64
|
-
* A summary metric used to capture how well positioned a node is to send,
|
|
65
|
-
*
|
|
66
|
-
*
|
|
73
|
+
* A summary metric used to capture how well positioned a node is to send,
|
|
74
|
+
* receive, or route transactions efficiently.
|
|
75
|
+
* Maximizing a node's conductivity helps a node’s transactions to be capital
|
|
76
|
+
* efficient. The value is an integer ranging between 0 and 10 (bounds
|
|
77
|
+
* included).
|
|
67
78
|
**/
|
|
68
79
|
conductivity?: number | undefined;
|
|
69
80
|
|
|
70
|
-
/**
|
|
81
|
+
/**
|
|
82
|
+
* The public key of this node. It acts as a unique identifier of this node
|
|
83
|
+
* in the Lightning Network. *
|
|
84
|
+
*/
|
|
71
85
|
publicKey?: string | undefined;
|
|
72
86
|
|
|
73
87
|
getAddresses(
|
|
@@ -1,10 +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 types of addresses that a node on the
|
|
5
|
+
* Lightning Network can have. *
|
|
6
|
+
*/
|
|
4
7
|
export enum NodeAddressType {
|
|
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
|
|
|
@@ -3,11 +3,15 @@
|
|
|
3
3
|
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
|
+
* Lightning Network. *
|
|
9
|
+
*/
|
|
7
10
|
interface NodeToAddressesConnection {
|
|
8
11
|
/**
|
|
9
|
-
* The total count of objects in this connection, using the current filters.
|
|
10
|
-
* number of objects returned in the current page
|
|
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
|
+
* (in the `entities` field).
|
|
11
15
|
**/
|
|
12
16
|
count: number;
|
|
13
17
|
|
|
@@ -12,11 +12,17 @@ import type Deposit from "./Deposit.js";
|
|
|
12
12
|
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
|
+
* Network. You can retrieve this object to receive information about a
|
|
18
|
+
* specific on-chain transaction made on the Lightning Network associated with
|
|
19
|
+
* your Lightspark Node.
|
|
20
|
+
* *
|
|
21
|
+
*/
|
|
16
22
|
interface OnChainTransaction {
|
|
17
23
|
/**
|
|
18
|
-
* The unique identifier of this entity across all Lightspark systems.
|
|
19
|
-
* string.
|
|
24
|
+
* The unique identifier of this entity across all Lightspark systems.
|
|
25
|
+
* Should be treated as an opaque string.
|
|
20
26
|
**/
|
|
21
27
|
id: string;
|
|
22
28
|
|
|
@@ -33,8 +39,8 @@ interface OnChainTransaction {
|
|
|
33
39
|
amount: CurrencyAmount;
|
|
34
40
|
|
|
35
41
|
/**
|
|
36
|
-
* The height of the block that included this transaction.
|
|
37
|
-
* transactions.
|
|
42
|
+
* The height of the block that included this transaction.
|
|
43
|
+
* This will be zero for unconfirmed transactions.
|
|
38
44
|
**/
|
|
39
45
|
blockHeight: number;
|
|
40
46
|
|
|
@@ -47,22 +53,28 @@ interface OnChainTransaction {
|
|
|
47
53
|
/** The date and time when this transaction was completed or failed. **/
|
|
48
54
|
resolvedAt?: string | undefined;
|
|
49
55
|
|
|
50
|
-
/**
|
|
56
|
+
/**
|
|
57
|
+
* The hash of this transaction, so it can be uniquely identified on the
|
|
58
|
+
* Lightning Network. *
|
|
59
|
+
*/
|
|
51
60
|
transactionHash?: string | undefined;
|
|
52
61
|
|
|
53
62
|
/**
|
|
54
|
-
* The fees that were paid by the wallet sending the transaction to commit it
|
|
55
|
-
* blockchain.
|
|
63
|
+
* The fees that were paid by the wallet sending the transaction to commit it
|
|
64
|
+
* to the Bitcoin blockchain.
|
|
56
65
|
**/
|
|
57
66
|
fees?: CurrencyAmount | undefined;
|
|
58
67
|
|
|
59
68
|
/**
|
|
60
|
-
* The hash of the block that included this transaction.
|
|
61
|
-
* transactions.
|
|
69
|
+
* The hash of the block that included this transaction.
|
|
70
|
+
* This will be null for unconfirmed transactions.
|
|
62
71
|
**/
|
|
63
72
|
blockHash?: string | undefined;
|
|
64
73
|
|
|
65
|
-
/**
|
|
74
|
+
/**
|
|
75
|
+
* The number of blockchain confirmations for this transaction in real time.
|
|
76
|
+
* *
|
|
77
|
+
*/
|
|
66
78
|
numConfirmations?: number | undefined;
|
|
67
79
|
}
|
|
68
80
|
|
|
@@ -28,12 +28,17 @@ import { RichTextFromJson, RichTextToJson } from "./RichText.js";
|
|
|
28
28
|
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
|
+
* Node. You can retrieve this object to receive payment related information
|
|
34
|
+
* about any payment sent from your Lightspark Node on the Lightning Network.
|
|
35
|
+
* *
|
|
36
|
+
*/
|
|
32
37
|
class OutgoingPayment implements LightningTransaction, Transaction, Entity {
|
|
33
38
|
constructor(
|
|
34
39
|
/**
|
|
35
|
-
* The unique identifier of this entity across all Lightspark systems.
|
|
36
|
-
* string.
|
|
40
|
+
* The unique identifier of this entity across all Lightspark systems.
|
|
41
|
+
* Should be treated as an opaque string.
|
|
37
42
|
**/
|
|
38
43
|
public readonly id: string,
|
|
39
44
|
/** The date and time when this transaction was initiated. **/
|
|
@@ -50,19 +55,31 @@ class OutgoingPayment implements LightningTransaction, Transaction, Entity {
|
|
|
50
55
|
public readonly typename: string,
|
|
51
56
|
/** The date and time when this transaction was completed or failed. **/
|
|
52
57
|
public readonly resolvedAt?: string | undefined,
|
|
53
|
-
/**
|
|
58
|
+
/**
|
|
59
|
+
* The hash of this transaction, so it can be uniquely identified on the
|
|
60
|
+
* Lightning Network. *
|
|
61
|
+
*/
|
|
54
62
|
public readonly transactionHash?: string | undefined,
|
|
55
63
|
/** If known, the final recipient node this payment was sent to. **/
|
|
56
64
|
public readonly destinationId?: string | undefined,
|
|
57
65
|
/** The fees paid by the sender node to send the payment. **/
|
|
58
66
|
public readonly fees?: CurrencyAmount | undefined,
|
|
59
|
-
/**
|
|
67
|
+
/**
|
|
68
|
+
* The data of the payment request that was paid by this transaction, if
|
|
69
|
+
* known. *
|
|
70
|
+
*/
|
|
60
71
|
public readonly paymentRequestData?: PaymentRequestData | undefined,
|
|
61
72
|
/** If applicable, the reason why the payment failed. **/
|
|
62
73
|
public readonly failureReason?: PaymentFailureReason | undefined,
|
|
63
|
-
/**
|
|
74
|
+
/**
|
|
75
|
+
* If applicable, user-facing error message describing why the payment
|
|
76
|
+
* failed. *
|
|
77
|
+
*/
|
|
64
78
|
public readonly failureMessage?: RichText | undefined,
|
|
65
|
-
/**
|
|
79
|
+
/**
|
|
80
|
+
* The post transaction data which can be used in KYT payment registration.
|
|
81
|
+
* *
|
|
82
|
+
*/
|
|
66
83
|
public readonly umaPostTransactionData?: PostTransactionData[] | undefined,
|
|
67
84
|
/** The preimage of the payment. **/
|
|
68
85
|
public readonly paymentPreimage?: string | undefined,
|