@lightsparkdev/lightspark-sdk 0.1.6
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/.fossa.yml +6 -0
- package/.prettierrc +1 -0
- package/.turbo/turbo-build.log +19 -0
- package/.turbo/turbo-lint.log +3 -0
- package/CHANGELOG.md +49 -0
- package/LICENSE +201 -0
- package/README.md +137 -0
- package/dist/Withdrawal-17e1c8af.d.ts +1672 -0
- package/dist/Withdrawal-27a4d10d.d.ts +1672 -0
- package/dist/chunk-3VRI7CHE.js +5508 -0
- package/dist/chunk-AGEUDR2V.js +4498 -0
- package/dist/chunk-N27QHRE4.js +5508 -0
- package/dist/client-3bba3f64.d.ts +1302 -0
- package/dist/index.cjs +6633 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +1177 -0
- package/dist/objects/index.cjs +5347 -0
- package/dist/objects/index.d.ts +3 -0
- package/dist/objects/index.js +88 -0
- package/examples/node-scripts/authHelpers.ts +20 -0
- package/examples/node-scripts/createInvoice.ts +64 -0
- package/examples/node-scripts/example.ts +288 -0
- package/examples/node-scripts/getAccountDashboard.ts +24 -0
- package/examples/node-scripts/getNodeChannels.ts +34 -0
- package/examples/node-scripts/internalAuthHelpers.ts +26 -0
- package/examples/node-scripts/internal_example.ts +296 -0
- package/examples/node-scripts/package-lock.json +887 -0
- package/examples/node-scripts/package.json +22 -0
- package/examples/node-scripts/prettyPrintJsonForDocs.ts +62 -0
- package/examples/node-scripts/tsconfig.json +27 -0
- package/examples/oauth-example/README.md +19 -0
- package/examples/oauth-example/package-lock.json +16071 -0
- package/examples/oauth-example/package.json +50 -0
- package/examples/oauth-example/public/favicon.ico +0 -0
- package/examples/oauth-example/public/index.html +43 -0
- package/examples/oauth-example/public/logo192.png +0 -0
- package/examples/oauth-example/public/logo512.png +0 -0
- package/examples/oauth-example/public/manifest.json +25 -0
- package/examples/oauth-example/public/robots.txt +3 -0
- package/examples/oauth-example/src/App.css +7 -0
- package/examples/oauth-example/src/App.test.tsx +12 -0
- package/examples/oauth-example/src/App.tsx +16 -0
- package/examples/oauth-example/src/auth/AuthContext.ts +8 -0
- package/examples/oauth-example/src/auth/AuthProvider.tsx +44 -0
- package/examples/oauth-example/src/auth/RequireAuth.tsx +19 -0
- package/examples/oauth-example/src/auth/oauthProvider.ts +35 -0
- package/examples/oauth-example/src/components/Button.tsx +39 -0
- package/examples/oauth-example/src/components/CurrencyAmount.tsx +117 -0
- package/examples/oauth-example/src/components/Dashboard.tsx +158 -0
- package/examples/oauth-example/src/components/Table.tsx +22 -0
- package/examples/oauth-example/src/hooks/useAccountInfo.tsx +31 -0
- package/examples/oauth-example/src/icons/BitcoinB.tsx +20 -0
- package/examples/oauth-example/src/icons/Icon.tsx +121 -0
- package/examples/oauth-example/src/icons/Satoshi.tsx +28 -0
- package/examples/oauth-example/src/index.css +13 -0
- package/examples/oauth-example/src/index.tsx +23 -0
- package/examples/oauth-example/src/lightsparkclient/LightsparkClientContext.ts +10 -0
- package/examples/oauth-example/src/lightsparkclient/LightsparkClientProvider.tsx +53 -0
- package/examples/oauth-example/src/logo.svg +1 -0
- package/examples/oauth-example/src/pages/DashboardPage.tsx +71 -0
- package/examples/oauth-example/src/pages/LoginPage.tsx +63 -0
- package/examples/oauth-example/src/react-app-env.d.ts +1 -0
- package/examples/oauth-example/src/reportWebVitals.ts +15 -0
- package/examples/oauth-example/src/routes/index.tsx +15 -0
- package/examples/oauth-example/src/setupTests.ts +5 -0
- package/examples/oauth-example/src/utils/currency.ts +483 -0
- package/examples/oauth-example/tsconfig.json +20 -0
- package/examples/streaming-wallet-extension/.fossa.yml +6 -0
- package/examples/streaming-wallet-extension/README.md +17 -0
- package/examples/streaming-wallet-extension/craco.config.js +58 -0
- package/examples/streaming-wallet-extension/package-lock.json +18260 -0
- package/examples/streaming-wallet-extension/package.json +77 -0
- package/examples/streaming-wallet-extension/public/index.html +24 -0
- package/examples/streaming-wallet-extension/public/lightspark_full.png +0 -0
- package/examples/streaming-wallet-extension/public/lightspark_icon_circle.png +0 -0
- package/examples/streaming-wallet-extension/public/manifest.json +43 -0
- package/examples/streaming-wallet-extension/public/robots.txt +3 -0
- package/examples/streaming-wallet-extension/src/App.css +53 -0
- package/examples/streaming-wallet-extension/src/App.tsx +425 -0
- package/examples/streaming-wallet-extension/src/auth/AccountStorage.ts +28 -0
- package/examples/streaming-wallet-extension/src/auth/DemoAccountProvider.ts +99 -0
- package/examples/streaming-wallet-extension/src/auth/StreamingDemoCredentials.ts +10 -0
- package/examples/streaming-wallet-extension/src/background/PaymentStrategy.ts +36 -0
- package/examples/streaming-wallet-extension/src/background/PlaybackRange.ts +31 -0
- package/examples/streaming-wallet-extension/src/background/StreamingInvoiceHolder.ts +33 -0
- package/examples/streaming-wallet-extension/src/background/TransactionObserver.ts +66 -0
- package/examples/streaming-wallet-extension/src/background/VideoPlaybackRanges.ts +38 -0
- package/examples/streaming-wallet-extension/src/background/VideoProgressCache.ts +87 -0
- package/examples/streaming-wallet-extension/src/background/background.ts +145 -0
- package/examples/streaming-wallet-extension/src/background/messageHandling.ts +185 -0
- package/examples/streaming-wallet-extension/src/common/datetimes.ts +28 -0
- package/examples/streaming-wallet-extension/src/common/settings.ts +12 -0
- package/examples/streaming-wallet-extension/src/common/storage.ts +8 -0
- package/examples/streaming-wallet-extension/src/common/streamingTabs.ts +27 -0
- package/examples/streaming-wallet-extension/src/common/types.tsx +23 -0
- package/examples/streaming-wallet-extension/src/components/CirclePlusIcon.tsx +19 -0
- package/examples/streaming-wallet-extension/src/components/CurrencyAmount.tsx +110 -0
- package/examples/streaming-wallet-extension/src/components/CurrencyAmountRaw.tsx +195 -0
- package/examples/streaming-wallet-extension/src/components/LeftArrow.tsx +21 -0
- package/examples/streaming-wallet-extension/src/components/Loading.tsx +151 -0
- package/examples/streaming-wallet-extension/src/components/StreamingTransactionChip.tsx +95 -0
- package/examples/streaming-wallet-extension/src/components/TransactionRow.tsx +93 -0
- package/examples/streaming-wallet-extension/src/contentscript/content.ts +123 -0
- package/examples/streaming-wallet-extension/src/contentscript/lightsparkDemoDom.tsx +113 -0
- package/examples/streaming-wallet-extension/src/contentscript/videoElementParsers.ts +92 -0
- package/examples/streaming-wallet-extension/src/index.css +16 -0
- package/examples/streaming-wallet-extension/src/index.tsx +11 -0
- package/examples/streaming-wallet-extension/src/lightsparkClientProvider.tsx +26 -0
- package/examples/streaming-wallet-extension/src/react-app-env.d.ts +1 -0
- package/examples/streaming-wallet-extension/src/types/Messages.ts +17 -0
- package/examples/streaming-wallet-extension/tsconfig.json +20 -0
- package/package.json +87 -0
- package/src/auth/AccountTokenAuthProvider.ts +37 -0
- package/src/auth/index.ts +3 -0
- package/src/client.ts +759 -0
- package/src/graphql/BitcoinFeeEstimate.ts +13 -0
- package/src/graphql/CreateApiToken.ts +22 -0
- package/src/graphql/CreateInvoice.ts +18 -0
- package/src/graphql/CreateNodeWalletAddress.ts +13 -0
- package/src/graphql/CurrentAccount.ts +13 -0
- package/src/graphql/DecodeInvoice.ts +16 -0
- package/src/graphql/DeleteApiToken.ts +13 -0
- package/src/graphql/FundNode.ts +18 -0
- package/src/graphql/LightningFeeEstimateForInvoice.ts +21 -0
- package/src/graphql/LightningFeeEstimateForNode.ts +21 -0
- package/src/graphql/MultiNodeDashboard.ts +118 -0
- package/src/graphql/PayInvoice.ts +29 -0
- package/src/graphql/RecoverNodeSigningKey.ts +15 -0
- package/src/graphql/RequestWithdrawal.ts +25 -0
- package/src/graphql/SendPayment.ts +29 -0
- package/src/graphql/SingleNodeDashboard.ts +116 -0
- package/src/graphql/TransactionSubscription.ts +16 -0
- package/src/graphql/TransactionsForNode.ts +42 -0
- package/src/index.ts +5 -0
- package/src/objects/Account.ts +1222 -0
- package/src/objects/AccountToApiTokensConnection.ts +50 -0
- package/src/objects/AccountToChannelsConnection.ts +35 -0
- package/src/objects/AccountToNodesConnection.ts +62 -0
- package/src/objects/AccountToPaymentRequestsConnection.ts +50 -0
- package/src/objects/AccountToTransactionsConnection.ts +112 -0
- package/src/objects/ApiToken.ts +80 -0
- package/src/objects/BitcoinNetwork.ts +19 -0
- package/src/objects/BlockchainBalance.ts +102 -0
- package/src/objects/Channel.ts +283 -0
- package/src/objects/ChannelClosingTransaction.ts +150 -0
- package/src/objects/ChannelFees.ts +34 -0
- package/src/objects/ChannelOpeningTransaction.ts +150 -0
- package/src/objects/ChannelStatus.ts +25 -0
- package/src/objects/ChannelToTransactionsConnection.ts +86 -0
- package/src/objects/CreateApiTokenInput.ts +22 -0
- package/src/objects/CreateApiTokenOutput.ts +41 -0
- package/src/objects/CreateInvoiceInput.ts +27 -0
- package/src/objects/CreateInvoiceOutput.ts +21 -0
- package/src/objects/CreateNodeWalletAddressInput.ts +15 -0
- package/src/objects/CreateNodeWalletAddressOutput.ts +27 -0
- package/src/objects/CurrencyAmount.ts +55 -0
- package/src/objects/CurrencyUnit.ts +25 -0
- package/src/objects/DeleteApiTokenInput.ts +13 -0
- package/src/objects/DeleteApiTokenOutput.ts +23 -0
- package/src/objects/Deposit.ts +144 -0
- package/src/objects/Entity.ts +868 -0
- package/src/objects/FeeEstimate.ts +39 -0
- package/src/objects/FundNodeInput.ts +16 -0
- package/src/objects/FundNodeOutput.ts +28 -0
- package/src/objects/GraphNode.ts +110 -0
- package/src/objects/Hop.ts +108 -0
- package/src/objects/HtlcAttemptFailureCode.ts +65 -0
- package/src/objects/IncomingPayment.ts +141 -0
- package/src/objects/IncomingPaymentAttempt.ts +96 -0
- package/src/objects/IncomingPaymentAttemptStatus.ts +20 -0
- package/src/objects/IncomingPaymentToAttemptsConnection.ts +39 -0
- package/src/objects/Invoice.ts +226 -0
- package/src/objects/InvoiceData.ts +185 -0
- package/src/objects/InvoiceType.ts +15 -0
- package/src/objects/LightningFeeEstimateForInvoiceInput.ts +28 -0
- package/src/objects/LightningFeeEstimateForNodeInput.ts +25 -0
- package/src/objects/LightningFeeEstimateOutput.ts +33 -0
- package/src/objects/LightningTransaction.ts +393 -0
- package/src/objects/LightsparkNode.ts +377 -0
- package/src/objects/LightsparkNodePurpose.ts +17 -0
- package/src/objects/LightsparkNodeStatus.ts +29 -0
- package/src/objects/LightsparkNodeToChannelsConnection.ts +50 -0
- package/src/objects/Node.ts +273 -0
- package/src/objects/NodeAddress.ts +29 -0
- package/src/objects/NodeAddressType.ts +18 -0
- package/src/objects/NodeToAddressesConnection.ts +39 -0
- package/src/objects/OnChainTransaction.ts +318 -0
- package/src/objects/OutgoingPayment.ts +319 -0
- package/src/objects/OutgoingPaymentAttempt.ts +164 -0
- package/src/objects/OutgoingPaymentAttemptStatus.ts +18 -0
- package/src/objects/OutgoingPaymentAttemptToHopsConnection.ts +37 -0
- package/src/objects/OutgoingPaymentToAttemptsConnection.ts +39 -0
- package/src/objects/PageInfo.ts +31 -0
- package/src/objects/PayInvoiceInput.ts +33 -0
- package/src/objects/PayInvoiceOutput.ts +22 -0
- package/src/objects/PaymentFailureReason.ts +29 -0
- package/src/objects/PaymentRequest.ts +231 -0
- package/src/objects/PaymentRequestData.ts +183 -0
- package/src/objects/PaymentRequestStatus.ts +15 -0
- package/src/objects/Permission.ts +39 -0
- package/src/objects/RequestWithdrawalInput.ts +35 -0
- package/src/objects/RequestWithdrawalOutput.ts +24 -0
- package/src/objects/RichText.ts +19 -0
- package/src/objects/RoutingTransaction.ts +150 -0
- package/src/objects/RoutingTransactionFailureReason.ts +17 -0
- package/src/objects/Secret.ts +23 -0
- package/src/objects/SendPaymentInput.ts +30 -0
- package/src/objects/SendPaymentOutput.ts +22 -0
- package/src/objects/Transaction.ts +609 -0
- package/src/objects/TransactionFailures.ts +23 -0
- package/src/objects/TransactionStatus.ts +23 -0
- package/src/objects/TransactionType.ts +31 -0
- package/src/objects/TransactionUpdate.ts +67 -0
- package/src/objects/WalletDashboard.ts +32 -0
- package/src/objects/WebhookEventType.ts +15 -0
- package/src/objects/Withdrawal.ts +144 -0
- package/src/objects/WithdrawalMode.ts +15 -0
- package/src/objects/WithdrawalRequest.ts +224 -0
- package/src/objects/WithdrawalRequestStatus.ts +17 -0
- package/src/objects/WithdrawalRequestToChannelClosingTransactionsConnection.ts +57 -0
- package/src/objects/WithdrawalRequestToChannelOpeningTransactionsConnection.ts +57 -0
- package/src/objects/index.ts +108 -0
- package/tsconfig.json +5 -0
|
@@ -0,0 +1,1672 @@
|
|
|
1
|
+
import { Maybe, Query, AuthProvider, NodeKeyCache } from '@lightsparkdev/core';
|
|
2
|
+
import Observable from 'zen-observable';
|
|
3
|
+
|
|
4
|
+
declare enum CurrencyUnit {
|
|
5
|
+
/**
|
|
6
|
+
* This is an enum value that represents values that could be added in the future.
|
|
7
|
+
* Clients should support unknown values as more of them could be added without notice.
|
|
8
|
+
*/
|
|
9
|
+
FUTURE_VALUE = "FUTURE_VALUE",
|
|
10
|
+
/** Bitcoin is the cryptocurrency native to the Bitcoin network. It is used as the native medium for value transfer for the Lightning Network. **/
|
|
11
|
+
BITCOIN = "BITCOIN",
|
|
12
|
+
/** 0.00000001 (10e-8) Bitcoin or one hundred millionth of a Bitcoin. This is the unit most commonly used in Lightning transactions. **/
|
|
13
|
+
SATOSHI = "SATOSHI",
|
|
14
|
+
/** 0.001 Satoshi, or 10e-11 Bitcoin. We recommend using the Satoshi unit instead when possible. **/
|
|
15
|
+
MILLISATOSHI = "MILLISATOSHI",
|
|
16
|
+
/** United States Dollar. **/
|
|
17
|
+
USD = "USD",
|
|
18
|
+
/** 0.000000001 (10e-9) Bitcoin or a billionth of a Bitcoin. We recommend using the Satoshi unit instead when possible. **/
|
|
19
|
+
NANOBITCOIN = "NANOBITCOIN",
|
|
20
|
+
/** 0.000001 (10e-6) Bitcoin or a millionth of a Bitcoin. We recommend using the Satoshi unit instead when possible. **/
|
|
21
|
+
MICROBITCOIN = "MICROBITCOIN",
|
|
22
|
+
/** 0.001 (10e-3) Bitcoin or a thousandth of a Bitcoin. We recommend using the Satoshi unit instead when possible. **/
|
|
23
|
+
MILLIBITCOIN = "MILLIBITCOIN"
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** Represents the value and unit for an amount of currency. **/
|
|
27
|
+
type CurrencyAmount = {
|
|
28
|
+
/** The original numeric value for this CurrencyAmount. **/
|
|
29
|
+
originalValue: number;
|
|
30
|
+
/** The original unit of currency for this CurrencyAmount. **/
|
|
31
|
+
originalUnit: CurrencyUnit;
|
|
32
|
+
/** The unit of user's preferred currency. **/
|
|
33
|
+
preferredCurrencyUnit: CurrencyUnit;
|
|
34
|
+
/**
|
|
35
|
+
* The rounded numeric value for this CurrencyAmount in the very base level of user's preferred
|
|
36
|
+
* currency. For example, for USD, the value will be in cents.
|
|
37
|
+
**/
|
|
38
|
+
preferredCurrencyValueRounded: number;
|
|
39
|
+
/**
|
|
40
|
+
* The approximate float value for this CurrencyAmount in the very base level of user's preferred
|
|
41
|
+
* currency. For example, for USD, the value will be in cents.
|
|
42
|
+
**/
|
|
43
|
+
preferredCurrencyValueApprox: number;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
declare enum LightsparkNodePurpose {
|
|
47
|
+
/**
|
|
48
|
+
* This is an enum value that represents values that could be added in the future.
|
|
49
|
+
* Clients should support unknown values as more of them could be added without notice.
|
|
50
|
+
*/
|
|
51
|
+
FUTURE_VALUE = "FUTURE_VALUE",
|
|
52
|
+
SEND = "SEND",
|
|
53
|
+
RECEIVE = "RECEIVE",
|
|
54
|
+
ROUTING = "ROUTING"
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
declare enum LightsparkNodeStatus {
|
|
58
|
+
/**
|
|
59
|
+
* This is an enum value that represents values that could be added in the future.
|
|
60
|
+
* Clients should support unknown values as more of them could be added without notice.
|
|
61
|
+
*/
|
|
62
|
+
FUTURE_VALUE = "FUTURE_VALUE",
|
|
63
|
+
CREATED = "CREATED",
|
|
64
|
+
DEPLOYED = "DEPLOYED",
|
|
65
|
+
STARTED = "STARTED",
|
|
66
|
+
SYNCING = "SYNCING",
|
|
67
|
+
READY = "READY",
|
|
68
|
+
STOPPED = "STOPPED",
|
|
69
|
+
TERMINATED = "TERMINATED",
|
|
70
|
+
WALLET_LOCKED = "WALLET_LOCKED",
|
|
71
|
+
FAILED_TO_DEPLOY = "FAILED_TO_DEPLOY"
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/** An enum that enumerates all possible types of addresses of a node on the Lightning Network. **/
|
|
75
|
+
declare enum NodeAddressType {
|
|
76
|
+
/**
|
|
77
|
+
* This is an enum value that represents values that could be added in the future.
|
|
78
|
+
* Clients should support unknown values as more of them could be added without notice.
|
|
79
|
+
*/
|
|
80
|
+
FUTURE_VALUE = "FUTURE_VALUE",
|
|
81
|
+
IPV4 = "IPV4",
|
|
82
|
+
IPV6 = "IPV6",
|
|
83
|
+
TOR = "TOR"
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
type AccountDashboard = {
|
|
87
|
+
id: string;
|
|
88
|
+
name: Maybe<string>;
|
|
89
|
+
nodes: {
|
|
90
|
+
id: string;
|
|
91
|
+
color: Maybe<string>;
|
|
92
|
+
displayName: string;
|
|
93
|
+
purpose: Maybe<LightsparkNodePurpose>;
|
|
94
|
+
publicKey: Maybe<string>;
|
|
95
|
+
status: Maybe<LightsparkNodeStatus>;
|
|
96
|
+
addresses: {
|
|
97
|
+
count: number;
|
|
98
|
+
entities: {
|
|
99
|
+
address: string;
|
|
100
|
+
type: NodeAddressType;
|
|
101
|
+
}[];
|
|
102
|
+
};
|
|
103
|
+
localBalance: Maybe<CurrencyAmount>;
|
|
104
|
+
remoteBalance: Maybe<CurrencyAmount>;
|
|
105
|
+
blockchainBalance: {
|
|
106
|
+
availableBalance: Maybe<CurrencyAmount>;
|
|
107
|
+
totalBalance: Maybe<CurrencyAmount>;
|
|
108
|
+
} | null;
|
|
109
|
+
}[];
|
|
110
|
+
blockchainBalance: Maybe<{
|
|
111
|
+
l1Balance: Maybe<CurrencyAmount>;
|
|
112
|
+
requiredReserve: Maybe<CurrencyAmount>;
|
|
113
|
+
availableBalance: Maybe<CurrencyAmount>;
|
|
114
|
+
unconfirmedBalance: Maybe<CurrencyAmount>;
|
|
115
|
+
}>;
|
|
116
|
+
localBalance: Maybe<CurrencyAmount>;
|
|
117
|
+
remoteBalance: Maybe<CurrencyAmount>;
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
declare enum BitcoinNetwork {
|
|
121
|
+
/**
|
|
122
|
+
* This is an enum value that represents values that could be added in the future.
|
|
123
|
+
* Clients should support unknown values as more of them could be added without notice.
|
|
124
|
+
*/
|
|
125
|
+
FUTURE_VALUE = "FUTURE_VALUE",
|
|
126
|
+
/** The production version of the Bitcoin Blockchain. **/
|
|
127
|
+
MAINNET = "MAINNET",
|
|
128
|
+
/** A test version of the Bitcoin Blockchain, maintained by Lightspark. **/
|
|
129
|
+
REGTEST = "REGTEST",
|
|
130
|
+
/** A test version of the Bitcoin Blockchain, maintained by a centralized organization. Not in use at Lightspark. **/
|
|
131
|
+
SIGNET = "SIGNET",
|
|
132
|
+
/** A test version of the Bitcoin Blockchain, publically available. **/
|
|
133
|
+
TESTNET = "TESTNET"
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/** This interface is used by all the entities in the Lightspark systems. It defines a few core fields that are available everywhere. Any object that implements this interface can be queried using the `entity` query and its ID. **/
|
|
137
|
+
type Entity = {
|
|
138
|
+
/**
|
|
139
|
+
* The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque
|
|
140
|
+
* string.
|
|
141
|
+
**/
|
|
142
|
+
id: string;
|
|
143
|
+
/** The date and time when the entity was first created. **/
|
|
144
|
+
createdAt: string;
|
|
145
|
+
/** The date and time when the entity was last updated. **/
|
|
146
|
+
updatedAt: string;
|
|
147
|
+
/** The typename of the object **/
|
|
148
|
+
typename: string;
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
declare enum Permission {
|
|
152
|
+
/**
|
|
153
|
+
* This is an enum value that represents values that could be added in the future.
|
|
154
|
+
* Clients should support unknown values as more of them could be added without notice.
|
|
155
|
+
*/
|
|
156
|
+
FUTURE_VALUE = "FUTURE_VALUE",
|
|
157
|
+
ALL = "ALL",
|
|
158
|
+
MAINNET_VIEW = "MAINNET_VIEW",
|
|
159
|
+
MAINNET_TRANSACT = "MAINNET_TRANSACT",
|
|
160
|
+
MAINNET_MANAGE = "MAINNET_MANAGE",
|
|
161
|
+
TESTNET_VIEW = "TESTNET_VIEW",
|
|
162
|
+
TESTNET_TRANSACT = "TESTNET_TRANSACT",
|
|
163
|
+
TESTNET_MANAGE = "TESTNET_MANAGE",
|
|
164
|
+
REGTEST_VIEW = "REGTEST_VIEW",
|
|
165
|
+
REGTEST_TRANSACT = "REGTEST_TRANSACT",
|
|
166
|
+
REGTEST_MANAGE = "REGTEST_MANAGE",
|
|
167
|
+
USER_VIEW = "USER_VIEW",
|
|
168
|
+
USER_MANAGE = "USER_MANAGE",
|
|
169
|
+
ACCOUNT_VIEW = "ACCOUNT_VIEW",
|
|
170
|
+
ACCOUNT_MANAGE = "ACCOUNT_MANAGE"
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
type ApiToken = Entity & {
|
|
174
|
+
/**
|
|
175
|
+
* The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque
|
|
176
|
+
* string.
|
|
177
|
+
**/
|
|
178
|
+
id: string;
|
|
179
|
+
/** The date and time when the entity was first created. **/
|
|
180
|
+
createdAt: string;
|
|
181
|
+
/** The date and time when the entity was last updated. **/
|
|
182
|
+
updatedAt: string;
|
|
183
|
+
/**
|
|
184
|
+
* An opaque identifier that should be used as a client_id (or username) in the HTTP Basic
|
|
185
|
+
* Authentication scheme when issuing requests against the Lightspark API.
|
|
186
|
+
**/
|
|
187
|
+
clientId: string;
|
|
188
|
+
/**
|
|
189
|
+
* An arbitrary name chosen by the creator of the token to help identify the token in the list of
|
|
190
|
+
* tokens that have been created for the account.
|
|
191
|
+
**/
|
|
192
|
+
name: string;
|
|
193
|
+
/** A list of permissions granted to the token. **/
|
|
194
|
+
permissions: Permission[];
|
|
195
|
+
/** The typename of the object **/
|
|
196
|
+
typename: string;
|
|
197
|
+
};
|
|
198
|
+
declare const getApiTokenQuery: (id: string) => Query<ApiToken>;
|
|
199
|
+
|
|
200
|
+
type CreateApiTokenOutput = {
|
|
201
|
+
/** The API Token that has been created. **/
|
|
202
|
+
apiToken: ApiToken;
|
|
203
|
+
/**
|
|
204
|
+
* The secret that should be used to authenticate against our API. This secret is not stored and will
|
|
205
|
+
* never be available again after this. You must keep this secret secure as it grants access to your
|
|
206
|
+
* account.
|
|
207
|
+
**/
|
|
208
|
+
clientSecret: string;
|
|
209
|
+
};
|
|
210
|
+
|
|
211
|
+
type FeeEstimate = {
|
|
212
|
+
feeFast: CurrencyAmount;
|
|
213
|
+
feeMin: CurrencyAmount;
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
/** An object that represents the address of a node on the Lightning Network. **/
|
|
217
|
+
type NodeAddress = {
|
|
218
|
+
/** The string representation of the address. **/
|
|
219
|
+
address: string;
|
|
220
|
+
/** The type, or protocol, of this address. **/
|
|
221
|
+
type: NodeAddressType;
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
/** A connection between a node and the addresses it has announced for itself on Lightning Network. **/
|
|
225
|
+
type NodeToAddressesConnection = {
|
|
226
|
+
/**
|
|
227
|
+
* The total count of objects in this connection, using the current filters. It is different from the
|
|
228
|
+
* number of objects returned in the current page (in the `entities` field).
|
|
229
|
+
**/
|
|
230
|
+
count: number;
|
|
231
|
+
/** The addresses for the current page of this connection. **/
|
|
232
|
+
entities: NodeAddress[];
|
|
233
|
+
};
|
|
234
|
+
|
|
235
|
+
/** This interface represents a lightning node that can be connected to the Lightning Network to send and receive transactions. **/
|
|
236
|
+
declare class Node implements Entity {
|
|
237
|
+
readonly id: string;
|
|
238
|
+
readonly createdAt: string;
|
|
239
|
+
readonly updatedAt: string;
|
|
240
|
+
readonly bitcoinNetwork: BitcoinNetwork;
|
|
241
|
+
readonly displayName: string;
|
|
242
|
+
readonly typename: string;
|
|
243
|
+
readonly alias?: string | undefined;
|
|
244
|
+
readonly color?: string | undefined;
|
|
245
|
+
readonly conductivity?: number | undefined;
|
|
246
|
+
readonly publicKey?: string | undefined;
|
|
247
|
+
constructor(id: string, createdAt: string, updatedAt: string, bitcoinNetwork: BitcoinNetwork, displayName: string, typename: string, alias?: string | undefined, color?: string | undefined, conductivity?: number | undefined, publicKey?: string | undefined);
|
|
248
|
+
getAddresses(client: LightsparkClient, first?: number | undefined, types?: NodeAddressType[] | undefined): Promise<NodeToAddressesConnection>;
|
|
249
|
+
static getNodeQuery(id: string): Query<Node>;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/** The interface of a payment request on the Lightning Network (a.k.a. Lightning Invoice). **/
|
|
253
|
+
type PaymentRequestData = {
|
|
254
|
+
encodedPaymentRequest: string;
|
|
255
|
+
bitcoinNetwork: BitcoinNetwork;
|
|
256
|
+
/** The typename of the object **/
|
|
257
|
+
typename: string;
|
|
258
|
+
};
|
|
259
|
+
|
|
260
|
+
/** This object represents the BOLT #11 invoice protocol for Lightning Payments. See https://github.com/lightning/bolts/blob/master/11-payment-encoding.md. **/
|
|
261
|
+
type InvoiceData = PaymentRequestData & {
|
|
262
|
+
encodedPaymentRequest: string;
|
|
263
|
+
bitcoinNetwork: BitcoinNetwork;
|
|
264
|
+
paymentHash: string;
|
|
265
|
+
amount: CurrencyAmount;
|
|
266
|
+
createdAt: string;
|
|
267
|
+
expiresAt: string;
|
|
268
|
+
destination: Node;
|
|
269
|
+
/** The typename of the object **/
|
|
270
|
+
typename: string;
|
|
271
|
+
memo?: string;
|
|
272
|
+
};
|
|
273
|
+
|
|
274
|
+
declare enum InvoiceType {
|
|
275
|
+
/**
|
|
276
|
+
* This is an enum value that represents values that could be added in the future.
|
|
277
|
+
* Clients should support unknown values as more of them could be added without notice.
|
|
278
|
+
*/
|
|
279
|
+
FUTURE_VALUE = "FUTURE_VALUE",
|
|
280
|
+
/** A standard Bolt 11 invoice. **/
|
|
281
|
+
STANDARD = "STANDARD",
|
|
282
|
+
/** An AMP (Atomic Multi-path Payment) invoice. **/
|
|
283
|
+
AMP = "AMP"
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
declare enum TransactionStatus {
|
|
287
|
+
/**
|
|
288
|
+
* This is an enum value that represents values that could be added in the future.
|
|
289
|
+
* Clients should support unknown values as more of them could be added without notice.
|
|
290
|
+
*/
|
|
291
|
+
FUTURE_VALUE = "FUTURE_VALUE",
|
|
292
|
+
/** Transaction succeeded.. **/
|
|
293
|
+
SUCCESS = "SUCCESS",
|
|
294
|
+
/** Transaction failed. **/
|
|
295
|
+
FAILED = "FAILED",
|
|
296
|
+
/** Transaction has been initiated and is currently in-flight. **/
|
|
297
|
+
PENDING = "PENDING",
|
|
298
|
+
/** For transaction type PAYMENT_REQUEST only. No payments have been made to a payment request. **/
|
|
299
|
+
NOT_STARTED = "NOT_STARTED",
|
|
300
|
+
/** For transaction type PAYMENT_REQUEST only. A payment request has expired. **/
|
|
301
|
+
EXPIRED = "EXPIRED",
|
|
302
|
+
/** For transaction type PAYMENT_REQUEST only. **/
|
|
303
|
+
CANCELLED = "CANCELLED"
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
type Transaction = Entity & {
|
|
307
|
+
/**
|
|
308
|
+
* The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque
|
|
309
|
+
* string.
|
|
310
|
+
**/
|
|
311
|
+
id: string;
|
|
312
|
+
/** The date and time when this transaction was initiated. **/
|
|
313
|
+
createdAt: string;
|
|
314
|
+
/** The date and time when the entity was last updated. **/
|
|
315
|
+
updatedAt: string;
|
|
316
|
+
/** The current status of this transaction. **/
|
|
317
|
+
status: TransactionStatus;
|
|
318
|
+
/** The amount of money involved in this transaction. **/
|
|
319
|
+
amount: CurrencyAmount;
|
|
320
|
+
/** The typename of the object **/
|
|
321
|
+
typename: string;
|
|
322
|
+
/** The date and time when this transaction was completed or failed. **/
|
|
323
|
+
resolvedAt?: string;
|
|
324
|
+
/** The hash of this transaction, so it can be uniquely identified on the Lightning Network. **/
|
|
325
|
+
transactionHash?: string;
|
|
326
|
+
};
|
|
327
|
+
declare const getTransactionQuery: (id: string) => Query<Transaction>;
|
|
328
|
+
|
|
329
|
+
type LightningTransaction = Transaction & Entity & {
|
|
330
|
+
/**
|
|
331
|
+
* The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque
|
|
332
|
+
* string.
|
|
333
|
+
**/
|
|
334
|
+
id: string;
|
|
335
|
+
/** The date and time when this transaction was initiated. **/
|
|
336
|
+
createdAt: string;
|
|
337
|
+
/** The date and time when the entity was last updated. **/
|
|
338
|
+
updatedAt: string;
|
|
339
|
+
/** The current status of this transaction. **/
|
|
340
|
+
status: TransactionStatus;
|
|
341
|
+
/** The amount of money involved in this transaction. **/
|
|
342
|
+
amount: CurrencyAmount;
|
|
343
|
+
/** The typename of the object **/
|
|
344
|
+
typename: string;
|
|
345
|
+
/** The date and time when this transaction was completed or failed. **/
|
|
346
|
+
resolvedAt?: string;
|
|
347
|
+
/** The hash of this transaction, so it can be uniquely identified on the Lightning Network. **/
|
|
348
|
+
transactionHash?: string;
|
|
349
|
+
};
|
|
350
|
+
declare const getLightningTransactionQuery: (id: string) => Query<LightningTransaction>;
|
|
351
|
+
|
|
352
|
+
declare enum HtlcAttemptFailureCode {
|
|
353
|
+
/**
|
|
354
|
+
* This is an enum value that represents values that could be added in the future.
|
|
355
|
+
* Clients should support unknown values as more of them could be added without notice.
|
|
356
|
+
*/
|
|
357
|
+
FUTURE_VALUE = "FUTURE_VALUE",
|
|
358
|
+
INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS = "INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS",
|
|
359
|
+
INCORRECT_PAYMENT_AMOUNT = "INCORRECT_PAYMENT_AMOUNT",
|
|
360
|
+
FINAL_INCORRECT_CLTV_EXPIRY = "FINAL_INCORRECT_CLTV_EXPIRY",
|
|
361
|
+
FINAL_INCORRECT_HTLC_AMOUNT = "FINAL_INCORRECT_HTLC_AMOUNT",
|
|
362
|
+
FINAL_EXPIRY_TOO_SOON = "FINAL_EXPIRY_TOO_SOON",
|
|
363
|
+
INVALID_REALM = "INVALID_REALM",
|
|
364
|
+
EXPIRY_TOO_SOON = "EXPIRY_TOO_SOON",
|
|
365
|
+
INVALID_ONION_VERSION = "INVALID_ONION_VERSION",
|
|
366
|
+
INVALID_ONION_HMAC = "INVALID_ONION_HMAC",
|
|
367
|
+
INVALID_ONION_KEY = "INVALID_ONION_KEY",
|
|
368
|
+
AMOUNT_BELOW_MINIMUM = "AMOUNT_BELOW_MINIMUM",
|
|
369
|
+
FEE_INSUFFICIENT = "FEE_INSUFFICIENT",
|
|
370
|
+
INCORRECT_CLTV_EXPIRY = "INCORRECT_CLTV_EXPIRY",
|
|
371
|
+
CHANNEL_DISABLED = "CHANNEL_DISABLED",
|
|
372
|
+
TEMPORARY_CHANNEL_FAILURE = "TEMPORARY_CHANNEL_FAILURE",
|
|
373
|
+
REQUIRED_NODE_FEATURE_MISSING = "REQUIRED_NODE_FEATURE_MISSING",
|
|
374
|
+
REQUIRED_CHANNEL_FEATURE_MISSING = "REQUIRED_CHANNEL_FEATURE_MISSING",
|
|
375
|
+
UNKNOWN_NEXT_PEER = "UNKNOWN_NEXT_PEER",
|
|
376
|
+
TEMPORARY_NODE_FAILURE = "TEMPORARY_NODE_FAILURE",
|
|
377
|
+
PERMANENT_NODE_FAILURE = "PERMANENT_NODE_FAILURE",
|
|
378
|
+
PERMANENT_CHANNEL_FAILURE = "PERMANENT_CHANNEL_FAILURE",
|
|
379
|
+
EXPIRY_TOO_FAR = "EXPIRY_TOO_FAR",
|
|
380
|
+
MPP_TIMEOUT = "MPP_TIMEOUT",
|
|
381
|
+
INVALID_ONION_PAYLOAD = "INVALID_ONION_PAYLOAD",
|
|
382
|
+
INTERNAL_FAILURE = "INTERNAL_FAILURE",
|
|
383
|
+
UNKNOWN_FAILURE = "UNKNOWN_FAILURE",
|
|
384
|
+
UNREADABLE_FAILURE = "UNREADABLE_FAILURE"
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
/** Enum that enumerates all the possible status of an outgoing payment attempt. **/
|
|
388
|
+
declare enum OutgoingPaymentAttemptStatus {
|
|
389
|
+
/**
|
|
390
|
+
* This is an enum value that represents values that could be added in the future.
|
|
391
|
+
* Clients should support unknown values as more of them could be added without notice.
|
|
392
|
+
*/
|
|
393
|
+
FUTURE_VALUE = "FUTURE_VALUE",
|
|
394
|
+
IN_FLIGHT = "IN_FLIGHT",
|
|
395
|
+
SUCCEEDED = "SUCCEEDED",
|
|
396
|
+
FAILED = "FAILED"
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
/** One hop signifies a payment moving one node ahead on a payment route; a list of sequential hops defines the path from sender node to recipient node for a payment attempt. **/
|
|
400
|
+
type Hop = Entity & {
|
|
401
|
+
/**
|
|
402
|
+
* The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque
|
|
403
|
+
* string.
|
|
404
|
+
**/
|
|
405
|
+
id: string;
|
|
406
|
+
/** The date and time when the entity was first created. **/
|
|
407
|
+
createdAt: string;
|
|
408
|
+
/** The date and time when the entity was last updated. **/
|
|
409
|
+
updatedAt: string;
|
|
410
|
+
/** The zero-based index position of this hop in the path **/
|
|
411
|
+
index: number;
|
|
412
|
+
/** The typename of the object **/
|
|
413
|
+
typename: string;
|
|
414
|
+
/** The destination node of the hop. **/
|
|
415
|
+
destinationId?: string;
|
|
416
|
+
/** The public key of the node to which the hop is bound. **/
|
|
417
|
+
publicKey?: string;
|
|
418
|
+
/** The amount that is to be forwarded to the destination node. **/
|
|
419
|
+
amountToForward?: CurrencyAmount;
|
|
420
|
+
/** The fees to be collected by the source node for forwarding the payment over the hop. **/
|
|
421
|
+
fee?: CurrencyAmount;
|
|
422
|
+
/** The block height at which an unsettled HTLC is considered expired. **/
|
|
423
|
+
expiryBlockHeight?: number;
|
|
424
|
+
};
|
|
425
|
+
declare const getHopQuery: (id: string) => Query<Hop>;
|
|
426
|
+
|
|
427
|
+
/** The connection from an outgoing payment attempt to the list of sequential hops that define the path from sender node to recipient node. **/
|
|
428
|
+
type OutgoingPaymentAttemptToHopsConnection = {
|
|
429
|
+
/**
|
|
430
|
+
* The total count of objects in this connection, using the current filters. It is different from the
|
|
431
|
+
* number of objects returned in the current page (in the `entities` field).
|
|
432
|
+
**/
|
|
433
|
+
count: number;
|
|
434
|
+
/** The hops for the current page of this connection. **/
|
|
435
|
+
entities: Hop[];
|
|
436
|
+
};
|
|
437
|
+
|
|
438
|
+
/** An attempt for a payment over a route from sender node to recipient node. **/
|
|
439
|
+
declare class OutgoingPaymentAttempt implements Entity {
|
|
440
|
+
readonly id: string;
|
|
441
|
+
readonly createdAt: string;
|
|
442
|
+
readonly updatedAt: string;
|
|
443
|
+
readonly status: OutgoingPaymentAttemptStatus;
|
|
444
|
+
readonly outgoingPaymentId: string;
|
|
445
|
+
readonly typename: string;
|
|
446
|
+
readonly failureCode?: HtlcAttemptFailureCode | undefined;
|
|
447
|
+
readonly failureSourceIndex?: number | undefined;
|
|
448
|
+
readonly resolvedAt?: string | undefined;
|
|
449
|
+
readonly amount?: CurrencyAmount | undefined;
|
|
450
|
+
readonly fees?: CurrencyAmount | undefined;
|
|
451
|
+
constructor(id: string, createdAt: string, updatedAt: string, status: OutgoingPaymentAttemptStatus, outgoingPaymentId: string, typename: string, failureCode?: HtlcAttemptFailureCode | undefined, failureSourceIndex?: number | undefined, resolvedAt?: string | undefined, amount?: CurrencyAmount | undefined, fees?: CurrencyAmount | undefined);
|
|
452
|
+
getHops(client: LightsparkClient, first?: number | undefined): Promise<OutgoingPaymentAttemptToHopsConnection>;
|
|
453
|
+
static getOutgoingPaymentAttemptQuery(id: string): Query<OutgoingPaymentAttempt>;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
/** The connection from outgoing payment to all attempts. **/
|
|
457
|
+
type OutgoingPaymentToAttemptsConnection = {
|
|
458
|
+
/**
|
|
459
|
+
* The total count of objects in this connection, using the current filters. It is different from the
|
|
460
|
+
* number of objects returned in the current page (in the `entities` field).
|
|
461
|
+
**/
|
|
462
|
+
count: number;
|
|
463
|
+
/** The attempts for the current page of this connection. **/
|
|
464
|
+
entities: OutgoingPaymentAttempt[];
|
|
465
|
+
};
|
|
466
|
+
|
|
467
|
+
declare enum PaymentFailureReason {
|
|
468
|
+
/**
|
|
469
|
+
* This is an enum value that represents values that could be added in the future.
|
|
470
|
+
* Clients should support unknown values as more of them could be added without notice.
|
|
471
|
+
*/
|
|
472
|
+
FUTURE_VALUE = "FUTURE_VALUE",
|
|
473
|
+
NONE = "NONE",
|
|
474
|
+
TIMEOUT = "TIMEOUT",
|
|
475
|
+
NO_ROUTE = "NO_ROUTE",
|
|
476
|
+
ERROR = "ERROR",
|
|
477
|
+
INCORRECT_PAYMENT_DETAILS = "INCORRECT_PAYMENT_DETAILS",
|
|
478
|
+
INSUFFICIENT_BALANCE = "INSUFFICIENT_BALANCE",
|
|
479
|
+
INVOICE_ALREADY_PAID = "INVOICE_ALREADY_PAID",
|
|
480
|
+
SELF_PAYMENT = "SELF_PAYMENT",
|
|
481
|
+
INVOICE_EXPIRED = "INVOICE_EXPIRED"
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
type RichText = {
|
|
485
|
+
text: string;
|
|
486
|
+
};
|
|
487
|
+
|
|
488
|
+
/** A transaction that was sent from a Lightspark node on the Lightning Network. **/
|
|
489
|
+
declare class OutgoingPayment implements LightningTransaction {
|
|
490
|
+
readonly id: string;
|
|
491
|
+
readonly createdAt: string;
|
|
492
|
+
readonly updatedAt: string;
|
|
493
|
+
readonly status: TransactionStatus;
|
|
494
|
+
readonly amount: CurrencyAmount;
|
|
495
|
+
readonly originId: string;
|
|
496
|
+
readonly typename: string;
|
|
497
|
+
readonly resolvedAt?: string | undefined;
|
|
498
|
+
readonly transactionHash?: string | undefined;
|
|
499
|
+
readonly destinationId?: string | undefined;
|
|
500
|
+
readonly fees?: CurrencyAmount | undefined;
|
|
501
|
+
readonly paymentRequestData?: PaymentRequestData | undefined;
|
|
502
|
+
readonly failureReason?: PaymentFailureReason | undefined;
|
|
503
|
+
readonly failureMessage?: RichText | undefined;
|
|
504
|
+
constructor(id: string, createdAt: string, updatedAt: string, status: TransactionStatus, amount: CurrencyAmount, originId: string, typename: string, resolvedAt?: string | undefined, transactionHash?: string | undefined, destinationId?: string | undefined, fees?: CurrencyAmount | undefined, paymentRequestData?: PaymentRequestData | undefined, failureReason?: PaymentFailureReason | undefined, failureMessage?: RichText | undefined);
|
|
505
|
+
getAttempts(client: LightsparkClient, first?: number | undefined): Promise<OutgoingPaymentToAttemptsConnection>;
|
|
506
|
+
static getOutgoingPaymentQuery(id: string): Query<OutgoingPayment>;
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
type TransactionUpdate = {
|
|
510
|
+
/**
|
|
511
|
+
* The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque
|
|
512
|
+
* string.
|
|
513
|
+
**/
|
|
514
|
+
id: string;
|
|
515
|
+
/** The date and time when this transaction was initiated. **/
|
|
516
|
+
createdAt: string;
|
|
517
|
+
/** The date and time when the entity was last updated. **/
|
|
518
|
+
updatedAt: string;
|
|
519
|
+
/** The current status of this transaction. **/
|
|
520
|
+
status: TransactionStatus;
|
|
521
|
+
/** The amount of money involved in this transaction. **/
|
|
522
|
+
amount: CurrencyAmount;
|
|
523
|
+
/** The typename of the object **/
|
|
524
|
+
typename: string;
|
|
525
|
+
/** The date and time when this transaction was completed or failed. **/
|
|
526
|
+
resolvedAt?: string;
|
|
527
|
+
/** The hash of this transaction, so it can be uniquely identified on the Lightning Network. **/
|
|
528
|
+
transactionHash?: string;
|
|
529
|
+
};
|
|
530
|
+
|
|
531
|
+
type WalletDashboard = {
|
|
532
|
+
id: string;
|
|
533
|
+
displayName: string;
|
|
534
|
+
purpose: Maybe<LightsparkNodePurpose>;
|
|
535
|
+
color: Maybe<string>;
|
|
536
|
+
publicKey: Maybe<string>;
|
|
537
|
+
status: Maybe<LightsparkNodeStatus>;
|
|
538
|
+
addresses: {
|
|
539
|
+
address: string;
|
|
540
|
+
type: NodeAddressType;
|
|
541
|
+
}[];
|
|
542
|
+
totalBalance: Maybe<CurrencyAmount>;
|
|
543
|
+
totalLocalBalance: Maybe<CurrencyAmount>;
|
|
544
|
+
onlineLocalBalance: Maybe<CurrencyAmount>;
|
|
545
|
+
remoteBalance: Maybe<CurrencyAmount>;
|
|
546
|
+
blockchainBalance: {
|
|
547
|
+
availableBalance: Maybe<CurrencyAmount>;
|
|
548
|
+
totalBalance: Maybe<CurrencyAmount>;
|
|
549
|
+
confirmedBalance: Maybe<CurrencyAmount>;
|
|
550
|
+
unconfirmedBalance: Maybe<CurrencyAmount>;
|
|
551
|
+
} | null;
|
|
552
|
+
recentTransactions: Transaction[];
|
|
553
|
+
};
|
|
554
|
+
|
|
555
|
+
declare enum WithdrawalMode {
|
|
556
|
+
/**
|
|
557
|
+
* This is an enum value that represents values that could be added in the future.
|
|
558
|
+
* Clients should support unknown values as more of them could be added without notice.
|
|
559
|
+
*/
|
|
560
|
+
FUTURE_VALUE = "FUTURE_VALUE",
|
|
561
|
+
WALLET_ONLY = "WALLET_ONLY",
|
|
562
|
+
WALLET_THEN_CHANNELS = "WALLET_THEN_CHANNELS"
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
declare enum WithdrawalRequestStatus {
|
|
566
|
+
/**
|
|
567
|
+
* This is an enum value that represents values that could be added in the future.
|
|
568
|
+
* Clients should support unknown values as more of them could be added without notice.
|
|
569
|
+
*/
|
|
570
|
+
FUTURE_VALUE = "FUTURE_VALUE",
|
|
571
|
+
FAILED = "FAILED",
|
|
572
|
+
IN_PROGRESS = "IN_PROGRESS",
|
|
573
|
+
SUCCESSFUL = "SUCCESSFUL"
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
/** Transaction happened on Bitcoin blockchain. **/
|
|
577
|
+
type OnChainTransaction = Transaction & Entity & {
|
|
578
|
+
/**
|
|
579
|
+
* The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque
|
|
580
|
+
* string.
|
|
581
|
+
**/
|
|
582
|
+
id: string;
|
|
583
|
+
/** The date and time when this transaction was initiated. **/
|
|
584
|
+
createdAt: string;
|
|
585
|
+
/** The date and time when the entity was last updated. **/
|
|
586
|
+
updatedAt: string;
|
|
587
|
+
/** The current status of this transaction. **/
|
|
588
|
+
status: TransactionStatus;
|
|
589
|
+
/** The amount of money involved in this transaction. **/
|
|
590
|
+
amount: CurrencyAmount;
|
|
591
|
+
/**
|
|
592
|
+
* The height of the block that included this transaction. This will be zero for unconfirmed
|
|
593
|
+
* transactions.
|
|
594
|
+
**/
|
|
595
|
+
blockHeight: number;
|
|
596
|
+
/** The Bitcoin blockchain addresses this transaction was sent to. **/
|
|
597
|
+
destinationAddresses: string[];
|
|
598
|
+
/** The typename of the object **/
|
|
599
|
+
typename: string;
|
|
600
|
+
/** The date and time when this transaction was completed or failed. **/
|
|
601
|
+
resolvedAt?: string;
|
|
602
|
+
/** The hash of this transaction, so it can be uniquely identified on the Lightning Network. **/
|
|
603
|
+
transactionHash?: string;
|
|
604
|
+
/**
|
|
605
|
+
* The fees that were paid by the wallet sending the transaction to commit it to the Bitcoin
|
|
606
|
+
* blockchain.
|
|
607
|
+
**/
|
|
608
|
+
fees?: CurrencyAmount;
|
|
609
|
+
/**
|
|
610
|
+
* The hash of the block that included this transaction. This will be null for unconfirmed
|
|
611
|
+
* transactions.
|
|
612
|
+
**/
|
|
613
|
+
blockHash?: string;
|
|
614
|
+
/** The number of blockchain confirmations for this transaction in real time. **/
|
|
615
|
+
numConfirmations?: number;
|
|
616
|
+
};
|
|
617
|
+
declare const getOnChainTransactionQuery: (id: string) => Query<OnChainTransaction>;
|
|
618
|
+
|
|
619
|
+
/** The transaction on Bitcoin blockchain to close a channel on Lightning Network where the balances are allocated back to local and remote nodes. **/
|
|
620
|
+
type ChannelClosingTransaction = OnChainTransaction & Transaction & Entity & {
|
|
621
|
+
/**
|
|
622
|
+
* The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque
|
|
623
|
+
* string.
|
|
624
|
+
**/
|
|
625
|
+
id: string;
|
|
626
|
+
/** The date and time when this transaction was initiated. **/
|
|
627
|
+
createdAt: string;
|
|
628
|
+
/** The date and time when the entity was last updated. **/
|
|
629
|
+
updatedAt: string;
|
|
630
|
+
/** The current status of this transaction. **/
|
|
631
|
+
status: TransactionStatus;
|
|
632
|
+
/** The amount of money involved in this transaction. **/
|
|
633
|
+
amount: CurrencyAmount;
|
|
634
|
+
/**
|
|
635
|
+
* The height of the block that included this transaction. This will be zero for unconfirmed
|
|
636
|
+
* transactions.
|
|
637
|
+
**/
|
|
638
|
+
blockHeight: number;
|
|
639
|
+
/** The Bitcoin blockchain addresses this transaction was sent to. **/
|
|
640
|
+
destinationAddresses: string[];
|
|
641
|
+
/** The typename of the object **/
|
|
642
|
+
typename: string;
|
|
643
|
+
/** The date and time when this transaction was completed or failed. **/
|
|
644
|
+
resolvedAt?: string;
|
|
645
|
+
/** The hash of this transaction, so it can be uniquely identified on the Lightning Network. **/
|
|
646
|
+
transactionHash?: string;
|
|
647
|
+
/**
|
|
648
|
+
* The fees that were paid by the wallet sending the transaction to commit it to the Bitcoin
|
|
649
|
+
* blockchain.
|
|
650
|
+
**/
|
|
651
|
+
fees?: CurrencyAmount;
|
|
652
|
+
/**
|
|
653
|
+
* The hash of the block that included this transaction. This will be null for unconfirmed
|
|
654
|
+
* transactions.
|
|
655
|
+
**/
|
|
656
|
+
blockHash?: string;
|
|
657
|
+
/** The number of blockchain confirmations for this transaction in real time. **/
|
|
658
|
+
numConfirmations?: number;
|
|
659
|
+
/** If known, the channel this transaction is closing. **/
|
|
660
|
+
channelId?: string;
|
|
661
|
+
};
|
|
662
|
+
declare const getChannelClosingTransactionQuery: (id: string) => Query<ChannelClosingTransaction>;
|
|
663
|
+
|
|
664
|
+
type PageInfo = {
|
|
665
|
+
hasNextPage?: boolean;
|
|
666
|
+
hasPreviousPage?: boolean;
|
|
667
|
+
startCursor?: string;
|
|
668
|
+
endCursor?: string;
|
|
669
|
+
};
|
|
670
|
+
|
|
671
|
+
type WithdrawalRequestToChannelClosingTransactionsConnection = {
|
|
672
|
+
/** An object that holds pagination information about the objects in this connection. **/
|
|
673
|
+
pageInfo: PageInfo;
|
|
674
|
+
/**
|
|
675
|
+
* The total count of objects in this connection, using the current filters. It is different from the
|
|
676
|
+
* number of objects returned in the current page (in the `entities` field).
|
|
677
|
+
**/
|
|
678
|
+
count: number;
|
|
679
|
+
/** The channel closing transactions for the current page of this connection. **/
|
|
680
|
+
entities: ChannelClosingTransaction[];
|
|
681
|
+
};
|
|
682
|
+
|
|
683
|
+
/** The transaction on Bitcoin blockchain to open a channel on Lightning Network funded by the local Lightspark node. **/
|
|
684
|
+
type ChannelOpeningTransaction = OnChainTransaction & Transaction & Entity & {
|
|
685
|
+
/**
|
|
686
|
+
* The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque
|
|
687
|
+
* string.
|
|
688
|
+
**/
|
|
689
|
+
id: string;
|
|
690
|
+
/** The date and time when this transaction was initiated. **/
|
|
691
|
+
createdAt: string;
|
|
692
|
+
/** The date and time when the entity was last updated. **/
|
|
693
|
+
updatedAt: string;
|
|
694
|
+
/** The current status of this transaction. **/
|
|
695
|
+
status: TransactionStatus;
|
|
696
|
+
/** The amount of money involved in this transaction. **/
|
|
697
|
+
amount: CurrencyAmount;
|
|
698
|
+
/**
|
|
699
|
+
* The height of the block that included this transaction. This will be zero for unconfirmed
|
|
700
|
+
* transactions.
|
|
701
|
+
**/
|
|
702
|
+
blockHeight: number;
|
|
703
|
+
/** The Bitcoin blockchain addresses this transaction was sent to. **/
|
|
704
|
+
destinationAddresses: string[];
|
|
705
|
+
/** The typename of the object **/
|
|
706
|
+
typename: string;
|
|
707
|
+
/** The date and time when this transaction was completed or failed. **/
|
|
708
|
+
resolvedAt?: string;
|
|
709
|
+
/** The hash of this transaction, so it can be uniquely identified on the Lightning Network. **/
|
|
710
|
+
transactionHash?: string;
|
|
711
|
+
/**
|
|
712
|
+
* The fees that were paid by the wallet sending the transaction to commit it to the Bitcoin
|
|
713
|
+
* blockchain.
|
|
714
|
+
**/
|
|
715
|
+
fees?: CurrencyAmount;
|
|
716
|
+
/**
|
|
717
|
+
* The hash of the block that included this transaction. This will be null for unconfirmed
|
|
718
|
+
* transactions.
|
|
719
|
+
**/
|
|
720
|
+
blockHash?: string;
|
|
721
|
+
/** The number of blockchain confirmations for this transaction in real time. **/
|
|
722
|
+
numConfirmations?: number;
|
|
723
|
+
/** If known, the channel this transaction is opening. **/
|
|
724
|
+
channelId?: string;
|
|
725
|
+
};
|
|
726
|
+
declare const getChannelOpeningTransactionQuery: (id: string) => Query<ChannelOpeningTransaction>;
|
|
727
|
+
|
|
728
|
+
type WithdrawalRequestToChannelOpeningTransactionsConnection = {
|
|
729
|
+
/** An object that holds pagination information about the objects in this connection. **/
|
|
730
|
+
pageInfo: PageInfo;
|
|
731
|
+
/**
|
|
732
|
+
* The total count of objects in this connection, using the current filters. It is different from the
|
|
733
|
+
* number of objects returned in the current page (in the `entities` field).
|
|
734
|
+
**/
|
|
735
|
+
count: number;
|
|
736
|
+
/** The channel opening transactions for the current page of this connection. **/
|
|
737
|
+
entities: ChannelOpeningTransaction[];
|
|
738
|
+
};
|
|
739
|
+
|
|
740
|
+
declare class WithdrawalRequest implements Entity {
|
|
741
|
+
readonly id: string;
|
|
742
|
+
readonly createdAt: string;
|
|
743
|
+
readonly updatedAt: string;
|
|
744
|
+
readonly amount: CurrencyAmount;
|
|
745
|
+
readonly bitcoinAddress: string;
|
|
746
|
+
readonly withdrawalMode: WithdrawalMode;
|
|
747
|
+
readonly status: WithdrawalRequestStatus;
|
|
748
|
+
readonly typename: string;
|
|
749
|
+
readonly completedAt?: string | undefined;
|
|
750
|
+
readonly withdrawalId?: string | undefined;
|
|
751
|
+
constructor(id: string, createdAt: string, updatedAt: string, amount: CurrencyAmount, bitcoinAddress: string, withdrawalMode: WithdrawalMode, status: WithdrawalRequestStatus, typename: string, completedAt?: string | undefined, withdrawalId?: string | undefined);
|
|
752
|
+
getChannelClosingTransactions(client: LightsparkClient, first?: number | undefined): Promise<WithdrawalRequestToChannelClosingTransactionsConnection>;
|
|
753
|
+
getChannelOpeningTransactions(client: LightsparkClient, first?: number | undefined): Promise<WithdrawalRequestToChannelOpeningTransactionsConnection>;
|
|
754
|
+
static getWithdrawalRequestQuery(id: string): Query<WithdrawalRequest>;
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
/**
|
|
758
|
+
* The LightsparkClient is the main entrypoint for interacting with the Lightspark API.
|
|
759
|
+
*
|
|
760
|
+
* ```ts
|
|
761
|
+
* const lightsparkClient = new LightsparkClient(
|
|
762
|
+
* new AccountTokenAuthProvider(TOKEN_ID, TOKEN_SECRET)
|
|
763
|
+
* );
|
|
764
|
+
* const encodedInvoice = await lightsparkClient.createInvoice(
|
|
765
|
+
* RECEIVING_NODE_ID,
|
|
766
|
+
* { value: 100, unit: CurrencyUnit.SATOSHI },
|
|
767
|
+
* "Whasssupppp",
|
|
768
|
+
* InvoiceType.AMP,
|
|
769
|
+
* );
|
|
770
|
+
*
|
|
771
|
+
* const invoiceDetails = await lightsparkClient.decodeInvoice(encodedInvoice);
|
|
772
|
+
* console.log(invoiceDetails);
|
|
773
|
+
*
|
|
774
|
+
* const payment = await lightsparkClient.payInvoice(PAYING_NODE_ID, encodedInvoice, 1000);
|
|
775
|
+
* console.log(payment);
|
|
776
|
+
* ```
|
|
777
|
+
*
|
|
778
|
+
* @class LightsparkClient
|
|
779
|
+
*/
|
|
780
|
+
declare class LightsparkClient {
|
|
781
|
+
private authProvider;
|
|
782
|
+
private readonly serverUrl;
|
|
783
|
+
private readonly nodeKeyCache;
|
|
784
|
+
private requester;
|
|
785
|
+
/**
|
|
786
|
+
* Constructs a new LightsparkClient.
|
|
787
|
+
*
|
|
788
|
+
* @param authProvider The auth provider to use for authentication. Defaults to a stub auth provider. For server-side
|
|
789
|
+
* use, you should use the `AccountTokenAuthProvider`.
|
|
790
|
+
* @param serverUrl The base URL of the server to connect to. Defaults to lightspark production.
|
|
791
|
+
* @param nodeKeyCache This is used to cache node keys for the duration of the session. Defaults to a new instance of
|
|
792
|
+
* `NodeKeyCache`. You should not need to change this.
|
|
793
|
+
*/
|
|
794
|
+
constructor(authProvider?: AuthProvider, serverUrl?: string, nodeKeyCache?: NodeKeyCache);
|
|
795
|
+
/**
|
|
796
|
+
* Sets the auth provider for the client. This is useful for switching between auth providers if you are using
|
|
797
|
+
* multiple accounts or waiting for the user to log in.
|
|
798
|
+
*
|
|
799
|
+
* @param authProvider
|
|
800
|
+
*/
|
|
801
|
+
setAuthProvider(authProvider: AuthProvider): Promise<void>;
|
|
802
|
+
/**
|
|
803
|
+
* @returns Whether or not the client is authorized. This is useful for determining if the user is logged in or not.
|
|
804
|
+
*/
|
|
805
|
+
isAuthorized(): Promise<boolean>;
|
|
806
|
+
/**
|
|
807
|
+
* @returns The current account, if one exists.
|
|
808
|
+
*/
|
|
809
|
+
getCurrentAccount(): Promise<Maybe<Account>>;
|
|
810
|
+
/**
|
|
811
|
+
* Retrieves the most recent transactions for a given node.
|
|
812
|
+
*
|
|
813
|
+
* @param nodeId The node ID for which to read transactions
|
|
814
|
+
* @param numTransactions The maximum number of transactions to read. Defaults to 20.
|
|
815
|
+
* @param bitcoinNetwork The bitcoin network on which to read transactions. Defaults to MAINNET.
|
|
816
|
+
* @param afterDate Filters transactions to those after the given date. Defaults to undefined (no limit).
|
|
817
|
+
* @returns An array of transactions for the given node ID.
|
|
818
|
+
*/
|
|
819
|
+
getRecentTransactions(nodeId: string, numTransactions?: number, bitcoinNetwork?: BitcoinNetwork, afterDate?: Maybe<string>): Promise<Transaction[]>;
|
|
820
|
+
/**
|
|
821
|
+
* Starts listening for new transactions or updates to existing transactions for a list of nodes.
|
|
822
|
+
*
|
|
823
|
+
* @param nodeIds The node IDs for which to listen to transactions.
|
|
824
|
+
* @returns A zen-observable that emits transaction updates for the given node IDs.
|
|
825
|
+
*/
|
|
826
|
+
listenToTransactions(nodeIds: string[]): Observable<TransactionUpdate | undefined>;
|
|
827
|
+
/**
|
|
828
|
+
* Retrieves a dashboard of basic info for the authenticated account. See `AccountDashboard` for which info is
|
|
829
|
+
* included.
|
|
830
|
+
*
|
|
831
|
+
* @param nodeIds The node IDs to include in the dashboard. Defaults to undefined (all nodes).
|
|
832
|
+
* @param bitcoinNetwork The bitcoin network to include in the dashboard. Defaults to MAINNET.
|
|
833
|
+
* @returns A basic account dashboard for the given node IDs.
|
|
834
|
+
* @throws LightsparkAuthException if the user is not logged in or a LightsparkException if no nodes are found.
|
|
835
|
+
*/
|
|
836
|
+
getAccountDashboard(nodeIds?: string[] | undefined, bitcoinNetwork?: BitcoinNetwork): Promise<AccountDashboard>;
|
|
837
|
+
/**
|
|
838
|
+
* Gets a basic dashboard for a single node, including recent transactions. See `WalletDashboard` for which info is
|
|
839
|
+
* included.
|
|
840
|
+
*
|
|
841
|
+
* @param nodeId The node ID for which to get a dashboard.
|
|
842
|
+
* @param bitcoinNetwork The bitcoin network for which to get a dashboard. Defaults to MAINNET.
|
|
843
|
+
* @param transactionsAfterDate Filters recent transactions to those after the given date.
|
|
844
|
+
* Defaults to undefined (no limit).
|
|
845
|
+
* @returns A basic dashboard for the given node ID.
|
|
846
|
+
*/
|
|
847
|
+
getSingleNodeDashboard(nodeId: string, bitcoinNetwork?: BitcoinNetwork, transactionsAfterDate?: Maybe<string>): Promise<WalletDashboard>;
|
|
848
|
+
/**
|
|
849
|
+
* Creates an invoice for the given node.
|
|
850
|
+
*
|
|
851
|
+
* @param nodeId The node ID for which to create an invoice.
|
|
852
|
+
* @param amountMsats The amount of the invoice in msats. You can create a zero-amount invoice to accept any payment amount.
|
|
853
|
+
* @param memo A string memo to include in the invoice as a description.
|
|
854
|
+
* @param type The type of invoice to create. Defaults to a normal payment invoice, but you can pass InvoiceType.AMP
|
|
855
|
+
* to create an [AMP invoice](https://docs.lightning.engineering/lightning-network-tools/lnd/amp), which can be
|
|
856
|
+
* paid multiple times.
|
|
857
|
+
* @returns An encoded payment request for the invoice, or undefined if the invoice could not be created.
|
|
858
|
+
*/
|
|
859
|
+
createInvoice(nodeId: string, amountMsats: number, memo: string, type?: InvoiceType | undefined): Promise<string | undefined>;
|
|
860
|
+
/**
|
|
861
|
+
* Decodes an encoded lightning invoice string.
|
|
862
|
+
*
|
|
863
|
+
* @param encodedInvoice The string encoded invoice to decode.
|
|
864
|
+
* @returns Decoded invoice data.
|
|
865
|
+
*/
|
|
866
|
+
decodeInvoice(encodedInvoice: string): Promise<InvoiceData>;
|
|
867
|
+
/**
|
|
868
|
+
* Gets an estimate of the fee for sending a payment over the given bitcoin network.
|
|
869
|
+
*
|
|
870
|
+
* @param bitcoinNetwork The bitcoin network for which to get a fee estimate. Defaults to MAINNET.
|
|
871
|
+
* @returns A fee estimate for the given bitcoin network including a minimum fee rate, and a max-speed fee rate.
|
|
872
|
+
*/
|
|
873
|
+
getBitcoinFeeEstimate(bitcoinNetwork?: BitcoinNetwork): Promise<FeeEstimate>;
|
|
874
|
+
/**
|
|
875
|
+
* Gets an estimate of the fees that will be paid for a Lightning invoice.
|
|
876
|
+
*
|
|
877
|
+
* @param nodeId The node from where you want to send the payment.
|
|
878
|
+
* @param encodedPaymentRequest The invoice you want to pay (as defined by the BOLT11 standard).
|
|
879
|
+
* @param amountMsats If the invoice does not specify a payment amount, then the amount that you wish to pay,
|
|
880
|
+
* expressed in msats.
|
|
881
|
+
* @returns An estimate of the fees that will be paid for a Lightning invoice.
|
|
882
|
+
*/
|
|
883
|
+
getLightningFeeEstimateForInvoice(nodeId: string, encodedPaymentRequest: string, amountMsats?: number | undefined): Promise<CurrencyAmount>;
|
|
884
|
+
/**
|
|
885
|
+
* Returns an estimate of the fees that will be paid to send a payment to another Lightning node.
|
|
886
|
+
*
|
|
887
|
+
* @param nodeId The node from where you want to send the payment.
|
|
888
|
+
* @param destinationNodePublicKey The public key of the node that you want to pay.
|
|
889
|
+
* @param amountMsats The payment amount expressed in msats.
|
|
890
|
+
* @returns An estimate of the fees that will be paid to send a payment to another Lightning node.
|
|
891
|
+
*/
|
|
892
|
+
getLightningFeeEstimateForNode(nodeId: string, destinationNodePublicKey: string, amountMsats: number): Promise<CurrencyAmount>;
|
|
893
|
+
/**
|
|
894
|
+
* Unlock the given node for sensitive operations like sending payments.
|
|
895
|
+
*
|
|
896
|
+
* @param nodeId The ID of the node to unlock.
|
|
897
|
+
* @param password The node password assigned at node creation.
|
|
898
|
+
* @returns True if the node was unlocked successfully, false otherwise.
|
|
899
|
+
*/
|
|
900
|
+
unlockNode(nodeId: string, password: string): Promise<boolean>;
|
|
901
|
+
private recoverNodeSigningKey;
|
|
902
|
+
/**
|
|
903
|
+
* Directly unlocks a node with a signing private key.
|
|
904
|
+
*
|
|
905
|
+
* @param nodeId The ID of the node to unlock.
|
|
906
|
+
* @param signingPrivateKeyPEM The PEM-encoded signing private key.
|
|
907
|
+
*/
|
|
908
|
+
loadNodeKey(nodeId: string, signingPrivateKeyPEM: string): Promise<void>;
|
|
909
|
+
/**
|
|
910
|
+
* Sends a lightning payment for a given invoice.
|
|
911
|
+
*
|
|
912
|
+
* @param payerNodeId The ID of the node that will pay the invoice.
|
|
913
|
+
* @param encodedInvoice The encoded invoice to pay.
|
|
914
|
+
* @param maximumFeesMsats Maximum fees (in msats) to pay for the payment. This parameter is required.
|
|
915
|
+
* As guidance, a maximum fee of 16 basis points should make almost all transactions succeed. For example,
|
|
916
|
+
* for a transaction between 10k sats and 100k sats, this would mean a fee limit of 16 to 160 sats.
|
|
917
|
+
* @param timeoutSecs A timeout for the payment in seconds. Defaults to 60 seconds.
|
|
918
|
+
* @param amountMsats The amount to pay in msats for a zero-amount invoice. Defaults to the full amount of the
|
|
919
|
+
* invoice. NOTE: This parameter can only be passed for a zero-amount invoice. Otherwise, the call will fail.
|
|
920
|
+
* @returns An `OutgoingPayment` object if the payment was successful, or undefined if the payment failed.
|
|
921
|
+
*/
|
|
922
|
+
payInvoice(payerNodeId: string, encodedInvoice: string, maximumFeesMsats: number, timeoutSecs?: number, amountMsats?: number | undefined): Promise<OutgoingPayment | undefined>;
|
|
923
|
+
/**
|
|
924
|
+
* Sends a payment directly to a node on the Lightning Network through the public key of the node without an invoice.
|
|
925
|
+
*
|
|
926
|
+
* @param payerNodeId The ID of the node that will send the payment.
|
|
927
|
+
* @param destinationPublicKey The public key of the destination node.
|
|
928
|
+
* @param timeoutSecs The timeout in seconds that we will try to make the payment.
|
|
929
|
+
* @param amountMsats The amount to pay in msats.
|
|
930
|
+
* @param maximumFeesMsats Maximum fees (in msats) to pay for the payment. This parameter is required.
|
|
931
|
+
* As guidance, a maximum fee of 15 basis points should make almost all transactions succeed. For example,
|
|
932
|
+
* for a transaction between 10k sats and 100k sats, this would mean a fee limit of 15 to 150 sats.
|
|
933
|
+
* @returns An `OutgoingPayment` object if the payment was successful, or undefined if the payment failed.
|
|
934
|
+
*/
|
|
935
|
+
sendPayment(payerNodeId: string, destinationPublicKey: string, timeoutSecs: number | undefined, amountMsats: number, maximumFeesMsats: number): Promise<OutgoingPayment | undefined>;
|
|
936
|
+
/**
|
|
937
|
+
* Creates an L1 Bitcoin wallet address for a given node which can be used to deposit or withdraw funds.
|
|
938
|
+
*
|
|
939
|
+
* @param nodeId The ID of the node to create a wallet address for.
|
|
940
|
+
* @returns A string containing the wallet address for the given node.
|
|
941
|
+
*/
|
|
942
|
+
createNodeWalletAddress(nodeId: string): Promise<string>;
|
|
943
|
+
/**
|
|
944
|
+
* Withdraws funds from the account and sends it to the requested bitcoin address.
|
|
945
|
+
*
|
|
946
|
+
* Depending on the chosen mode, it will first take the funds from the wallet, and if applicable, close channels
|
|
947
|
+
* appropriately to recover enough funds and reopen channels with the remaining funds.
|
|
948
|
+
* The process is asynchronous and may take up to a few minutes. You can check the progress by polling the
|
|
949
|
+
* `WithdrawalRequest` that is created, or by subscribing to a webhook.
|
|
950
|
+
*
|
|
951
|
+
* @param nodeId The ID of the node from which to withdraw funds.
|
|
952
|
+
* @param amountSats The amount of funds to withdraw in satoshis.
|
|
953
|
+
* @param bitcoinAddress The Bitcoin address to withdraw funds to.
|
|
954
|
+
* @param mode The mode to use for the withdrawal. See `WithdrawalMode` for more information.
|
|
955
|
+
*/
|
|
956
|
+
requestWithdrawal(nodeId: string, amountSats: number, bitcoinAddress: string, mode: WithdrawalMode): Promise<WithdrawalRequest>;
|
|
957
|
+
/**
|
|
958
|
+
* Adds funds to a Lightspark node on the REGTEST network. If the amount is not specified, 10,000,000 SATOSHI will be
|
|
959
|
+
* added. This API only functions for nodes created on the REGTEST network and will return an error when called for
|
|
960
|
+
* any non-REGTEST node.
|
|
961
|
+
*
|
|
962
|
+
* @param nodeId The ID of the node to fund. Must be a REGTEST node.
|
|
963
|
+
* @param amountSats The amount of funds to add to the node in satoshis. Defaults to 10,000,000 SATOSHI.
|
|
964
|
+
* @returns
|
|
965
|
+
*/
|
|
966
|
+
fundNode(nodeId: string, amountSats?: number | undefined): Promise<CurrencyAmount>;
|
|
967
|
+
/**
|
|
968
|
+
* Creates a new API token that can be used to authenticate requests for this account when using the Lightspark APIs
|
|
969
|
+
* and SDKs.
|
|
970
|
+
*
|
|
971
|
+
* @param name Creates a new API token that can be used to authenticate requests for this account when using the
|
|
972
|
+
* Lightspark APIs and SDKs.
|
|
973
|
+
* @param transact Whether the token should be able to transact or only view data.
|
|
974
|
+
* @param testMode True if the token should be able to access only testnet false to access only mainnet.
|
|
975
|
+
* @returns An object containing the API token and client secret.
|
|
976
|
+
*/
|
|
977
|
+
createApiToken(name: string, transact?: boolean, testMode?: boolean): Promise<CreateApiTokenOutput>;
|
|
978
|
+
/**
|
|
979
|
+
* Deletes an existing API token from this account.
|
|
980
|
+
*
|
|
981
|
+
* @param id The ID of the API token to delete.
|
|
982
|
+
*/
|
|
983
|
+
deleteApiToken(id: string): Promise<void>;
|
|
984
|
+
/**
|
|
985
|
+
* Executes a raw `Query` against the Lightspark API.
|
|
986
|
+
*
|
|
987
|
+
* This generally should not be used directly, but is exposed for advanced use cases and for internal use to retrieve
|
|
988
|
+
* complex fields from objects.
|
|
989
|
+
*
|
|
990
|
+
* @param query The `Query` to execute.
|
|
991
|
+
* @returns The result of the query.
|
|
992
|
+
*/
|
|
993
|
+
executeRawQuery<T>(query: Query<T>): Promise<T | null>;
|
|
994
|
+
}
|
|
995
|
+
|
|
996
|
+
type AccountToApiTokensConnection = {
|
|
997
|
+
/** An object that holds pagination information about the objects in this connection. **/
|
|
998
|
+
pageInfo: PageInfo;
|
|
999
|
+
/**
|
|
1000
|
+
* The total count of objects in this connection, using the current filters. It is different from the
|
|
1001
|
+
* number of objects returned in the current page (in the `entities` field).
|
|
1002
|
+
**/
|
|
1003
|
+
count: number;
|
|
1004
|
+
/** The API tokens for the current page of this connection. **/
|
|
1005
|
+
entities: ApiToken[];
|
|
1006
|
+
};
|
|
1007
|
+
|
|
1008
|
+
type ChannelFees = {
|
|
1009
|
+
baseFee?: CurrencyAmount;
|
|
1010
|
+
feeRatePerMil?: number;
|
|
1011
|
+
};
|
|
1012
|
+
|
|
1013
|
+
declare enum ChannelStatus {
|
|
1014
|
+
/**
|
|
1015
|
+
* This is an enum value that represents values that could be added in the future.
|
|
1016
|
+
* Clients should support unknown values as more of them could be added without notice.
|
|
1017
|
+
*/
|
|
1018
|
+
FUTURE_VALUE = "FUTURE_VALUE",
|
|
1019
|
+
/** The channel is online and ready to send and receive funds. **/
|
|
1020
|
+
OK = "OK",
|
|
1021
|
+
/** The channel has been created, but the Bitcoin transaction that initiates it still needs to be confirmed on the Bitcoin blockchain. **/
|
|
1022
|
+
PENDING = "PENDING",
|
|
1023
|
+
/** The channel is not available, likely because the peer is not online. **/
|
|
1024
|
+
OFFLINE = "OFFLINE",
|
|
1025
|
+
/** The channel is behaving properly, but its remote balance is much higher than its local balance so it is not balanced properly for sending funds out. **/
|
|
1026
|
+
UNBALANCED_FOR_SEND = "UNBALANCED_FOR_SEND",
|
|
1027
|
+
/** The channel is behaving properly, but its remote balance is much lower than its local balance so it is not balanced properly for receiving funds. **/
|
|
1028
|
+
UNBALANCED_FOR_RECEIVE = "UNBALANCED_FOR_RECEIVE",
|
|
1029
|
+
/** The channel has been closed. Information about the channel is still available for historical purposes but the channel cannot be used anymore. **/
|
|
1030
|
+
CLOSED = "CLOSED",
|
|
1031
|
+
/** Something unexpected happened and we cannot determine the status of this channel. Please try again later or contact the support. **/
|
|
1032
|
+
ERROR = "ERROR"
|
|
1033
|
+
}
|
|
1034
|
+
|
|
1035
|
+
type ChannelToTransactionsConnection = {
|
|
1036
|
+
/**
|
|
1037
|
+
* The total count of objects in this connection, using the current filters. It is different from the
|
|
1038
|
+
* number of objects returned in the current page (in the `entities` field).
|
|
1039
|
+
**/
|
|
1040
|
+
count: number;
|
|
1041
|
+
/**
|
|
1042
|
+
* The average fee for the transactions that transited through this channel, according to the filters
|
|
1043
|
+
* and constraints of the connection.
|
|
1044
|
+
**/
|
|
1045
|
+
averageFee?: CurrencyAmount;
|
|
1046
|
+
/**
|
|
1047
|
+
* The total amount transacted for the transactions that transited through this channel, according to
|
|
1048
|
+
* the filters and constraints of the connection.
|
|
1049
|
+
**/
|
|
1050
|
+
totalAmountTransacted?: CurrencyAmount;
|
|
1051
|
+
/**
|
|
1052
|
+
* The total amount of fees for the transactions that transited through this channel, according to the
|
|
1053
|
+
* filters and constraints of the connection.
|
|
1054
|
+
**/
|
|
1055
|
+
totalFees?: CurrencyAmount;
|
|
1056
|
+
};
|
|
1057
|
+
|
|
1058
|
+
declare enum TransactionType {
|
|
1059
|
+
/**
|
|
1060
|
+
* This is an enum value that represents values that could be added in the future.
|
|
1061
|
+
* Clients should support unknown values as more of them could be added without notice.
|
|
1062
|
+
*/
|
|
1063
|
+
FUTURE_VALUE = "FUTURE_VALUE",
|
|
1064
|
+
/** Transactions initiated from a Lightspark node on Lightning Network. **/
|
|
1065
|
+
OUTGOING_PAYMENT = "OUTGOING_PAYMENT",
|
|
1066
|
+
/** Transactions received by a Lightspark node on Lightning Network. **/
|
|
1067
|
+
INCOMING_PAYMENT = "INCOMING_PAYMENT",
|
|
1068
|
+
/** Transactions that forwarded payments through Lightspark nodes on Lightning Network. **/
|
|
1069
|
+
ROUTED = "ROUTED",
|
|
1070
|
+
/** Transactions on the Bitcoin blockchain to withdraw funds from a Lightspark node to a Bitcoin wallet. **/
|
|
1071
|
+
L1_WITHDRAW = "L1_WITHDRAW",
|
|
1072
|
+
/** Transactions on Bitcoin blockchain to fund a Lightspark node's wallet. **/
|
|
1073
|
+
L1_DEPOSIT = "L1_DEPOSIT",
|
|
1074
|
+
/** Transactions on Bitcoin blockchain to open a channel on Lightning Network funded by the local Lightspark node. **/
|
|
1075
|
+
CHANNEL_OPEN = "CHANNEL_OPEN",
|
|
1076
|
+
/** Transactions on Bitcoin blockchain to close a channel on Lightning Network where the balances are allocated back to local and remote nodes. **/
|
|
1077
|
+
CHANNEL_CLOSE = "CHANNEL_CLOSE",
|
|
1078
|
+
/** Transactions initiated from a Lightspark node on Lightning Network. **/
|
|
1079
|
+
PAYMENT = "PAYMENT",
|
|
1080
|
+
/** Payment requests from a Lightspark node on Lightning Network **/
|
|
1081
|
+
PAYMENT_REQUEST = "PAYMENT_REQUEST",
|
|
1082
|
+
/** Transactions that forwarded payments through Lightspark nodes on Lightning Network. **/
|
|
1083
|
+
ROUTE = "ROUTE"
|
|
1084
|
+
}
|
|
1085
|
+
|
|
1086
|
+
/** An object that represents a payment channel between two nodes in the Lightning Network. **/
|
|
1087
|
+
declare class Channel implements Entity {
|
|
1088
|
+
readonly id: string;
|
|
1089
|
+
readonly createdAt: string;
|
|
1090
|
+
readonly updatedAt: string;
|
|
1091
|
+
readonly localNodeId: string;
|
|
1092
|
+
readonly typename: string;
|
|
1093
|
+
readonly fundingTransactionId?: string | undefined;
|
|
1094
|
+
readonly capacity?: CurrencyAmount | undefined;
|
|
1095
|
+
readonly localBalance?: CurrencyAmount | undefined;
|
|
1096
|
+
readonly localUnsettledBalance?: CurrencyAmount | undefined;
|
|
1097
|
+
readonly remoteBalance?: CurrencyAmount | undefined;
|
|
1098
|
+
readonly remoteUnsettledBalance?: CurrencyAmount | undefined;
|
|
1099
|
+
readonly unsettledBalance?: CurrencyAmount | undefined;
|
|
1100
|
+
readonly totalBalance?: CurrencyAmount | undefined;
|
|
1101
|
+
readonly status?: ChannelStatus | undefined;
|
|
1102
|
+
readonly estimatedForceClosureWaitMinutes?: number | undefined;
|
|
1103
|
+
readonly commitFee?: CurrencyAmount | undefined;
|
|
1104
|
+
readonly fees?: ChannelFees | undefined;
|
|
1105
|
+
readonly remoteNodeId?: string | undefined;
|
|
1106
|
+
readonly shortChannelId?: string | undefined;
|
|
1107
|
+
constructor(id: string, createdAt: string, updatedAt: string, localNodeId: string, typename: string, fundingTransactionId?: string | undefined, capacity?: CurrencyAmount | undefined, localBalance?: CurrencyAmount | undefined, localUnsettledBalance?: CurrencyAmount | undefined, remoteBalance?: CurrencyAmount | undefined, remoteUnsettledBalance?: CurrencyAmount | undefined, unsettledBalance?: CurrencyAmount | undefined, totalBalance?: CurrencyAmount | undefined, status?: ChannelStatus | undefined, estimatedForceClosureWaitMinutes?: number | undefined, commitFee?: CurrencyAmount | undefined, fees?: ChannelFees | undefined, remoteNodeId?: string | undefined, shortChannelId?: string | undefined);
|
|
1108
|
+
getUptimePercentage(client: LightsparkClient, afterDate?: string | undefined, beforeDate?: string | undefined): Promise<number>;
|
|
1109
|
+
getTransactions(client: LightsparkClient, types?: TransactionType[] | undefined, afterDate?: string | undefined, beforeDate?: string | undefined): Promise<ChannelToTransactionsConnection>;
|
|
1110
|
+
static getChannelQuery(id: string): Query<Channel>;
|
|
1111
|
+
}
|
|
1112
|
+
|
|
1113
|
+
declare class AccountToChannelsConnection {
|
|
1114
|
+
readonly count: number;
|
|
1115
|
+
readonly entities: Channel[];
|
|
1116
|
+
constructor(count: number, entities: Channel[]);
|
|
1117
|
+
}
|
|
1118
|
+
|
|
1119
|
+
/** This object provides a detailed breakdown of a `LightsparkNode`'s current balance on the Bitcoin Network. **/
|
|
1120
|
+
type BlockchainBalance = {
|
|
1121
|
+
/** The total wallet balance, including unconfirmed UTXOs. **/
|
|
1122
|
+
totalBalance?: CurrencyAmount;
|
|
1123
|
+
/** The balance of confirmed UTXOs in the wallet. **/
|
|
1124
|
+
confirmedBalance?: CurrencyAmount;
|
|
1125
|
+
/** The balance of unconfirmed UTXOs in the wallet. **/
|
|
1126
|
+
unconfirmedBalance?: CurrencyAmount;
|
|
1127
|
+
/** The balance that's locked by an on-chain transaction. **/
|
|
1128
|
+
lockedBalance?: CurrencyAmount;
|
|
1129
|
+
/** Funds required to be held in reserve for channel bumping. **/
|
|
1130
|
+
requiredReserve?: CurrencyAmount;
|
|
1131
|
+
/** Funds available for creating channels or withdrawing. **/
|
|
1132
|
+
availableBalance?: CurrencyAmount;
|
|
1133
|
+
};
|
|
1134
|
+
|
|
1135
|
+
type LightsparkNodeToChannelsConnection = {
|
|
1136
|
+
/** An object that holds pagination information about the objects in this connection. **/
|
|
1137
|
+
pageInfo: PageInfo;
|
|
1138
|
+
/**
|
|
1139
|
+
* The total count of objects in this connection, using the current filters. It is different from the
|
|
1140
|
+
* number of objects returned in the current page (in the `entities` field).
|
|
1141
|
+
**/
|
|
1142
|
+
count: number;
|
|
1143
|
+
/** The channels for the current page of this connection. **/
|
|
1144
|
+
entities: Channel[];
|
|
1145
|
+
};
|
|
1146
|
+
|
|
1147
|
+
type Secret = {
|
|
1148
|
+
encryptedValue: string;
|
|
1149
|
+
cipher: string;
|
|
1150
|
+
};
|
|
1151
|
+
|
|
1152
|
+
/** This is a node that is managed by Lightspark and is managed within the current connected account. It contains many details about the node configuration, state, and metadata. **/
|
|
1153
|
+
declare class LightsparkNode implements Node {
|
|
1154
|
+
readonly id: string;
|
|
1155
|
+
readonly createdAt: string;
|
|
1156
|
+
readonly updatedAt: string;
|
|
1157
|
+
readonly bitcoinNetwork: BitcoinNetwork;
|
|
1158
|
+
readonly displayName: string;
|
|
1159
|
+
readonly accountId: string;
|
|
1160
|
+
readonly typename: string;
|
|
1161
|
+
readonly alias?: string | undefined;
|
|
1162
|
+
readonly color?: string | undefined;
|
|
1163
|
+
readonly conductivity?: number | undefined;
|
|
1164
|
+
readonly publicKey?: string | undefined;
|
|
1165
|
+
readonly blockchainBalance?: BlockchainBalance | undefined;
|
|
1166
|
+
readonly encryptedSigningPrivateKey?: Secret | undefined;
|
|
1167
|
+
readonly totalBalance?: CurrencyAmount | undefined;
|
|
1168
|
+
readonly totalLocalBalance?: CurrencyAmount | undefined;
|
|
1169
|
+
readonly localBalance?: CurrencyAmount | undefined;
|
|
1170
|
+
readonly purpose?: LightsparkNodePurpose | undefined;
|
|
1171
|
+
readonly remoteBalance?: CurrencyAmount | undefined;
|
|
1172
|
+
readonly status?: LightsparkNodeStatus | undefined;
|
|
1173
|
+
constructor(id: string, createdAt: string, updatedAt: string, bitcoinNetwork: BitcoinNetwork, displayName: string, accountId: string, typename: string, alias?: string | undefined, color?: string | undefined, conductivity?: number | undefined, publicKey?: string | undefined, blockchainBalance?: BlockchainBalance | undefined, encryptedSigningPrivateKey?: Secret | undefined, totalBalance?: CurrencyAmount | undefined, totalLocalBalance?: CurrencyAmount | undefined, localBalance?: CurrencyAmount | undefined, purpose?: LightsparkNodePurpose | undefined, remoteBalance?: CurrencyAmount | undefined, status?: LightsparkNodeStatus | undefined);
|
|
1174
|
+
getAddresses(client: LightsparkClient, first?: number | undefined, types?: NodeAddressType[] | undefined): Promise<NodeToAddressesConnection>;
|
|
1175
|
+
getChannels(client: LightsparkClient, first?: number | undefined, statuses?: ChannelStatus[] | undefined): Promise<LightsparkNodeToChannelsConnection>;
|
|
1176
|
+
static getLightsparkNodeQuery(id: string): Query<LightsparkNode>;
|
|
1177
|
+
}
|
|
1178
|
+
|
|
1179
|
+
/** A connection between an account and the nodes it manages. **/
|
|
1180
|
+
type AccountToNodesConnection = {
|
|
1181
|
+
/** An object that holds pagination information about the objects in this connection. **/
|
|
1182
|
+
pageInfo: PageInfo;
|
|
1183
|
+
/**
|
|
1184
|
+
* The total count of objects in this connection, using the current filters. It is different from the
|
|
1185
|
+
* number of objects returned in the current page (in the `entities` field).
|
|
1186
|
+
**/
|
|
1187
|
+
count: number;
|
|
1188
|
+
/** The nodes for the current page of this connection. **/
|
|
1189
|
+
entities: LightsparkNode[];
|
|
1190
|
+
/**
|
|
1191
|
+
* The main purpose for the selected set of nodes. It is automatically determined from the nodes that
|
|
1192
|
+
* are selected in this connection and is used for optimization purposes, as well as to determine the
|
|
1193
|
+
* variation of the UI that should be presented to the user.
|
|
1194
|
+
**/
|
|
1195
|
+
purpose?: LightsparkNodePurpose;
|
|
1196
|
+
};
|
|
1197
|
+
|
|
1198
|
+
declare enum PaymentRequestStatus {
|
|
1199
|
+
/**
|
|
1200
|
+
* This is an enum value that represents values that could be added in the future.
|
|
1201
|
+
* Clients should support unknown values as more of them could be added without notice.
|
|
1202
|
+
*/
|
|
1203
|
+
FUTURE_VALUE = "FUTURE_VALUE",
|
|
1204
|
+
OPEN = "OPEN",
|
|
1205
|
+
CLOSED = "CLOSED"
|
|
1206
|
+
}
|
|
1207
|
+
|
|
1208
|
+
type PaymentRequest = Entity & {
|
|
1209
|
+
/**
|
|
1210
|
+
* The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque
|
|
1211
|
+
* string.
|
|
1212
|
+
**/
|
|
1213
|
+
id: string;
|
|
1214
|
+
/** The date and time when the entity was first created. **/
|
|
1215
|
+
createdAt: string;
|
|
1216
|
+
/** The date and time when the entity was last updated. **/
|
|
1217
|
+
updatedAt: string;
|
|
1218
|
+
/** The details of the payment request. **/
|
|
1219
|
+
data: PaymentRequestData;
|
|
1220
|
+
/** The status of the payment request. **/
|
|
1221
|
+
status: PaymentRequestStatus;
|
|
1222
|
+
/** The typename of the object **/
|
|
1223
|
+
typename: string;
|
|
1224
|
+
};
|
|
1225
|
+
declare const getPaymentRequestQuery: (id: string) => Query<PaymentRequest>;
|
|
1226
|
+
|
|
1227
|
+
type AccountToPaymentRequestsConnection = {
|
|
1228
|
+
/** The payment requests for the current page of this connection. **/
|
|
1229
|
+
entities: PaymentRequest[];
|
|
1230
|
+
/** An object that holds pagination information about the objects in this connection. **/
|
|
1231
|
+
pageInfo: PageInfo;
|
|
1232
|
+
/**
|
|
1233
|
+
* The total count of objects in this connection, using the current filters. It is different from the
|
|
1234
|
+
* number of objects returned in the current page (in the `entities` field).
|
|
1235
|
+
**/
|
|
1236
|
+
count?: number;
|
|
1237
|
+
};
|
|
1238
|
+
|
|
1239
|
+
type AccountToTransactionsConnection = {
|
|
1240
|
+
/**
|
|
1241
|
+
* The total count of objects in this connection, using the current filters. It is different from the
|
|
1242
|
+
* number of objects returned in the current page (in the `entities` field).
|
|
1243
|
+
**/
|
|
1244
|
+
count: number;
|
|
1245
|
+
/** The transactions for the current page of this connection. **/
|
|
1246
|
+
entities: Transaction[];
|
|
1247
|
+
/** An object that holds pagination information about the objects in this connection. **/
|
|
1248
|
+
pageInfo: PageInfo;
|
|
1249
|
+
/**
|
|
1250
|
+
* Profit (or loss) generated by the transactions in this connection, with the set of filters and
|
|
1251
|
+
* constraints provided.
|
|
1252
|
+
**/
|
|
1253
|
+
profitLoss?: CurrencyAmount;
|
|
1254
|
+
/**
|
|
1255
|
+
* Average fee earned for the transactions in this connection, with the set of filters and constraints
|
|
1256
|
+
* provided.
|
|
1257
|
+
**/
|
|
1258
|
+
averageFeeEarned?: CurrencyAmount;
|
|
1259
|
+
/**
|
|
1260
|
+
* Total amount transacted by the transactions in this connection, with the set of filters and
|
|
1261
|
+
* constraints provided.
|
|
1262
|
+
**/
|
|
1263
|
+
totalAmountTransacted?: CurrencyAmount;
|
|
1264
|
+
};
|
|
1265
|
+
|
|
1266
|
+
declare enum RoutingTransactionFailureReason {
|
|
1267
|
+
/**
|
|
1268
|
+
* This is an enum value that represents values that could be added in the future.
|
|
1269
|
+
* Clients should support unknown values as more of them could be added without notice.
|
|
1270
|
+
*/
|
|
1271
|
+
FUTURE_VALUE = "FUTURE_VALUE",
|
|
1272
|
+
INCOMING_LINK_FAILURE = "INCOMING_LINK_FAILURE",
|
|
1273
|
+
OUTGOING_LINK_FAILURE = "OUTGOING_LINK_FAILURE",
|
|
1274
|
+
FORWARDING_FAILURE = "FORWARDING_FAILURE"
|
|
1275
|
+
}
|
|
1276
|
+
|
|
1277
|
+
type TransactionFailures = {
|
|
1278
|
+
paymentFailures?: PaymentFailureReason[];
|
|
1279
|
+
routingTransactionFailures?: RoutingTransactionFailureReason[];
|
|
1280
|
+
};
|
|
1281
|
+
|
|
1282
|
+
declare class Account implements Entity {
|
|
1283
|
+
readonly id: string;
|
|
1284
|
+
readonly createdAt: string;
|
|
1285
|
+
readonly updatedAt: string;
|
|
1286
|
+
readonly typename: string;
|
|
1287
|
+
readonly name?: string | undefined;
|
|
1288
|
+
constructor(id: string, createdAt: string, updatedAt: string, typename: string, name?: string | undefined);
|
|
1289
|
+
getApiTokens(client: LightsparkClient, first?: number | undefined): Promise<AccountToApiTokensConnection>;
|
|
1290
|
+
getBlockchainBalance(client: LightsparkClient, bitcoinNetworks?: BitcoinNetwork[] | undefined, nodeIds?: string[] | undefined): Promise<BlockchainBalance | null>;
|
|
1291
|
+
getConductivity(client: LightsparkClient, bitcoinNetworks?: BitcoinNetwork[] | undefined, nodeIds?: string[] | undefined): Promise<number>;
|
|
1292
|
+
getLocalBalance(client: LightsparkClient, bitcoinNetworks?: BitcoinNetwork[] | undefined, nodeIds?: string[] | undefined): Promise<CurrencyAmount | null>;
|
|
1293
|
+
getNodes(client: LightsparkClient, first?: number | undefined, bitcoinNetworks?: BitcoinNetwork[] | undefined, nodeIds?: string[] | undefined): Promise<AccountToNodesConnection>;
|
|
1294
|
+
getRemoteBalance(client: LightsparkClient, bitcoinNetworks?: BitcoinNetwork[] | undefined, nodeIds?: string[] | undefined): Promise<CurrencyAmount | null>;
|
|
1295
|
+
getUptimePercentage(client: LightsparkClient, afterDate?: string | undefined, beforeDate?: string | undefined, bitcoinNetworks?: BitcoinNetwork[] | undefined, nodeIds?: string[] | undefined): Promise<number>;
|
|
1296
|
+
getChannels(client: LightsparkClient, bitcoinNetwork: BitcoinNetwork, lightningNodeId?: string | undefined, afterDate?: string | undefined, beforeDate?: string | undefined, first?: number | undefined): Promise<AccountToChannelsConnection>;
|
|
1297
|
+
getTransactions(client: LightsparkClient, first?: number | undefined, after?: string | undefined, types?: TransactionType[] | undefined, afterDate?: string | undefined, beforeDate?: string | undefined, bitcoinNetwork?: BitcoinNetwork | undefined, lightningNodeId?: string | undefined, statuses?: TransactionStatus[] | undefined, excludeFailures?: TransactionFailures | undefined): Promise<AccountToTransactionsConnection>;
|
|
1298
|
+
getPaymentRequests(client: LightsparkClient, first?: number | undefined, after?: string | undefined, afterDate?: string | undefined, beforeDate?: string | undefined, bitcoinNetwork?: BitcoinNetwork | undefined, lightningNodeId?: string | undefined): Promise<AccountToPaymentRequestsConnection>;
|
|
1299
|
+
static getAccountQuery(): Query<Account>;
|
|
1300
|
+
}
|
|
1301
|
+
|
|
1302
|
+
type CreateApiTokenInput = {
|
|
1303
|
+
/** An arbitrary name that the user can choose to identify the API token in a list. **/
|
|
1304
|
+
name: string;
|
|
1305
|
+
/** List of permissions to grant to the API token **/
|
|
1306
|
+
permissions: Permission[];
|
|
1307
|
+
};
|
|
1308
|
+
|
|
1309
|
+
type CreateInvoiceInput = {
|
|
1310
|
+
nodeId: string;
|
|
1311
|
+
amountMsats: number;
|
|
1312
|
+
memo?: string;
|
|
1313
|
+
invoiceType?: InvoiceType;
|
|
1314
|
+
};
|
|
1315
|
+
|
|
1316
|
+
type CreateInvoiceOutput = {
|
|
1317
|
+
invoiceId: string;
|
|
1318
|
+
};
|
|
1319
|
+
|
|
1320
|
+
type CreateNodeWalletAddressInput = {
|
|
1321
|
+
nodeId: string;
|
|
1322
|
+
};
|
|
1323
|
+
|
|
1324
|
+
type CreateNodeWalletAddressOutput = {
|
|
1325
|
+
nodeId: string;
|
|
1326
|
+
walletAddress: string;
|
|
1327
|
+
};
|
|
1328
|
+
|
|
1329
|
+
type DeleteApiTokenInput = {
|
|
1330
|
+
apiTokenId: string;
|
|
1331
|
+
};
|
|
1332
|
+
|
|
1333
|
+
type DeleteApiTokenOutput = {
|
|
1334
|
+
accountId: string;
|
|
1335
|
+
};
|
|
1336
|
+
|
|
1337
|
+
/** The transaction on Bitcoin blockchain to fund the Lightspark node's wallet. **/
|
|
1338
|
+
type Deposit = OnChainTransaction & Transaction & Entity & {
|
|
1339
|
+
/**
|
|
1340
|
+
* The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque
|
|
1341
|
+
* string.
|
|
1342
|
+
**/
|
|
1343
|
+
id: string;
|
|
1344
|
+
/** The date and time when this transaction was initiated. **/
|
|
1345
|
+
createdAt: string;
|
|
1346
|
+
/** The date and time when the entity was last updated. **/
|
|
1347
|
+
updatedAt: string;
|
|
1348
|
+
/** The current status of this transaction. **/
|
|
1349
|
+
status: TransactionStatus;
|
|
1350
|
+
/** The amount of money involved in this transaction. **/
|
|
1351
|
+
amount: CurrencyAmount;
|
|
1352
|
+
/**
|
|
1353
|
+
* The height of the block that included this transaction. This will be zero for unconfirmed
|
|
1354
|
+
* transactions.
|
|
1355
|
+
**/
|
|
1356
|
+
blockHeight: number;
|
|
1357
|
+
/** The Bitcoin blockchain addresses this transaction was sent to. **/
|
|
1358
|
+
destinationAddresses: string[];
|
|
1359
|
+
/** The recipient Lightspark node this deposit was sent to. **/
|
|
1360
|
+
destinationId: string;
|
|
1361
|
+
/** The typename of the object **/
|
|
1362
|
+
typename: string;
|
|
1363
|
+
/** The date and time when this transaction was completed or failed. **/
|
|
1364
|
+
resolvedAt?: string;
|
|
1365
|
+
/** The hash of this transaction, so it can be uniquely identified on the Lightning Network. **/
|
|
1366
|
+
transactionHash?: string;
|
|
1367
|
+
/**
|
|
1368
|
+
* The fees that were paid by the wallet sending the transaction to commit it to the Bitcoin
|
|
1369
|
+
* blockchain.
|
|
1370
|
+
**/
|
|
1371
|
+
fees?: CurrencyAmount;
|
|
1372
|
+
/**
|
|
1373
|
+
* The hash of the block that included this transaction. This will be null for unconfirmed
|
|
1374
|
+
* transactions.
|
|
1375
|
+
**/
|
|
1376
|
+
blockHash?: string;
|
|
1377
|
+
/** The number of blockchain confirmations for this transaction in real time. **/
|
|
1378
|
+
numConfirmations?: number;
|
|
1379
|
+
};
|
|
1380
|
+
declare const getDepositQuery: (id: string) => Query<Deposit>;
|
|
1381
|
+
|
|
1382
|
+
type FundNodeInput = {
|
|
1383
|
+
nodeId: string;
|
|
1384
|
+
amountSats?: number;
|
|
1385
|
+
};
|
|
1386
|
+
|
|
1387
|
+
type FundNodeOutput = {
|
|
1388
|
+
amount: CurrencyAmount;
|
|
1389
|
+
};
|
|
1390
|
+
|
|
1391
|
+
/** This is a node on the Lightning Network, managed by a third party. The information about this node is public data that has been obtained by observing the Lightning Network. **/
|
|
1392
|
+
declare class GraphNode implements Node {
|
|
1393
|
+
readonly id: string;
|
|
1394
|
+
readonly createdAt: string;
|
|
1395
|
+
readonly updatedAt: string;
|
|
1396
|
+
readonly bitcoinNetwork: BitcoinNetwork;
|
|
1397
|
+
readonly displayName: string;
|
|
1398
|
+
readonly typename: string;
|
|
1399
|
+
readonly alias?: string | undefined;
|
|
1400
|
+
readonly color?: string | undefined;
|
|
1401
|
+
readonly conductivity?: number | undefined;
|
|
1402
|
+
readonly publicKey?: string | undefined;
|
|
1403
|
+
constructor(id: string, createdAt: string, updatedAt: string, bitcoinNetwork: BitcoinNetwork, displayName: string, typename: string, alias?: string | undefined, color?: string | undefined, conductivity?: number | undefined, publicKey?: string | undefined);
|
|
1404
|
+
getAddresses(client: LightsparkClient, first?: number | undefined, types?: NodeAddressType[] | undefined): Promise<NodeToAddressesConnection>;
|
|
1405
|
+
static getGraphNodeQuery(id: string): Query<GraphNode>;
|
|
1406
|
+
}
|
|
1407
|
+
|
|
1408
|
+
/** Enum that enumerates all the possible status of an incoming payment attempt. **/
|
|
1409
|
+
declare enum IncomingPaymentAttemptStatus {
|
|
1410
|
+
/**
|
|
1411
|
+
* This is an enum value that represents values that could be added in the future.
|
|
1412
|
+
* Clients should support unknown values as more of them could be added without notice.
|
|
1413
|
+
*/
|
|
1414
|
+
FUTURE_VALUE = "FUTURE_VALUE",
|
|
1415
|
+
ACCEPTED = "ACCEPTED",
|
|
1416
|
+
SETTLED = "SETTLED",
|
|
1417
|
+
CANCELED = "CANCELED",
|
|
1418
|
+
UNKNOWN = "UNKNOWN"
|
|
1419
|
+
}
|
|
1420
|
+
|
|
1421
|
+
/** An attempt for a payment over a route from sender node to recipient node. **/
|
|
1422
|
+
type IncomingPaymentAttempt = Entity & {
|
|
1423
|
+
/**
|
|
1424
|
+
* The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque
|
|
1425
|
+
* string.
|
|
1426
|
+
**/
|
|
1427
|
+
id: string;
|
|
1428
|
+
/** The date and time when the entity was first created. **/
|
|
1429
|
+
createdAt: string;
|
|
1430
|
+
/** The date and time when the entity was last updated. **/
|
|
1431
|
+
updatedAt: string;
|
|
1432
|
+
/** The status of the incoming payment attempt. **/
|
|
1433
|
+
status: IncomingPaymentAttemptStatus;
|
|
1434
|
+
/** The total amount of that was attempted to send. **/
|
|
1435
|
+
amount: CurrencyAmount;
|
|
1436
|
+
/** The channel this attempt was made on. **/
|
|
1437
|
+
channelId: string;
|
|
1438
|
+
/** The typename of the object **/
|
|
1439
|
+
typename: string;
|
|
1440
|
+
/** The time the incoming payment attempt failed or succeeded. **/
|
|
1441
|
+
resolvedAt?: string;
|
|
1442
|
+
};
|
|
1443
|
+
declare const getIncomingPaymentAttemptQuery: (id: string) => Query<IncomingPaymentAttempt>;
|
|
1444
|
+
|
|
1445
|
+
/** The connection from incoming payment to all attempts. **/
|
|
1446
|
+
type IncomingPaymentToAttemptsConnection = {
|
|
1447
|
+
/**
|
|
1448
|
+
* The total count of objects in this connection, using the current filters. It is different from the
|
|
1449
|
+
* number of objects returned in the current page (in the `entities` field).
|
|
1450
|
+
**/
|
|
1451
|
+
count: number;
|
|
1452
|
+
/** The incoming payment attempts for the current page of this connection. **/
|
|
1453
|
+
entities: IncomingPaymentAttempt[];
|
|
1454
|
+
};
|
|
1455
|
+
|
|
1456
|
+
/** A transaction that was sent to a Lightspark node on the Lightning Network. **/
|
|
1457
|
+
declare class IncomingPayment implements LightningTransaction {
|
|
1458
|
+
readonly id: string;
|
|
1459
|
+
readonly createdAt: string;
|
|
1460
|
+
readonly updatedAt: string;
|
|
1461
|
+
readonly status: TransactionStatus;
|
|
1462
|
+
readonly amount: CurrencyAmount;
|
|
1463
|
+
readonly destinationId: string;
|
|
1464
|
+
readonly typename: string;
|
|
1465
|
+
readonly resolvedAt?: string | undefined;
|
|
1466
|
+
readonly transactionHash?: string | undefined;
|
|
1467
|
+
readonly originId?: string | undefined;
|
|
1468
|
+
readonly paymentRequestId?: string | undefined;
|
|
1469
|
+
constructor(id: string, createdAt: string, updatedAt: string, status: TransactionStatus, amount: CurrencyAmount, destinationId: string, typename: string, resolvedAt?: string | undefined, transactionHash?: string | undefined, originId?: string | undefined, paymentRequestId?: string | undefined);
|
|
1470
|
+
getAttempts(client: LightsparkClient, first?: number | undefined, statuses?: IncomingPaymentAttemptStatus[] | undefined): Promise<IncomingPaymentToAttemptsConnection>;
|
|
1471
|
+
static getIncomingPaymentQuery(id: string): Query<IncomingPayment>;
|
|
1472
|
+
}
|
|
1473
|
+
|
|
1474
|
+
/** This object represents a BOLT #11 invoice (https://github.com/lightning/bolts/blob/master/11-payment-encoding.md) initiated by a Lightspark Node. **/
|
|
1475
|
+
type Invoice = PaymentRequest & Entity & {
|
|
1476
|
+
/**
|
|
1477
|
+
* The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque
|
|
1478
|
+
* string.
|
|
1479
|
+
**/
|
|
1480
|
+
id: string;
|
|
1481
|
+
/** The date and time when the entity was first created. **/
|
|
1482
|
+
createdAt: string;
|
|
1483
|
+
/** The date and time when the entity was last updated. **/
|
|
1484
|
+
updatedAt: string;
|
|
1485
|
+
/** The details of the invoice. **/
|
|
1486
|
+
data: InvoiceData;
|
|
1487
|
+
/** The status of the payment request. **/
|
|
1488
|
+
status: PaymentRequestStatus;
|
|
1489
|
+
/** The typename of the object **/
|
|
1490
|
+
typename: string;
|
|
1491
|
+
/** The total amount that has been paid to this invoice. **/
|
|
1492
|
+
amountPaid?: CurrencyAmount;
|
|
1493
|
+
};
|
|
1494
|
+
declare const getInvoiceQuery: (id: string) => Query<Invoice>;
|
|
1495
|
+
|
|
1496
|
+
type LightningFeeEstimateForInvoiceInput = {
|
|
1497
|
+
/** The node from where you want to send the payment. **/
|
|
1498
|
+
nodeId: string;
|
|
1499
|
+
/** The invoice you want to pay (as defined by the BOLT11 standard). **/
|
|
1500
|
+
encodedPaymentRequest: string;
|
|
1501
|
+
/**
|
|
1502
|
+
* If the invoice does not specify a payment amount, then the amount that you wish to pay, expressed
|
|
1503
|
+
* in msats.
|
|
1504
|
+
**/
|
|
1505
|
+
amountMsats?: number;
|
|
1506
|
+
};
|
|
1507
|
+
|
|
1508
|
+
type LightningFeeEstimateForNodeInput = {
|
|
1509
|
+
/** The node from where you want to send the payment. **/
|
|
1510
|
+
nodeId: string;
|
|
1511
|
+
/** The public key of the node that you want to pay. **/
|
|
1512
|
+
destinationNodePublicKey: string;
|
|
1513
|
+
/** The payment amount expressed in msats. **/
|
|
1514
|
+
amountMsats: number;
|
|
1515
|
+
};
|
|
1516
|
+
|
|
1517
|
+
type LightningFeeEstimateOutput = {
|
|
1518
|
+
/** The estimated fees for the payment. **/
|
|
1519
|
+
feeEstimate: CurrencyAmount;
|
|
1520
|
+
};
|
|
1521
|
+
|
|
1522
|
+
type PayInvoiceInput = {
|
|
1523
|
+
/** The node from where you want to send the payment. **/
|
|
1524
|
+
nodeId: string;
|
|
1525
|
+
/** The invoice you want to pay (as defined by the BOLT11 standard). **/
|
|
1526
|
+
encodedInvoice: string;
|
|
1527
|
+
/** The timeout in seconds that we will try to make the payment. **/
|
|
1528
|
+
timeoutSecs: number;
|
|
1529
|
+
/** The maximum amount of fees that you want to pay for this payment to be sent, expressed in msats. **/
|
|
1530
|
+
maximumFeesMsats: number;
|
|
1531
|
+
/**
|
|
1532
|
+
* The amount you will pay for this invoice, expressed in msats. It should ONLY be set when the
|
|
1533
|
+
* invoice amount is zero.
|
|
1534
|
+
**/
|
|
1535
|
+
amountMsats?: number;
|
|
1536
|
+
};
|
|
1537
|
+
|
|
1538
|
+
type PayInvoiceOutput = {
|
|
1539
|
+
/** The payment that has been sent. **/
|
|
1540
|
+
paymentId: string;
|
|
1541
|
+
};
|
|
1542
|
+
|
|
1543
|
+
type RequestWithdrawalInput = {
|
|
1544
|
+
/** The node from which you'd like to make the withdrawal. **/
|
|
1545
|
+
nodeId: string;
|
|
1546
|
+
/** The bitcoin address where the withdrawal should be sent. **/
|
|
1547
|
+
bitcoinAddress: string;
|
|
1548
|
+
/**
|
|
1549
|
+
* The amount you want to withdraw from this node in Satoshis. Use the special value -1 to withdrawal
|
|
1550
|
+
* all funds from this node.
|
|
1551
|
+
**/
|
|
1552
|
+
amountSats: number;
|
|
1553
|
+
/** The strategy that should be used to withdraw the funds from this node. **/
|
|
1554
|
+
withdrawalMode: WithdrawalMode;
|
|
1555
|
+
};
|
|
1556
|
+
|
|
1557
|
+
type RequestWithdrawalOutput = {
|
|
1558
|
+
/** The request that is created for this withdrawal. **/
|
|
1559
|
+
requestId: string;
|
|
1560
|
+
};
|
|
1561
|
+
|
|
1562
|
+
/** A transaction that was forwarded through a Lightspark node on the Lightning Network. **/
|
|
1563
|
+
type RoutingTransaction = LightningTransaction & Transaction & Entity & {
|
|
1564
|
+
/**
|
|
1565
|
+
* The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque
|
|
1566
|
+
* string.
|
|
1567
|
+
**/
|
|
1568
|
+
id: string;
|
|
1569
|
+
/** The date and time when this transaction was initiated. **/
|
|
1570
|
+
createdAt: string;
|
|
1571
|
+
/** The date and time when the entity was last updated. **/
|
|
1572
|
+
updatedAt: string;
|
|
1573
|
+
/** The current status of this transaction. **/
|
|
1574
|
+
status: TransactionStatus;
|
|
1575
|
+
/** The amount of money involved in this transaction. **/
|
|
1576
|
+
amount: CurrencyAmount;
|
|
1577
|
+
/** The typename of the object **/
|
|
1578
|
+
typename: string;
|
|
1579
|
+
/** The date and time when this transaction was completed or failed. **/
|
|
1580
|
+
resolvedAt?: string;
|
|
1581
|
+
/** The hash of this transaction, so it can be uniquely identified on the Lightning Network. **/
|
|
1582
|
+
transactionHash?: string;
|
|
1583
|
+
/** If known, the channel this transaction was received from. **/
|
|
1584
|
+
incomingChannelId?: string;
|
|
1585
|
+
/** If known, the channel this transaction was forwarded to. **/
|
|
1586
|
+
outgoingChannelId?: string;
|
|
1587
|
+
/**
|
|
1588
|
+
* The fees collected by the node when routing this transaction. We subtract the outgoing amount to
|
|
1589
|
+
* the incoming amount to determine how much fees were collected.
|
|
1590
|
+
**/
|
|
1591
|
+
fees?: CurrencyAmount;
|
|
1592
|
+
/** If applicable, user-facing error message describing why the routing failed. **/
|
|
1593
|
+
failureMessage?: RichText;
|
|
1594
|
+
/** If applicable, the reason why the routing failed. **/
|
|
1595
|
+
failureReason?: RoutingTransactionFailureReason;
|
|
1596
|
+
};
|
|
1597
|
+
declare const getRoutingTransactionQuery: (id: string) => Query<RoutingTransaction>;
|
|
1598
|
+
|
|
1599
|
+
type SendPaymentInput = {
|
|
1600
|
+
/** The node from where you want to send the payment. **/
|
|
1601
|
+
nodeId: string;
|
|
1602
|
+
/** The public key of the destination node. **/
|
|
1603
|
+
destinationPublicKey: string;
|
|
1604
|
+
/** The timeout in seconds that we will try to make the payment. **/
|
|
1605
|
+
timeoutSecs: number;
|
|
1606
|
+
/** The amount you will send to the destination node, expressed in msats. **/
|
|
1607
|
+
amountMsats: number;
|
|
1608
|
+
/** The maximum amount of fees that you want to pay for this payment to be sent, expressed in msats. **/
|
|
1609
|
+
maximumFeesMsats: number;
|
|
1610
|
+
};
|
|
1611
|
+
|
|
1612
|
+
type SendPaymentOutput = {
|
|
1613
|
+
/** The payment that has been sent. **/
|
|
1614
|
+
paymentId: string;
|
|
1615
|
+
};
|
|
1616
|
+
|
|
1617
|
+
declare enum WebhookEventType {
|
|
1618
|
+
/**
|
|
1619
|
+
* This is an enum value that represents values that could be added in the future.
|
|
1620
|
+
* Clients should support unknown values as more of them could be added without notice.
|
|
1621
|
+
*/
|
|
1622
|
+
FUTURE_VALUE = "FUTURE_VALUE",
|
|
1623
|
+
PAYMENT_FINISHED = "PAYMENT_FINISHED",
|
|
1624
|
+
NODE_STATUS = "NODE_STATUS"
|
|
1625
|
+
}
|
|
1626
|
+
|
|
1627
|
+
/** The transaction on the Bitcoin blockchain to withdraw funds from the Lightspark node to a Bitcoin wallet. **/
|
|
1628
|
+
type Withdrawal = OnChainTransaction & Transaction & Entity & {
|
|
1629
|
+
/**
|
|
1630
|
+
* The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque
|
|
1631
|
+
* string.
|
|
1632
|
+
**/
|
|
1633
|
+
id: string;
|
|
1634
|
+
/** The date and time when this transaction was initiated. **/
|
|
1635
|
+
createdAt: string;
|
|
1636
|
+
/** The date and time when the entity was last updated. **/
|
|
1637
|
+
updatedAt: string;
|
|
1638
|
+
/** The current status of this transaction. **/
|
|
1639
|
+
status: TransactionStatus;
|
|
1640
|
+
/** The amount of money involved in this transaction. **/
|
|
1641
|
+
amount: CurrencyAmount;
|
|
1642
|
+
/**
|
|
1643
|
+
* The height of the block that included this transaction. This will be zero for unconfirmed
|
|
1644
|
+
* transactions.
|
|
1645
|
+
**/
|
|
1646
|
+
blockHeight: number;
|
|
1647
|
+
/** The Bitcoin blockchain addresses this transaction was sent to. **/
|
|
1648
|
+
destinationAddresses: string[];
|
|
1649
|
+
/** The Lightspark node this withdrawal originated from. **/
|
|
1650
|
+
originId: string;
|
|
1651
|
+
/** The typename of the object **/
|
|
1652
|
+
typename: string;
|
|
1653
|
+
/** The date and time when this transaction was completed or failed. **/
|
|
1654
|
+
resolvedAt?: string;
|
|
1655
|
+
/** The hash of this transaction, so it can be uniquely identified on the Lightning Network. **/
|
|
1656
|
+
transactionHash?: string;
|
|
1657
|
+
/**
|
|
1658
|
+
* The fees that were paid by the wallet sending the transaction to commit it to the Bitcoin
|
|
1659
|
+
* blockchain.
|
|
1660
|
+
**/
|
|
1661
|
+
fees?: CurrencyAmount;
|
|
1662
|
+
/**
|
|
1663
|
+
* The hash of the block that included this transaction. This will be null for unconfirmed
|
|
1664
|
+
* transactions.
|
|
1665
|
+
**/
|
|
1666
|
+
blockHash?: string;
|
|
1667
|
+
/** The number of blockchain confirmations for this transaction in real time. **/
|
|
1668
|
+
numConfirmations?: number;
|
|
1669
|
+
};
|
|
1670
|
+
declare const getWithdrawalQuery: (id: string) => Query<Withdrawal>;
|
|
1671
|
+
|
|
1672
|
+
export { LightsparkNode as $, Account as A, BitcoinNetwork as B, Channel as C, DeleteApiTokenInput as D, Entity as E, FeeEstimate as F, FundNodeInput as G, FundNodeOutput as H, GraphNode as I, Hop as J, getHopQuery as K, LightsparkClient as L, HtlcAttemptFailureCode as M, IncomingPayment as N, IncomingPaymentAttempt as O, getIncomingPaymentAttemptQuery as P, IncomingPaymentAttemptStatus as Q, IncomingPaymentToAttemptsConnection as R, Invoice as S, getInvoiceQuery as T, InvoiceData as U, InvoiceType as V, LightningFeeEstimateForInvoiceInput as W, LightningFeeEstimateForNodeInput as X, LightningFeeEstimateOutput as Y, LightningTransaction as Z, getLightningTransactionQuery as _, AccountToApiTokensConnection as a, LightsparkNodePurpose as a0, LightsparkNodeStatus as a1, LightsparkNodeToChannelsConnection as a2, Node as a3, NodeAddress as a4, NodeAddressType as a5, NodeToAddressesConnection as a6, OnChainTransaction as a7, getOnChainTransactionQuery as a8, OutgoingPayment as a9, TransactionType as aA, TransactionUpdate as aB, WalletDashboard as aC, WebhookEventType as aD, Withdrawal as aE, getWithdrawalQuery as aF, WithdrawalMode as aG, WithdrawalRequest as aH, WithdrawalRequestStatus as aI, WithdrawalRequestToChannelClosingTransactionsConnection as aJ, WithdrawalRequestToChannelOpeningTransactionsConnection as aK, OutgoingPaymentAttempt as aa, OutgoingPaymentAttemptStatus as ab, OutgoingPaymentAttemptToHopsConnection as ac, OutgoingPaymentToAttemptsConnection as ad, PageInfo as ae, PayInvoiceInput as af, PayInvoiceOutput as ag, PaymentFailureReason as ah, PaymentRequest as ai, getPaymentRequestQuery as aj, PaymentRequestData as ak, PaymentRequestStatus as al, Permission as am, RequestWithdrawalInput as an, RequestWithdrawalOutput as ao, RichText as ap, RoutingTransaction as aq, getRoutingTransactionQuery as ar, RoutingTransactionFailureReason as as, Secret as at, SendPaymentInput as au, SendPaymentOutput as av, Transaction as aw, getTransactionQuery as ax, TransactionFailures as ay, TransactionStatus as az, AccountToChannelsConnection as b, AccountToNodesConnection as c, AccountToPaymentRequestsConnection as d, AccountToTransactionsConnection as e, ApiToken as f, getApiTokenQuery as g, BlockchainBalance as h, ChannelClosingTransaction as i, getChannelClosingTransactionQuery as j, ChannelFees as k, ChannelOpeningTransaction as l, getChannelOpeningTransactionQuery as m, ChannelStatus as n, ChannelToTransactionsConnection as o, CreateApiTokenInput as p, CreateApiTokenOutput as q, CreateInvoiceInput as r, CreateInvoiceOutput as s, CreateNodeWalletAddressInput as t, CreateNodeWalletAddressOutput as u, CurrencyAmount as v, CurrencyUnit as w, DeleteApiTokenOutput as x, Deposit as y, getDepositQuery as z };
|