@lightsparkdev/lightspark-sdk 1.2.2 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/dist/{BitcoinNetwork-a816c0be.d.ts → BitcoinNetwork-972b1d01.d.ts} +4 -1
- package/dist/{chunk-GLL4KTUT.js → chunk-Y55D3PD4.js} +11 -11
- package/dist/env.d.cts +1 -1
- package/dist/env.d.ts +1 -1
- package/dist/{index-eb604025.d.ts → index-a5028d74.d.ts} +866 -451
- package/dist/index.cjs +622 -557
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +363 -298
- 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 +117 -65
- package/src/env.ts +3 -1
- package/src/graphql/CancelInvoice.ts +17 -0
- package/src/objects/Account.ts +7 -3
- package/src/objects/AccountToApiTokensConnection.ts +3 -2
- package/src/objects/AccountToChannelsConnection.ts +3 -2
- package/src/objects/AccountToNodesConnection.ts +3 -2
- package/src/objects/AccountToPaymentRequestsConnection.ts +3 -2
- package/src/objects/AccountToTransactionsConnection.ts +7 -6
- package/src/objects/AccountToWalletsConnection.ts +3 -2
- package/src/objects/ApiToken.ts +10 -5
- package/src/objects/Balances.ts +20 -12
- package/src/objects/BitcoinNetwork.ts +4 -1
- package/src/objects/CancelInvoiceInput.ts +18 -0
- package/src/objects/CancelInvoiceOutput.ts +26 -0
- package/src/objects/Channel.ts +26 -12
- package/src/objects/ChannelClosingTransaction.ts +7 -3
- package/src/objects/ChannelOpeningTransaction.ts +7 -3
- package/src/objects/ChannelStatus.ts +24 -5
- package/src/objects/ChannelToTransactionsConnection.ts +9 -8
- package/src/objects/Connection.ts +3 -2
- 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 +2 -2
- package/src/objects/CurrencyUnit.ts +29 -6
- package/src/objects/Deposit.ts +8 -3
- package/src/objects/Entity.ts +8 -3
- package/src/objects/FeeEstimate.ts +5 -1
- package/src/objects/GraphNode.ts +20 -11
- package/src/objects/Hop.ts +8 -3
- package/src/objects/HtlcAttemptFailureCode.ts +4 -1
- package/src/objects/IncentivesIneligibilityReason.ts +16 -4
- package/src/objects/IncentivesStatus.ts +9 -2
- package/src/objects/IncomingPayment.ts +9 -5
- package/src/objects/IncomingPaymentAttempt.ts +7 -3
- package/src/objects/IncomingPaymentToAttemptsConnection.ts +3 -2
- package/src/objects/Invoice.ts +2 -2
- package/src/objects/InvoiceData.ts +7 -3
- package/src/objects/LightningFeeEstimateForInvoiceInput.ts +2 -2
- package/src/objects/LightningTransaction.ts +7 -3
- package/src/objects/LightsparkNode.ts +21 -12
- package/src/objects/LightsparkNodeOwner.ts +2 -2
- package/src/objects/LightsparkNodeToChannelsConnection.ts +3 -2
- package/src/objects/LightsparkNodeWithOSK.ts +20 -12
- package/src/objects/LightsparkNodeWithRemoteSigning.ts +16 -11
- package/src/objects/Node.ts +19 -11
- package/src/objects/NodeAddressType.ts +4 -1
- package/src/objects/NodeToAddressesConnection.ts +7 -3
- package/src/objects/OnChainTransaction.ts +8 -3
- package/src/objects/OutgoingPayment.ts +8 -3
- package/src/objects/OutgoingPaymentAttempt.ts +16 -9
- package/src/objects/OutgoingPaymentAttemptToHopsConnection.ts +7 -3
- package/src/objects/OutgoingPaymentToAttemptsConnection.ts +3 -2
- package/src/objects/PageInfo.ts +5 -1
- package/src/objects/PayInvoiceInput.ts +4 -1
- package/src/objects/PaymentFailureReason.ts +4 -1
- package/src/objects/PaymentRequest.ts +7 -3
- package/src/objects/PaymentRequestData.ts +5 -1
- package/src/objects/PaymentRequestStatus.ts +4 -1
- package/src/objects/Permission.ts +4 -1
- package/src/objects/RegisterPaymentInput.ts +8 -7
- package/src/objects/RequestWithdrawalInput.ts +2 -2
- package/src/objects/RiskRating.ts +5 -1
- package/src/objects/RoutingTransaction.ts +11 -5
- package/src/objects/RoutingTransactionFailureReason.ts +4 -1
- 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/Transaction.ts +8 -3
- package/src/objects/TransactionStatus.ts +8 -2
- package/src/objects/TransactionType.ts +16 -4
- package/src/objects/TransactionUpdate.ts +6 -3
- package/src/objects/UmaInvitation.ts +2 -2
- package/src/objects/Wallet.ts +12 -4
- package/src/objects/WalletStatus.ts +18 -4
- package/src/objects/WalletToPaymentRequestsConnection.ts +3 -2
- package/src/objects/WalletToTransactionsConnection.ts +3 -2
- package/src/objects/WebhookEventType.ts +4 -1
- package/src/objects/Withdrawal.ts +7 -3
- package/src/objects/WithdrawalRequest.ts +10 -5
- package/src/objects/WithdrawalRequestToChannelClosingTransactionsConnection.ts +3 -2
- package/src/objects/WithdrawalRequestToChannelOpeningTransactionsConnection.ts +3 -2
- package/src/objects/index.ts +8 -6
- package/src/tests/integration/general-regtest.test.ts +15 -1
package/src/objects/GraphNode.ts
CHANGED
|
@@ -10,12 +10,17 @@ 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. You can retrieve this object to get publicly
|
|
16
|
+
* available information about any node on the Lightning Network.
|
|
17
|
+
* *
|
|
18
|
+
*/
|
|
14
19
|
class GraphNode implements Node, Entity {
|
|
15
20
|
constructor(
|
|
16
21
|
/**
|
|
17
|
-
* The unique identifier of this entity across all Lightspark systems.
|
|
18
|
-
* string.
|
|
22
|
+
* The unique identifier of this entity across all Lightspark systems.
|
|
23
|
+
* Should be treated as an opaque string.
|
|
19
24
|
**/
|
|
20
25
|
public readonly id: string,
|
|
21
26
|
/** The date and time when the entity was first created. **/
|
|
@@ -25,21 +30,22 @@ class GraphNode implements Node, Entity {
|
|
|
25
30
|
/** The Bitcoin Network this node is deployed in. **/
|
|
26
31
|
public readonly bitcoinNetwork: BitcoinNetwork,
|
|
27
32
|
/**
|
|
28
|
-
* The name of this node in the network. It will be the most human-readable option possible,
|
|
29
|
-
* on the data available for this node.
|
|
33
|
+
* The name of this node in the network. It will be the most human-readable option possible,
|
|
34
|
+
* depending on the data available for this node.
|
|
30
35
|
**/
|
|
31
36
|
public readonly displayName: string,
|
|
32
37
|
/** The typename of the object **/
|
|
33
38
|
public readonly typename: string,
|
|
34
39
|
/**
|
|
35
|
-
* A name that identifies the node. It has no importance in terms of operating the node,
|
|
36
|
-
* way to identify and search for commercial services or popular nodes.
|
|
37
|
-
* any time by the node operator.
|
|
40
|
+
* A name that identifies the node. It has no importance in terms of operating the node,
|
|
41
|
+
* it is just a way to identify and search for commercial services or popular nodes.
|
|
42
|
+
* This alias can be changed at any time by the node operator.
|
|
38
43
|
**/
|
|
39
44
|
public readonly alias?: string | undefined,
|
|
40
45
|
/**
|
|
41
|
-
* A hexadecimal string that describes a color. For example "#000000" is black, "#FFFFFF" is
|
|
42
|
-
* has no importance in terms of operating the node,
|
|
46
|
+
* A hexadecimal string that describes a color. For example "#000000" is black, "#FFFFFF" is
|
|
47
|
+
* white. It has no importance in terms of operating the node,
|
|
48
|
+
* it is just a way to visually differentiate nodes.
|
|
43
49
|
* That color can be changed at any time by the node operator.
|
|
44
50
|
**/
|
|
45
51
|
public readonly color?: string | undefined,
|
|
@@ -49,7 +55,10 @@ class GraphNode implements Node, Entity {
|
|
|
49
55
|
* capital efficient. The value is an integer ranging between 0 and 10 (bounds included).
|
|
50
56
|
**/
|
|
51
57
|
public readonly conductivity?: number | undefined,
|
|
52
|
-
/**
|
|
58
|
+
/**
|
|
59
|
+
* The public key of this node. It acts as a unique identifier of this node in the Lightning
|
|
60
|
+
* Network. *
|
|
61
|
+
*/
|
|
53
62
|
public readonly publicKey?: string | undefined,
|
|
54
63
|
) {
|
|
55
64
|
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 route.
|
|
12
|
+
* You can retrieve this object to get information about a node on a particular payment path and
|
|
13
|
+
* 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
|
|
|
@@ -1,6 +1,9 @@
|
|
|
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 Lightning Network may
|
|
5
|
+
* have failed. *
|
|
6
|
+
*/
|
|
4
7
|
export enum HtlcAttemptFailureCode {
|
|
5
8
|
/**
|
|
6
9
|
* This is an enum value that represents values that could be added in the future.
|
|
@@ -7,17 +7,29 @@ export enum IncentivesIneligibilityReason {
|
|
|
7
7
|
* Clients should support unknown values as more of them could be added without notice.
|
|
8
8
|
*/
|
|
9
9
|
FUTURE_VALUE = "FUTURE_VALUE",
|
|
10
|
-
/**
|
|
10
|
+
/**
|
|
11
|
+
* This invitation is not eligible for incentives because it has been created outside of the
|
|
12
|
+
* incentives flow. *
|
|
13
|
+
*/
|
|
11
14
|
DISABLED = "DISABLED",
|
|
12
15
|
/** This invitation is not eligible for incentives because the sender is not eligible. **/
|
|
13
16
|
SENDER_NOT_ELIGIBLE = "SENDER_NOT_ELIGIBLE",
|
|
14
17
|
/** This invitation is not eligible for incentives because the receiver is not eligible. **/
|
|
15
18
|
RECEIVER_NOT_ELIGIBLE = "RECEIVER_NOT_ELIGIBLE",
|
|
16
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* This invitation is not eligible for incentives because the sending VASP is not part of the
|
|
21
|
+
* incentives program. *
|
|
22
|
+
*/
|
|
17
23
|
SENDING_VASP_NOT_ELIGIBLE = "SENDING_VASP_NOT_ELIGIBLE",
|
|
18
|
-
/**
|
|
24
|
+
/**
|
|
25
|
+
* This invitation is not eligible for incentives because the receiving VASP is not part of the
|
|
26
|
+
* incentives program. *
|
|
27
|
+
*/
|
|
19
28
|
RECEIVING_VASP_NOT_ELIGIBLE = "RECEIVING_VASP_NOT_ELIGIBLE",
|
|
20
|
-
/**
|
|
29
|
+
/**
|
|
30
|
+
* This invitation is not eligible for incentives because the sender and receiver are in the same
|
|
31
|
+
* region. *
|
|
32
|
+
*/
|
|
21
33
|
NOT_CROSS_BORDER = "NOT_CROSS_BORDER",
|
|
22
34
|
}
|
|
23
35
|
|
|
@@ -7,11 +7,18 @@ export enum IncentivesStatus {
|
|
|
7
7
|
* Clients should support unknown values as more of them could be added without notice.
|
|
8
8
|
*/
|
|
9
9
|
FUTURE_VALUE = "FUTURE_VALUE",
|
|
10
|
-
/**
|
|
10
|
+
/**
|
|
11
|
+
* The invitation is eligible for incentives in its current state. When it is claimed, we will
|
|
12
|
+
* reassess. *
|
|
13
|
+
*/
|
|
11
14
|
PENDING = "PENDING",
|
|
12
15
|
/** The incentives have been validated. **/
|
|
13
16
|
VALIDATED = "VALIDATED",
|
|
14
|
-
/**
|
|
17
|
+
/**
|
|
18
|
+
* This invitation is not eligible for incentives.
|
|
19
|
+
* A more detailed reason can be found in the `incentives_ineligibility_reason` field.
|
|
20
|
+
* *
|
|
21
|
+
*/
|
|
15
22
|
INELIGIBLE = "INELIGIBLE",
|
|
16
23
|
}
|
|
17
24
|
|
|
@@ -21,12 +21,16 @@ 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 Lightning Network.
|
|
26
|
+
* You can retrieve this object to receive payment related information about a specific payment
|
|
27
|
+
* received by a Lightspark node. *
|
|
28
|
+
*/
|
|
25
29
|
class IncomingPayment implements LightningTransaction, Transaction, Entity {
|
|
26
30
|
constructor(
|
|
27
31
|
/**
|
|
28
|
-
* The unique identifier of this entity across all Lightspark systems.
|
|
29
|
-
* string.
|
|
32
|
+
* The unique identifier of this entity across all Lightspark systems.
|
|
33
|
+
* Should be treated as an opaque string.
|
|
30
34
|
**/
|
|
31
35
|
public readonly id: string,
|
|
32
36
|
/** The date and time when this transaction was initiated. **/
|
|
@@ -46,8 +50,8 @@ class IncomingPayment implements LightningTransaction, Transaction, Entity {
|
|
|
46
50
|
/** The hash of this transaction, so it can be uniquely identified on the Lightning Network. **/
|
|
47
51
|
public readonly transactionHash?: string | undefined,
|
|
48
52
|
/**
|
|
49
|
-
* The optional payment request for this incoming payment,
|
|
50
|
-
* through keysend.
|
|
53
|
+
* The optional payment request for this incoming payment,
|
|
54
|
+
* which will be null if the payment is sent through keysend.
|
|
51
55
|
**/
|
|
52
56
|
public readonly paymentRequestId?: string | undefined,
|
|
53
57
|
/** The post transaction data which can be used in KYT payment registration. **/
|
|
@@ -8,11 +8,15 @@ 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 the Lightning Network.
|
|
13
|
+
* You can retrieve this object to receive payment related information about a specific incoming
|
|
14
|
+
* payment attempt. *
|
|
15
|
+
*/
|
|
12
16
|
interface IncomingPaymentAttempt {
|
|
13
17
|
/**
|
|
14
|
-
* The unique identifier of this entity across all Lightspark systems.
|
|
15
|
-
* string.
|
|
18
|
+
* The unique identifier of this entity across all Lightspark systems.
|
|
19
|
+
* Should be treated as an opaque string.
|
|
16
20
|
**/
|
|
17
21
|
id: string;
|
|
18
22
|
|
|
@@ -11,8 +11,9 @@ 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 (in the `entities`
|
|
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 (in the `entities`
|
|
16
|
+
* field).
|
|
16
17
|
**/
|
|
17
18
|
count: number;
|
|
18
19
|
|
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 specific invoice.
|
|
15
|
+
* *
|
|
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
|
|
|
@@ -8,8 +8,8 @@ interface LightningFeeEstimateForInvoiceInput {
|
|
|
8
8
|
encodedPaymentRequest: string;
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
* If the invoice does not specify a payment amount, then the amount that you wish to pay,
|
|
12
|
-
* in msats.
|
|
11
|
+
* If the invoice does not specify a payment amount, then the amount that you wish to pay,
|
|
12
|
+
* expressed in msats.
|
|
13
13
|
**/
|
|
14
14
|
amountMsats?: number | undefined;
|
|
15
15
|
}
|
|
@@ -22,11 +22,15 @@ 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 Network.
|
|
27
|
+
* You can retrieve this object to receive information about a specific transaction made over
|
|
28
|
+
* Lightning for a Lightspark node. *
|
|
29
|
+
*/
|
|
26
30
|
interface LightningTransaction {
|
|
27
31
|
/**
|
|
28
|
-
* The unique identifier of this entity across all Lightspark systems.
|
|
29
|
-
* string.
|
|
32
|
+
* The unique identifier of this entity across all Lightspark systems.
|
|
33
|
+
* Should be treated as an opaque string.
|
|
30
34
|
**/
|
|
31
35
|
id: string;
|
|
32
36
|
|
|
@@ -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 current connected
|
|
29
|
+
* account. This object contains information about the node’s configuration, state, and metadata.
|
|
30
|
+
* *
|
|
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,8 @@ interface LightsparkNode {
|
|
|
42
46
|
bitcoinNetwork: BitcoinNetwork;
|
|
43
47
|
|
|
44
48
|
/**
|
|
45
|
-
* The name of this node in the network. It will be the most human-readable option possible,
|
|
46
|
-
* on the data available for this node.
|
|
49
|
+
* The name of this node in the network. It will be the most human-readable option possible,
|
|
50
|
+
* depending on the data available for this node.
|
|
47
51
|
**/
|
|
48
52
|
displayName: string;
|
|
49
53
|
|
|
@@ -60,15 +64,16 @@ interface LightsparkNode {
|
|
|
60
64
|
typename: string;
|
|
61
65
|
|
|
62
66
|
/**
|
|
63
|
-
* A name that identifies the node. It has no importance in terms of operating the node,
|
|
64
|
-
* way to identify and search for commercial services or popular nodes.
|
|
65
|
-
* any time by the node operator.
|
|
67
|
+
* A name that identifies the node. It has no importance in terms of operating the node,
|
|
68
|
+
* it is just a way to identify and search for commercial services or popular nodes.
|
|
69
|
+
* This alias can be changed at any time by the node operator.
|
|
66
70
|
**/
|
|
67
71
|
alias?: string | undefined;
|
|
68
72
|
|
|
69
73
|
/**
|
|
70
|
-
* A hexadecimal string that describes a color. For example "#000000" is black, "#FFFFFF" is
|
|
71
|
-
* has no importance in terms of operating the node,
|
|
74
|
+
* A hexadecimal string that describes a color. For example "#000000" is black, "#FFFFFF" is
|
|
75
|
+
* white. It has no importance in terms of operating the node,
|
|
76
|
+
* it is just a way to visually differentiate nodes.
|
|
72
77
|
* That color can be changed at any time by the node operator.
|
|
73
78
|
**/
|
|
74
79
|
color?: string | undefined;
|
|
@@ -80,14 +85,18 @@ interface LightsparkNode {
|
|
|
80
85
|
**/
|
|
81
86
|
conductivity?: number | undefined;
|
|
82
87
|
|
|
83
|
-
/**
|
|
88
|
+
/**
|
|
89
|
+
* The public key of this node. It acts as a unique identifier of this node in the Lightning
|
|
90
|
+
* Network. *
|
|
91
|
+
*/
|
|
84
92
|
publicKey?: string | undefined;
|
|
85
93
|
|
|
86
94
|
/** The current status of this node. **/
|
|
87
95
|
status?: LightsparkNodeStatus | undefined;
|
|
88
96
|
|
|
89
97
|
/**
|
|
90
|
-
* The sum of the balance on the Bitcoin Network, channel balances, and commit fees on this
|
|
98
|
+
* The sum of the balance on the Bitcoin Network, channel balances, and commit fees on this
|
|
99
|
+
* node.
|
|
91
100
|
*
|
|
92
101
|
* @deprecated Use `balances` instead.
|
|
93
102
|
**/
|
|
@@ -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
|
|
|
@@ -7,8 +7,9 @@ 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 (in the `entities`
|
|
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 (in the `entities`
|
|
12
|
+
* field).
|
|
12
13
|
**/
|
|
13
14
|
count: number;
|
|
14
15
|
|
|
@@ -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,8 +44,8 @@ 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. It will be the most human-readable option possible,
|
|
48
|
-
* on the data available for this node.
|
|
47
|
+
* The name of this node in the network. It will be the most human-readable option possible,
|
|
48
|
+
* depending on the data available for this node.
|
|
49
49
|
**/
|
|
50
50
|
public readonly displayName: string,
|
|
51
51
|
/** The owner of this LightsparkNode. **/
|
|
@@ -58,14 +58,15 @@ class LightsparkNodeWithOSK implements LightsparkNode, Node, Entity {
|
|
|
58
58
|
/** The typename of the object **/
|
|
59
59
|
public readonly typename: string,
|
|
60
60
|
/**
|
|
61
|
-
* A name that identifies the node. It has no importance in terms of operating the node,
|
|
62
|
-
* way to identify and search for commercial services or popular nodes.
|
|
63
|
-
* any time by the node operator.
|
|
61
|
+
* A name that identifies the node. It has no importance in terms of operating the node,
|
|
62
|
+
* it is just a way to identify and search for commercial services or popular nodes.
|
|
63
|
+
* This alias can be changed at any time by the node operator.
|
|
64
64
|
**/
|
|
65
65
|
public readonly alias?: string | undefined,
|
|
66
66
|
/**
|
|
67
|
-
* A hexadecimal string that describes a color. For example "#000000" is black, "#FFFFFF" is
|
|
68
|
-
* has no importance in terms of operating the node,
|
|
67
|
+
* A hexadecimal string that describes a color. For example "#000000" is black, "#FFFFFF" is
|
|
68
|
+
* white. It has no importance in terms of operating the node,
|
|
69
|
+
* it is just a way to visually differentiate nodes.
|
|
69
70
|
* That color can be changed at any time by the node operator.
|
|
70
71
|
**/
|
|
71
72
|
public readonly color?: string | undefined,
|
|
@@ -75,12 +76,16 @@ class LightsparkNodeWithOSK implements LightsparkNode, Node, Entity {
|
|
|
75
76
|
* capital efficient. The value is an integer ranging between 0 and 10 (bounds included).
|
|
76
77
|
**/
|
|
77
78
|
public readonly conductivity?: number | undefined,
|
|
78
|
-
/**
|
|
79
|
+
/**
|
|
80
|
+
* The public key of this node. It acts as a unique identifier of this node in the Lightning
|
|
81
|
+
* Network. *
|
|
82
|
+
*/
|
|
79
83
|
public readonly publicKey?: string | undefined,
|
|
80
84
|
/** The current status of this node. **/
|
|
81
85
|
public readonly status?: LightsparkNodeStatus | undefined,
|
|
82
86
|
/**
|
|
83
|
-
* The sum of the balance on the Bitcoin Network, channel balances, and commit fees on this
|
|
87
|
+
* The sum of the balance on the Bitcoin Network, channel balances, and commit fees on this
|
|
88
|
+
* node.
|
|
84
89
|
*
|
|
85
90
|
* @deprecated Use `balances` instead.
|
|
86
91
|
**/
|
|
@@ -111,7 +116,10 @@ class LightsparkNodeWithOSK implements LightsparkNode, Node, Entity {
|
|
|
111
116
|
public readonly blockchainBalance?: BlockchainBalance | undefined,
|
|
112
117
|
/** The balances that describe the funds in this node. **/
|
|
113
118
|
public readonly balances?: Balances | undefined,
|
|
114
|
-
/**
|
|
119
|
+
/**
|
|
120
|
+
* The private key client is using to sign a GraphQL request which will be verified at server
|
|
121
|
+
* side. *
|
|
122
|
+
*/
|
|
115
123
|
public readonly encryptedSigningPrivateKey?: Secret | undefined,
|
|
116
124
|
) {
|
|
117
125
|
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,8 +42,8 @@ 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. It will be the most human-readable option possible,
|
|
46
|
-
* on the data available for this node.
|
|
45
|
+
* The name of this node in the network. It will be the most human-readable option possible,
|
|
46
|
+
* depending on the data available for this node.
|
|
47
47
|
**/
|
|
48
48
|
public readonly displayName: string,
|
|
49
49
|
/** The owner of this LightsparkNode. **/
|
|
@@ -56,14 +56,15 @@ class LightsparkNodeWithRemoteSigning implements LightsparkNode, Node, Entity {
|
|
|
56
56
|
/** The typename of the object **/
|
|
57
57
|
public readonly typename: string,
|
|
58
58
|
/**
|
|
59
|
-
* A name that identifies the node. It has no importance in terms of operating the node,
|
|
60
|
-
* way to identify and search for commercial services or popular nodes.
|
|
61
|
-
* any time by the node operator.
|
|
59
|
+
* A name that identifies the node. It has no importance in terms of operating the node,
|
|
60
|
+
* it is just a way to identify and search for commercial services or popular nodes.
|
|
61
|
+
* This alias can be changed at any time by the node operator.
|
|
62
62
|
**/
|
|
63
63
|
public readonly alias?: string | undefined,
|
|
64
64
|
/**
|
|
65
|
-
* A hexadecimal string that describes a color. For example "#000000" is black, "#FFFFFF" is
|
|
66
|
-
* has no importance in terms of operating the node,
|
|
65
|
+
* A hexadecimal string that describes a color. For example "#000000" is black, "#FFFFFF" is
|
|
66
|
+
* white. It has no importance in terms of operating the node,
|
|
67
|
+
* it is just a way to visually differentiate nodes.
|
|
67
68
|
* That color can be changed at any time by the node operator.
|
|
68
69
|
**/
|
|
69
70
|
public readonly color?: string | undefined,
|
|
@@ -73,12 +74,16 @@ class LightsparkNodeWithRemoteSigning implements LightsparkNode, Node, Entity {
|
|
|
73
74
|
* capital efficient. The value is an integer ranging between 0 and 10 (bounds included).
|
|
74
75
|
**/
|
|
75
76
|
public readonly conductivity?: number | undefined,
|
|
76
|
-
/**
|
|
77
|
+
/**
|
|
78
|
+
* The public key of this node. It acts as a unique identifier of this node in the Lightning
|
|
79
|
+
* Network. *
|
|
80
|
+
*/
|
|
77
81
|
public readonly publicKey?: string | undefined,
|
|
78
82
|
/** The current status of this node. **/
|
|
79
83
|
public readonly status?: LightsparkNodeStatus | undefined,
|
|
80
84
|
/**
|
|
81
|
-
* The sum of the balance on the Bitcoin Network, channel balances, and commit fees on this
|
|
85
|
+
* The sum of the balance on the Bitcoin Network, channel balances, and commit fees on this
|
|
86
|
+
* node.
|
|
82
87
|
*
|
|
83
88
|
* @deprecated Use `balances` instead.
|
|
84
89
|
**/
|
package/src/objects/Node.ts
CHANGED
|
@@ -20,11 +20,15 @@ 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 Network,
|
|
25
|
+
* and could either be a Lightspark node or a node managed by a third party.
|
|
26
|
+
* *
|
|
27
|
+
*/
|
|
24
28
|
interface Node {
|
|
25
29
|
/**
|
|
26
|
-
* The unique identifier of this entity across all Lightspark systems.
|
|
27
|
-
* string.
|
|
30
|
+
* The unique identifier of this entity across all Lightspark systems.
|
|
31
|
+
* Should be treated as an opaque string.
|
|
28
32
|
**/
|
|
29
33
|
id: string;
|
|
30
34
|
|
|
@@ -38,8 +42,8 @@ interface Node {
|
|
|
38
42
|
bitcoinNetwork: BitcoinNetwork;
|
|
39
43
|
|
|
40
44
|
/**
|
|
41
|
-
* The name of this node in the network. It will be the most human-readable option possible,
|
|
42
|
-
* on the data available for this node.
|
|
45
|
+
* The name of this node in the network. It will be the most human-readable option possible,
|
|
46
|
+
* depending on the data available for this node.
|
|
43
47
|
**/
|
|
44
48
|
displayName: string;
|
|
45
49
|
|
|
@@ -47,15 +51,16 @@ interface Node {
|
|
|
47
51
|
typename: string;
|
|
48
52
|
|
|
49
53
|
/**
|
|
50
|
-
* A name that identifies the node. It has no importance in terms of operating the node,
|
|
51
|
-
* way to identify and search for commercial services or popular nodes.
|
|
52
|
-
* any time by the node operator.
|
|
54
|
+
* A name that identifies the node. It has no importance in terms of operating the node,
|
|
55
|
+
* it is just a way to identify and search for commercial services or popular nodes.
|
|
56
|
+
* This alias can be changed at any time by the node operator.
|
|
53
57
|
**/
|
|
54
58
|
alias?: string | undefined;
|
|
55
59
|
|
|
56
60
|
/**
|
|
57
|
-
* A hexadecimal string that describes a color. For example "#000000" is black, "#FFFFFF" is
|
|
58
|
-
* has no importance in terms of operating the node,
|
|
61
|
+
* A hexadecimal string that describes a color. For example "#000000" is black, "#FFFFFF" is
|
|
62
|
+
* white. It has no importance in terms of operating the node,
|
|
63
|
+
* it is just a way to visually differentiate nodes.
|
|
59
64
|
* That color can be changed at any time by the node operator.
|
|
60
65
|
**/
|
|
61
66
|
color?: string | undefined;
|
|
@@ -67,7 +72,10 @@ interface Node {
|
|
|
67
72
|
**/
|
|
68
73
|
conductivity?: number | undefined;
|
|
69
74
|
|
|
70
|
-
/**
|
|
75
|
+
/**
|
|
76
|
+
* The public key of this node. It acts as a unique identifier of this node in the Lightning
|
|
77
|
+
* Network. *
|
|
78
|
+
*/
|
|
71
79
|
publicKey?: string | undefined;
|
|
72
80
|
|
|
73
81
|
getAddresses(
|
|
@@ -1,6 +1,9 @@
|
|
|
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 Lightning Network can
|
|
5
|
+
* have. *
|
|
6
|
+
*/
|
|
4
7
|
export enum NodeAddressType {
|
|
5
8
|
/**
|
|
6
9
|
* This is an enum value that represents values that could be added in the future.
|
|
@@ -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 Lightning Network.
|
|
8
|
+
* *
|
|
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 (in the `entities`
|
|
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 (in the `entities`
|
|
14
|
+
* field).
|
|
11
15
|
**/
|
|
12
16
|
count: number;
|
|
13
17
|
|
|
@@ -12,11 +12,16 @@ 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 Network.
|
|
17
|
+
* You can retrieve this object to receive information about a specific on-chain transaction made
|
|
18
|
+
* on the Lightning Network associated with your Lightspark Node.
|
|
19
|
+
* *
|
|
20
|
+
*/
|
|
16
21
|
interface OnChainTransaction {
|
|
17
22
|
/**
|
|
18
|
-
* The unique identifier of this entity across all Lightspark systems.
|
|
19
|
-
* string.
|
|
23
|
+
* The unique identifier of this entity across all Lightspark systems.
|
|
24
|
+
* Should be treated as an opaque string.
|
|
20
25
|
**/
|
|
21
26
|
id: string;
|
|
22
27
|
|