@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
|
@@ -11,12 +11,16 @@ import { PageInfoFromJson, PageInfoToJson } from "./PageInfo.js";
|
|
|
11
11
|
/** A connection between an account and the nodes it manages. **/
|
|
12
12
|
interface AccountToNodesConnection {
|
|
13
13
|
/**
|
|
14
|
-
* The total count of objects in this connection, using the current filters.
|
|
15
|
-
* number of objects returned in the current page
|
|
14
|
+
* The total count of objects in this connection, using the current filters.
|
|
15
|
+
* It is different from the number of objects returned in the current page
|
|
16
|
+
* (in the `entities` field).
|
|
16
17
|
**/
|
|
17
18
|
count: number;
|
|
18
19
|
|
|
19
|
-
/**
|
|
20
|
+
/**
|
|
21
|
+
* An object that holds pagination information about the objects in this
|
|
22
|
+
* connection. *
|
|
23
|
+
*/
|
|
20
24
|
pageInfo: PageInfo;
|
|
21
25
|
|
|
22
26
|
/** The nodes for the current page of this connection. **/
|
|
@@ -10,12 +10,16 @@ import {
|
|
|
10
10
|
|
|
11
11
|
interface AccountToPaymentRequestsConnection {
|
|
12
12
|
/**
|
|
13
|
-
* The total count of objects in this connection, using the current filters.
|
|
14
|
-
* number of objects returned in the current page
|
|
13
|
+
* The total count of objects in this connection, using the current filters.
|
|
14
|
+
* It is different from the number of objects returned in the current page
|
|
15
|
+
* (in the `entities` field).
|
|
15
16
|
**/
|
|
16
17
|
count: number;
|
|
17
18
|
|
|
18
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* An object that holds pagination information about the objects in this
|
|
21
|
+
* connection. *
|
|
22
|
+
*/
|
|
19
23
|
pageInfo: PageInfo;
|
|
20
24
|
|
|
21
25
|
/** The payment requests for the current page of this connection. **/
|
|
@@ -12,12 +12,16 @@ import { TransactionFromJson, TransactionToJson } from "./Transaction.js";
|
|
|
12
12
|
|
|
13
13
|
interface AccountToTransactionsConnection {
|
|
14
14
|
/**
|
|
15
|
-
* The total count of objects in this connection, using the current filters.
|
|
16
|
-
* number of objects returned in the current page
|
|
15
|
+
* The total count of objects in this connection, using the current filters.
|
|
16
|
+
* It is different from the number of objects returned in the current page
|
|
17
|
+
* (in the `entities` field).
|
|
17
18
|
**/
|
|
18
19
|
count: number;
|
|
19
20
|
|
|
20
|
-
/**
|
|
21
|
+
/**
|
|
22
|
+
* An object that holds pagination information about the objects in this
|
|
23
|
+
* connection. *
|
|
24
|
+
*/
|
|
21
25
|
pageInfo: PageInfo;
|
|
22
26
|
|
|
23
27
|
/** The transactions for the current page of this connection. **/
|
|
@@ -27,20 +31,20 @@ interface AccountToTransactionsConnection {
|
|
|
27
31
|
typename: string;
|
|
28
32
|
|
|
29
33
|
/**
|
|
30
|
-
* Profit (or loss) generated by the transactions in this connection,
|
|
31
|
-
* constraints provided.
|
|
34
|
+
* Profit (or loss) generated by the transactions in this connection,
|
|
35
|
+
* with the set of filters and constraints provided.
|
|
32
36
|
**/
|
|
33
37
|
profitLoss?: CurrencyAmount | undefined;
|
|
34
38
|
|
|
35
39
|
/**
|
|
36
|
-
* Average fee earned for the transactions in this connection,
|
|
37
|
-
* provided.
|
|
40
|
+
* Average fee earned for the transactions in this connection,
|
|
41
|
+
* with the set of filters and constraints provided.
|
|
38
42
|
**/
|
|
39
43
|
averageFeeEarned?: CurrencyAmount | undefined;
|
|
40
44
|
|
|
41
45
|
/**
|
|
42
|
-
* Total amount transacted by the transactions in this connection,
|
|
43
|
-
* constraints provided.
|
|
46
|
+
* Total amount transacted by the transactions in this connection,
|
|
47
|
+
* with the set of filters and constraints provided.
|
|
44
48
|
**/
|
|
45
49
|
totalAmountTransacted?: CurrencyAmount | undefined;
|
|
46
50
|
}
|
|
@@ -7,12 +7,16 @@ import { WalletFromJson } from "./Wallet.js";
|
|
|
7
7
|
|
|
8
8
|
interface AccountToWalletsConnection {
|
|
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 wallets for the current page of this connection. **/
|
package/src/objects/ApiToken.ts
CHANGED
|
@@ -3,11 +3,16 @@
|
|
|
3
3
|
import { type Query } from "@lightsparkdev/core";
|
|
4
4
|
import Permission from "./Permission.js";
|
|
5
5
|
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* This is an object representing a Lightspark API token,
|
|
8
|
+
* that can be used to authenticate this account when making API calls or using
|
|
9
|
+
* our SDKs. See the “Authentication” section of our API docs for more details
|
|
10
|
+
* on its usage. *
|
|
11
|
+
*/
|
|
7
12
|
interface ApiToken {
|
|
8
13
|
/**
|
|
9
|
-
* The unique identifier of this entity across all Lightspark systems.
|
|
10
|
-
* string.
|
|
14
|
+
* The unique identifier of this entity across all Lightspark systems.
|
|
15
|
+
* Should be treated as an opaque string.
|
|
11
16
|
**/
|
|
12
17
|
id: string;
|
|
13
18
|
|
|
@@ -18,14 +23,15 @@ interface ApiToken {
|
|
|
18
23
|
updatedAt: string;
|
|
19
24
|
|
|
20
25
|
/**
|
|
21
|
-
* An opaque identifier that should be used as a client_id (or username) in
|
|
22
|
-
* Authentication scheme when issuing requests against the
|
|
26
|
+
* An opaque identifier that should be used as a client_id (or username) in
|
|
27
|
+
* the HTTP Basic Authentication scheme when issuing requests against the
|
|
28
|
+
* Lightspark API.
|
|
23
29
|
**/
|
|
24
30
|
clientId: string;
|
|
25
31
|
|
|
26
32
|
/**
|
|
27
|
-
* An arbitrary name chosen by the creator of the token to help identify the
|
|
28
|
-
* tokens that have been created for the account.
|
|
33
|
+
* An arbitrary name chosen by the creator of the token to help identify the
|
|
34
|
+
* token in the list of tokens that have been created for the account.
|
|
29
35
|
**/
|
|
30
36
|
name: string;
|
|
31
37
|
|
package/src/objects/Balances.ts
CHANGED
|
@@ -6,28 +6,38 @@ import {
|
|
|
6
6
|
CurrencyAmountToJson,
|
|
7
7
|
} from "./CurrencyAmount.js";
|
|
8
8
|
|
|
9
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* This is an object representing the balance associated with your Lightspark
|
|
11
|
+
* account. You can retrieve this object to see your balance,
|
|
12
|
+
* which can be broken down into several different categorizations.
|
|
13
|
+
* *
|
|
14
|
+
*/
|
|
10
15
|
interface Balances {
|
|
11
16
|
/**
|
|
12
|
-
* This represents the balance that should be displayed when asked "how much
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
17
|
+
* This represents the balance that should be displayed when asked "how much
|
|
18
|
+
* do I own right now?". It represents the amount currently owned,
|
|
19
|
+
* including things that may not be owned soon (e.g. in-flight outgoing
|
|
20
|
+
* payments, in-flight withdrawals, commit fees, etc.).
|
|
21
|
+
* It really is a snapshot of what is officially owned at this instant.
|
|
16
22
|
**/
|
|
17
23
|
ownedBalance: CurrencyAmount;
|
|
18
24
|
|
|
19
25
|
/**
|
|
20
|
-
* This represents the balance that should be displayed when asked "how much
|
|
21
|
-
*
|
|
22
|
-
*
|
|
26
|
+
* This represents the balance that should be displayed when asked "how much
|
|
27
|
+
* can I send on Lightning right now?".
|
|
28
|
+
* It represents the amount currently available to be sent on the Lightning
|
|
29
|
+
* network. We remove from the balance all the funds that are temporarily
|
|
30
|
+
* locked (e.g. channel reserves).
|
|
23
31
|
**/
|
|
24
32
|
availableToSendBalance: CurrencyAmount;
|
|
25
33
|
|
|
26
34
|
/**
|
|
27
|
-
* This represents the balance that should be displayed when asked "how much
|
|
28
|
-
* the Bitcoin network right now?".
|
|
29
|
-
*
|
|
30
|
-
*
|
|
35
|
+
* This represents the balance that should be displayed when asked "how much
|
|
36
|
+
* money can I withdraw on the Bitcoin network right now?".
|
|
37
|
+
* It represents the amount currently available to withdraw and is usually
|
|
38
|
+
* equal to the `owned_balance` but it does not include in-flight operations
|
|
39
|
+
* (which would likely succeed and therefore likely make your withdrawal
|
|
40
|
+
* fail).
|
|
31
41
|
**/
|
|
32
42
|
availableToWithdrawBalance: CurrencyAmount;
|
|
33
43
|
}
|
|
@@ -3,15 +3,20 @@
|
|
|
3
3
|
/** This is an enum identifying a particular Bitcoin Network. **/
|
|
4
4
|
export enum BitcoinNetwork {
|
|
5
5
|
/**
|
|
6
|
-
* This is an enum value that represents values that could be added in the
|
|
7
|
-
* Clients should support unknown values as more of them could be
|
|
6
|
+
* This is an enum value that represents values that could be added in the
|
|
7
|
+
* future. Clients should support unknown values as more of them could be
|
|
8
|
+
* added without notice.
|
|
8
9
|
*/
|
|
9
10
|
FUTURE_VALUE = "FUTURE_VALUE",
|
|
10
11
|
/** The production version of the Bitcoin Blockchain. **/
|
|
11
12
|
MAINNET = "MAINNET",
|
|
12
13
|
/** A test version of the Bitcoin Blockchain, maintained by Lightspark. **/
|
|
13
14
|
REGTEST = "REGTEST",
|
|
14
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* A test version of the Bitcoin Blockchain, maintained by a centralized
|
|
17
|
+
* organization. Not in use at Lightspark.
|
|
18
|
+
* *
|
|
19
|
+
*/
|
|
15
20
|
SIGNET = "SIGNET",
|
|
16
21
|
/** A test version of the Bitcoin Blockchain, publicly available. **/
|
|
17
22
|
TESTNET = "TESTNET",
|
|
@@ -6,7 +6,10 @@ import {
|
|
|
6
6
|
CurrencyAmountToJson,
|
|
7
7
|
} from "./CurrencyAmount.js";
|
|
8
8
|
|
|
9
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* This is an object representing a detailed breakdown of the balance for a
|
|
11
|
+
* Lightspark Node. *
|
|
12
|
+
*/
|
|
10
13
|
interface BlockchainBalance {
|
|
11
14
|
/** The total wallet balance, including unconfirmed UTXOs. **/
|
|
12
15
|
totalBalance?: CurrencyAmount | undefined;
|
package/src/objects/Channel.ts
CHANGED
|
@@ -16,12 +16,16 @@ import {
|
|
|
16
16
|
import type Entity from "./Entity.js";
|
|
17
17
|
import type TransactionType from "./TransactionType.js";
|
|
18
18
|
|
|
19
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* This is an object representing a channel on the Lightning Network.
|
|
21
|
+
* You can retrieve this object to get detailed information on a specific
|
|
22
|
+
* Lightning Network channel. *
|
|
23
|
+
*/
|
|
20
24
|
class Channel implements Entity {
|
|
21
25
|
constructor(
|
|
22
26
|
/**
|
|
23
|
-
* The unique identifier of this entity across all Lightspark systems.
|
|
24
|
-
* string.
|
|
27
|
+
* The unique identifier of this entity across all Lightspark systems.
|
|
28
|
+
* Should be treated as an opaque string.
|
|
25
29
|
**/
|
|
26
30
|
public readonly id: string,
|
|
27
31
|
/** The date and time when the entity was first created. **/
|
|
@@ -35,38 +39,57 @@ class Channel implements Entity {
|
|
|
35
39
|
/** The transaction that funded the channel upon channel opening. **/
|
|
36
40
|
public readonly fundingTransactionId?: string | undefined,
|
|
37
41
|
/**
|
|
38
|
-
* The total amount of funds in this channel,
|
|
39
|
-
* channel balance on the
|
|
42
|
+
* The total amount of funds in this channel,
|
|
43
|
+
* including the channel balance on the local node,
|
|
44
|
+
* the channel balance on the remote node and the on-chain fees to close
|
|
45
|
+
* the channel.
|
|
40
46
|
**/
|
|
41
47
|
public readonly capacity?: CurrencyAmount | undefined,
|
|
42
48
|
/** The channel balance on the local node. **/
|
|
43
49
|
public readonly localBalance?: CurrencyAmount | undefined,
|
|
44
|
-
/**
|
|
50
|
+
/**
|
|
51
|
+
* The channel balance on the local node that is currently allocated to
|
|
52
|
+
* in-progress payments. *
|
|
53
|
+
*/
|
|
45
54
|
public readonly localUnsettledBalance?: CurrencyAmount | undefined,
|
|
46
55
|
/** The channel balance on the remote node. **/
|
|
47
56
|
public readonly remoteBalance?: CurrencyAmount | undefined,
|
|
48
|
-
/**
|
|
57
|
+
/**
|
|
58
|
+
* The channel balance on the remote node that is currently allocated to
|
|
59
|
+
* in-progress payments. *
|
|
60
|
+
*/
|
|
49
61
|
public readonly remoteUnsettledBalance?: CurrencyAmount | undefined,
|
|
50
|
-
/**
|
|
62
|
+
/**
|
|
63
|
+
* The channel balance that is currently allocated to in-progress payments.
|
|
64
|
+
* *
|
|
65
|
+
*/
|
|
51
66
|
public readonly unsettledBalance?: CurrencyAmount | undefined,
|
|
52
|
-
/**
|
|
67
|
+
/**
|
|
68
|
+
* The total balance in this channel,
|
|
69
|
+
* including the channel balance on both local and remote nodes.
|
|
70
|
+
* *
|
|
71
|
+
*/
|
|
53
72
|
public readonly totalBalance?: CurrencyAmount | undefined,
|
|
54
73
|
/** The current status of this channel. **/
|
|
55
74
|
public readonly status?: ChannelStatus | undefined,
|
|
56
75
|
/**
|
|
57
|
-
* The estimated time to wait for the channel's hash timelock contract to
|
|
58
|
-
* the channel. It is in unit of minutes.
|
|
76
|
+
* The estimated time to wait for the channel's hash timelock contract to
|
|
77
|
+
* expire when force closing the channel. It is in unit of minutes.
|
|
59
78
|
**/
|
|
60
79
|
public readonly estimatedForceClosureWaitMinutes?: number | undefined,
|
|
61
|
-
/**
|
|
80
|
+
/**
|
|
81
|
+
* The amount to be paid in fees for the current set of commitment
|
|
82
|
+
* transactions. *
|
|
83
|
+
*/
|
|
62
84
|
public readonly commitFee?: CurrencyAmount | undefined,
|
|
63
85
|
/** The fees charged for routing payments through this channel. **/
|
|
64
86
|
public readonly fees?: ChannelFees | undefined,
|
|
65
87
|
/** If known, the remote node of the channel. **/
|
|
66
88
|
public readonly remoteNodeId?: string | undefined,
|
|
67
89
|
/**
|
|
68
|
-
* The unique identifier of the channel on Lightning Network,
|
|
69
|
-
* the channel was confirmed.
|
|
90
|
+
* The unique identifier of the channel on Lightning Network,
|
|
91
|
+
* which is the location in the chain that the channel was confirmed.
|
|
92
|
+
* The format is <block-height>:<tx-index>:<tx-output>.
|
|
70
93
|
**/
|
|
71
94
|
public readonly shortChannelId?: string | undefined,
|
|
72
95
|
) {
|
|
@@ -8,11 +8,16 @@ import {
|
|
|
8
8
|
} from "./CurrencyAmount.js";
|
|
9
9
|
import TransactionStatus from "./TransactionStatus.js";
|
|
10
10
|
|
|
11
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* This is an object representing a transaction which closes a channel on the
|
|
13
|
+
* Lightning Network. This operation allocates balances back to the local and
|
|
14
|
+
* remote nodes.
|
|
15
|
+
* *
|
|
16
|
+
*/
|
|
12
17
|
interface ChannelClosingTransaction {
|
|
13
18
|
/**
|
|
14
|
-
* The unique identifier of this entity across all Lightspark systems.
|
|
15
|
-
* string.
|
|
19
|
+
* The unique identifier of this entity across all Lightspark systems.
|
|
20
|
+
* Should be treated as an opaque string.
|
|
16
21
|
**/
|
|
17
22
|
id: string;
|
|
18
23
|
|
|
@@ -29,8 +34,8 @@ interface ChannelClosingTransaction {
|
|
|
29
34
|
amount: CurrencyAmount;
|
|
30
35
|
|
|
31
36
|
/**
|
|
32
|
-
* The height of the block that included this transaction.
|
|
33
|
-
* transactions.
|
|
37
|
+
* The height of the block that included this transaction.
|
|
38
|
+
* This will be zero for unconfirmed transactions.
|
|
34
39
|
**/
|
|
35
40
|
blockHeight: number;
|
|
36
41
|
|
|
@@ -43,22 +48,28 @@ interface ChannelClosingTransaction {
|
|
|
43
48
|
/** The date and time when this transaction was completed or failed. **/
|
|
44
49
|
resolvedAt?: string | undefined;
|
|
45
50
|
|
|
46
|
-
/**
|
|
51
|
+
/**
|
|
52
|
+
* The hash of this transaction, so it can be uniquely identified on the
|
|
53
|
+
* Lightning Network. *
|
|
54
|
+
*/
|
|
47
55
|
transactionHash?: string | undefined;
|
|
48
56
|
|
|
49
57
|
/**
|
|
50
|
-
* The fees that were paid by the wallet sending the transaction to commit it
|
|
51
|
-
* blockchain.
|
|
58
|
+
* The fees that were paid by the wallet sending the transaction to commit it
|
|
59
|
+
* to the Bitcoin blockchain.
|
|
52
60
|
**/
|
|
53
61
|
fees?: CurrencyAmount | undefined;
|
|
54
62
|
|
|
55
63
|
/**
|
|
56
|
-
* The hash of the block that included this transaction.
|
|
57
|
-
* transactions.
|
|
64
|
+
* The hash of the block that included this transaction.
|
|
65
|
+
* This will be null for unconfirmed transactions.
|
|
58
66
|
**/
|
|
59
67
|
blockHash?: string | undefined;
|
|
60
68
|
|
|
61
|
-
/**
|
|
69
|
+
/**
|
|
70
|
+
* The number of blockchain confirmations for this transaction in real time.
|
|
71
|
+
* *
|
|
72
|
+
*/
|
|
62
73
|
numConfirmations?: number | undefined;
|
|
63
74
|
|
|
64
75
|
/** If known, the channel this transaction is closing. **/
|
|
@@ -6,7 +6,10 @@ import {
|
|
|
6
6
|
CurrencyAmountToJson,
|
|
7
7
|
} from "./CurrencyAmount.js";
|
|
8
8
|
|
|
9
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* This represents the fee policies set for a channel on the Lightning Network.
|
|
11
|
+
* *
|
|
12
|
+
*/
|
|
10
13
|
interface ChannelFees {
|
|
11
14
|
baseFee?: CurrencyAmount | undefined;
|
|
12
15
|
|
|
@@ -8,11 +8,16 @@ import {
|
|
|
8
8
|
} from "./CurrencyAmount.js";
|
|
9
9
|
import TransactionStatus from "./TransactionStatus.js";
|
|
10
10
|
|
|
11
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* This is an object representing a transaction which opens a channel on the
|
|
13
|
+
* Lightning Network. This object occurs only for channels funded by the local
|
|
14
|
+
* Lightspark node.
|
|
15
|
+
* *
|
|
16
|
+
*/
|
|
12
17
|
interface ChannelOpeningTransaction {
|
|
13
18
|
/**
|
|
14
|
-
* The unique identifier of this entity across all Lightspark systems.
|
|
15
|
-
* string.
|
|
19
|
+
* The unique identifier of this entity across all Lightspark systems.
|
|
20
|
+
* Should be treated as an opaque string.
|
|
16
21
|
**/
|
|
17
22
|
id: string;
|
|
18
23
|
|
|
@@ -29,8 +34,8 @@ interface ChannelOpeningTransaction {
|
|
|
29
34
|
amount: CurrencyAmount;
|
|
30
35
|
|
|
31
36
|
/**
|
|
32
|
-
* The height of the block that included this transaction.
|
|
33
|
-
* transactions.
|
|
37
|
+
* The height of the block that included this transaction.
|
|
38
|
+
* This will be zero for unconfirmed transactions.
|
|
34
39
|
**/
|
|
35
40
|
blockHeight: number;
|
|
36
41
|
|
|
@@ -43,22 +48,28 @@ interface ChannelOpeningTransaction {
|
|
|
43
48
|
/** The date and time when this transaction was completed or failed. **/
|
|
44
49
|
resolvedAt?: string | undefined;
|
|
45
50
|
|
|
46
|
-
/**
|
|
51
|
+
/**
|
|
52
|
+
* The hash of this transaction, so it can be uniquely identified on the
|
|
53
|
+
* Lightning Network. *
|
|
54
|
+
*/
|
|
47
55
|
transactionHash?: string | undefined;
|
|
48
56
|
|
|
49
57
|
/**
|
|
50
|
-
* The fees that were paid by the wallet sending the transaction to commit it
|
|
51
|
-
* blockchain.
|
|
58
|
+
* The fees that were paid by the wallet sending the transaction to commit it
|
|
59
|
+
* to the Bitcoin blockchain.
|
|
52
60
|
**/
|
|
53
61
|
fees?: CurrencyAmount | undefined;
|
|
54
62
|
|
|
55
63
|
/**
|
|
56
|
-
* The hash of the block that included this transaction.
|
|
57
|
-
* transactions.
|
|
64
|
+
* The hash of the block that included this transaction.
|
|
65
|
+
* This will be null for unconfirmed transactions.
|
|
58
66
|
**/
|
|
59
67
|
blockHash?: string | undefined;
|
|
60
68
|
|
|
61
|
-
/**
|
|
69
|
+
/**
|
|
70
|
+
* The number of blockchain confirmations for this transaction in real time.
|
|
71
|
+
* *
|
|
72
|
+
*/
|
|
62
73
|
numConfirmations?: number | undefined;
|
|
63
74
|
|
|
64
75
|
/** If known, the channel this transaction is opening. **/
|
|
@@ -1,25 +1,50 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* This is an enum representing the status of a channel on the Lightning
|
|
5
|
+
* Network. *
|
|
6
|
+
*/
|
|
4
7
|
export enum ChannelStatus {
|
|
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
|
/** The channel is online and ready to send and receive funds. **/
|
|
11
15
|
OK = "OK",
|
|
12
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* The channel has been created, but the Bitcoin transaction that initiates
|
|
18
|
+
* it still needs to be confirmed on the Bitcoin blockchain.
|
|
19
|
+
* *
|
|
20
|
+
*/
|
|
13
21
|
PENDING = "PENDING",
|
|
14
22
|
/** The channel is not available, likely because the peer is not online. **/
|
|
15
23
|
OFFLINE = "OFFLINE",
|
|
16
|
-
/**
|
|
24
|
+
/**
|
|
25
|
+
* The channel is behaving properly, but its remote balance is much higher
|
|
26
|
+
* than its local balance so it is not balanced properly for sending funds
|
|
27
|
+
* out.
|
|
28
|
+
* *
|
|
29
|
+
*/
|
|
17
30
|
UNBALANCED_FOR_SEND = "UNBALANCED_FOR_SEND",
|
|
18
|
-
/**
|
|
31
|
+
/**
|
|
32
|
+
* The channel is behaving properly, but its remote balance is much lower
|
|
33
|
+
* than its local balance so it is not balanced properly for receiving funds.
|
|
34
|
+
* *
|
|
35
|
+
*/
|
|
19
36
|
UNBALANCED_FOR_RECEIVE = "UNBALANCED_FOR_RECEIVE",
|
|
20
|
-
/**
|
|
37
|
+
/**
|
|
38
|
+
* The channel has been closed. Information about the channel is still
|
|
39
|
+
* available for historical purposes but the channel cannot be used anymore.
|
|
40
|
+
* *
|
|
41
|
+
*/
|
|
21
42
|
CLOSED = "CLOSED",
|
|
22
|
-
/**
|
|
43
|
+
/**
|
|
44
|
+
* Something unexpected happened and we cannot determine the status of this
|
|
45
|
+
* channel. Please try again later or contact the support.
|
|
46
|
+
* *
|
|
47
|
+
*/
|
|
23
48
|
ERROR = "ERROR",
|
|
24
49
|
}
|
|
25
50
|
|
|
@@ -8,26 +8,27 @@ import {
|
|
|
8
8
|
|
|
9
9
|
interface ChannelToTransactionsConnection {
|
|
10
10
|
/**
|
|
11
|
-
* The total count of objects in this connection, using the current filters.
|
|
12
|
-
* number of objects returned in the current page
|
|
11
|
+
* The total count of objects in this connection, using the current filters.
|
|
12
|
+
* It is different from the number of objects returned in the current page
|
|
13
|
+
* (in the `entities` field).
|
|
13
14
|
**/
|
|
14
15
|
count: number;
|
|
15
16
|
|
|
16
17
|
/**
|
|
17
|
-
* The average fee for the transactions that transited through this channel,
|
|
18
|
-
* and constraints of the connection.
|
|
18
|
+
* The average fee for the transactions that transited through this channel,
|
|
19
|
+
* according to the filters and constraints of the connection.
|
|
19
20
|
**/
|
|
20
21
|
averageFee?: CurrencyAmount | undefined;
|
|
21
22
|
|
|
22
23
|
/**
|
|
23
|
-
* The total amount transacted for the transactions that transited through
|
|
24
|
-
* the filters and constraints of the connection.
|
|
24
|
+
* The total amount transacted for the transactions that transited through
|
|
25
|
+
* this channel, according to the filters and constraints of the connection.
|
|
25
26
|
**/
|
|
26
27
|
totalAmountTransacted?: CurrencyAmount | undefined;
|
|
27
28
|
|
|
28
29
|
/**
|
|
29
|
-
* The total amount of fees for the transactions that transited through this
|
|
30
|
-
* filters and constraints of the connection.
|
|
30
|
+
* The total amount of fees for the transactions that transited through this
|
|
31
|
+
* channel, according to the filters and constraints of the connection.
|
|
31
32
|
**/
|
|
32
33
|
totalFees?: CurrencyAmount | undefined;
|
|
33
34
|
}
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
/** This is an enum identifying a type of compliance provider. **/
|
|
4
4
|
export enum ComplianceProvider {
|
|
5
5
|
/**
|
|
6
|
-
* This is an enum value that represents values that could be added in the
|
|
7
|
-
* Clients should support unknown values as more of them could be
|
|
6
|
+
* This is an enum value that represents values that could be added in the
|
|
7
|
+
* future. Clients should support unknown values as more of them could be
|
|
8
|
+
* added without notice.
|
|
8
9
|
*/
|
|
9
10
|
FUTURE_VALUE = "FUTURE_VALUE",
|
|
10
11
|
|
|
@@ -39,12 +39,16 @@ import type WalletToTransactionsConnection from "./WalletToTransactionsConnectio
|
|
|
39
39
|
|
|
40
40
|
interface Connection {
|
|
41
41
|
/**
|
|
42
|
-
* The total count of objects in this connection, using the current filters.
|
|
43
|
-
* number of objects returned in the current page
|
|
42
|
+
* The total count of objects in this connection, using the current filters.
|
|
43
|
+
* It is different from the number of objects returned in the current page
|
|
44
|
+
* (in the `entities` field).
|
|
44
45
|
**/
|
|
45
46
|
count: number;
|
|
46
47
|
|
|
47
|
-
/**
|
|
48
|
+
/**
|
|
49
|
+
* An object that holds pagination information about the objects in this
|
|
50
|
+
* connection. *
|
|
51
|
+
*/
|
|
48
52
|
pageInfo: PageInfo;
|
|
49
53
|
|
|
50
54
|
/** The typename of the object **/
|
|
@@ -3,7 +3,10 @@
|
|
|
3
3
|
import Permission from "./Permission.js";
|
|
4
4
|
|
|
5
5
|
interface CreateApiTokenInput {
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* An arbitrary name that the user can choose to identify the API token in a
|
|
8
|
+
* list. *
|
|
9
|
+
*/
|
|
7
10
|
name: string;
|
|
8
11
|
|
|
9
12
|
/** List of permissions to grant to the API token **/
|
|
@@ -8,9 +8,9 @@ interface CreateApiTokenOutput {
|
|
|
8
8
|
apiToken: ApiToken;
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
* The secret that should be used to authenticate against our API.
|
|
12
|
-
* never be available again after this.
|
|
13
|
-
* account.
|
|
11
|
+
* The secret that should be used to authenticate against our API.
|
|
12
|
+
* This secret is not stored and will never be available again after this.
|
|
13
|
+
* You must keep this secret secure as it grants access to your account.
|
|
14
14
|
**/
|
|
15
15
|
clientSecret: string;
|
|
16
16
|
}
|
|
@@ -8,8 +8,9 @@ interface CreateLnurlInvoiceInput {
|
|
|
8
8
|
amountMsats: number;
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
* The SHA256 hash of the LNURL metadata payload.
|
|
12
|
-
*
|
|
11
|
+
* The SHA256 hash of the LNURL metadata payload.
|
|
12
|
+
* This will be present in the h-tag (SHA256 purpose of payment) of the
|
|
13
|
+
* resulting Bolt 11 invoice.
|
|
13
14
|
**/
|
|
14
15
|
metadataHash: string;
|
|
15
16
|
|