@lightsparkdev/lightspark-sdk 0.1.6 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/README.md +1 -1
  3. package/dist/{Withdrawal-17e1c8af.d.ts → Withdrawal-ebb4865c.d.ts} +393 -377
  4. package/dist/{chunk-N27QHRE4.js → chunk-XFOVS6EY.js} +56 -40
  5. package/dist/index.cjs +25 -9
  6. package/dist/index.d.ts +1 -1
  7. package/dist/index.js +1 -1
  8. package/dist/objects/index.cjs +24 -8
  9. package/dist/objects/index.d.ts +1 -1
  10. package/dist/objects/index.js +1 -1
  11. package/package.json +7 -2
  12. package/src/client.ts +0 -1
  13. package/src/objects/Account.ts +2 -2
  14. package/src/objects/Entity.ts +10 -2
  15. package/src/objects/Invoice.ts +1 -1
  16. package/src/objects/InvoiceData.ts +10 -1
  17. package/src/objects/LightningTransaction.ts +1 -1
  18. package/src/objects/LightsparkNodeStatus.ts +2 -0
  19. package/src/objects/OutgoingPayment.ts +1 -1
  20. package/src/objects/PaymentRequest.ts +1 -1
  21. package/src/objects/PaymentRequestData.ts +1 -1
  22. package/src/objects/Transaction.ts +1 -1
  23. package/src/objects/WebhookEventType.ts +10 -0
  24. package/src/objects/WithdrawalRequest.ts +12 -0
  25. package/.fossa.yml +0 -6
  26. package/.prettierrc +0 -1
  27. package/.turbo/turbo-build.log +0 -19
  28. package/.turbo/turbo-lint.log +0 -3
  29. package/dist/chunk-AGEUDR2V.js +0 -4498
  30. package/dist/client-3bba3f64.d.ts +0 -1302
  31. package/examples/node-scripts/authHelpers.ts +0 -20
  32. package/examples/node-scripts/createInvoice.ts +0 -64
  33. package/examples/node-scripts/example.ts +0 -288
  34. package/examples/node-scripts/getAccountDashboard.ts +0 -24
  35. package/examples/node-scripts/getNodeChannels.ts +0 -34
  36. package/examples/node-scripts/internalAuthHelpers.ts +0 -26
  37. package/examples/node-scripts/internal_example.ts +0 -296
  38. package/examples/node-scripts/package-lock.json +0 -887
  39. package/examples/node-scripts/package.json +0 -22
  40. package/examples/node-scripts/prettyPrintJsonForDocs.ts +0 -62
  41. package/examples/node-scripts/tsconfig.json +0 -27
  42. package/examples/oauth-example/README.md +0 -19
  43. package/examples/oauth-example/package-lock.json +0 -16071
  44. package/examples/oauth-example/package.json +0 -50
  45. package/examples/oauth-example/public/favicon.ico +0 -0
  46. package/examples/oauth-example/public/index.html +0 -43
  47. package/examples/oauth-example/public/logo192.png +0 -0
  48. package/examples/oauth-example/public/logo512.png +0 -0
  49. package/examples/oauth-example/public/manifest.json +0 -25
  50. package/examples/oauth-example/public/robots.txt +0 -3
  51. package/examples/oauth-example/src/App.css +0 -7
  52. package/examples/oauth-example/src/App.test.tsx +0 -12
  53. package/examples/oauth-example/src/App.tsx +0 -16
  54. package/examples/oauth-example/src/auth/AuthContext.ts +0 -8
  55. package/examples/oauth-example/src/auth/AuthProvider.tsx +0 -44
  56. package/examples/oauth-example/src/auth/RequireAuth.tsx +0 -19
  57. package/examples/oauth-example/src/auth/oauthProvider.ts +0 -35
  58. package/examples/oauth-example/src/components/Button.tsx +0 -39
  59. package/examples/oauth-example/src/components/CurrencyAmount.tsx +0 -117
  60. package/examples/oauth-example/src/components/Dashboard.tsx +0 -158
  61. package/examples/oauth-example/src/components/Table.tsx +0 -22
  62. package/examples/oauth-example/src/hooks/useAccountInfo.tsx +0 -31
  63. package/examples/oauth-example/src/icons/BitcoinB.tsx +0 -20
  64. package/examples/oauth-example/src/icons/Icon.tsx +0 -121
  65. package/examples/oauth-example/src/icons/Satoshi.tsx +0 -28
  66. package/examples/oauth-example/src/index.css +0 -13
  67. package/examples/oauth-example/src/index.tsx +0 -23
  68. package/examples/oauth-example/src/lightsparkclient/LightsparkClientContext.ts +0 -10
  69. package/examples/oauth-example/src/lightsparkclient/LightsparkClientProvider.tsx +0 -53
  70. package/examples/oauth-example/src/logo.svg +0 -1
  71. package/examples/oauth-example/src/pages/DashboardPage.tsx +0 -71
  72. package/examples/oauth-example/src/pages/LoginPage.tsx +0 -63
  73. package/examples/oauth-example/src/react-app-env.d.ts +0 -1
  74. package/examples/oauth-example/src/reportWebVitals.ts +0 -15
  75. package/examples/oauth-example/src/routes/index.tsx +0 -15
  76. package/examples/oauth-example/src/setupTests.ts +0 -5
  77. package/examples/oauth-example/src/utils/currency.ts +0 -483
  78. package/examples/oauth-example/tsconfig.json +0 -20
  79. package/examples/streaming-wallet-extension/.fossa.yml +0 -6
  80. package/examples/streaming-wallet-extension/README.md +0 -17
  81. package/examples/streaming-wallet-extension/craco.config.js +0 -58
  82. package/examples/streaming-wallet-extension/package-lock.json +0 -18260
  83. package/examples/streaming-wallet-extension/package.json +0 -77
  84. package/examples/streaming-wallet-extension/public/index.html +0 -24
  85. package/examples/streaming-wallet-extension/public/lightspark_full.png +0 -0
  86. package/examples/streaming-wallet-extension/public/lightspark_icon_circle.png +0 -0
  87. package/examples/streaming-wallet-extension/public/manifest.json +0 -43
  88. package/examples/streaming-wallet-extension/public/robots.txt +0 -3
  89. package/examples/streaming-wallet-extension/src/App.css +0 -53
  90. package/examples/streaming-wallet-extension/src/App.tsx +0 -425
  91. package/examples/streaming-wallet-extension/src/auth/AccountStorage.ts +0 -28
  92. package/examples/streaming-wallet-extension/src/auth/DemoAccountProvider.ts +0 -99
  93. package/examples/streaming-wallet-extension/src/auth/StreamingDemoCredentials.ts +0 -10
  94. package/examples/streaming-wallet-extension/src/background/PaymentStrategy.ts +0 -36
  95. package/examples/streaming-wallet-extension/src/background/PlaybackRange.ts +0 -31
  96. package/examples/streaming-wallet-extension/src/background/StreamingInvoiceHolder.ts +0 -33
  97. package/examples/streaming-wallet-extension/src/background/TransactionObserver.ts +0 -66
  98. package/examples/streaming-wallet-extension/src/background/VideoPlaybackRanges.ts +0 -38
  99. package/examples/streaming-wallet-extension/src/background/VideoProgressCache.ts +0 -87
  100. package/examples/streaming-wallet-extension/src/background/background.ts +0 -145
  101. package/examples/streaming-wallet-extension/src/background/messageHandling.ts +0 -185
  102. package/examples/streaming-wallet-extension/src/common/datetimes.ts +0 -28
  103. package/examples/streaming-wallet-extension/src/common/settings.ts +0 -12
  104. package/examples/streaming-wallet-extension/src/common/storage.ts +0 -8
  105. package/examples/streaming-wallet-extension/src/common/streamingTabs.ts +0 -27
  106. package/examples/streaming-wallet-extension/src/common/types.tsx +0 -23
  107. package/examples/streaming-wallet-extension/src/components/CirclePlusIcon.tsx +0 -19
  108. package/examples/streaming-wallet-extension/src/components/CurrencyAmount.tsx +0 -110
  109. package/examples/streaming-wallet-extension/src/components/CurrencyAmountRaw.tsx +0 -195
  110. package/examples/streaming-wallet-extension/src/components/LeftArrow.tsx +0 -21
  111. package/examples/streaming-wallet-extension/src/components/Loading.tsx +0 -151
  112. package/examples/streaming-wallet-extension/src/components/StreamingTransactionChip.tsx +0 -95
  113. package/examples/streaming-wallet-extension/src/components/TransactionRow.tsx +0 -93
  114. package/examples/streaming-wallet-extension/src/contentscript/content.ts +0 -123
  115. package/examples/streaming-wallet-extension/src/contentscript/lightsparkDemoDom.tsx +0 -113
  116. package/examples/streaming-wallet-extension/src/contentscript/videoElementParsers.ts +0 -92
  117. package/examples/streaming-wallet-extension/src/index.css +0 -16
  118. package/examples/streaming-wallet-extension/src/index.tsx +0 -11
  119. package/examples/streaming-wallet-extension/src/lightsparkClientProvider.tsx +0 -26
  120. package/examples/streaming-wallet-extension/src/react-app-env.d.ts +0 -1
  121. package/examples/streaming-wallet-extension/src/types/Messages.ts +0 -17
  122. package/examples/streaming-wallet-extension/tsconfig.json +0 -20
  123. package/tsconfig.json +0 -5
@@ -67,6 +67,7 @@ declare enum LightsparkNodeStatus {
67
67
  READY = "READY",
68
68
  STOPPED = "STOPPED",
69
69
  TERMINATED = "TERMINATED",
70
+ TERMINATING = "TERMINATING",
70
71
  WALLET_LOCKED = "WALLET_LOCKED",
71
72
  FAILED_TO_DEPLOY = "FAILED_TO_DEPLOY"
72
73
  }
@@ -117,22 +118,6 @@ type AccountDashboard = {
117
118
  remoteBalance: Maybe<CurrencyAmount>;
118
119
  };
119
120
 
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
121
  /** 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
122
  type Entity = {
138
123
  /**
@@ -197,20 +182,178 @@ type ApiToken = Entity & {
197
182
  };
198
183
  declare const getApiTokenQuery: (id: string) => Query<ApiToken>;
199
184
 
200
- type CreateApiTokenOutput = {
201
- /** The API Token that has been created. **/
202
- apiToken: ApiToken;
185
+ type PageInfo = {
186
+ hasNextPage?: boolean;
187
+ hasPreviousPage?: boolean;
188
+ startCursor?: string;
189
+ endCursor?: string;
190
+ };
191
+
192
+ type AccountToApiTokensConnection = {
193
+ /** An object that holds pagination information about the objects in this connection. **/
194
+ pageInfo: PageInfo;
203
195
  /**
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.
196
+ * The total count of objects in this connection, using the current filters. It is different from the
197
+ * number of objects returned in the current page (in the `entities` field).
207
198
  **/
208
- clientSecret: string;
199
+ count: number;
200
+ /** The API tokens for the current page of this connection. **/
201
+ entities: ApiToken[];
209
202
  };
210
203
 
211
- type FeeEstimate = {
212
- feeFast: CurrencyAmount;
213
- feeMin: CurrencyAmount;
204
+ type ChannelFees = {
205
+ baseFee?: CurrencyAmount;
206
+ feeRatePerMil?: number;
207
+ };
208
+
209
+ declare enum ChannelStatus {
210
+ /**
211
+ * This is an enum value that represents values that could be added in the future.
212
+ * Clients should support unknown values as more of them could be added without notice.
213
+ */
214
+ FUTURE_VALUE = "FUTURE_VALUE",
215
+ /** The channel is online and ready to send and receive funds. **/
216
+ OK = "OK",
217
+ /** The channel has been created, but the Bitcoin transaction that initiates it still needs to be confirmed on the Bitcoin blockchain. **/
218
+ PENDING = "PENDING",
219
+ /** The channel is not available, likely because the peer is not online. **/
220
+ OFFLINE = "OFFLINE",
221
+ /** 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. **/
222
+ UNBALANCED_FOR_SEND = "UNBALANCED_FOR_SEND",
223
+ /** 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. **/
224
+ UNBALANCED_FOR_RECEIVE = "UNBALANCED_FOR_RECEIVE",
225
+ /** The channel has been closed. Information about the channel is still available for historical purposes but the channel cannot be used anymore. **/
226
+ CLOSED = "CLOSED",
227
+ /** Something unexpected happened and we cannot determine the status of this channel. Please try again later or contact the support. **/
228
+ ERROR = "ERROR"
229
+ }
230
+
231
+ type ChannelToTransactionsConnection = {
232
+ /**
233
+ * The total count of objects in this connection, using the current filters. It is different from the
234
+ * number of objects returned in the current page (in the `entities` field).
235
+ **/
236
+ count: number;
237
+ /**
238
+ * The average fee for the transactions that transited through this channel, according to the filters
239
+ * and constraints of the connection.
240
+ **/
241
+ averageFee?: CurrencyAmount;
242
+ /**
243
+ * The total amount transacted for the transactions that transited through this channel, according to
244
+ * the filters and constraints of the connection.
245
+ **/
246
+ totalAmountTransacted?: CurrencyAmount;
247
+ /**
248
+ * The total amount of fees for the transactions that transited through this channel, according to the
249
+ * filters and constraints of the connection.
250
+ **/
251
+ totalFees?: CurrencyAmount;
252
+ };
253
+
254
+ declare enum TransactionType {
255
+ /**
256
+ * This is an enum value that represents values that could be added in the future.
257
+ * Clients should support unknown values as more of them could be added without notice.
258
+ */
259
+ FUTURE_VALUE = "FUTURE_VALUE",
260
+ /** Transactions initiated from a Lightspark node on Lightning Network. **/
261
+ OUTGOING_PAYMENT = "OUTGOING_PAYMENT",
262
+ /** Transactions received by a Lightspark node on Lightning Network. **/
263
+ INCOMING_PAYMENT = "INCOMING_PAYMENT",
264
+ /** Transactions that forwarded payments through Lightspark nodes on Lightning Network. **/
265
+ ROUTED = "ROUTED",
266
+ /** Transactions on the Bitcoin blockchain to withdraw funds from a Lightspark node to a Bitcoin wallet. **/
267
+ L1_WITHDRAW = "L1_WITHDRAW",
268
+ /** Transactions on Bitcoin blockchain to fund a Lightspark node's wallet. **/
269
+ L1_DEPOSIT = "L1_DEPOSIT",
270
+ /** Transactions on Bitcoin blockchain to open a channel on Lightning Network funded by the local Lightspark node. **/
271
+ CHANNEL_OPEN = "CHANNEL_OPEN",
272
+ /** Transactions on Bitcoin blockchain to close a channel on Lightning Network where the balances are allocated back to local and remote nodes. **/
273
+ CHANNEL_CLOSE = "CHANNEL_CLOSE",
274
+ /** Transactions initiated from a Lightspark node on Lightning Network. **/
275
+ PAYMENT = "PAYMENT",
276
+ /** Payment requests from a Lightspark node on Lightning Network **/
277
+ PAYMENT_REQUEST = "PAYMENT_REQUEST",
278
+ /** Transactions that forwarded payments through Lightspark nodes on Lightning Network. **/
279
+ ROUTE = "ROUTE"
280
+ }
281
+
282
+ /** An object that represents a payment channel between two nodes in the Lightning Network. **/
283
+ declare class Channel implements Entity {
284
+ readonly id: string;
285
+ readonly createdAt: string;
286
+ readonly updatedAt: string;
287
+ readonly localNodeId: string;
288
+ readonly typename: string;
289
+ readonly fundingTransactionId?: string | undefined;
290
+ readonly capacity?: CurrencyAmount | undefined;
291
+ readonly localBalance?: CurrencyAmount | undefined;
292
+ readonly localUnsettledBalance?: CurrencyAmount | undefined;
293
+ readonly remoteBalance?: CurrencyAmount | undefined;
294
+ readonly remoteUnsettledBalance?: CurrencyAmount | undefined;
295
+ readonly unsettledBalance?: CurrencyAmount | undefined;
296
+ readonly totalBalance?: CurrencyAmount | undefined;
297
+ readonly status?: ChannelStatus | undefined;
298
+ readonly estimatedForceClosureWaitMinutes?: number | undefined;
299
+ readonly commitFee?: CurrencyAmount | undefined;
300
+ readonly fees?: ChannelFees | undefined;
301
+ readonly remoteNodeId?: string | undefined;
302
+ readonly shortChannelId?: string | undefined;
303
+ 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);
304
+ getUptimePercentage(client: LightsparkClient, afterDate?: string | undefined, beforeDate?: string | undefined): Promise<number>;
305
+ getTransactions(client: LightsparkClient, types?: TransactionType[] | undefined, afterDate?: string | undefined, beforeDate?: string | undefined): Promise<ChannelToTransactionsConnection>;
306
+ static getChannelQuery(id: string): Query<Channel>;
307
+ }
308
+
309
+ declare class AccountToChannelsConnection {
310
+ readonly count: number;
311
+ readonly entities: Channel[];
312
+ constructor(count: number, entities: Channel[]);
313
+ }
314
+
315
+ declare enum BitcoinNetwork {
316
+ /**
317
+ * This is an enum value that represents values that could be added in the future.
318
+ * Clients should support unknown values as more of them could be added without notice.
319
+ */
320
+ FUTURE_VALUE = "FUTURE_VALUE",
321
+ /** The production version of the Bitcoin Blockchain. **/
322
+ MAINNET = "MAINNET",
323
+ /** A test version of the Bitcoin Blockchain, maintained by Lightspark. **/
324
+ REGTEST = "REGTEST",
325
+ /** A test version of the Bitcoin Blockchain, maintained by a centralized organization. Not in use at Lightspark. **/
326
+ SIGNET = "SIGNET",
327
+ /** A test version of the Bitcoin Blockchain, publically available. **/
328
+ TESTNET = "TESTNET"
329
+ }
330
+
331
+ /** This object provides a detailed breakdown of a `LightsparkNode`'s current balance on the Bitcoin Network. **/
332
+ type BlockchainBalance = {
333
+ /** The total wallet balance, including unconfirmed UTXOs. **/
334
+ totalBalance?: CurrencyAmount;
335
+ /** The balance of confirmed UTXOs in the wallet. **/
336
+ confirmedBalance?: CurrencyAmount;
337
+ /** The balance of unconfirmed UTXOs in the wallet. **/
338
+ unconfirmedBalance?: CurrencyAmount;
339
+ /** The balance that's locked by an on-chain transaction. **/
340
+ lockedBalance?: CurrencyAmount;
341
+ /** Funds required to be held in reserve for channel bumping. **/
342
+ requiredReserve?: CurrencyAmount;
343
+ /** Funds available for creating channels or withdrawing. **/
344
+ availableBalance?: CurrencyAmount;
345
+ };
346
+
347
+ type LightsparkNodeToChannelsConnection = {
348
+ /** An object that holds pagination information about the objects in this connection. **/
349
+ pageInfo: PageInfo;
350
+ /**
351
+ * The total count of objects in this connection, using the current filters. It is different from the
352
+ * number of objects returned in the current page (in the `entities` field).
353
+ **/
354
+ count: number;
355
+ /** The channels for the current page of this connection. **/
356
+ entities: Channel[];
214
357
  };
215
358
 
216
359
  /** An object that represents the address of a node on the Lightning Network. **/
@@ -249,6 +392,57 @@ declare class Node implements Entity {
249
392
  static getNodeQuery(id: string): Query<Node>;
250
393
  }
251
394
 
395
+ type Secret = {
396
+ encryptedValue: string;
397
+ cipher: string;
398
+ };
399
+
400
+ /** 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. **/
401
+ declare class LightsparkNode implements Node {
402
+ readonly id: string;
403
+ readonly createdAt: string;
404
+ readonly updatedAt: string;
405
+ readonly bitcoinNetwork: BitcoinNetwork;
406
+ readonly displayName: string;
407
+ readonly accountId: string;
408
+ readonly typename: string;
409
+ readonly alias?: string | undefined;
410
+ readonly color?: string | undefined;
411
+ readonly conductivity?: number | undefined;
412
+ readonly publicKey?: string | undefined;
413
+ readonly blockchainBalance?: BlockchainBalance | undefined;
414
+ readonly encryptedSigningPrivateKey?: Secret | undefined;
415
+ readonly totalBalance?: CurrencyAmount | undefined;
416
+ readonly totalLocalBalance?: CurrencyAmount | undefined;
417
+ readonly localBalance?: CurrencyAmount | undefined;
418
+ readonly purpose?: LightsparkNodePurpose | undefined;
419
+ readonly remoteBalance?: CurrencyAmount | undefined;
420
+ readonly status?: LightsparkNodeStatus | undefined;
421
+ 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);
422
+ getAddresses(client: LightsparkClient, first?: number | undefined, types?: NodeAddressType[] | undefined): Promise<NodeToAddressesConnection>;
423
+ getChannels(client: LightsparkClient, first?: number | undefined, statuses?: ChannelStatus[] | undefined): Promise<LightsparkNodeToChannelsConnection>;
424
+ static getLightsparkNodeQuery(id: string): Query<LightsparkNode>;
425
+ }
426
+
427
+ /** A connection between an account and the nodes it manages. **/
428
+ type AccountToNodesConnection = {
429
+ /** An object that holds pagination information about the objects in this connection. **/
430
+ pageInfo: PageInfo;
431
+ /**
432
+ * The total count of objects in this connection, using the current filters. It is different from the
433
+ * number of objects returned in the current page (in the `entities` field).
434
+ **/
435
+ count: number;
436
+ /** The nodes for the current page of this connection. **/
437
+ entities: LightsparkNode[];
438
+ /**
439
+ * The main purpose for the selected set of nodes. It is automatically determined from the nodes that
440
+ * are selected in this connection and is used for optimization purposes, as well as to determine the
441
+ * variation of the UI that should be presented to the user.
442
+ **/
443
+ purpose?: LightsparkNodePurpose;
444
+ };
445
+
252
446
  /** The interface of a payment request on the Lightning Network (a.k.a. Lightning Invoice). **/
253
447
  type PaymentRequestData = {
254
448
  encodedPaymentRequest: string;
@@ -257,32 +451,47 @@ type PaymentRequestData = {
257
451
  typename: string;
258
452
  };
259
453
 
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 {
454
+ declare enum PaymentRequestStatus {
275
455
  /**
276
456
  * This is an enum value that represents values that could be added in the future.
277
457
  * Clients should support unknown values as more of them could be added without notice.
278
458
  */
279
459
  FUTURE_VALUE = "FUTURE_VALUE",
280
- /** A standard Bolt 11 invoice. **/
281
- STANDARD = "STANDARD",
282
- /** An AMP (Atomic Multi-path Payment) invoice. **/
283
- AMP = "AMP"
460
+ OPEN = "OPEN",
461
+ CLOSED = "CLOSED"
284
462
  }
285
463
 
464
+ type PaymentRequest = Entity & {
465
+ /**
466
+ * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque
467
+ * string.
468
+ **/
469
+ id: string;
470
+ /** The date and time when the entity was first created. **/
471
+ createdAt: string;
472
+ /** The date and time when the entity was last updated. **/
473
+ updatedAt: string;
474
+ /** The details of the payment request. **/
475
+ data: PaymentRequestData;
476
+ /** The status of the payment request. **/
477
+ status: PaymentRequestStatus;
478
+ /** The typename of the object **/
479
+ typename: string;
480
+ };
481
+ declare const getPaymentRequestQuery: (id: string) => Query<PaymentRequest>;
482
+
483
+ type AccountToPaymentRequestsConnection = {
484
+ /** The payment requests for the current page of this connection. **/
485
+ entities: PaymentRequest[];
486
+ /** An object that holds pagination information about the objects in this connection. **/
487
+ pageInfo: PageInfo;
488
+ /**
489
+ * The total count of objects in this connection, using the current filters. It is different from the
490
+ * number of objects returned in the current page (in the `entities` field).
491
+ **/
492
+ count?: number;
493
+ };
494
+
286
495
  declare enum TransactionStatus {
287
496
  /**
288
497
  * This is an enum value that represents values that could be added in the future.
@@ -326,6 +535,137 @@ type Transaction = Entity & {
326
535
  };
327
536
  declare const getTransactionQuery: (id: string) => Query<Transaction>;
328
537
 
538
+ type AccountToTransactionsConnection = {
539
+ /**
540
+ * The total count of objects in this connection, using the current filters. It is different from the
541
+ * number of objects returned in the current page (in the `entities` field).
542
+ **/
543
+ count: number;
544
+ /** The transactions for the current page of this connection. **/
545
+ entities: Transaction[];
546
+ /** An object that holds pagination information about the objects in this connection. **/
547
+ pageInfo: PageInfo;
548
+ /**
549
+ * Profit (or loss) generated by the transactions in this connection, with the set of filters and
550
+ * constraints provided.
551
+ **/
552
+ profitLoss?: CurrencyAmount;
553
+ /**
554
+ * Average fee earned for the transactions in this connection, with the set of filters and constraints
555
+ * provided.
556
+ **/
557
+ averageFeeEarned?: CurrencyAmount;
558
+ /**
559
+ * Total amount transacted by the transactions in this connection, with the set of filters and
560
+ * constraints provided.
561
+ **/
562
+ totalAmountTransacted?: CurrencyAmount;
563
+ };
564
+
565
+ declare enum PaymentFailureReason {
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
+ NONE = "NONE",
572
+ TIMEOUT = "TIMEOUT",
573
+ NO_ROUTE = "NO_ROUTE",
574
+ ERROR = "ERROR",
575
+ INCORRECT_PAYMENT_DETAILS = "INCORRECT_PAYMENT_DETAILS",
576
+ INSUFFICIENT_BALANCE = "INSUFFICIENT_BALANCE",
577
+ INVOICE_ALREADY_PAID = "INVOICE_ALREADY_PAID",
578
+ SELF_PAYMENT = "SELF_PAYMENT",
579
+ INVOICE_EXPIRED = "INVOICE_EXPIRED"
580
+ }
581
+
582
+ declare enum RoutingTransactionFailureReason {
583
+ /**
584
+ * This is an enum value that represents values that could be added in the future.
585
+ * Clients should support unknown values as more of them could be added without notice.
586
+ */
587
+ FUTURE_VALUE = "FUTURE_VALUE",
588
+ INCOMING_LINK_FAILURE = "INCOMING_LINK_FAILURE",
589
+ OUTGOING_LINK_FAILURE = "OUTGOING_LINK_FAILURE",
590
+ FORWARDING_FAILURE = "FORWARDING_FAILURE"
591
+ }
592
+
593
+ type TransactionFailures = {
594
+ paymentFailures?: PaymentFailureReason[];
595
+ routingTransactionFailures?: RoutingTransactionFailureReason[];
596
+ };
597
+
598
+ declare class Account implements Entity {
599
+ readonly id: string;
600
+ readonly createdAt: string;
601
+ readonly updatedAt: string;
602
+ readonly typename: string;
603
+ readonly name?: string | undefined;
604
+ constructor(id: string, createdAt: string, updatedAt: string, typename: string, name?: string | undefined);
605
+ getApiTokens(client: LightsparkClient, first?: number | undefined): Promise<AccountToApiTokensConnection>;
606
+ getBlockchainBalance(client: LightsparkClient, bitcoinNetworks?: BitcoinNetwork[] | undefined, nodeIds?: string[] | undefined): Promise<BlockchainBalance | null>;
607
+ getConductivity(client: LightsparkClient, bitcoinNetworks?: BitcoinNetwork[] | undefined, nodeIds?: string[] | undefined): Promise<number>;
608
+ getLocalBalance(client: LightsparkClient, bitcoinNetworks?: BitcoinNetwork[] | undefined, nodeIds?: string[] | undefined): Promise<CurrencyAmount | null>;
609
+ getNodes(client: LightsparkClient, first?: number | undefined, bitcoinNetworks?: BitcoinNetwork[] | undefined, nodeIds?: string[] | undefined): Promise<AccountToNodesConnection>;
610
+ getRemoteBalance(client: LightsparkClient, bitcoinNetworks?: BitcoinNetwork[] | undefined, nodeIds?: string[] | undefined): Promise<CurrencyAmount | null>;
611
+ getUptimePercentage(client: LightsparkClient, afterDate?: string | undefined, beforeDate?: string | undefined, bitcoinNetworks?: BitcoinNetwork[] | undefined, nodeIds?: string[] | undefined): Promise<number>;
612
+ getChannels(client: LightsparkClient, bitcoinNetwork: BitcoinNetwork, lightningNodeId?: string | undefined, afterDate?: string | undefined, beforeDate?: string | undefined, first?: number | undefined): Promise<AccountToChannelsConnection>;
613
+ 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>;
614
+ getPaymentRequests(client: LightsparkClient, first?: number | undefined, after?: string | undefined, afterDate?: string | undefined, beforeDate?: string | undefined, bitcoinNetwork?: BitcoinNetwork | undefined, lightningNodeId?: string | undefined): Promise<AccountToPaymentRequestsConnection>;
615
+ static getAccountQuery(): Query<Account>;
616
+ }
617
+
618
+ type CreateApiTokenOutput = {
619
+ /** The API Token that has been created. **/
620
+ apiToken: ApiToken;
621
+ /**
622
+ * The secret that should be used to authenticate against our API. This secret is not stored and will
623
+ * never be available again after this. You must keep this secret secure as it grants access to your
624
+ * account.
625
+ **/
626
+ clientSecret: string;
627
+ };
628
+
629
+ type FeeEstimate = {
630
+ feeFast: CurrencyAmount;
631
+ feeMin: CurrencyAmount;
632
+ };
633
+
634
+ /** This object represents the BOLT #11 invoice protocol for Lightning Payments. See https://github.com/lightning/bolts/blob/master/11-payment-encoding.md. **/
635
+ type InvoiceData = PaymentRequestData & {
636
+ encodedPaymentRequest: string;
637
+ bitcoinNetwork: BitcoinNetwork;
638
+ /** The payment hash of this invoice. **/
639
+ paymentHash: string;
640
+ /**
641
+ * The requested amount in this invoice. If it is equal to 0, the sender should choose the amount to
642
+ * send.
643
+ **/
644
+ amount: CurrencyAmount;
645
+ /** The date and time when this invoice was created. **/
646
+ createdAt: string;
647
+ /** The date and time when this invoice will expire. **/
648
+ expiresAt: string;
649
+ /** The lightning node that will be paid when fulfilling this invoice. **/
650
+ destination: Node;
651
+ /** The typename of the object **/
652
+ typename: string;
653
+ /** A short, UTF-8 encoded, description of the purpose of this invoice. **/
654
+ memo?: string;
655
+ };
656
+
657
+ declare enum InvoiceType {
658
+ /**
659
+ * This is an enum value that represents values that could be added in the future.
660
+ * Clients should support unknown values as more of them could be added without notice.
661
+ */
662
+ FUTURE_VALUE = "FUTURE_VALUE",
663
+ /** A standard Bolt 11 invoice. **/
664
+ STANDARD = "STANDARD",
665
+ /** An AMP (Atomic Multi-path Payment) invoice. **/
666
+ AMP = "AMP"
667
+ }
668
+
329
669
  type LightningTransaction = Transaction & Entity & {
330
670
  /**
331
671
  * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque
@@ -464,23 +804,6 @@ type OutgoingPaymentToAttemptsConnection = {
464
804
  entities: OutgoingPaymentAttempt[];
465
805
  };
466
806
 
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
807
  type RichText = {
485
808
  text: string;
486
809
  };
@@ -661,13 +984,6 @@ type ChannelClosingTransaction = OnChainTransaction & Transaction & Entity & {
661
984
  };
662
985
  declare const getChannelClosingTransactionQuery: (id: string) => Query<ChannelClosingTransaction>;
663
986
 
664
- type PageInfo = {
665
- hasNextPage?: boolean;
666
- hasPreviousPage?: boolean;
667
- startCursor?: string;
668
- endCursor?: string;
669
- };
670
-
671
987
  type WithdrawalRequestToChannelClosingTransactionsConnection = {
672
988
  /** An object that holds pagination information about the objects in this connection. **/
673
989
  pageInfo: PageInfo;
@@ -746,9 +1062,10 @@ declare class WithdrawalRequest implements Entity {
746
1062
  readonly withdrawalMode: WithdrawalMode;
747
1063
  readonly status: WithdrawalRequestStatus;
748
1064
  readonly typename: string;
1065
+ readonly estimatedAmount?: CurrencyAmount | undefined;
749
1066
  readonly completedAt?: string | undefined;
750
1067
  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);
1068
+ constructor(id: string, createdAt: string, updatedAt: string, amount: CurrencyAmount, bitcoinAddress: string, withdrawalMode: WithdrawalMode, status: WithdrawalRequestStatus, typename: string, estimatedAmount?: CurrencyAmount | undefined, completedAt?: string | undefined, withdrawalId?: string | undefined);
752
1069
  getChannelClosingTransactions(client: LightsparkClient, first?: number | undefined): Promise<WithdrawalRequestToChannelClosingTransactionsConnection>;
753
1070
  getChannelOpeningTransactions(client: LightsparkClient, first?: number | undefined): Promise<WithdrawalRequestToChannelOpeningTransactionsConnection>;
754
1071
  static getWithdrawalRequestQuery(id: string): Query<WithdrawalRequest>;
@@ -993,312 +1310,6 @@ declare class LightsparkClient {
993
1310
  executeRawQuery<T>(query: Query<T>): Promise<T | null>;
994
1311
  }
995
1312
 
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
1313
  type CreateApiTokenInput = {
1303
1314
  /** An arbitrary name that the user can choose to identify the API token in a list. **/
1304
1315
  name: string;
@@ -1621,7 +1632,12 @@ declare enum WebhookEventType {
1621
1632
  */
1622
1633
  FUTURE_VALUE = "FUTURE_VALUE",
1623
1634
  PAYMENT_FINISHED = "PAYMENT_FINISHED",
1624
- NODE_STATUS = "NODE_STATUS"
1635
+ NODE_STATUS = "NODE_STATUS",
1636
+ WALLET_STATUS = "WALLET_STATUS",
1637
+ WALLET_OUTGOING_PAYMENT_FINISHED = "WALLET_OUTGOING_PAYMENT_FINISHED",
1638
+ WALLET_INCOMING_PAYMENT_FINISHED = "WALLET_INCOMING_PAYMENT_FINISHED",
1639
+ WALLET_WITHDRAWAL_FINISHED = "WALLET_WITHDRAWAL_FINISHED",
1640
+ WALLET_FUNDS_RECEIVED = "WALLET_FUNDS_RECEIVED"
1625
1641
  }
1626
1642
 
1627
1643
  /** The transaction on the Bitcoin blockchain to withdraw funds from the Lightspark node to a Bitcoin wallet. **/