@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
@@ -1,15 +1,13 @@
1
1
  // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
2
 
3
3
  /**
4
- * This is an enum of the potential reasons that an attempted routed
5
- * transaction through a Lightspark node may have failed.
6
- * *
4
+ * This is an enum of the potential reasons that an attempted routed transaction through a
5
+ * Lightspark node may have failed. *
7
6
  */
8
7
  export enum RoutingTransactionFailureReason {
9
8
  /**
10
- * This is an enum value that represents values that could be added in the
11
- * future. Clients should support unknown values as more of them could be
12
- * added without notice.
9
+ * This is an enum value that represents values that could be added in the future.
10
+ * Clients should support unknown values as more of them could be added without notice.
13
11
  */
14
12
  FUTURE_VALUE = "FUTURE_VALUE",
15
13
 
@@ -5,8 +5,8 @@ import ComplianceProvider from "./ComplianceProvider.js";
5
5
  interface ScreenNodeInput {
6
6
  /**
7
7
  * The compliance provider that is going to screen the node.
8
- * You need to be a customer of the selected provider and store the API key
9
- * on the Lightspark account setting page.
8
+ * You need to be a customer of the selected provider and store the API key on the Lightspark
9
+ * account setting page.
10
10
  **/
11
11
  provider: ComplianceProvider;
12
12
 
@@ -14,8 +14,8 @@ interface SendPaymentInput {
14
14
  amountMsats: number;
15
15
 
16
16
  /**
17
- * The maximum amount of fees that you want to pay for this payment to be
18
- * sent, expressed in msats. *
17
+ * The maximum amount of fees that you want to pay for this payment to be sent, expressed in
18
+ * msats. *
19
19
  */
20
20
  maximumFeesMsats: number;
21
21
  }
@@ -9,8 +9,8 @@ interface SetInvoicePaymentHashInput {
9
9
 
10
10
  /**
11
11
  * The 32-byte nonce used to generate the invoice preimage if applicable.
12
- * It will later be included in RELEASE_PAYMENT_PREIMAGE webhook to help
13
- * recover the raw preimage.
12
+ * It will later be included in RELEASE_PAYMENT_PREIMAGE webhook to help recover the raw
13
+ * preimage.
14
14
  **/
15
15
  preimageNonce?: string | undefined;
16
16
  }
@@ -20,8 +20,8 @@ interface SignablePayload {
20
20
  payload: string;
21
21
 
22
22
  /**
23
- * The consistent method for generating the same set of accounts and wallets
24
- * for a given private key *
23
+ * The consistent method for generating the same set of accounts and wallets for a given
24
+ * private key *
25
25
  */
26
26
  derivationPath: string;
27
27
 
@@ -2,9 +2,8 @@
2
2
 
3
3
  export enum SignablePayloadStatus {
4
4
  /**
5
- * This is an enum value that represents values that could be added in the
6
- * future. Clients should support unknown values as more of them could be
7
- * added without notice.
5
+ * This is an enum value that represents values that could be added in the future.
6
+ * Clients should support unknown values as more of them could be added without notice.
8
7
  */
9
8
  FUTURE_VALUE = "FUTURE_VALUE",
10
9
 
@@ -27,11 +27,9 @@ import TransactionStatus from "./TransactionStatus.js";
27
27
  import type Withdrawal from "./Withdrawal.js";
28
28
 
29
29
  /**
30
- * This object represents a payment transaction.
31
- * The transaction can occur either on a Bitcoin Network,
32
- * or over the Lightning Network. You can retrieve this object to receive
33
- * specific information about a particular transaction tied to your Lightspark
34
- * Node.
30
+ * This object represents a payment transaction. The transaction can occur either on a Bitcoin
31
+ * Network, or over the Lightning Network. You can retrieve this object to receive specific
32
+ * information about a particular transaction tied to your Lightspark Node.
35
33
  * *
36
34
  */
37
35
  interface Transaction {
@@ -59,10 +57,7 @@ interface Transaction {
59
57
  /** The date and time when this transaction was completed or failed. **/
60
58
  resolvedAt?: string | undefined;
61
59
 
62
- /**
63
- * The hash of this transaction, so it can be uniquely identified on the
64
- * Lightning Network. *
65
- */
60
+ /** The hash of this transaction, so it can be uniquely identified on the Lightning Network. **/
66
61
  transactionHash?: string | undefined;
67
62
  }
68
63
 
@@ -3,10 +3,7 @@
3
3
  import PaymentFailureReason from "./PaymentFailureReason.js";
4
4
  import RoutingTransactionFailureReason from "./RoutingTransactionFailureReason.js";
5
5
 
6
- /**
7
- * This object represents payment failures associated with your Lightspark
8
- * Node. *
9
- */
6
+ /** This object represents payment failures associated with your Lightspark Node. **/
10
7
  interface TransactionFailures {
11
8
  paymentFailures?: PaymentFailureReason[] | undefined;
12
9
 
@@ -1,14 +1,13 @@
1
1
  // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
2
 
3
3
  /**
4
- * This is an enum of the potential statuses a transaction associated with your
5
- * Lightspark Node can take. *
4
+ * This is an enum of the potential statuses a transaction associated with your Lightspark Node can
5
+ * take. *
6
6
  */
7
7
  export enum TransactionStatus {
8
8
  /**
9
- * This is an enum value that represents values that could be added in the
10
- * future. Clients should support unknown values as more of them could be
11
- * added without notice.
9
+ * This is an enum value that represents values that could be added in the future.
10
+ * Clients should support unknown values as more of them could be added without notice.
12
11
  */
13
12
  FUTURE_VALUE = "FUTURE_VALUE",
14
13
  /** Transaction succeeded.. **/
@@ -18,15 +17,11 @@ export enum TransactionStatus {
18
17
  /** Transaction has been initiated and is currently in-flight. **/
19
18
  PENDING = "PENDING",
20
19
  /**
21
- * For transaction type PAYMENT_REQUEST only.
22
- * No payments have been made to a payment request.
20
+ * For transaction type PAYMENT_REQUEST only. No payments have been made to a payment request.
23
21
  * *
24
22
  */
25
23
  NOT_STARTED = "NOT_STARTED",
26
- /**
27
- * For transaction type PAYMENT_REQUEST only. A payment request has expired.
28
- * *
29
- */
24
+ /** For transaction type PAYMENT_REQUEST only. A payment request has expired. **/
30
25
  EXPIRED = "EXPIRED",
31
26
  /** For transaction type PAYMENT_REQUEST only. **/
32
27
  CANCELLED = "CANCELLED",
@@ -1,53 +1,43 @@
1
1
  // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
2
 
3
3
  /**
4
- * This is an enum of the potential types of transactions that can be
5
- * associated with your Lightspark Node.
6
- * *
4
+ * This is an enum of the potential types of transactions that can be associated with your
5
+ * Lightspark Node. *
7
6
  */
8
7
  export enum TransactionType {
9
8
  /**
10
- * This is an enum value that represents values that could be added in the
11
- * future. Clients should support unknown values as more of them could be
12
- * added without notice.
9
+ * This is an enum value that represents values that could be added in the future.
10
+ * Clients should support unknown values as more of them could be added without notice.
13
11
  */
14
12
  FUTURE_VALUE = "FUTURE_VALUE",
15
13
  /** Transactions initiated from a Lightspark node on Lightning Network. **/
16
14
  OUTGOING_PAYMENT = "OUTGOING_PAYMENT",
17
15
  /** Transactions received by a Lightspark node on Lightning Network. **/
18
16
  INCOMING_PAYMENT = "INCOMING_PAYMENT",
19
- /**
20
- * Transactions that forwarded payments through Lightspark nodes on Lightning
21
- * Network. *
22
- */
17
+ /** Transactions that forwarded payments through Lightspark nodes on Lightning Network. **/
23
18
  ROUTED = "ROUTED",
24
19
  /**
25
- * Transactions on the Bitcoin blockchain to withdraw funds from a Lightspark
26
- * node to a Bitcoin wallet. *
20
+ * Transactions on the Bitcoin blockchain to withdraw funds from a Lightspark node to a Bitcoin
21
+ * wallet. *
27
22
  */
28
23
  L1_WITHDRAW = "L1_WITHDRAW",
29
24
  /** Transactions on Bitcoin blockchain to fund a Lightspark node's wallet. **/
30
25
  L1_DEPOSIT = "L1_DEPOSIT",
31
26
  /**
32
- * Transactions on Bitcoin blockchain to open a channel on Lightning Network
33
- * funded by the local Lightspark node.
34
- * *
27
+ * Transactions on Bitcoin blockchain to open a channel on Lightning Network funded by the local
28
+ * Lightspark node. *
35
29
  */
36
30
  CHANNEL_OPEN = "CHANNEL_OPEN",
37
31
  /**
38
- * Transactions on Bitcoin blockchain to close a channel on Lightning Network
39
- * where the balances are allocated back to local and remote nodes.
40
- * *
32
+ * Transactions on Bitcoin blockchain to close a channel on Lightning Network where the balances
33
+ * are allocated back to local and remote nodes. *
41
34
  */
42
35
  CHANNEL_CLOSE = "CHANNEL_CLOSE",
43
36
  /** Transactions initiated from a Lightspark node on Lightning Network. **/
44
37
  PAYMENT = "PAYMENT",
45
38
  /** Payment requests from a Lightspark node on Lightning Network **/
46
39
  PAYMENT_REQUEST = "PAYMENT_REQUEST",
47
- /**
48
- * Transactions that forwarded payments through Lightspark nodes on Lightning
49
- * Network. *
50
- */
40
+ /** Transactions that forwarded payments through Lightspark nodes on Lightning Network. **/
51
41
  ROUTE = "ROUTE",
52
42
  }
53
43
 
@@ -27,10 +27,7 @@ interface UmaInvitation {
27
27
  /** The UMA of the user who created the invitation. **/
28
28
  inviterUma: string;
29
29
 
30
- /**
31
- * The current status of the incentives that may be tied to this invitation.
32
- * *
33
- */
30
+ /** The current status of the incentives that may be tied to this invitation. **/
34
31
  incentivesStatus: IncentivesStatus;
35
32
 
36
33
  /** The typename of the object **/
@@ -39,10 +36,7 @@ interface UmaInvitation {
39
36
  /** The UMA of the user who claimed the invitation. **/
40
37
  inviteeUma?: string | undefined;
41
38
 
42
- /**
43
- * The reason why the invitation is not eligible for incentives, if
44
- * applicable. *
45
- */
39
+ /** The reason why the invitation is not eligible for incentives, if applicable. **/
46
40
  incentivesIneligibilityReason?: IncentivesIneligibilityReason | undefined;
47
41
  }
48
42
 
@@ -20,8 +20,8 @@ import { WalletToTransactionsConnectionFromJson } from "./WalletToTransactionsCo
20
20
  /**
21
21
  * This object represents a Lightspark Wallet, tied to your Lightspark account.
22
22
  * Wallets can be used to send or receive funds over the Lightning Network.
23
- * You can retrieve this object to receive information about a specific wallet
24
- * tied to your Lightspark account. *
23
+ * You can retrieve this object to receive information about a specific wallet tied to your
24
+ * Lightspark account. *
25
25
  */
26
26
  class Wallet implements LightsparkNodeOwner, Entity {
27
27
  constructor(
@@ -35,8 +35,7 @@ class Wallet implements LightsparkNodeOwner, Entity {
35
35
  /** The date and time when the entity was last updated. **/
36
36
  public readonly updatedAt: string,
37
37
  /**
38
- * The unique identifier of this wallet,
39
- * as provided by the Lightspark Customer during login.
38
+ * The unique identifier of this wallet, as provided by the Lightspark Customer during login.
40
39
  * *
41
40
  */
42
41
  public readonly thirdPartyIdentifier: string,
@@ -1,14 +1,10 @@
1
1
  // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
2
 
3
- /**
4
- * This is an enum of the potential statuses that your Lightspark wallet can
5
- * take. *
6
- */
3
+ /** This is an enum of the potential statuses that your Lightspark wallet can take. **/
7
4
  export enum WalletStatus {
8
5
  /**
9
- * This is an enum value that represents values that could be added in the
10
- * future. Clients should support unknown values as more of them could be
11
- * added without notice.
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.
12
8
  */
13
9
  FUTURE_VALUE = "FUTURE_VALUE",
14
10
  /**
@@ -17,39 +13,30 @@ export enum WalletStatus {
17
13
  * *
18
14
  */
19
15
  NOT_SETUP = "NOT_SETUP",
20
- /**
21
- * The wallet is currently being deployed in the Lightspark infrastructure.
22
- * *
23
- */
16
+ /** The wallet is currently being deployed in the Lightspark infrastructure. **/
24
17
  DEPLOYING = "DEPLOYING",
25
18
  /**
26
- * The wallet has been deployed in the Lightspark infrastructure and is ready
27
- * to be initialized. *
19
+ * The wallet has been deployed in the Lightspark infrastructure and is ready to be initialized.
20
+ * *
28
21
  */
29
22
  DEPLOYED = "DEPLOYED",
30
23
  /** The wallet is currently being initialized. **/
31
24
  INITIALIZING = "INITIALIZING",
32
25
  /** The wallet is available and ready to be used. **/
33
26
  READY = "READY",
34
- /**
35
- * The wallet is temporarily available,
36
- * due to a transient issue or a scheduled maintenance.
37
- * *
38
- */
27
+ /** The wallet is temporarily available, due to a transient issue or a scheduled maintenance. **/
39
28
  UNAVAILABLE = "UNAVAILABLE",
40
29
  /**
41
- * The wallet had an unrecoverable failure.
42
- * This status is not expected to happend and will be investigated by the
43
- * Lightspark team. *
30
+ * The wallet had an unrecoverable failure. This status is not expected to happend and will be
31
+ * investigated by the Lightspark team. *
44
32
  */
45
33
  FAILED = "FAILED",
46
34
  /** The wallet is being terminated. **/
47
35
  TERMINATING = "TERMINATING",
48
36
  /**
49
- * The wallet has been terminated and is not available in the Lightspark
50
- * infrastructure anymore. It is not connected to the Lightning network and
51
- * its funds can only be accessed using the Funds Recovery flow.
52
- * *
37
+ * The wallet has been terminated and is not available in the Lightspark infrastructure anymore.
38
+ * It is not connected to the Lightning network and its funds can only be accessed using the Funds
39
+ * Recovery flow. *
53
40
  */
54
41
  TERMINATED = "TERMINATED",
55
42
  }
@@ -11,15 +11,12 @@ import {
11
11
  interface WalletToPaymentRequestsConnection {
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. **/
@@ -8,15 +8,12 @@ import { TransactionFromJson, TransactionToJson } from "./Transaction.js";
8
8
  interface WalletToTransactionsConnection {
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 transactions for the current page of this connection. **/
@@ -1,14 +1,13 @@
1
1
  // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
2
 
3
3
  /**
4
- * This is an enum of the potential event types that can be associated with
5
- * your Lightspark wallets. *
4
+ * This is an enum of the potential event types that can be associated with your Lightspark
5
+ * wallets. *
6
6
  */
7
7
  export enum WebhookEventType {
8
8
  /**
9
- * This is an enum value that represents values that could be added in the
10
- * future. Clients should support unknown values as more of them could be
11
- * added without notice.
9
+ * This is an enum value that represents values that could be added in the future.
10
+ * Clients should support unknown values as more of them could be added without notice.
12
11
  */
13
12
  FUTURE_VALUE = "FUTURE_VALUE",
14
13
 
@@ -9,10 +9,9 @@ import {
9
9
  import TransactionStatus from "./TransactionStatus.js";
10
10
 
11
11
  /**
12
- * This object represents an L1 withdrawal from your Lightspark Node to any
13
- * Bitcoin wallet. You can retrieve this object to receive detailed information
14
- * about any L1 withdrawal associated with your Lightspark Node or account.
15
- * *
12
+ * This object represents an L1 withdrawal from your Lightspark Node to any Bitcoin wallet.
13
+ * You can retrieve this object to receive detailed information about any L1 withdrawal associated
14
+ * with your Lightspark Node or account. *
16
15
  */
17
16
  interface Withdrawal {
18
17
  /**
@@ -34,8 +33,8 @@ interface Withdrawal {
34
33
  amount: CurrencyAmount;
35
34
 
36
35
  /**
37
- * The height of the block that included this transaction.
38
- * This will be zero for unconfirmed transactions.
36
+ * The height of the block that included this transaction. This will be zero for unconfirmed
37
+ * transactions.
39
38
  **/
40
39
  blockHeight: number;
41
40
 
@@ -51,28 +50,22 @@ interface Withdrawal {
51
50
  /** The date and time when this transaction was completed or failed. **/
52
51
  resolvedAt?: string | undefined;
53
52
 
54
- /**
55
- * The hash of this transaction, so it can be uniquely identified on the
56
- * Lightning Network. *
57
- */
53
+ /** The hash of this transaction, so it can be uniquely identified on the Lightning Network. **/
58
54
  transactionHash?: string | undefined;
59
55
 
60
56
  /**
61
- * The fees that were paid by the wallet sending the transaction to commit it
62
- * to the Bitcoin blockchain.
57
+ * The fees that were paid by the wallet sending the transaction to commit it to the Bitcoin
58
+ * blockchain.
63
59
  **/
64
60
  fees?: CurrencyAmount | undefined;
65
61
 
66
62
  /**
67
- * The hash of the block that included this transaction.
68
- * This will be null for unconfirmed transactions.
63
+ * The hash of the block that included this transaction. This will be null for unconfirmed
64
+ * transactions.
69
65
  **/
70
66
  blockHash?: string | undefined;
71
67
 
72
- /**
73
- * The number of blockchain confirmations for this transaction in real time.
74
- * *
75
- */
68
+ /** The number of blockchain confirmations for this transaction in real time. **/
76
69
  numConfirmations?: number | undefined;
77
70
  }
78
71
 
@@ -1,14 +1,10 @@
1
1
  // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
2
 
3
- /**
4
- * This is an enum of the potential modes that your Bitcoin withdrawal can
5
- * take. *
6
- */
3
+ /** This is an enum of the potential modes that your Bitcoin withdrawal can take. **/
7
4
  export enum WithdrawalMode {
8
5
  /**
9
- * This is an enum value that represents values that could be added in the
10
- * future. Clients should support unknown values as more of them could be
11
- * added without notice.
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.
12
8
  */
13
9
  FUTURE_VALUE = "FUTURE_VALUE",
14
10
 
@@ -17,9 +17,8 @@ import type WithdrawalRequestToChannelOpeningTransactionsConnection from "./With
17
17
  import { WithdrawalRequestToChannelOpeningTransactionsConnectionFromJson } from "./WithdrawalRequestToChannelOpeningTransactionsConnection.js";
18
18
 
19
19
  /**
20
- * This object represents a request made for an L1 withdrawal from your
21
- * Lightspark Node to any Bitcoin wallet.
22
- * You can retrieve this object to receive detailed information about any
20
+ * This object represents a request made for an L1 withdrawal from your Lightspark Node to any
21
+ * Bitcoin wallet. You can retrieve this object to receive detailed information about any
23
22
  * withdrawal request made from your Lightspark account.
24
23
  * *
25
24
  */
@@ -38,10 +37,7 @@ class WithdrawalRequest implements Entity {
38
37
  public readonly amount: CurrencyAmount,
39
38
  /** The bitcoin address where the funds should be sent. **/
40
39
  public readonly bitcoinAddress: string,
41
- /**
42
- * The strategy that should be used to withdraw the funds from the account.
43
- * *
44
- */
40
+ /** The strategy that should be used to withdraw the funds from the account. **/
45
41
  public readonly withdrawalMode: WithdrawalMode,
46
42
  /** The current status of this withdrawal request. **/
47
43
  public readonly status: WithdrawalRequestStatus,
@@ -3,9 +3,8 @@
3
3
  /** This is an enum of the potential statuses that a Withdrawal can take. **/
4
4
  export enum WithdrawalRequestStatus {
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
 
@@ -9,23 +9,17 @@ import type PageInfo from "./PageInfo.js";
9
9
  import { PageInfoFromJson, PageInfoToJson } from "./PageInfo.js";
10
10
 
11
11
  interface WithdrawalRequestToChannelClosingTransactionsConnection {
12
- /**
13
- * An object that holds pagination information about the objects in this
14
- * connection. *
15
- */
12
+ /** An object that holds pagination information about the objects in this connection. **/
16
13
  pageInfo: PageInfo;
17
14
 
18
15
  /**
19
16
  * The total count of objects in this connection, using the current filters.
20
- * It is different from the number of objects returned in the current page
21
- * (in the `entities` field).
17
+ * It is different from the number of objects returned in the current page (in the `entities`
18
+ * field).
22
19
  **/
23
20
  count: number;
24
21
 
25
- /**
26
- * The channel closing transactions for the current page of this connection.
27
- * *
28
- */
22
+ /** The channel closing transactions for the current page of this connection. **/
29
23
  entities: ChannelClosingTransaction[];
30
24
  }
31
25
 
@@ -9,23 +9,17 @@ import type PageInfo from "./PageInfo.js";
9
9
  import { PageInfoFromJson, PageInfoToJson } from "./PageInfo.js";
10
10
 
11
11
  interface WithdrawalRequestToChannelOpeningTransactionsConnection {
12
- /**
13
- * An object that holds pagination information about the objects in this
14
- * connection. *
15
- */
12
+ /** An object that holds pagination information about the objects in this connection. **/
16
13
  pageInfo: PageInfo;
17
14
 
18
15
  /**
19
16
  * The total count of objects in this connection, using the current filters.
20
- * It is different from the number of objects returned in the current page
21
- * (in the `entities` field).
17
+ * It is different from the number of objects returned in the current page (in the `entities`
18
+ * field).
22
19
  **/
23
20
  count: number;
24
21
 
25
- /**
26
- * The channel opening transactions for the current page of this connection.
27
- * *
28
- */
22
+ /** The channel opening transactions for the current page of this connection. **/
29
23
  entities: ChannelOpeningTransaction[];
30
24
  }
31
25
 
@@ -9,6 +9,8 @@ export { default as ApiToken, getApiTokenQuery } from "./ApiToken.js";
9
9
  export { default as Balances } from "./Balances.js";
10
10
  export { default as BitcoinNetwork } from "./BitcoinNetwork.js";
11
11
  export { default as BlockchainBalance } from "./BlockchainBalance.js";
12
+ export { default as CancelInvoiceInput } from "./CancelInvoiceInput.js";
13
+ export { default as CancelInvoiceOutput } from "./CancelInvoiceOutput.js";
12
14
  export { default as Channel } from "./Channel.js";
13
15
  export {
14
16
  default as ChannelClosingTransaction,
@@ -485,6 +485,20 @@ describe(p1SuiteName, () => {
485
485
  TESTS_TIMEOUT,
486
486
  );
487
487
 
488
+ test("Should create and cancel uma invoice", async () => {
489
+ const umaInvoice = await lightsparkClient.createUmaInvoice(
490
+ getRegtestNodeId(),
491
+ 10_000,
492
+ "hi there!",
493
+ );
494
+ expect(umaInvoice).toBeDefined();
495
+ const cancelledInvoice = await lightsparkClient.cancelInvoice(
496
+ umaInvoice!.id,
497
+ );
498
+ expect(cancelledInvoice).toBeDefined();
499
+ expect(cancelledInvoice?.id).toBe(umaInvoice?.id);
500
+ });
501
+
488
502
  test(
489
503
  "Should create STANDARD a test mode invoice",
490
504
  async () => {