@lightsparkdev/lightspark-sdk 1.2.3 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/{BitcoinNetwork-37e9f091.d.ts → BitcoinNetwork-972b1d01.d.ts} +4 -6
  3. package/dist/{chunk-NCPWHRFO.js → chunk-Y55D3PD4.js} +11 -11
  4. package/dist/env.d.cts +1 -1
  5. package/dist/env.d.ts +1 -1
  6. package/dist/{index-449c9f58.d.ts → index-a5028d74.d.ts} +572 -943
  7. package/dist/index.cjs +263 -232
  8. package/dist/index.d.cts +3 -3
  9. package/dist/index.d.ts +3 -3
  10. package/dist/index.js +43 -12
  11. package/dist/objects/index.d.cts +2 -2
  12. package/dist/objects/index.d.ts +2 -2
  13. package/dist/objects/index.js +1 -1
  14. package/package.json +2 -2
  15. package/src/client.ts +18 -0
  16. package/src/graphql/CancelInvoice.ts +17 -0
  17. package/src/objects/Account.ts +2 -2
  18. package/src/objects/AccountToApiTokensConnection.ts +3 -6
  19. package/src/objects/AccountToChannelsConnection.ts +3 -3
  20. package/src/objects/AccountToNodesConnection.ts +3 -6
  21. package/src/objects/AccountToPaymentRequestsConnection.ts +3 -6
  22. package/src/objects/AccountToTransactionsConnection.ts +5 -8
  23. package/src/objects/AccountToWalletsConnection.ts +3 -6
  24. package/src/objects/ApiToken.ts +7 -8
  25. package/src/objects/Balances.ts +16 -18
  26. package/src/objects/BitcoinNetwork.ts +4 -6
  27. package/src/objects/BlockchainBalance.ts +1 -4
  28. package/src/objects/CancelInvoiceInput.ts +18 -0
  29. package/src/objects/CancelInvoiceOutput.ts +26 -0
  30. package/src/objects/Channel.ts +16 -25
  31. package/src/objects/ChannelClosingTransaction.ts +10 -17
  32. package/src/objects/ChannelFees.ts +1 -4
  33. package/src/objects/ChannelOpeningTransaction.ts +10 -17
  34. package/src/objects/ChannelStatus.ts +13 -19
  35. package/src/objects/ChannelToTransactionsConnection.ts +6 -6
  36. package/src/objects/ComplianceProvider.ts +2 -3
  37. package/src/objects/Connection.ts +3 -6
  38. package/src/objects/CreateApiTokenInput.ts +1 -4
  39. package/src/objects/CreateLnurlInvoiceInput.ts +2 -2
  40. package/src/objects/CreateTestModePaymentoutput.ts +2 -2
  41. package/src/objects/CurrencyAmount.ts +4 -6
  42. package/src/objects/CurrencyUnit.ts +7 -11
  43. package/src/objects/Deposit.ts +10 -16
  44. package/src/objects/Entity.ts +2 -2
  45. package/src/objects/FeeEstimate.ts +3 -3
  46. package/src/objects/GraphNode.ts +13 -20
  47. package/src/objects/Hop.ts +4 -7
  48. package/src/objects/HtlcAttemptFailureCode.ts +4 -5
  49. package/src/objects/IncentivesIneligibilityReason.ts +13 -25
  50. package/src/objects/IncentivesStatus.ts +5 -8
  51. package/src/objects/IncomingPayment.ts +5 -12
  52. package/src/objects/IncomingPaymentAttempt.ts +3 -4
  53. package/src/objects/IncomingPaymentAttemptStatus.ts +3 -7
  54. package/src/objects/IncomingPaymentToAttemptsConnection.ts +3 -6
  55. package/src/objects/InvoiceData.ts +2 -2
  56. package/src/objects/InvoiceType.ts +2 -3
  57. package/src/objects/LightningFeeEstimateForInvoiceInput.ts +2 -2
  58. package/src/objects/LightningTransaction.ts +4 -8
  59. package/src/objects/LightsparkNode.ts +19 -25
  60. package/src/objects/LightsparkNodeStatus.ts +2 -3
  61. package/src/objects/LightsparkNodeToChannelsConnection.ts +3 -6
  62. package/src/objects/LightsparkNodeWithOSK.ts +19 -27
  63. package/src/objects/LightsparkNodeWithRemoteSigning.ts +17 -25
  64. package/src/objects/Node.ts +13 -19
  65. package/src/objects/NodeAddressType.ts +4 -5
  66. package/src/objects/NodeToAddressesConnection.ts +4 -4
  67. package/src/objects/OnChainTransaction.ts +11 -18
  68. package/src/objects/OutgoingPayment.ts +7 -19
  69. package/src/objects/OutgoingPaymentAttempt.ts +11 -19
  70. package/src/objects/OutgoingPaymentAttemptStatus.ts +3 -7
  71. package/src/objects/OutgoingPaymentAttemptToHopsConnection.ts +5 -9
  72. package/src/objects/OutgoingPaymentToAttemptsConnection.ts +3 -6
  73. package/src/objects/PageInfo.ts +2 -3
  74. package/src/objects/PayInvoiceInput.ts +4 -4
  75. package/src/objects/PaymentDirection.ts +2 -3
  76. package/src/objects/PaymentFailureReason.ts +4 -5
  77. package/src/objects/PaymentRequest.ts +3 -4
  78. package/src/objects/PaymentRequestData.ts +3 -3
  79. package/src/objects/PaymentRequestStatus.ts +4 -5
  80. package/src/objects/Permission.ts +4 -5
  81. package/src/objects/PostTransactionData.ts +3 -6
  82. package/src/objects/RegionCode.ts +12 -43
  83. package/src/objects/RegisterPaymentInput.ts +5 -9
  84. package/src/objects/RemoteSigningSubEventType.ts +3 -7
  85. package/src/objects/RiskRating.ts +5 -6
  86. package/src/objects/RoutingTransaction.ts +8 -15
  87. package/src/objects/RoutingTransactionFailureReason.ts +4 -6
  88. package/src/objects/ScreenNodeInput.ts +2 -2
  89. package/src/objects/SendPaymentInput.ts +2 -2
  90. package/src/objects/SetInvoicePaymentHashInput.ts +2 -2
  91. package/src/objects/SignablePayload.ts +2 -2
  92. package/src/objects/SignablePayloadStatus.ts +2 -3
  93. package/src/objects/Transaction.ts +4 -9
  94. package/src/objects/TransactionFailures.ts +1 -4
  95. package/src/objects/TransactionStatus.ts +6 -11
  96. package/src/objects/TransactionType.ts +12 -22
  97. package/src/objects/UmaInvitation.ts +2 -8
  98. package/src/objects/Wallet.ts +3 -4
  99. package/src/objects/WalletStatus.ts +12 -25
  100. package/src/objects/WalletToPaymentRequestsConnection.ts +3 -6
  101. package/src/objects/WalletToTransactionsConnection.ts +3 -6
  102. package/src/objects/WebhookEventType.ts +4 -5
  103. package/src/objects/Withdrawal.ts +11 -18
  104. package/src/objects/WithdrawalMode.ts +3 -7
  105. package/src/objects/WithdrawalRequest.ts +3 -7
  106. package/src/objects/WithdrawalRequestStatus.ts +2 -3
  107. package/src/objects/WithdrawalRequestToChannelClosingTransactionsConnection.ts +4 -10
  108. package/src/objects/WithdrawalRequestToChannelOpeningTransactionsConnection.ts +4 -10
  109. package/src/objects/index.ts +2 -0
  110. package/src/tests/integration/general-regtest.test.ts +14 -0
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { AuthProvider } from '@lightsparkdev/core';
2
- import { W as WebhookEventType, L as LightsparkClient } from './index-449c9f58.js';
3
- export { A as Account, a as AccountToApiTokensConnection, b as AccountToChannelsConnection, c as AccountToNodesConnection, d as AccountToPaymentRequestsConnection, e as AccountToTransactionsConnection, f as AccountToWalletsConnection, g as ApiToken, B as Balances, i as BlockchainBalance, C as Channel, j as ChannelClosingTransaction, l as ChannelFees, m as ChannelOpeningTransaction, o as ChannelSnapshot, p as ChannelStatus, q as ChannelToTransactionsConnection, r as ClaimUmaInvitationInput, s as ClaimUmaInvitationOutput, t as ClaimUmaInvitationWithIncentivesInput, u as ClaimUmaInvitationWithIncentivesOutput, v as ComplianceProvider, w as Connection, x as CreateApiTokenInput, y as CreateApiTokenOutput, z as CreateInvitationWithIncentivesInput, D as CreateInvitationWithIncentivesOutput, E as CreateInvoiceInput, F as CreateInvoiceOutput, G as CreateLnurlInvoiceInput, H as CreateNodeWalletAddressInput, I as CreateNodeWalletAddressOutput, J as CreateTestModeInvoiceInput, K as CreateTestModeInvoiceOutput, M as CreateTestModePaymentInput, N as CreateTestModePaymentoutput, O as CreateUmaInvitationInput, P as CreateUmaInvitationOutput, Q as CreateUmaInvoiceInput, R as CurrencyAmount, S as CurrencyUnit, T as DeclineToSignMessagesInput, U as DeclineToSignMessagesOutput, V as DeleteApiTokenInput, X as DeleteApiTokenOutput, Y as Deposit, _ as Entity, $ as FeeEstimate, a0 as FundNodeInput, a1 as FundNodeOutput, a2 as GraphNode, a3 as Hop, a5 as HtlcAttemptFailureCode, a6 as IdAndSignature, a7 as IncentivesIneligibilityReason, a8 as IncentivesStatus, a9 as IncomingPayment, aa as IncomingPaymentAttempt, ac as IncomingPaymentAttemptStatus, ad as IncomingPaymentToAttemptsConnection, ae as Invoice, ag as InvoiceData, ah as InvoiceType, ai as LightningFeeEstimateForInvoiceInput, aj as LightningFeeEstimateForNodeInput, ak as LightningFeeEstimateOutput, al as LightningTransaction, an as LightsparkNode, ap as LightsparkNodeOwner, ar as LightsparkNodeStatus, as as LightsparkNodeToChannelsConnection, at as LightsparkNodeWithOSK, au as LightsparkNodeWithRemoteSigning, av as Node, ax as NodeAddress, ay as NodeAddressType, az as NodeToAddressesConnection, aA as OnChainTransaction, aC as OutgoingPayment, aD as OutgoingPaymentAttempt, aE as OutgoingPaymentAttemptStatus, aF as OutgoingPaymentAttemptToHopsConnection, aG as OutgoingPaymentToAttemptsConnection, aH as OutgoingPaymentsForInvoiceQueryInput, aI as OutgoingPaymentsForInvoiceQueryOutput, aJ as PageInfo, aK as PayInvoiceInput, aL as PayInvoiceOutput, aM as PayUmaInvoiceInput, aN as PaymentDirection, aO as PaymentFailureReason, aP as PaymentRequest, aR as PaymentRequestData, aS as PaymentRequestStatus, aT as Permission, aU as PostTransactionData, aV as RegionCode, aW as RegisterPaymentInput, aX as RegisterPaymentOutput, aY as ReleaseChannelPerCommitmentSecretInput, aZ as ReleaseChannelPerCommitmentSecretOutput, a_ as ReleasePaymentPreimageInput, a$ as ReleasePaymentPreimageOutput, b0 as RemoteSigningSubEventType, b1 as RequestWithdrawalInput, b2 as RequestWithdrawalOutput, b3 as RichText, b4 as RiskRating, b5 as RoutingTransaction, b7 as RoutingTransactionFailureReason, b8 as ScreenNodeInput, b9 as ScreenNodeOutput, ba as Secret, bb as SendPaymentInput, bc as SendPaymentOutput, bd as SetInvoicePaymentHashInput, be as SetInvoicePaymentHashOutput, bf as SignInvoiceInput, bg as SignInvoiceOutput, bh as SignMessagesInput, bi as SignMessagesOutput, bj as Signable, bl as SignablePayload, bn as SignablePayloadStatus, bo as SingleNodeDashboard, bp as Transaction, br as TransactionFailures, bs as TransactionStatus, bt as TransactionType, bu as TransactionUpdate, bv as UmaInvitation, bx as UpdateChannelPerCommitmentPointInput, by as UpdateChannelPerCommitmentPointOutput, bz as UpdateNodeSharedSecretInput, bA as UpdateNodeSharedSecretOutput, bB as Wallet, bC as WalletStatus, bD as WalletToPaymentRequestsConnection, bE as WalletToTransactionsConnection, bF as Withdrawal, bH as WithdrawalMode, bI as WithdrawalRequest, bJ as WithdrawalRequestStatus, bK as WithdrawalRequestToChannelClosingTransactionsConnection, bL as WithdrawalRequestToChannelOpeningTransactionsConnection, h as getApiTokenQuery, k as getChannelClosingTransactionQuery, n as getChannelOpeningTransactionQuery, Z as getDepositQuery, a4 as getHopQuery, ab as getIncomingPaymentAttemptQuery, af as getInvoiceQuery, am as getLightningTransactionQuery, aq as getLightsparkNodeOwnerQuery, ao as getLightsparkNodeQuery, aw as getNodeQuery, aB as getOnChainTransactionQuery, aQ as getPaymentRequestQuery, b6 as getRoutingTransactionQuery, bm as getSignablePayloadQuery, bk as getSignableQuery, bq as getTransactionQuery, bw as getUmaInvitationQuery, bG as getWithdrawalQuery } from './index-449c9f58.js';
4
- import { B as BitcoinNetwork } from './BitcoinNetwork-37e9f091.js';
2
+ import { W as WebhookEventType, L as LightsparkClient } from './index-a5028d74.js';
3
+ export { A as Account, a as AccountToApiTokensConnection, b as AccountToChannelsConnection, c as AccountToNodesConnection, d as AccountToPaymentRequestsConnection, e as AccountToTransactionsConnection, f as AccountToWalletsConnection, g as ApiToken, B as Balances, i as BlockchainBalance, C as CancelInvoiceInput, j as CancelInvoiceOutput, k as Channel, l as ChannelClosingTransaction, n as ChannelFees, o as ChannelOpeningTransaction, q as ChannelSnapshot, r as ChannelStatus, s as ChannelToTransactionsConnection, t as ClaimUmaInvitationInput, u as ClaimUmaInvitationOutput, v as ClaimUmaInvitationWithIncentivesInput, w as ClaimUmaInvitationWithIncentivesOutput, x as ComplianceProvider, y as Connection, z as CreateApiTokenInput, D as CreateApiTokenOutput, E as CreateInvitationWithIncentivesInput, F as CreateInvitationWithIncentivesOutput, G as CreateInvoiceInput, H as CreateInvoiceOutput, I as CreateLnurlInvoiceInput, J as CreateNodeWalletAddressInput, K as CreateNodeWalletAddressOutput, M as CreateTestModeInvoiceInput, N as CreateTestModeInvoiceOutput, O as CreateTestModePaymentInput, P as CreateTestModePaymentoutput, Q as CreateUmaInvitationInput, R as CreateUmaInvitationOutput, S as CreateUmaInvoiceInput, T as CurrencyAmount, U as CurrencyUnit, V as DeclineToSignMessagesInput, X as DeclineToSignMessagesOutput, Y as DeleteApiTokenInput, Z as DeleteApiTokenOutput, _ as Deposit, a0 as Entity, a1 as FeeEstimate, a2 as FundNodeInput, a3 as FundNodeOutput, a4 as GraphNode, a5 as Hop, a7 as HtlcAttemptFailureCode, a8 as IdAndSignature, a9 as IncentivesIneligibilityReason, aa as IncentivesStatus, ab as IncomingPayment, ac as IncomingPaymentAttempt, ae as IncomingPaymentAttemptStatus, af as IncomingPaymentToAttemptsConnection, ag as Invoice, ai as InvoiceData, aj as InvoiceType, ak as LightningFeeEstimateForInvoiceInput, al as LightningFeeEstimateForNodeInput, am as LightningFeeEstimateOutput, an as LightningTransaction, ap as LightsparkNode, ar as LightsparkNodeOwner, at as LightsparkNodeStatus, au as LightsparkNodeToChannelsConnection, av as LightsparkNodeWithOSK, aw as LightsparkNodeWithRemoteSigning, ax as Node, az as NodeAddress, aA as NodeAddressType, aB as NodeToAddressesConnection, aC as OnChainTransaction, aE as OutgoingPayment, aF as OutgoingPaymentAttempt, aG as OutgoingPaymentAttemptStatus, aH as OutgoingPaymentAttemptToHopsConnection, aI as OutgoingPaymentToAttemptsConnection, aJ as OutgoingPaymentsForInvoiceQueryInput, aK as OutgoingPaymentsForInvoiceQueryOutput, aL as PageInfo, aM as PayInvoiceInput, aN as PayInvoiceOutput, aO as PayUmaInvoiceInput, aP as PaymentDirection, aQ as PaymentFailureReason, aR as PaymentRequest, aT as PaymentRequestData, aU as PaymentRequestStatus, aV as Permission, aW as PostTransactionData, aX as RegionCode, aY as RegisterPaymentInput, aZ as RegisterPaymentOutput, a_ as ReleaseChannelPerCommitmentSecretInput, a$ as ReleaseChannelPerCommitmentSecretOutput, b0 as ReleasePaymentPreimageInput, b1 as ReleasePaymentPreimageOutput, b2 as RemoteSigningSubEventType, b3 as RequestWithdrawalInput, b4 as RequestWithdrawalOutput, b5 as RichText, b6 as RiskRating, b7 as RoutingTransaction, b9 as RoutingTransactionFailureReason, ba as ScreenNodeInput, bb as ScreenNodeOutput, bc as Secret, bd as SendPaymentInput, be as SendPaymentOutput, bf as SetInvoicePaymentHashInput, bg as SetInvoicePaymentHashOutput, bh as SignInvoiceInput, bi as SignInvoiceOutput, bj as SignMessagesInput, bk as SignMessagesOutput, bl as Signable, bn as SignablePayload, bp as SignablePayloadStatus, bq as SingleNodeDashboard, br as Transaction, bt as TransactionFailures, bu as TransactionStatus, bv as TransactionType, bw as TransactionUpdate, bx as UmaInvitation, bz as UpdateChannelPerCommitmentPointInput, bA as UpdateChannelPerCommitmentPointOutput, bB as UpdateNodeSharedSecretInput, bC as UpdateNodeSharedSecretOutput, bD as Wallet, bE as WalletStatus, bF as WalletToPaymentRequestsConnection, bG as WalletToTransactionsConnection, bH as Withdrawal, bJ as WithdrawalMode, bK as WithdrawalRequest, bL as WithdrawalRequestStatus, bM as WithdrawalRequestToChannelClosingTransactionsConnection, bN as WithdrawalRequestToChannelOpeningTransactionsConnection, h as getApiTokenQuery, m as getChannelClosingTransactionQuery, p as getChannelOpeningTransactionQuery, $ as getDepositQuery, a6 as getHopQuery, ad as getIncomingPaymentAttemptQuery, ah as getInvoiceQuery, ao as getLightningTransactionQuery, as as getLightsparkNodeOwnerQuery, aq as getLightsparkNodeQuery, ay as getNodeQuery, aD as getOnChainTransactionQuery, aS as getPaymentRequestQuery, b8 as getRoutingTransactionQuery, bo as getSignablePayloadQuery, bm as getSignableQuery, bs as getTransactionQuery, by as getUmaInvitationQuery, bI as getWithdrawalQuery } from './index-a5028d74.js';
4
+ import { B as BitcoinNetwork } from './BitcoinNetwork-972b1d01.js';
5
5
  import 'zen-observable';
6
6
 
7
7
  declare class AccountTokenAuthProvider implements AuthProvider {
package/dist/index.js CHANGED
@@ -86,7 +86,7 @@ import {
86
86
  getTransactionQuery,
87
87
  getUmaInvitationQuery,
88
88
  getWithdrawalQuery
89
- } from "./chunk-NCPWHRFO.js";
89
+ } from "./chunk-Y55D3PD4.js";
90
90
  import {
91
91
  BitcoinNetwork_default
92
92
  } from "./chunk-K6SAUSAX.js";
@@ -144,7 +144,7 @@ import {
144
144
  // package.json
145
145
  var package_default = {
146
146
  name: "@lightsparkdev/lightspark-sdk",
147
- version: "1.2.3",
147
+ version: "1.3.0",
148
148
  description: "Lightspark JS SDK",
149
149
  author: "Lightspark Inc.",
150
150
  keywords: [
@@ -232,7 +232,7 @@ var package_default = {
232
232
  },
233
233
  license: "Apache-2.0",
234
234
  dependencies: {
235
- "@lightsparkdev/core": "1.0.11",
235
+ "@lightsparkdev/core": "1.0.12",
236
236
  "@lightsparkdev/crypto-wasm": "0.1.2",
237
237
  "auto-bind": "^5.0.1",
238
238
  "crypto-browserify": "^3.12.0",
@@ -459,6 +459,21 @@ var BitcoinFeeEstimate = `
459
459
  ${FRAGMENT2}
460
460
  `;
461
461
 
462
+ // src/graphql/CancelInvoice.ts
463
+ var CancelInvoice = `
464
+ mutation CancelInvoice(
465
+ $invoice_id: ID!
466
+ ) {
467
+ cancel_invoice(input: { invoice_id: $invoice_id }) {
468
+ invoice {
469
+ ...InvoiceFragment
470
+ }
471
+ }
472
+ }
473
+
474
+ ${FRAGMENT4}
475
+ `;
476
+
462
477
  // src/graphql/ClaimUmaInvitation.ts
463
478
  var ClaimUmaInvitation = `
464
479
  mutation ClaimUmaInvitation(
@@ -475,7 +490,7 @@ var ClaimUmaInvitation = `
475
490
  }
476
491
  }
477
492
 
478
- ${FRAGMENT3}
493
+ ${FRAGMENT5}
479
494
  `;
480
495
 
481
496
  // src/graphql/ClaimUmaInvitationWithIncentives.ts
@@ -498,7 +513,7 @@ var ClaimUmaInvitationWithIncentives = `
498
513
  }
499
514
  }
500
515
 
501
- ${FRAGMENT3}
516
+ ${FRAGMENT5}
502
517
  `;
503
518
 
504
519
  // src/graphql/CreateApiToken.ts
@@ -518,7 +533,7 @@ var CreateApiToken = `
518
533
  }
519
534
  }
520
535
 
521
- ${FRAGMENT4}
536
+ ${FRAGMENT6}
522
537
  `;
523
538
 
524
539
  // src/graphql/CreateInvoice.ts
@@ -559,7 +574,7 @@ mutation CreateLnurlInvoice(
559
574
  }
560
575
  }
561
576
  }
562
- ${FRAGMENT6}
577
+ ${FRAGMENT4}
563
578
  `;
564
579
 
565
580
  // src/graphql/CreateNodeWalletAddress.ts
@@ -629,7 +644,7 @@ var CreateUmaInvitation = `
629
644
  }
630
645
  }
631
646
 
632
- ${FRAGMENT3}
647
+ ${FRAGMENT5}
633
648
  `;
634
649
 
635
650
  // src/graphql/CreateUmaInvitationWithIncentives.ts
@@ -650,7 +665,7 @@ var CreateUmaInvitationWithIncentives = `
650
665
  }
651
666
  }
652
667
 
653
- ${FRAGMENT3}
668
+ ${FRAGMENT5}
654
669
  `;
655
670
 
656
671
  // src/graphql/CreateUmaInvoice.ts
@@ -672,7 +687,7 @@ mutation CreateUmaInvoice(
672
687
  }
673
688
  }
674
689
  }
675
- ${FRAGMENT6}
690
+ ${FRAGMENT4}
676
691
  `;
677
692
 
678
693
  // src/graphql/DecodeInvoice.ts
@@ -686,7 +701,7 @@ var DecodeInvoice = `
686
701
  }
687
702
  }
688
703
 
689
- ${FRAGMENT5}
704
+ ${FRAGMENT3}
690
705
  `;
691
706
 
692
707
  // src/graphql/DeleteApiToken.ts
@@ -712,7 +727,7 @@ var FetchUmaInvitation = `
712
727
  }
713
728
  }
714
729
 
715
- ${FRAGMENT3}
730
+ ${FRAGMENT5}
716
731
  `;
717
732
 
718
733
  // src/graphql/FundNode.ts
@@ -1544,6 +1559,22 @@ var LightsparkClient = class {
1544
1559
  }
1545
1560
  return InvoiceFromJson(invoiceJson);
1546
1561
  }
1562
+ /**
1563
+ * Cancels an existing unpaid invoice and returns that invoice. Cancelled invoices cannot be paid.
1564
+ *
1565
+ * @param invoiceId The ID of the invoice to cancel.
1566
+ * @returns The cancelled invoice, or undefined if the invoice could not be cancelled.
1567
+ */
1568
+ async cancelInvoice(invoiceId) {
1569
+ const response = await this.requester.makeRawRequest(CancelInvoice, {
1570
+ invoice_id: invoiceId
1571
+ });
1572
+ const invoiceJson = response.cancel_invoice?.invoice;
1573
+ if (!invoiceJson) {
1574
+ return void 0;
1575
+ }
1576
+ return InvoiceFromJson(invoiceJson);
1577
+ }
1547
1578
  /**
1548
1579
  * Decodes an encoded lightning invoice string.
1549
1580
  *
@@ -1,4 +1,4 @@
1
- export { A as Account, a as AccountToApiTokensConnection, b as AccountToChannelsConnection, c as AccountToNodesConnection, d as AccountToPaymentRequestsConnection, e as AccountToTransactionsConnection, f as AccountToWalletsConnection, g as ApiToken, B as Balances, i as BlockchainBalance, C as Channel, j as ChannelClosingTransaction, l as ChannelFees, m as ChannelOpeningTransaction, o as ChannelSnapshot, p as ChannelStatus, q as ChannelToTransactionsConnection, r as ClaimUmaInvitationInput, s as ClaimUmaInvitationOutput, t as ClaimUmaInvitationWithIncentivesInput, u as ClaimUmaInvitationWithIncentivesOutput, v as ComplianceProvider, w as Connection, x as CreateApiTokenInput, y as CreateApiTokenOutput, z as CreateInvitationWithIncentivesInput, D as CreateInvitationWithIncentivesOutput, E as CreateInvoiceInput, F as CreateInvoiceOutput, G as CreateLnurlInvoiceInput, H as CreateNodeWalletAddressInput, I as CreateNodeWalletAddressOutput, J as CreateTestModeInvoiceInput, K as CreateTestModeInvoiceOutput, M as CreateTestModePaymentInput, N as CreateTestModePaymentoutput, O as CreateUmaInvitationInput, P as CreateUmaInvitationOutput, Q as CreateUmaInvoiceInput, R as CurrencyAmount, S as CurrencyUnit, T as DeclineToSignMessagesInput, U as DeclineToSignMessagesOutput, V as DeleteApiTokenInput, X as DeleteApiTokenOutput, Y as Deposit, _ as Entity, $ as FeeEstimate, a0 as FundNodeInput, a1 as FundNodeOutput, a2 as GraphNode, a3 as Hop, a5 as HtlcAttemptFailureCode, a6 as IdAndSignature, a7 as IncentivesIneligibilityReason, a8 as IncentivesStatus, a9 as IncomingPayment, aa as IncomingPaymentAttempt, ac as IncomingPaymentAttemptStatus, ad as IncomingPaymentToAttemptsConnection, ae as Invoice, ag as InvoiceData, ah as InvoiceType, ai as LightningFeeEstimateForInvoiceInput, aj as LightningFeeEstimateForNodeInput, ak as LightningFeeEstimateOutput, al as LightningTransaction, an as LightsparkNode, ap as LightsparkNodeOwner, ar as LightsparkNodeStatus, as as LightsparkNodeToChannelsConnection, at as LightsparkNodeWithOSK, au as LightsparkNodeWithRemoteSigning, av as Node, ax as NodeAddress, ay as NodeAddressType, az as NodeToAddressesConnection, aA as OnChainTransaction, aC as OutgoingPayment, aD as OutgoingPaymentAttempt, aE as OutgoingPaymentAttemptStatus, aF as OutgoingPaymentAttemptToHopsConnection, aG as OutgoingPaymentToAttemptsConnection, aH as OutgoingPaymentsForInvoiceQueryInput, aI as OutgoingPaymentsForInvoiceQueryOutput, aJ as PageInfo, aK as PayInvoiceInput, aL as PayInvoiceOutput, aM as PayUmaInvoiceInput, aN as PaymentDirection, aO as PaymentFailureReason, aP as PaymentRequest, aR as PaymentRequestData, aS as PaymentRequestStatus, aT as Permission, aU as PostTransactionData, aV as RegionCode, aW as RegisterPaymentInput, aX as RegisterPaymentOutput, aY as ReleaseChannelPerCommitmentSecretInput, aZ as ReleaseChannelPerCommitmentSecretOutput, a_ as ReleasePaymentPreimageInput, a$ as ReleasePaymentPreimageOutput, b0 as RemoteSigningSubEventType, b1 as RequestWithdrawalInput, b2 as RequestWithdrawalOutput, b3 as RichText, b4 as RiskRating, b5 as RoutingTransaction, b7 as RoutingTransactionFailureReason, b8 as ScreenNodeInput, b9 as ScreenNodeOutput, ba as Secret, bb as SendPaymentInput, bc as SendPaymentOutput, bd as SetInvoicePaymentHashInput, be as SetInvoicePaymentHashOutput, bf as SignInvoiceInput, bg as SignInvoiceOutput, bh as SignMessagesInput, bi as SignMessagesOutput, bj as Signable, bl as SignablePayload, bn as SignablePayloadStatus, bo as SingleNodeDashboard, bp as Transaction, br as TransactionFailures, bs as TransactionStatus, bt as TransactionType, bu as TransactionUpdate, bv as UmaInvitation, bx as UpdateChannelPerCommitmentPointInput, by as UpdateChannelPerCommitmentPointOutput, bz as UpdateNodeSharedSecretInput, bA as UpdateNodeSharedSecretOutput, bB as Wallet, bC as WalletStatus, bD as WalletToPaymentRequestsConnection, bE as WalletToTransactionsConnection, W as WebhookEventType, bF as Withdrawal, bH as WithdrawalMode, bI as WithdrawalRequest, bJ as WithdrawalRequestStatus, bK as WithdrawalRequestToChannelClosingTransactionsConnection, bL as WithdrawalRequestToChannelOpeningTransactionsConnection, h as getApiTokenQuery, k as getChannelClosingTransactionQuery, n as getChannelOpeningTransactionQuery, Z as getDepositQuery, a4 as getHopQuery, ab as getIncomingPaymentAttemptQuery, af as getInvoiceQuery, am as getLightningTransactionQuery, aq as getLightsparkNodeOwnerQuery, ao as getLightsparkNodeQuery, aw as getNodeQuery, aB as getOnChainTransactionQuery, aQ as getPaymentRequestQuery, b6 as getRoutingTransactionQuery, bm as getSignablePayloadQuery, bk as getSignableQuery, bq as getTransactionQuery, bw as getUmaInvitationQuery, bG as getWithdrawalQuery } from '../index-449c9f58.js';
2
- export { B as BitcoinNetwork } from '../BitcoinNetwork-37e9f091.js';
1
+ export { A as Account, a as AccountToApiTokensConnection, b as AccountToChannelsConnection, c as AccountToNodesConnection, d as AccountToPaymentRequestsConnection, e as AccountToTransactionsConnection, f as AccountToWalletsConnection, g as ApiToken, B as Balances, i as BlockchainBalance, C as CancelInvoiceInput, j as CancelInvoiceOutput, k as Channel, l as ChannelClosingTransaction, n as ChannelFees, o as ChannelOpeningTransaction, q as ChannelSnapshot, r as ChannelStatus, s as ChannelToTransactionsConnection, t as ClaimUmaInvitationInput, u as ClaimUmaInvitationOutput, v as ClaimUmaInvitationWithIncentivesInput, w as ClaimUmaInvitationWithIncentivesOutput, x as ComplianceProvider, y as Connection, z as CreateApiTokenInput, D as CreateApiTokenOutput, E as CreateInvitationWithIncentivesInput, F as CreateInvitationWithIncentivesOutput, G as CreateInvoiceInput, H as CreateInvoiceOutput, I as CreateLnurlInvoiceInput, J as CreateNodeWalletAddressInput, K as CreateNodeWalletAddressOutput, M as CreateTestModeInvoiceInput, N as CreateTestModeInvoiceOutput, O as CreateTestModePaymentInput, P as CreateTestModePaymentoutput, Q as CreateUmaInvitationInput, R as CreateUmaInvitationOutput, S as CreateUmaInvoiceInput, T as CurrencyAmount, U as CurrencyUnit, V as DeclineToSignMessagesInput, X as DeclineToSignMessagesOutput, Y as DeleteApiTokenInput, Z as DeleteApiTokenOutput, _ as Deposit, a0 as Entity, a1 as FeeEstimate, a2 as FundNodeInput, a3 as FundNodeOutput, a4 as GraphNode, a5 as Hop, a7 as HtlcAttemptFailureCode, a8 as IdAndSignature, a9 as IncentivesIneligibilityReason, aa as IncentivesStatus, ab as IncomingPayment, ac as IncomingPaymentAttempt, ae as IncomingPaymentAttemptStatus, af as IncomingPaymentToAttemptsConnection, ag as Invoice, ai as InvoiceData, aj as InvoiceType, ak as LightningFeeEstimateForInvoiceInput, al as LightningFeeEstimateForNodeInput, am as LightningFeeEstimateOutput, an as LightningTransaction, ap as LightsparkNode, ar as LightsparkNodeOwner, at as LightsparkNodeStatus, au as LightsparkNodeToChannelsConnection, av as LightsparkNodeWithOSK, aw as LightsparkNodeWithRemoteSigning, ax as Node, az as NodeAddress, aA as NodeAddressType, aB as NodeToAddressesConnection, aC as OnChainTransaction, aE as OutgoingPayment, aF as OutgoingPaymentAttempt, aG as OutgoingPaymentAttemptStatus, aH as OutgoingPaymentAttemptToHopsConnection, aI as OutgoingPaymentToAttemptsConnection, aJ as OutgoingPaymentsForInvoiceQueryInput, aK as OutgoingPaymentsForInvoiceQueryOutput, aL as PageInfo, aM as PayInvoiceInput, aN as PayInvoiceOutput, aO as PayUmaInvoiceInput, aP as PaymentDirection, aQ as PaymentFailureReason, aR as PaymentRequest, aT as PaymentRequestData, aU as PaymentRequestStatus, aV as Permission, aW as PostTransactionData, aX as RegionCode, aY as RegisterPaymentInput, aZ as RegisterPaymentOutput, a_ as ReleaseChannelPerCommitmentSecretInput, a$ as ReleaseChannelPerCommitmentSecretOutput, b0 as ReleasePaymentPreimageInput, b1 as ReleasePaymentPreimageOutput, b2 as RemoteSigningSubEventType, b3 as RequestWithdrawalInput, b4 as RequestWithdrawalOutput, b5 as RichText, b6 as RiskRating, b7 as RoutingTransaction, b9 as RoutingTransactionFailureReason, ba as ScreenNodeInput, bb as ScreenNodeOutput, bc as Secret, bd as SendPaymentInput, be as SendPaymentOutput, bf as SetInvoicePaymentHashInput, bg as SetInvoicePaymentHashOutput, bh as SignInvoiceInput, bi as SignInvoiceOutput, bj as SignMessagesInput, bk as SignMessagesOutput, bl as Signable, bn as SignablePayload, bp as SignablePayloadStatus, bq as SingleNodeDashboard, br as Transaction, bt as TransactionFailures, bu as TransactionStatus, bv as TransactionType, bw as TransactionUpdate, bx as UmaInvitation, bz as UpdateChannelPerCommitmentPointInput, bA as UpdateChannelPerCommitmentPointOutput, bB as UpdateNodeSharedSecretInput, bC as UpdateNodeSharedSecretOutput, bD as Wallet, bE as WalletStatus, bF as WalletToPaymentRequestsConnection, bG as WalletToTransactionsConnection, W as WebhookEventType, bH as Withdrawal, bJ as WithdrawalMode, bK as WithdrawalRequest, bL as WithdrawalRequestStatus, bM as WithdrawalRequestToChannelClosingTransactionsConnection, bN as WithdrawalRequestToChannelOpeningTransactionsConnection, h as getApiTokenQuery, m as getChannelClosingTransactionQuery, p as getChannelOpeningTransactionQuery, $ as getDepositQuery, a6 as getHopQuery, ad as getIncomingPaymentAttemptQuery, ah as getInvoiceQuery, ao as getLightningTransactionQuery, as as getLightsparkNodeOwnerQuery, aq as getLightsparkNodeQuery, ay as getNodeQuery, aD as getOnChainTransactionQuery, aS as getPaymentRequestQuery, b8 as getRoutingTransactionQuery, bo as getSignablePayloadQuery, bm as getSignableQuery, bs as getTransactionQuery, by as getUmaInvitationQuery, bI as getWithdrawalQuery } from '../index-a5028d74.js';
2
+ export { B as BitcoinNetwork } from '../BitcoinNetwork-972b1d01.js';
3
3
  import '@lightsparkdev/core';
4
4
  import 'zen-observable';
@@ -1,4 +1,4 @@
1
- export { A as Account, a as AccountToApiTokensConnection, b as AccountToChannelsConnection, c as AccountToNodesConnection, d as AccountToPaymentRequestsConnection, e as AccountToTransactionsConnection, f as AccountToWalletsConnection, g as ApiToken, B as Balances, i as BlockchainBalance, C as Channel, j as ChannelClosingTransaction, l as ChannelFees, m as ChannelOpeningTransaction, o as ChannelSnapshot, p as ChannelStatus, q as ChannelToTransactionsConnection, r as ClaimUmaInvitationInput, s as ClaimUmaInvitationOutput, t as ClaimUmaInvitationWithIncentivesInput, u as ClaimUmaInvitationWithIncentivesOutput, v as ComplianceProvider, w as Connection, x as CreateApiTokenInput, y as CreateApiTokenOutput, z as CreateInvitationWithIncentivesInput, D as CreateInvitationWithIncentivesOutput, E as CreateInvoiceInput, F as CreateInvoiceOutput, G as CreateLnurlInvoiceInput, H as CreateNodeWalletAddressInput, I as CreateNodeWalletAddressOutput, J as CreateTestModeInvoiceInput, K as CreateTestModeInvoiceOutput, M as CreateTestModePaymentInput, N as CreateTestModePaymentoutput, O as CreateUmaInvitationInput, P as CreateUmaInvitationOutput, Q as CreateUmaInvoiceInput, R as CurrencyAmount, S as CurrencyUnit, T as DeclineToSignMessagesInput, U as DeclineToSignMessagesOutput, V as DeleteApiTokenInput, X as DeleteApiTokenOutput, Y as Deposit, _ as Entity, $ as FeeEstimate, a0 as FundNodeInput, a1 as FundNodeOutput, a2 as GraphNode, a3 as Hop, a5 as HtlcAttemptFailureCode, a6 as IdAndSignature, a7 as IncentivesIneligibilityReason, a8 as IncentivesStatus, a9 as IncomingPayment, aa as IncomingPaymentAttempt, ac as IncomingPaymentAttemptStatus, ad as IncomingPaymentToAttemptsConnection, ae as Invoice, ag as InvoiceData, ah as InvoiceType, ai as LightningFeeEstimateForInvoiceInput, aj as LightningFeeEstimateForNodeInput, ak as LightningFeeEstimateOutput, al as LightningTransaction, an as LightsparkNode, ap as LightsparkNodeOwner, ar as LightsparkNodeStatus, as as LightsparkNodeToChannelsConnection, at as LightsparkNodeWithOSK, au as LightsparkNodeWithRemoteSigning, av as Node, ax as NodeAddress, ay as NodeAddressType, az as NodeToAddressesConnection, aA as OnChainTransaction, aC as OutgoingPayment, aD as OutgoingPaymentAttempt, aE as OutgoingPaymentAttemptStatus, aF as OutgoingPaymentAttemptToHopsConnection, aG as OutgoingPaymentToAttemptsConnection, aH as OutgoingPaymentsForInvoiceQueryInput, aI as OutgoingPaymentsForInvoiceQueryOutput, aJ as PageInfo, aK as PayInvoiceInput, aL as PayInvoiceOutput, aM as PayUmaInvoiceInput, aN as PaymentDirection, aO as PaymentFailureReason, aP as PaymentRequest, aR as PaymentRequestData, aS as PaymentRequestStatus, aT as Permission, aU as PostTransactionData, aV as RegionCode, aW as RegisterPaymentInput, aX as RegisterPaymentOutput, aY as ReleaseChannelPerCommitmentSecretInput, aZ as ReleaseChannelPerCommitmentSecretOutput, a_ as ReleasePaymentPreimageInput, a$ as ReleasePaymentPreimageOutput, b0 as RemoteSigningSubEventType, b1 as RequestWithdrawalInput, b2 as RequestWithdrawalOutput, b3 as RichText, b4 as RiskRating, b5 as RoutingTransaction, b7 as RoutingTransactionFailureReason, b8 as ScreenNodeInput, b9 as ScreenNodeOutput, ba as Secret, bb as SendPaymentInput, bc as SendPaymentOutput, bd as SetInvoicePaymentHashInput, be as SetInvoicePaymentHashOutput, bf as SignInvoiceInput, bg as SignInvoiceOutput, bh as SignMessagesInput, bi as SignMessagesOutput, bj as Signable, bl as SignablePayload, bn as SignablePayloadStatus, bo as SingleNodeDashboard, bp as Transaction, br as TransactionFailures, bs as TransactionStatus, bt as TransactionType, bu as TransactionUpdate, bv as UmaInvitation, bx as UpdateChannelPerCommitmentPointInput, by as UpdateChannelPerCommitmentPointOutput, bz as UpdateNodeSharedSecretInput, bA as UpdateNodeSharedSecretOutput, bB as Wallet, bC as WalletStatus, bD as WalletToPaymentRequestsConnection, bE as WalletToTransactionsConnection, W as WebhookEventType, bF as Withdrawal, bH as WithdrawalMode, bI as WithdrawalRequest, bJ as WithdrawalRequestStatus, bK as WithdrawalRequestToChannelClosingTransactionsConnection, bL as WithdrawalRequestToChannelOpeningTransactionsConnection, h as getApiTokenQuery, k as getChannelClosingTransactionQuery, n as getChannelOpeningTransactionQuery, Z as getDepositQuery, a4 as getHopQuery, ab as getIncomingPaymentAttemptQuery, af as getInvoiceQuery, am as getLightningTransactionQuery, aq as getLightsparkNodeOwnerQuery, ao as getLightsparkNodeQuery, aw as getNodeQuery, aB as getOnChainTransactionQuery, aQ as getPaymentRequestQuery, b6 as getRoutingTransactionQuery, bm as getSignablePayloadQuery, bk as getSignableQuery, bq as getTransactionQuery, bw as getUmaInvitationQuery, bG as getWithdrawalQuery } from '../index-449c9f58.js';
2
- export { B as BitcoinNetwork } from '../BitcoinNetwork-37e9f091.js';
1
+ export { A as Account, a as AccountToApiTokensConnection, b as AccountToChannelsConnection, c as AccountToNodesConnection, d as AccountToPaymentRequestsConnection, e as AccountToTransactionsConnection, f as AccountToWalletsConnection, g as ApiToken, B as Balances, i as BlockchainBalance, C as CancelInvoiceInput, j as CancelInvoiceOutput, k as Channel, l as ChannelClosingTransaction, n as ChannelFees, o as ChannelOpeningTransaction, q as ChannelSnapshot, r as ChannelStatus, s as ChannelToTransactionsConnection, t as ClaimUmaInvitationInput, u as ClaimUmaInvitationOutput, v as ClaimUmaInvitationWithIncentivesInput, w as ClaimUmaInvitationWithIncentivesOutput, x as ComplianceProvider, y as Connection, z as CreateApiTokenInput, D as CreateApiTokenOutput, E as CreateInvitationWithIncentivesInput, F as CreateInvitationWithIncentivesOutput, G as CreateInvoiceInput, H as CreateInvoiceOutput, I as CreateLnurlInvoiceInput, J as CreateNodeWalletAddressInput, K as CreateNodeWalletAddressOutput, M as CreateTestModeInvoiceInput, N as CreateTestModeInvoiceOutput, O as CreateTestModePaymentInput, P as CreateTestModePaymentoutput, Q as CreateUmaInvitationInput, R as CreateUmaInvitationOutput, S as CreateUmaInvoiceInput, T as CurrencyAmount, U as CurrencyUnit, V as DeclineToSignMessagesInput, X as DeclineToSignMessagesOutput, Y as DeleteApiTokenInput, Z as DeleteApiTokenOutput, _ as Deposit, a0 as Entity, a1 as FeeEstimate, a2 as FundNodeInput, a3 as FundNodeOutput, a4 as GraphNode, a5 as Hop, a7 as HtlcAttemptFailureCode, a8 as IdAndSignature, a9 as IncentivesIneligibilityReason, aa as IncentivesStatus, ab as IncomingPayment, ac as IncomingPaymentAttempt, ae as IncomingPaymentAttemptStatus, af as IncomingPaymentToAttemptsConnection, ag as Invoice, ai as InvoiceData, aj as InvoiceType, ak as LightningFeeEstimateForInvoiceInput, al as LightningFeeEstimateForNodeInput, am as LightningFeeEstimateOutput, an as LightningTransaction, ap as LightsparkNode, ar as LightsparkNodeOwner, at as LightsparkNodeStatus, au as LightsparkNodeToChannelsConnection, av as LightsparkNodeWithOSK, aw as LightsparkNodeWithRemoteSigning, ax as Node, az as NodeAddress, aA as NodeAddressType, aB as NodeToAddressesConnection, aC as OnChainTransaction, aE as OutgoingPayment, aF as OutgoingPaymentAttempt, aG as OutgoingPaymentAttemptStatus, aH as OutgoingPaymentAttemptToHopsConnection, aI as OutgoingPaymentToAttemptsConnection, aJ as OutgoingPaymentsForInvoiceQueryInput, aK as OutgoingPaymentsForInvoiceQueryOutput, aL as PageInfo, aM as PayInvoiceInput, aN as PayInvoiceOutput, aO as PayUmaInvoiceInput, aP as PaymentDirection, aQ as PaymentFailureReason, aR as PaymentRequest, aT as PaymentRequestData, aU as PaymentRequestStatus, aV as Permission, aW as PostTransactionData, aX as RegionCode, aY as RegisterPaymentInput, aZ as RegisterPaymentOutput, a_ as ReleaseChannelPerCommitmentSecretInput, a$ as ReleaseChannelPerCommitmentSecretOutput, b0 as ReleasePaymentPreimageInput, b1 as ReleasePaymentPreimageOutput, b2 as RemoteSigningSubEventType, b3 as RequestWithdrawalInput, b4 as RequestWithdrawalOutput, b5 as RichText, b6 as RiskRating, b7 as RoutingTransaction, b9 as RoutingTransactionFailureReason, ba as ScreenNodeInput, bb as ScreenNodeOutput, bc as Secret, bd as SendPaymentInput, be as SendPaymentOutput, bf as SetInvoicePaymentHashInput, bg as SetInvoicePaymentHashOutput, bh as SignInvoiceInput, bi as SignInvoiceOutput, bj as SignMessagesInput, bk as SignMessagesOutput, bl as Signable, bn as SignablePayload, bp as SignablePayloadStatus, bq as SingleNodeDashboard, br as Transaction, bt as TransactionFailures, bu as TransactionStatus, bv as TransactionType, bw as TransactionUpdate, bx as UmaInvitation, bz as UpdateChannelPerCommitmentPointInput, bA as UpdateChannelPerCommitmentPointOutput, bB as UpdateNodeSharedSecretInput, bC as UpdateNodeSharedSecretOutput, bD as Wallet, bE as WalletStatus, bF as WalletToPaymentRequestsConnection, bG as WalletToTransactionsConnection, W as WebhookEventType, bH as Withdrawal, bJ as WithdrawalMode, bK as WithdrawalRequest, bL as WithdrawalRequestStatus, bM as WithdrawalRequestToChannelClosingTransactionsConnection, bN as WithdrawalRequestToChannelOpeningTransactionsConnection, h as getApiTokenQuery, m as getChannelClosingTransactionQuery, p as getChannelOpeningTransactionQuery, $ as getDepositQuery, a6 as getHopQuery, ad as getIncomingPaymentAttemptQuery, ah as getInvoiceQuery, ao as getLightningTransactionQuery, as as getLightsparkNodeOwnerQuery, aq as getLightsparkNodeQuery, ay as getNodeQuery, aD as getOnChainTransactionQuery, aS as getPaymentRequestQuery, b8 as getRoutingTransactionQuery, bo as getSignablePayloadQuery, bm as getSignableQuery, bs as getTransactionQuery, by as getUmaInvitationQuery, bI as getWithdrawalQuery } from '../index-a5028d74.js';
2
+ export { B as BitcoinNetwork } from '../BitcoinNetwork-972b1d01.js';
3
3
  import '@lightsparkdev/core';
4
4
  import 'zen-observable';
@@ -55,7 +55,7 @@ import {
55
55
  getTransactionQuery,
56
56
  getUmaInvitationQuery,
57
57
  getWithdrawalQuery
58
- } from "../chunk-NCPWHRFO.js";
58
+ } from "../chunk-Y55D3PD4.js";
59
59
  import {
60
60
  BitcoinNetwork_default
61
61
  } from "../chunk-K6SAUSAX.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightsparkdev/lightspark-sdk",
3
- "version": "1.2.3",
3
+ "version": "1.3.0",
4
4
  "description": "Lightspark JS SDK",
5
5
  "author": "Lightspark Inc.",
6
6
  "keywords": [
@@ -88,7 +88,7 @@
88
88
  },
89
89
  "license": "Apache-2.0",
90
90
  "dependencies": {
91
- "@lightsparkdev/core": "1.0.11",
91
+ "@lightsparkdev/core": "1.0.12",
92
92
  "@lightsparkdev/crypto-wasm": "0.1.2",
93
93
  "auto-bind": "^5.0.1",
94
94
  "crypto-browserify": "^3.12.0",
package/src/client.ts CHANGED
@@ -27,6 +27,7 @@ import packageJson from "../package.json";
27
27
  import NodeKeyLoaderCache from "./NodeKeyLoaderCache.js";
28
28
  import { type SigningKeyLoaderArgs } from "./SigningKeyLoader.js";
29
29
  import { BitcoinFeeEstimate as BitcoinFeeEstimateQuery } from "./graphql/BitcoinFeeEstimate.js";
30
+ import { CancelInvoice } from "./graphql/CancelInvoice.js";
30
31
  import { ClaimUmaInvitation } from "./graphql/ClaimUmaInvitation.js";
31
32
  import { ClaimUmaInvitationWithIncentives } from "./graphql/ClaimUmaInvitationWithIncentives.js";
32
33
  import { CreateApiToken } from "./graphql/CreateApiToken.js";
@@ -604,6 +605,23 @@ class LightsparkClient {
604
605
  return InvoiceFromJson(invoiceJson);
605
606
  }
606
607
 
608
+ /**
609
+ * Cancels an existing unpaid invoice and returns that invoice. Cancelled invoices cannot be paid.
610
+ *
611
+ * @param invoiceId The ID of the invoice to cancel.
612
+ * @returns The cancelled invoice, or undefined if the invoice could not be cancelled.
613
+ */
614
+ public async cancelInvoice(invoiceId: string): Promise<Invoice | undefined> {
615
+ const response = await this.requester.makeRawRequest(CancelInvoice, {
616
+ invoice_id: invoiceId,
617
+ });
618
+ const invoiceJson = response.cancel_invoice?.invoice;
619
+ if (!invoiceJson) {
620
+ return undefined;
621
+ }
622
+ return InvoiceFromJson(invoiceJson);
623
+ }
624
+
607
625
  /**
608
626
  * Decodes an encoded lightning invoice string.
609
627
  *
@@ -0,0 +1,17 @@
1
+ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
+
3
+ import { FRAGMENT as InvoiceFragment } from "../objects/Invoice.js";
4
+
5
+ export const CancelInvoice = `
6
+ mutation CancelInvoice(
7
+ $invoice_id: ID!
8
+ ) {
9
+ cancel_invoice(input: { invoice_id: $invoice_id }) {
10
+ invoice {
11
+ ...InvoiceFragment
12
+ }
13
+ }
14
+ }
15
+
16
+ ${InvoiceFragment}
17
+ `;
@@ -28,8 +28,8 @@ import type TransactionType from "./TransactionType.js";
28
28
 
29
29
  /**
30
30
  * This is an object representing the connected Lightspark account.
31
- * You can retrieve this object to see your account information and objects
32
- * tied to your account. *
31
+ * You can retrieve this object to see your account information and objects tied to your account.
32
+ * *
33
33
  */
34
34
  class Account implements LightsparkNodeOwner, Entity {
35
35
  constructor(
@@ -8,15 +8,12 @@ import { PageInfoFromJson, PageInfoToJson } from "./PageInfo.js";
8
8
  interface AccountToApiTokensConnection {
9
9
  /**
10
10
  * The total count of objects in this connection, using the current filters.
11
- * It is different from the number of objects returned in the current page
12
- * (in the `entities` field).
11
+ * It is different from the number of objects returned in the current page (in the `entities`
12
+ * field).
13
13
  **/
14
14
  count: number;
15
15
 
16
- /**
17
- * An object that holds pagination information about the objects in this
18
- * connection. *
19
- */
16
+ /** An object that holds pagination information about the objects in this connection. **/
20
17
  pageInfo: PageInfo;
21
18
 
22
19
  /** The API tokens for the current page of this connection. **/
@@ -7,9 +7,9 @@ import { ChannelFromJson } from "./Channel.js";
7
7
  class AccountToChannelsConnection {
8
8
  constructor(
9
9
  /**
10
- * The total count of objects in this connection, using the current
11
- * filters. It is different from the number of objects returned in the
12
- * current page (in the `entities` field).
10
+ * The total count of objects in this connection, using the current filters.
11
+ * It is different from the number of objects returned in the current page (in the `entities`
12
+ * field).
13
13
  **/
14
14
  public readonly count: number,
15
15
  /** The channels for the current page of this connection. **/
@@ -12,15 +12,12 @@ import { PageInfoFromJson, PageInfoToJson } from "./PageInfo.js";
12
12
  interface AccountToNodesConnection {
13
13
  /**
14
14
  * The total count of objects in this connection, using the current filters.
15
- * It is different from the number of objects returned in the current page
16
- * (in the `entities` field).
15
+ * It is different from the number of objects returned in the current page (in the `entities`
16
+ * field).
17
17
  **/
18
18
  count: number;
19
19
 
20
- /**
21
- * An object that holds pagination information about the objects in this
22
- * connection. *
23
- */
20
+ /** An object that holds pagination information about the objects in this connection. **/
24
21
  pageInfo: PageInfo;
25
22
 
26
23
  /** The nodes for the current page of this connection. **/
@@ -11,15 +11,12 @@ import {
11
11
  interface AccountToPaymentRequestsConnection {
12
12
  /**
13
13
  * The total count of objects in this connection, using the current filters.
14
- * It is different from the number of objects returned in the current page
15
- * (in the `entities` field).
14
+ * It is different from the number of objects returned in the current page (in the `entities`
15
+ * field).
16
16
  **/
17
17
  count: number;
18
18
 
19
- /**
20
- * An object that holds pagination information about the objects in this
21
- * connection. *
22
- */
19
+ /** An object that holds pagination information about the objects in this connection. **/
23
20
  pageInfo: PageInfo;
24
21
 
25
22
  /** The payment requests for the current page of this connection. **/
@@ -13,15 +13,12 @@ import { TransactionFromJson, TransactionToJson } from "./Transaction.js";
13
13
  interface AccountToTransactionsConnection {
14
14
  /**
15
15
  * The total count of objects in this connection, using the current filters.
16
- * It is different from the number of objects returned in the current page
17
- * (in the `entities` field).
16
+ * It is different from the number of objects returned in the current page (in the `entities`
17
+ * field).
18
18
  **/
19
19
  count: number;
20
20
 
21
- /**
22
- * An object that holds pagination information about the objects in this
23
- * connection. *
24
- */
21
+ /** An object that holds pagination information about the objects in this connection. **/
25
22
  pageInfo: PageInfo;
26
23
 
27
24
  /** The transactions for the current page of this connection. **/
@@ -43,8 +40,8 @@ interface AccountToTransactionsConnection {
43
40
  averageFeeEarned?: CurrencyAmount | undefined;
44
41
 
45
42
  /**
46
- * Total amount transacted by the transactions in this connection,
47
- * with the set of filters and constraints provided.
43
+ * Total amount transacted by the transactions in this connection, with the set of filters and
44
+ * constraints provided.
48
45
  **/
49
46
  totalAmountTransacted?: CurrencyAmount | undefined;
50
47
  }
@@ -8,15 +8,12 @@ import { WalletFromJson } from "./Wallet.js";
8
8
  interface AccountToWalletsConnection {
9
9
  /**
10
10
  * The total count of objects in this connection, using the current filters.
11
- * It is different from the number of objects returned in the current page
12
- * (in the `entities` field).
11
+ * It is different from the number of objects returned in the current page (in the `entities`
12
+ * field).
13
13
  **/
14
14
  count: number;
15
15
 
16
- /**
17
- * An object that holds pagination information about the objects in this
18
- * connection. *
19
- */
16
+ /** An object that holds pagination information about the objects in this connection. **/
20
17
  pageInfo: PageInfo;
21
18
 
22
19
  /** The wallets for the current page of this connection. **/
@@ -5,9 +5,9 @@ import Permission from "./Permission.js";
5
5
 
6
6
  /**
7
7
  * This is an object representing a Lightspark API token,
8
- * that can be used to authenticate this account when making API calls or using
9
- * our SDKs. See the “Authentication” section of our API docs for more details
10
- * on its usage. *
8
+ * that can be used to authenticate this account when making API calls or using our SDKs.
9
+ * See the “Authentication” section of our API docs for more details on its usage.
10
+ * *
11
11
  */
12
12
  interface ApiToken {
13
13
  /**
@@ -23,15 +23,14 @@ interface ApiToken {
23
23
  updatedAt: string;
24
24
 
25
25
  /**
26
- * An opaque identifier that should be used as a client_id (or username) in
27
- * the HTTP Basic Authentication scheme when issuing requests against the
28
- * Lightspark API.
26
+ * An opaque identifier that should be used as a client_id (or username) in the HTTP Basic
27
+ * Authentication scheme when issuing requests against the Lightspark API.
29
28
  **/
30
29
  clientId: string;
31
30
 
32
31
  /**
33
- * An arbitrary name chosen by the creator of the token to help identify the
34
- * token in the list of tokens that have been created for the account.
32
+ * An arbitrary name chosen by the creator of the token to help identify the token in the list
33
+ * of tokens that have been created for the account.
35
34
  **/
36
35
  name: string;
37
36
 
@@ -7,37 +7,35 @@ import {
7
7
  } from "./CurrencyAmount.js";
8
8
 
9
9
  /**
10
- * This is an object representing the balance associated with your Lightspark
11
- * account. You can retrieve this object to see your balance,
10
+ * This is an object representing the balance associated with your Lightspark account.
11
+ * You can retrieve this object to see your balance,
12
12
  * which can be broken down into several different categorizations.
13
13
  * *
14
14
  */
15
15
  interface Balances {
16
16
  /**
17
- * This represents the balance that should be displayed when asked "how much
18
- * do I own right now?". It represents the amount currently owned,
19
- * including things that may not be owned soon (e.g. in-flight outgoing
20
- * payments, in-flight withdrawals, commit fees, etc.).
21
- * It really is a snapshot of what is officially owned at this instant.
17
+ * This represents the balance that should be displayed when asked "how much do I own right
18
+ * now?". It represents the amount currently owned,
19
+ * including things that may not be owned soon (e.g. in-flight outgoing payments, in-flight
20
+ * withdrawals, commit fees, etc.). It really is a snapshot of what is officially owned at this
21
+ * instant.
22
22
  **/
23
23
  ownedBalance: CurrencyAmount;
24
24
 
25
25
  /**
26
- * This represents the balance that should be displayed when asked "how much
27
- * can I send on Lightning right now?".
28
- * It represents the amount currently available to be sent on the Lightning
29
- * network. We remove from the balance all the funds that are temporarily
30
- * locked (e.g. channel reserves).
26
+ * This represents the balance that should be displayed when asked "how much can I send on
27
+ * Lightning right now?". It represents the amount currently available to be sent on the
28
+ * Lightning network. We remove from the balance all the funds that are temporarily locked
29
+ * (e.g. channel reserves).
31
30
  **/
32
31
  availableToSendBalance: CurrencyAmount;
33
32
 
34
33
  /**
35
- * This represents the balance that should be displayed when asked "how much
36
- * money can I withdraw on the Bitcoin network right now?".
37
- * It represents the amount currently available to withdraw and is usually
38
- * equal to the `owned_balance` but it does not include in-flight operations
39
- * (which would likely succeed and therefore likely make your withdrawal
40
- * fail).
34
+ * This represents the balance that should be displayed when asked "how much money can I
35
+ * withdraw on the Bitcoin network right now?".
36
+ * It represents the amount currently available to withdraw and is usually equal to the
37
+ * `owned_balance` but it does not include in-flight operations (which would likely succeed and
38
+ * therefore likely make your withdrawal fail).
41
39
  **/
42
40
  availableToWithdrawBalance: CurrencyAmount;
43
41
  }
@@ -3,9 +3,8 @@
3
3
  /** This is an enum identifying a particular Bitcoin Network. **/
4
4
  export enum BitcoinNetwork {
5
5
  /**
6
- * This is an enum value that represents values that could be added in the
7
- * future. Clients should support unknown values as more of them could be
8
- * added without notice.
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.
9
8
  */
10
9
  FUTURE_VALUE = "FUTURE_VALUE",
11
10
  /** The production version of the Bitcoin Blockchain. **/
@@ -13,9 +12,8 @@ export enum BitcoinNetwork {
13
12
  /** A test version of the Bitcoin Blockchain, maintained by Lightspark. **/
14
13
  REGTEST = "REGTEST",
15
14
  /**
16
- * A test version of the Bitcoin Blockchain, maintained by a centralized
17
- * organization. Not in use at Lightspark.
18
- * *
15
+ * A test version of the Bitcoin Blockchain, maintained by a centralized organization.
16
+ * Not in use at Lightspark. *
19
17
  */
20
18
  SIGNET = "SIGNET",
21
19
  /** A test version of the Bitcoin Blockchain, publicly available. **/
@@ -6,10 +6,7 @@ import {
6
6
  CurrencyAmountToJson,
7
7
  } from "./CurrencyAmount.js";
8
8
 
9
- /**
10
- * This is an object representing a detailed breakdown of the balance for a
11
- * Lightspark Node. *
12
- */
9
+ /** This is an object representing a detailed breakdown of the balance for a Lightspark Node. **/
13
10
  interface BlockchainBalance {
14
11
  /** The total wallet balance, including unconfirmed UTXOs. **/
15
12
  totalBalance?: CurrencyAmount | undefined;
@@ -0,0 +1,18 @@
1
+ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
+
3
+ interface CancelInvoiceInput {
4
+ invoiceId: string;
5
+ }
6
+
7
+ export const CancelInvoiceInputFromJson = (obj: any): CancelInvoiceInput => {
8
+ return {
9
+ invoiceId: obj["cancel_invoice_input_invoice_id"],
10
+ } as CancelInvoiceInput;
11
+ };
12
+ export const CancelInvoiceInputToJson = (obj: CancelInvoiceInput): any => {
13
+ return {
14
+ cancel_invoice_input_invoice_id: obj.invoiceId,
15
+ };
16
+ };
17
+
18
+ export default CancelInvoiceInput;
@@ -0,0 +1,26 @@
1
+ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
+
3
+ interface CancelInvoiceOutput {
4
+ invoiceId: string;
5
+ }
6
+
7
+ export const CancelInvoiceOutputFromJson = (obj: any): CancelInvoiceOutput => {
8
+ return {
9
+ invoiceId: obj["cancel_invoice_output_invoice"].id,
10
+ } as CancelInvoiceOutput;
11
+ };
12
+ export const CancelInvoiceOutputToJson = (obj: CancelInvoiceOutput): any => {
13
+ return {
14
+ cancel_invoice_output_invoice: { id: obj.invoiceId },
15
+ };
16
+ };
17
+
18
+ export const FRAGMENT = `
19
+ fragment CancelInvoiceOutputFragment on CancelInvoiceOutput {
20
+ __typename
21
+ cancel_invoice_output_invoice: invoice {
22
+ id
23
+ }
24
+ }`;
25
+
26
+ export default CancelInvoiceOutput;