@lightsparkdev/lightspark-sdk 1.2.0 → 1.2.1
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 +11 -0
- package/dist/{chunk-5RDIWPBE.js → chunk-D32EWIPX.js} +3 -1
- package/dist/env.cjs +3 -1
- package/dist/env.d.cts +17 -0
- package/dist/env.js +2 -2
- package/dist/{index-f040db9f.d.ts → index-5acc6526.d.ts} +717 -14
- package/dist/index.cjs +29 -19
- package/dist/index.d.cts +41 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.js +26 -21
- package/dist/objects/index.d.cts +4 -0
- package/dist/objects/index.d.ts +1 -1
- package/dist/objects/index.js +1 -1
- package/dist/{text-encoding-MDIPJAHL.js → text-encoding-26SMKBAQ.js} +3 -1
- package/package.json +4 -4
- package/src/auth/AccountTokenAuthProvider.ts +15 -11
- package/src/client.ts +7 -6
- package/src/helpers.ts +3 -1
- package/src/objects/Account.ts +8 -0
- package/src/objects/AccountToChannelsConnection.ts +5 -0
- package/src/objects/Channel.ts +31 -0
- package/src/objects/GraphNode.ts +28 -0
- package/src/objects/IncomingPayment.ts +17 -0
- package/src/objects/LightsparkNodeWithOSK.ts +61 -0
- package/src/objects/LightsparkNodeWithRemoteSigning.ts +60 -0
- package/src/objects/OutgoingPayment.ts +19 -0
- package/src/objects/OutgoingPaymentAttempt.ts +26 -0
- package/src/objects/Wallet.ts +12 -0
- package/src/objects/WithdrawalRequest.ts +17 -0
- package/src/tests/integration/constants.ts +13 -0
- package/src/tests/integration/general-regtest.test.ts +652 -0
- package/src/tests/serialization.test.ts +5 -2
- package/src/webhooks.ts +1 -1
- package/src/tests/integration/client.test.ts +0 -207
- /package/dist/{chunk-NIMBE7W3.js → chunk-BMTV3EA2.js} +0 -0
package/src/objects/GraphNode.ts
CHANGED
|
@@ -13,15 +13,43 @@ import { NodeToAddressesConnectionFromJson } from "./NodeToAddressesConnection.j
|
|
|
13
13
|
/** This object represents a node that exists on the Lightning Network, including nodes not managed by Lightspark. You can retrieve this object to get publicly available information about any node on the Lightning Network. **/
|
|
14
14
|
class GraphNode implements Node, Entity {
|
|
15
15
|
constructor(
|
|
16
|
+
/**
|
|
17
|
+
* The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque
|
|
18
|
+
* string.
|
|
19
|
+
**/
|
|
16
20
|
public readonly id: string,
|
|
21
|
+
/** The date and time when the entity was first created. **/
|
|
17
22
|
public readonly createdAt: string,
|
|
23
|
+
/** The date and time when the entity was last updated. **/
|
|
18
24
|
public readonly updatedAt: string,
|
|
25
|
+
/** The Bitcoin Network this node is deployed in. **/
|
|
19
26
|
public readonly bitcoinNetwork: BitcoinNetwork,
|
|
27
|
+
/**
|
|
28
|
+
* The name of this node in the network. It will be the most human-readable option possible, depending
|
|
29
|
+
* on the data available for this node.
|
|
30
|
+
**/
|
|
20
31
|
public readonly displayName: string,
|
|
32
|
+
/** The typename of the object **/
|
|
21
33
|
public readonly typename: string,
|
|
34
|
+
/**
|
|
35
|
+
* A name that identifies the node. It has no importance in terms of operating the node, it is just a
|
|
36
|
+
* way to identify and search for commercial services or popular nodes. This alias can be changed at
|
|
37
|
+
* any time by the node operator.
|
|
38
|
+
**/
|
|
22
39
|
public readonly alias?: string | undefined,
|
|
40
|
+
/**
|
|
41
|
+
* A hexadecimal string that describes a color. For example "#000000" is black, "#FFFFFF" is white. It
|
|
42
|
+
* has no importance in terms of operating the node, it is just a way to visually differentiate nodes.
|
|
43
|
+
* That color can be changed at any time by the node operator.
|
|
44
|
+
**/
|
|
23
45
|
public readonly color?: string | undefined,
|
|
46
|
+
/**
|
|
47
|
+
* A summary metric used to capture how well positioned a node is to send, receive, or route
|
|
48
|
+
* transactions efficiently. Maximizing a node's conductivity helps a node’s transactions to be
|
|
49
|
+
* capital efficient. The value is an integer ranging between 0 and 10 (bounds included).
|
|
50
|
+
**/
|
|
24
51
|
public readonly conductivity?: number | undefined,
|
|
52
|
+
/** The public key of this node. It acts as a unique identifier of this node in the Lightning Network. **/
|
|
25
53
|
public readonly publicKey?: string | undefined,
|
|
26
54
|
) {
|
|
27
55
|
autoBind(this);
|
|
@@ -24,16 +24,33 @@ import TransactionStatus from "./TransactionStatus.js";
|
|
|
24
24
|
/** This object represents any payment sent to a Lightspark node on the Lightning Network. You can retrieve this object to receive payment related information about a specific payment received by a Lightspark node. **/
|
|
25
25
|
class IncomingPayment implements LightningTransaction, Transaction, Entity {
|
|
26
26
|
constructor(
|
|
27
|
+
/**
|
|
28
|
+
* The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque
|
|
29
|
+
* string.
|
|
30
|
+
**/
|
|
27
31
|
public readonly id: string,
|
|
32
|
+
/** The date and time when this transaction was initiated. **/
|
|
28
33
|
public readonly createdAt: string,
|
|
34
|
+
/** The date and time when the entity was last updated. **/
|
|
29
35
|
public readonly updatedAt: string,
|
|
36
|
+
/** The current status of this transaction. **/
|
|
30
37
|
public readonly status: TransactionStatus,
|
|
38
|
+
/** The amount of money involved in this transaction. **/
|
|
31
39
|
public readonly amount: CurrencyAmount,
|
|
40
|
+
/** The recipient Lightspark node this payment was sent to. **/
|
|
32
41
|
public readonly destinationId: string,
|
|
42
|
+
/** The typename of the object **/
|
|
33
43
|
public readonly typename: string,
|
|
44
|
+
/** The date and time when this transaction was completed or failed. **/
|
|
34
45
|
public readonly resolvedAt?: string | undefined,
|
|
46
|
+
/** The hash of this transaction, so it can be uniquely identified on the Lightning Network. **/
|
|
35
47
|
public readonly transactionHash?: string | undefined,
|
|
48
|
+
/**
|
|
49
|
+
* The optional payment request for this incoming payment, which will be null if the payment is sent
|
|
50
|
+
* through keysend.
|
|
51
|
+
**/
|
|
36
52
|
public readonly paymentRequestId?: string | undefined,
|
|
53
|
+
/** The post transaction data which can be used in KYT payment registration. **/
|
|
37
54
|
public readonly umaPostTransactionData?: PostTransactionData[] | undefined,
|
|
38
55
|
) {
|
|
39
56
|
autoBind(this);
|
|
@@ -32,25 +32,86 @@ import { SecretFromJson, SecretToJson } from "./Secret.js";
|
|
|
32
32
|
/** This is a Lightspark node with OSK. **/
|
|
33
33
|
class LightsparkNodeWithOSK implements LightsparkNode, Node, Entity {
|
|
34
34
|
constructor(
|
|
35
|
+
/**
|
|
36
|
+
* The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque
|
|
37
|
+
* string.
|
|
38
|
+
**/
|
|
35
39
|
public readonly id: string,
|
|
40
|
+
/** The date and time when the entity was first created. **/
|
|
36
41
|
public readonly createdAt: string,
|
|
42
|
+
/** The date and time when the entity was last updated. **/
|
|
37
43
|
public readonly updatedAt: string,
|
|
44
|
+
/** The Bitcoin Network this node is deployed in. **/
|
|
38
45
|
public readonly bitcoinNetwork: BitcoinNetwork,
|
|
46
|
+
/**
|
|
47
|
+
* The name of this node in the network. It will be the most human-readable option possible, depending
|
|
48
|
+
* on the data available for this node.
|
|
49
|
+
**/
|
|
39
50
|
public readonly displayName: string,
|
|
51
|
+
/** The owner of this LightsparkNode. **/
|
|
40
52
|
public readonly ownerId: string,
|
|
53
|
+
/**
|
|
54
|
+
* The utxos of the channels that are connected to this node. This is used in uma flow for
|
|
55
|
+
* pre-screening.
|
|
56
|
+
**/
|
|
41
57
|
public readonly umaPrescreeningUtxos: string[],
|
|
58
|
+
/** The typename of the object **/
|
|
42
59
|
public readonly typename: string,
|
|
60
|
+
/**
|
|
61
|
+
* A name that identifies the node. It has no importance in terms of operating the node, it is just a
|
|
62
|
+
* way to identify and search for commercial services or popular nodes. This alias can be changed at
|
|
63
|
+
* any time by the node operator.
|
|
64
|
+
**/
|
|
43
65
|
public readonly alias?: string | undefined,
|
|
66
|
+
/**
|
|
67
|
+
* A hexadecimal string that describes a color. For example "#000000" is black, "#FFFFFF" is white. It
|
|
68
|
+
* has no importance in terms of operating the node, it is just a way to visually differentiate nodes.
|
|
69
|
+
* That color can be changed at any time by the node operator.
|
|
70
|
+
**/
|
|
44
71
|
public readonly color?: string | undefined,
|
|
72
|
+
/**
|
|
73
|
+
* A summary metric used to capture how well positioned a node is to send, receive, or route
|
|
74
|
+
* transactions efficiently. Maximizing a node's conductivity helps a node’s transactions to be
|
|
75
|
+
* capital efficient. The value is an integer ranging between 0 and 10 (bounds included).
|
|
76
|
+
**/
|
|
45
77
|
public readonly conductivity?: number | undefined,
|
|
78
|
+
/** The public key of this node. It acts as a unique identifier of this node in the Lightning Network. **/
|
|
46
79
|
public readonly publicKey?: string | undefined,
|
|
80
|
+
/** The current status of this node. **/
|
|
47
81
|
public readonly status?: LightsparkNodeStatus | undefined,
|
|
82
|
+
/**
|
|
83
|
+
* The sum of the balance on the Bitcoin Network, channel balances, and commit fees on this node.
|
|
84
|
+
*
|
|
85
|
+
* @deprecated Use `balances` instead.
|
|
86
|
+
**/
|
|
48
87
|
public readonly totalBalance?: CurrencyAmount | undefined,
|
|
88
|
+
/**
|
|
89
|
+
* The total sum of the channel balances (online and offline) on this node.
|
|
90
|
+
*
|
|
91
|
+
* @deprecated Use `balances` instead.
|
|
92
|
+
**/
|
|
49
93
|
public readonly totalLocalBalance?: CurrencyAmount | undefined,
|
|
94
|
+
/**
|
|
95
|
+
* The sum of the channel balances (online only) that are available to send on this node.
|
|
96
|
+
*
|
|
97
|
+
* @deprecated Use `balances` instead.
|
|
98
|
+
**/
|
|
50
99
|
public readonly localBalance?: CurrencyAmount | undefined,
|
|
100
|
+
/**
|
|
101
|
+
* The sum of the channel balances that are available to receive on this node.
|
|
102
|
+
*
|
|
103
|
+
* @deprecated Use `balances` instead.
|
|
104
|
+
**/
|
|
51
105
|
public readonly remoteBalance?: CurrencyAmount | undefined,
|
|
106
|
+
/**
|
|
107
|
+
* The details of the balance of this node on the Bitcoin Network.
|
|
108
|
+
*
|
|
109
|
+
* @deprecated Use `balances` instead.
|
|
110
|
+
**/
|
|
52
111
|
public readonly blockchainBalance?: BlockchainBalance | undefined,
|
|
112
|
+
/** The balances that describe the funds in this node. **/
|
|
53
113
|
public readonly balances?: Balances | undefined,
|
|
114
|
+
/** The private key client is using to sign a GraphQL request which will be verified at server side. **/
|
|
54
115
|
public readonly encryptedSigningPrivateKey?: Secret | undefined,
|
|
55
116
|
) {
|
|
56
117
|
autoBind(this);
|
|
@@ -30,24 +30,84 @@ import { NodeToAddressesConnectionFromJson } from "./NodeToAddressesConnection.j
|
|
|
30
30
|
/** This is a Lightspark node with remote signing. **/
|
|
31
31
|
class LightsparkNodeWithRemoteSigning implements LightsparkNode, Node, Entity {
|
|
32
32
|
constructor(
|
|
33
|
+
/**
|
|
34
|
+
* The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque
|
|
35
|
+
* string.
|
|
36
|
+
**/
|
|
33
37
|
public readonly id: string,
|
|
38
|
+
/** The date and time when the entity was first created. **/
|
|
34
39
|
public readonly createdAt: string,
|
|
40
|
+
/** The date and time when the entity was last updated. **/
|
|
35
41
|
public readonly updatedAt: string,
|
|
42
|
+
/** The Bitcoin Network this node is deployed in. **/
|
|
36
43
|
public readonly bitcoinNetwork: BitcoinNetwork,
|
|
44
|
+
/**
|
|
45
|
+
* The name of this node in the network. It will be the most human-readable option possible, depending
|
|
46
|
+
* on the data available for this node.
|
|
47
|
+
**/
|
|
37
48
|
public readonly displayName: string,
|
|
49
|
+
/** The owner of this LightsparkNode. **/
|
|
38
50
|
public readonly ownerId: string,
|
|
51
|
+
/**
|
|
52
|
+
* The utxos of the channels that are connected to this node. This is used in uma flow for
|
|
53
|
+
* pre-screening.
|
|
54
|
+
**/
|
|
39
55
|
public readonly umaPrescreeningUtxos: string[],
|
|
56
|
+
/** The typename of the object **/
|
|
40
57
|
public readonly typename: string,
|
|
58
|
+
/**
|
|
59
|
+
* A name that identifies the node. It has no importance in terms of operating the node, it is just a
|
|
60
|
+
* way to identify and search for commercial services or popular nodes. This alias can be changed at
|
|
61
|
+
* any time by the node operator.
|
|
62
|
+
**/
|
|
41
63
|
public readonly alias?: string | undefined,
|
|
64
|
+
/**
|
|
65
|
+
* A hexadecimal string that describes a color. For example "#000000" is black, "#FFFFFF" is white. It
|
|
66
|
+
* has no importance in terms of operating the node, it is just a way to visually differentiate nodes.
|
|
67
|
+
* That color can be changed at any time by the node operator.
|
|
68
|
+
**/
|
|
42
69
|
public readonly color?: string | undefined,
|
|
70
|
+
/**
|
|
71
|
+
* A summary metric used to capture how well positioned a node is to send, receive, or route
|
|
72
|
+
* transactions efficiently. Maximizing a node's conductivity helps a node’s transactions to be
|
|
73
|
+
* capital efficient. The value is an integer ranging between 0 and 10 (bounds included).
|
|
74
|
+
**/
|
|
43
75
|
public readonly conductivity?: number | undefined,
|
|
76
|
+
/** The public key of this node. It acts as a unique identifier of this node in the Lightning Network. **/
|
|
44
77
|
public readonly publicKey?: string | undefined,
|
|
78
|
+
/** The current status of this node. **/
|
|
45
79
|
public readonly status?: LightsparkNodeStatus | undefined,
|
|
80
|
+
/**
|
|
81
|
+
* The sum of the balance on the Bitcoin Network, channel balances, and commit fees on this node.
|
|
82
|
+
*
|
|
83
|
+
* @deprecated Use `balances` instead.
|
|
84
|
+
**/
|
|
46
85
|
public readonly totalBalance?: CurrencyAmount | undefined,
|
|
86
|
+
/**
|
|
87
|
+
* The total sum of the channel balances (online and offline) on this node.
|
|
88
|
+
*
|
|
89
|
+
* @deprecated Use `balances` instead.
|
|
90
|
+
**/
|
|
47
91
|
public readonly totalLocalBalance?: CurrencyAmount | undefined,
|
|
92
|
+
/**
|
|
93
|
+
* The sum of the channel balances (online only) that are available to send on this node.
|
|
94
|
+
*
|
|
95
|
+
* @deprecated Use `balances` instead.
|
|
96
|
+
**/
|
|
48
97
|
public readonly localBalance?: CurrencyAmount | undefined,
|
|
98
|
+
/**
|
|
99
|
+
* The sum of the channel balances that are available to receive on this node.
|
|
100
|
+
*
|
|
101
|
+
* @deprecated Use `balances` instead.
|
|
102
|
+
**/
|
|
49
103
|
public readonly remoteBalance?: CurrencyAmount | undefined,
|
|
104
|
+
/**
|
|
105
|
+
* The details of the balance of this node on the Bitcoin Network.
|
|
106
|
+
*
|
|
107
|
+
* @deprecated Use `balances` instead.
|
|
108
|
+
**/
|
|
50
109
|
public readonly blockchainBalance?: BlockchainBalance | undefined,
|
|
110
|
+
/** The balances that describe the funds in this node. **/
|
|
51
111
|
public readonly balances?: Balances | undefined,
|
|
52
112
|
) {
|
|
53
113
|
autoBind(this);
|
|
@@ -31,21 +31,40 @@ import TransactionStatus from "./TransactionStatus.js";
|
|
|
31
31
|
/** This object represents a Lightning Network payment sent from a Lightspark Node. You can retrieve this object to receive payment related information about any payment sent from your Lightspark Node on the Lightning Network. **/
|
|
32
32
|
class OutgoingPayment implements LightningTransaction, Transaction, Entity {
|
|
33
33
|
constructor(
|
|
34
|
+
/**
|
|
35
|
+
* The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque
|
|
36
|
+
* string.
|
|
37
|
+
**/
|
|
34
38
|
public readonly id: string,
|
|
39
|
+
/** The date and time when this transaction was initiated. **/
|
|
35
40
|
public readonly createdAt: string,
|
|
41
|
+
/** The date and time when the entity was last updated. **/
|
|
36
42
|
public readonly updatedAt: string,
|
|
43
|
+
/** The current status of this transaction. **/
|
|
37
44
|
public readonly status: TransactionStatus,
|
|
45
|
+
/** The amount of money involved in this transaction. **/
|
|
38
46
|
public readonly amount: CurrencyAmount,
|
|
47
|
+
/** The Lightspark node this payment originated from. **/
|
|
39
48
|
public readonly originId: string,
|
|
49
|
+
/** The typename of the object **/
|
|
40
50
|
public readonly typename: string,
|
|
51
|
+
/** The date and time when this transaction was completed or failed. **/
|
|
41
52
|
public readonly resolvedAt?: string | undefined,
|
|
53
|
+
/** The hash of this transaction, so it can be uniquely identified on the Lightning Network. **/
|
|
42
54
|
public readonly transactionHash?: string | undefined,
|
|
55
|
+
/** If known, the final recipient node this payment was sent to. **/
|
|
43
56
|
public readonly destinationId?: string | undefined,
|
|
57
|
+
/** The fees paid by the sender node to send the payment. **/
|
|
44
58
|
public readonly fees?: CurrencyAmount | undefined,
|
|
59
|
+
/** The data of the payment request that was paid by this transaction, if known. **/
|
|
45
60
|
public readonly paymentRequestData?: PaymentRequestData | undefined,
|
|
61
|
+
/** If applicable, the reason why the payment failed. **/
|
|
46
62
|
public readonly failureReason?: PaymentFailureReason | undefined,
|
|
63
|
+
/** If applicable, user-facing error message describing why the payment failed. **/
|
|
47
64
|
public readonly failureMessage?: RichText | undefined,
|
|
65
|
+
/** The post transaction data which can be used in KYT payment registration. **/
|
|
48
66
|
public readonly umaPostTransactionData?: PostTransactionData[] | undefined,
|
|
67
|
+
/** The preimage of the payment. **/
|
|
49
68
|
public readonly paymentPreimage?: string | undefined,
|
|
50
69
|
) {
|
|
51
70
|
autoBind(this);
|
|
@@ -22,17 +22,43 @@ import { OutgoingPaymentAttemptToHopsConnectionFromJson } from "./OutgoingPaymen
|
|
|
22
22
|
/** This object represents an attempted Lightning Network payment sent from a Lightspark Node. You can retrieve this object to receive payment related information about any payment attempt sent from your Lightspark Node on the Lightning Network, including any potential reasons the payment may have failed. **/
|
|
23
23
|
class OutgoingPaymentAttempt implements Entity {
|
|
24
24
|
constructor(
|
|
25
|
+
/**
|
|
26
|
+
* The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque
|
|
27
|
+
* string.
|
|
28
|
+
**/
|
|
25
29
|
public readonly id: string,
|
|
30
|
+
/** The date and time when the attempt was initiated. **/
|
|
26
31
|
public readonly createdAt: string,
|
|
32
|
+
/** The date and time when the entity was last updated. **/
|
|
27
33
|
public readonly updatedAt: string,
|
|
34
|
+
/** The status of an outgoing payment attempt. **/
|
|
28
35
|
public readonly status: OutgoingPaymentAttemptStatus,
|
|
36
|
+
/** The outgoing payment for this attempt. **/
|
|
29
37
|
public readonly outgoingPaymentId: string,
|
|
38
|
+
/** The typename of the object **/
|
|
30
39
|
public readonly typename: string,
|
|
40
|
+
/** If the payment attempt failed, then this contains the Bolt #4 failure code. **/
|
|
31
41
|
public readonly failureCode?: HtlcAttemptFailureCode | undefined,
|
|
42
|
+
/**
|
|
43
|
+
* If the payment attempt failed, then this contains the index of the hop at which the problem
|
|
44
|
+
* occurred.
|
|
45
|
+
**/
|
|
32
46
|
public readonly failureSourceIndex?: number | undefined,
|
|
47
|
+
/** The time the outgoing payment attempt failed or succeeded. **/
|
|
33
48
|
public readonly resolvedAt?: string | undefined,
|
|
49
|
+
/**
|
|
50
|
+
* The total amount of funds required to complete a payment over this route. This value includes the
|
|
51
|
+
* cumulative fees for each hop. As a result, the attempt extended to the first-hop in the route will
|
|
52
|
+
* need to have at least this much value, otherwise the route will fail at an intermediate node due to
|
|
53
|
+
* an insufficient amount.
|
|
54
|
+
**/
|
|
34
55
|
public readonly amount?: CurrencyAmount | undefined,
|
|
56
|
+
/**
|
|
57
|
+
* The sum of the fees paid at each hop within the route of this attempt. In the case of a one-hop
|
|
58
|
+
* payment, this value will be zero as we don't need to pay a fee to ourselves.
|
|
59
|
+
**/
|
|
35
60
|
public readonly fees?: CurrencyAmount | undefined,
|
|
61
|
+
/** The channel snapshot at the time the outgoing payment attempt was made. **/
|
|
36
62
|
public readonly channelSnapshot?: ChannelSnapshot | undefined,
|
|
37
63
|
) {
|
|
38
64
|
autoBind(this);
|
package/src/objects/Wallet.ts
CHANGED
|
@@ -20,14 +20,26 @@ import { WalletToTransactionsConnectionFromJson } from "./WalletToTransactionsCo
|
|
|
20
20
|
/** This object represents a Lightspark Wallet, tied to your Lightspark account. Wallets can be used to send or receive funds over the Lightning Network. You can retrieve this object to receive information about a specific wallet tied to your Lightspark account. **/
|
|
21
21
|
class Wallet implements LightsparkNodeOwner, Entity {
|
|
22
22
|
constructor(
|
|
23
|
+
/**
|
|
24
|
+
* The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque
|
|
25
|
+
* string.
|
|
26
|
+
**/
|
|
23
27
|
public readonly id: string,
|
|
28
|
+
/** The date and time when the entity was first created. **/
|
|
24
29
|
public readonly createdAt: string,
|
|
30
|
+
/** The date and time when the entity was last updated. **/
|
|
25
31
|
public readonly updatedAt: string,
|
|
32
|
+
/** The unique identifier of this wallet, as provided by the Lightspark Customer during login. **/
|
|
26
33
|
public readonly thirdPartyIdentifier: string,
|
|
34
|
+
/** The status of this wallet. **/
|
|
27
35
|
public readonly status: WalletStatus,
|
|
36
|
+
/** The typename of the object **/
|
|
28
37
|
public readonly typename: string,
|
|
38
|
+
/** The date and time when the wallet user last logged in. **/
|
|
29
39
|
public readonly lastLoginAt?: string | undefined,
|
|
40
|
+
/** The balances that describe the funds in this wallet. **/
|
|
30
41
|
public readonly balances?: Balances | undefined,
|
|
42
|
+
/** The account this wallet belongs to. **/
|
|
31
43
|
public readonly accountId?: string | undefined,
|
|
32
44
|
) {
|
|
33
45
|
autoBind(this);
|
|
@@ -19,16 +19,33 @@ import { WithdrawalRequestToChannelOpeningTransactionsConnectionFromJson } from
|
|
|
19
19
|
/** This object represents a request made for an L1 withdrawal from your Lightspark Node to any Bitcoin wallet. You can retrieve this object to receive detailed information about any withdrawal request made from your Lightspark account. **/
|
|
20
20
|
class WithdrawalRequest implements Entity {
|
|
21
21
|
constructor(
|
|
22
|
+
/**
|
|
23
|
+
* The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque
|
|
24
|
+
* string.
|
|
25
|
+
**/
|
|
22
26
|
public readonly id: string,
|
|
27
|
+
/** The date and time when the entity was first created. **/
|
|
23
28
|
public readonly createdAt: string,
|
|
29
|
+
/** The date and time when the entity was last updated. **/
|
|
24
30
|
public readonly updatedAt: string,
|
|
31
|
+
/** The amount of money that should be withdrawn in this request. **/
|
|
25
32
|
public readonly amount: CurrencyAmount,
|
|
33
|
+
/** The bitcoin address where the funds should be sent. **/
|
|
26
34
|
public readonly bitcoinAddress: string,
|
|
35
|
+
/** The strategy that should be used to withdraw the funds from the account. **/
|
|
27
36
|
public readonly withdrawalMode: WithdrawalMode,
|
|
37
|
+
/** The current status of this withdrawal request. **/
|
|
28
38
|
public readonly status: WithdrawalRequestStatus,
|
|
39
|
+
/** The typename of the object **/
|
|
29
40
|
public readonly typename: string,
|
|
41
|
+
/**
|
|
42
|
+
* If the requested amount is `-1` (i.e. everything), this field may contain an estimate of the amount
|
|
43
|
+
* for the withdrawal.
|
|
44
|
+
**/
|
|
30
45
|
public readonly estimatedAmount?: CurrencyAmount | undefined,
|
|
46
|
+
/** The time at which this request was completed. **/
|
|
31
47
|
public readonly completedAt?: string | undefined,
|
|
48
|
+
/** The withdrawal transaction that has been generated by this request. **/
|
|
32
49
|
public readonly withdrawalId?: string | undefined,
|
|
33
50
|
) {
|
|
34
51
|
autoBind(this);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export const TESTS_TIMEOUT = 60_000; //ms
|
|
2
|
+
export const LONG_TEST_TIMEOUT = 600_0000; //ms
|
|
3
|
+
export const DAY_IN_MS = 86400000; //ms
|
|
4
|
+
export const INVOICE_EXPIRY = 172800; //ms
|
|
5
|
+
export const TRANSACTION_WAIT_TIME = TESTS_TIMEOUT / 1000; //seconds
|
|
6
|
+
export const PAGINATION_STEP = 3;
|
|
7
|
+
|
|
8
|
+
export const PAY_AMOUNT = 1_000; //msats
|
|
9
|
+
export const MAX_FEE = 10000000; //msats
|
|
10
|
+
|
|
11
|
+
export const REGTEST_SIGNING_KEY_PASSWORD = "1234!@#$";
|
|
12
|
+
export const ENCODED_REGTEST_REQUEST_FOR_TESTS =
|
|
13
|
+
"lnbcrt1pjj6zu2pp50qr2p79v65u9l8w3859259yj9fe5nt79hfw5k2am424440tlj09qdq0dp5jqargv4ex2ggcqzpgxqyz5vqsp5v0z0fu99jf37xcasu88evuphx9kdrpvtupdvhu329kx7k7un59zs9qyyssqegzx986rszy96te2kmxl7prlz0p8avthpwzhsz5v220uek7xxrz54svdsjpzwn04m6utj5ua9tmtktygc5xmjmjaqey9dadt33r8gxspvcg8wv";
|