@lightsparkdev/lightspark-sdk 1.2.1 → 1.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/{BitcoinNetwork-a816c0be.d.ts → BitcoinNetwork-37e9f091.d.ts} +8 -3
  3. package/dist/{chunk-VTPDR6P4.js → chunk-NCPWHRFO.js} +353 -15
  4. package/dist/env.d.cts +1 -1
  5. package/dist/env.d.ts +1 -1
  6. package/dist/{index-5acc6526.d.ts → index-449c9f58.d.ts} +2089 -644
  7. package/dist/index.cjs +1082 -470
  8. package/dist/index.d.cts +3 -3
  9. package/dist/index.d.ts +3 -3
  10. package/dist/index.js +584 -302
  11. package/dist/objects/index.cjs +345 -5
  12. package/dist/objects/index.d.cts +2 -2
  13. package/dist/objects/index.d.ts +2 -2
  14. package/dist/objects/index.js +9 -1
  15. package/package.json +4 -4
  16. package/src/NodeKeyLoaderCache.ts +4 -3
  17. package/src/SigningKeyLoader.ts +12 -7
  18. package/src/client.ts +287 -60
  19. package/src/env.ts +3 -1
  20. package/src/graphql/ClaimUmaInvitation.ts +21 -0
  21. package/src/graphql/ClaimUmaInvitationWithIncentives.ts +25 -0
  22. package/src/graphql/CreateUmaInvitation.ts +19 -0
  23. package/src/graphql/CreateUmaInvitationWithIncentives.ts +23 -0
  24. package/src/graphql/FetchUmaInvitation.ts +15 -0
  25. package/src/objects/Account.ts +7 -3
  26. package/src/objects/AccountToApiTokensConnection.ts +7 -3
  27. package/src/objects/AccountToChannelsConnection.ts +3 -2
  28. package/src/objects/AccountToNodesConnection.ts +7 -3
  29. package/src/objects/AccountToPaymentRequestsConnection.ts +7 -3
  30. package/src/objects/AccountToTransactionsConnection.ts +13 -9
  31. package/src/objects/AccountToWalletsConnection.ts +7 -3
  32. package/src/objects/ApiToken.ts +13 -7
  33. package/src/objects/Balances.ts +22 -12
  34. package/src/objects/BitcoinNetwork.ts +8 -3
  35. package/src/objects/BlockchainBalance.ts +4 -1
  36. package/src/objects/Channel.ts +37 -14
  37. package/src/objects/ChannelClosingTransaction.ts +22 -11
  38. package/src/objects/ChannelFees.ts +4 -1
  39. package/src/objects/ChannelOpeningTransaction.ts +22 -11
  40. package/src/objects/ChannelStatus.ts +33 -8
  41. package/src/objects/ChannelToTransactionsConnection.ts +9 -8
  42. package/src/objects/ClaimUmaInvitationInput.ts +26 -0
  43. package/src/objects/ClaimUmaInvitationOutput.ts +30 -0
  44. package/src/objects/ClaimUmaInvitationWithIncentivesInput.ts +44 -0
  45. package/src/objects/ClaimUmaInvitationWithIncentivesOutput.ts +33 -0
  46. package/src/objects/ComplianceProvider.ts +3 -2
  47. package/src/objects/Connection.ts +7 -3
  48. package/src/objects/CreateApiTokenInput.ts +4 -1
  49. package/src/objects/CreateApiTokenOutput.ts +3 -3
  50. package/src/objects/CreateInvitationWithIncentivesInput.ts +37 -0
  51. package/src/objects/CreateInvitationWithIncentivesOutput.ts +32 -0
  52. package/src/objects/CreateLnurlInvoiceInput.ts +3 -2
  53. package/src/objects/CreateTestModePaymentInput.ts +2 -2
  54. package/src/objects/CreateTestModePaymentoutput.ts +5 -1
  55. package/src/objects/CreateUmaInvitationInput.ts +22 -0
  56. package/src/objects/CreateUmaInvitationOutput.ts +30 -0
  57. package/src/objects/CurrencyAmount.ts +6 -4
  58. package/src/objects/CurrencyUnit.ts +36 -9
  59. package/src/objects/Deposit.ts +22 -11
  60. package/src/objects/Entity.ts +21 -3
  61. package/src/objects/FeeEstimate.ts +5 -1
  62. package/src/objects/GraphNode.ts +30 -14
  63. package/src/objects/Hop.ts +12 -4
  64. package/src/objects/HtlcAttemptFailureCode.ts +7 -3
  65. package/src/objects/IncentivesIneligibilityReason.ts +48 -0
  66. package/src/objects/IncentivesStatus.ts +28 -0
  67. package/src/objects/IncomingPayment.ts +18 -7
  68. package/src/objects/IncomingPaymentAttempt.ts +8 -3
  69. package/src/objects/IncomingPaymentAttemptStatus.ts +7 -3
  70. package/src/objects/IncomingPaymentToAttemptsConnection.ts +7 -3
  71. package/src/objects/Invoice.ts +2 -2
  72. package/src/objects/InvoiceData.ts +7 -3
  73. package/src/objects/InvoiceType.ts +3 -2
  74. package/src/objects/LightningFeeEstimateForInvoiceInput.ts +2 -2
  75. package/src/objects/LightningTransaction.ts +12 -4
  76. package/src/objects/LightsparkNode.ts +33 -18
  77. package/src/objects/LightsparkNodeOwner.ts +2 -2
  78. package/src/objects/LightsparkNodeStatus.ts +3 -2
  79. package/src/objects/LightsparkNodeToChannelsConnection.ts +7 -3
  80. package/src/objects/LightsparkNodeWithOSK.ts +35 -19
  81. package/src/objects/LightsparkNodeWithRemoteSigning.ts +31 -18
  82. package/src/objects/Node.ts +28 -14
  83. package/src/objects/NodeAddressType.ts +7 -3
  84. package/src/objects/NodeToAddressesConnection.ts +7 -3
  85. package/src/objects/OnChainTransaction.ts +23 -11
  86. package/src/objects/OutgoingPayment.ts +25 -7
  87. package/src/objects/OutgoingPaymentAttempt.ts +34 -14
  88. package/src/objects/OutgoingPaymentAttemptStatus.ts +7 -3
  89. package/src/objects/OutgoingPaymentAttemptToHopsConnection.ts +12 -4
  90. package/src/objects/OutgoingPaymentToAttemptsConnection.ts +7 -3
  91. package/src/objects/PageInfo.ts +6 -1
  92. package/src/objects/PayInvoiceInput.ts +6 -3
  93. package/src/objects/PaymentDirection.ts +3 -2
  94. package/src/objects/PaymentFailureReason.ts +7 -3
  95. package/src/objects/PaymentRequest.ts +8 -3
  96. package/src/objects/PaymentRequestData.ts +5 -1
  97. package/src/objects/PaymentRequestStatus.ts +7 -3
  98. package/src/objects/Permission.ts +7 -3
  99. package/src/objects/PostTransactionData.ts +6 -3
  100. package/src/objects/RegionCode.ts +541 -0
  101. package/src/objects/RegisterPaymentInput.ts +12 -7
  102. package/src/objects/RemoteSigningSubEventType.ts +7 -3
  103. package/src/objects/RequestWithdrawalInput.ts +2 -2
  104. package/src/objects/RiskRating.ts +8 -3
  105. package/src/objects/RoutingTransaction.ts +20 -7
  106. package/src/objects/RoutingTransactionFailureReason.ts +8 -3
  107. package/src/objects/ScreenNodeInput.ts +3 -2
  108. package/src/objects/SendPaymentInput.ts +4 -1
  109. package/src/objects/SetInvoicePaymentHashInput.ts +3 -2
  110. package/src/objects/Signable.ts +2 -2
  111. package/src/objects/SignablePayload.ts +6 -3
  112. package/src/objects/SignablePayloadStatus.ts +3 -2
  113. package/src/objects/Transaction.ts +14 -4
  114. package/src/objects/TransactionFailures.ts +4 -1
  115. package/src/objects/TransactionStatus.ts +16 -5
  116. package/src/objects/TransactionType.ts +30 -8
  117. package/src/objects/TransactionUpdate.ts +6 -3
  118. package/src/objects/UmaInvitation.ts +119 -0
  119. package/src/objects/Wallet.ts +13 -4
  120. package/src/objects/WalletStatus.ts +36 -9
  121. package/src/objects/WalletToPaymentRequestsConnection.ts +7 -3
  122. package/src/objects/WalletToTransactionsConnection.ts +7 -3
  123. package/src/objects/WebhookEventType.ts +11 -3
  124. package/src/objects/Withdrawal.ts +22 -11
  125. package/src/objects/WithdrawalMode.ts +7 -3
  126. package/src/objects/WithdrawalRequest.ts +15 -6
  127. package/src/objects/WithdrawalRequestStatus.ts +3 -2
  128. package/src/objects/WithdrawalRequestToChannelClosingTransactionsConnection.ts +11 -4
  129. package/src/objects/WithdrawalRequestToChannelOpeningTransactionsConnection.ts +11 -4
  130. package/src/objects/index.ts +21 -6
  131. package/src/tests/integration/constants.ts +0 -3
  132. package/src/tests/integration/general-regtest.test.ts +178 -197
@@ -5,25 +5,30 @@ import PaymentDirection from "./PaymentDirection.js";
5
5
 
6
6
  interface RegisterPaymentInput {
7
7
  /**
8
- * The compliance provider that is going to screen the node. You need to be a customer of the selected
9
- * provider and store the API key on the Lightspark account setting page.
8
+ * The compliance provider that is going to screen the node.
9
+ * You need to be a customer of the selected provider and store the API key
10
+ * on the Lightspark account setting page.
10
11
  **/
11
12
  provider: ComplianceProvider;
12
13
 
13
14
  /**
14
- * The Lightspark ID of the lightning payment you want to register. It can be the id of either an
15
- * OutgoingPayment or an IncomingPayment.
15
+ * The Lightspark ID of the lightning payment you want to register.
16
+ * It can be the id of either an OutgoingPayment or an IncomingPayment.
16
17
  **/
17
18
  paymentId: string;
18
19
 
19
20
  /**
20
- * The public key of the counterparty lightning node, which would be the public key of the recipient
21
- * node if it is to register an outgoing payment, or the public key of the sender node if it is to
21
+ * The public key of the counterparty lightning node,
22
+ * which would be the public key of the recipient node if it is to register
23
+ * an outgoing payment, or the public key of the sender node if it is to
22
24
  * register an incoming payment.
23
25
  **/
24
26
  nodePubkey: string;
25
27
 
26
- /** Indicates whether this payment is an OutgoingPayment or an IncomingPayment. **/
28
+ /**
29
+ * Indicates whether this payment is an OutgoingPayment or an
30
+ * IncomingPayment. *
31
+ */
27
32
  direction: PaymentDirection;
28
33
  }
29
34
 
@@ -1,10 +1,14 @@
1
1
  // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
2
 
3
- /** This is an enum of the potential sub-event types for Remote Signing webook events. **/
3
+ /**
4
+ * This is an enum of the potential sub-event types for Remote Signing webook
5
+ * events. *
6
+ */
4
7
  export enum RemoteSigningSubEventType {
5
8
  /**
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
+ * This is an enum value that represents values that could be added in the
10
+ * future. Clients should support unknown values as more of them could be
11
+ * added without notice.
8
12
  */
9
13
  FUTURE_VALUE = "FUTURE_VALUE",
10
14
 
@@ -10,8 +10,8 @@ interface RequestWithdrawalInput {
10
10
  bitcoinAddress: string;
11
11
 
12
12
  /**
13
- * The amount you want to withdraw from this node in Satoshis. Use the special value -1 to withdrawal
14
- * all funds from this node.
13
+ * The amount you want to withdraw from this node in Satoshis.
14
+ * Use the special value -1 to withdrawal all funds from this node.
15
15
  **/
16
16
  amountSats: number;
17
17
 
@@ -1,10 +1,15 @@
1
1
  // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
2
 
3
- /** This is an enum of the potential risk ratings related to a transaction made over the Lightning Network. These risk ratings are returned from the CryptoSanctionScreeningProvider. **/
3
+ /**
4
+ * This is an enum of the potential risk ratings related to a transaction made
5
+ * over the Lightning Network. These risk ratings are returned from the
6
+ * CryptoSanctionScreeningProvider. *
7
+ */
4
8
  export enum RiskRating {
5
9
  /**
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.
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.
8
13
  */
9
14
  FUTURE_VALUE = "FUTURE_VALUE",
10
15
 
@@ -11,11 +11,17 @@ import { RichTextFromJson, RichTextToJson } from "./RichText.js";
11
11
  import RoutingTransactionFailureReason from "./RoutingTransactionFailureReason.js";
12
12
  import TransactionStatus from "./TransactionStatus.js";
13
13
 
14
- /** This object represents a transaction that was forwarded through a Lightspark node on the Lightning Network, i.e., a routed transaction. You can retrieve this object to receive information about any transaction routed through your Lightspark Node. **/
14
+ /**
15
+ * This object represents a transaction that was forwarded through a Lightspark
16
+ * node on the Lightning Network, i.e., a routed transaction.
17
+ * You can retrieve this object to receive information about any transaction
18
+ * routed through your Lightspark Node.
19
+ * *
20
+ */
15
21
  interface RoutingTransaction {
16
22
  /**
17
- * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque
18
- * string.
23
+ * The unique identifier of this entity across all Lightspark systems.
24
+ * Should be treated as an opaque string.
19
25
  **/
20
26
  id: string;
21
27
 
@@ -37,7 +43,10 @@ interface RoutingTransaction {
37
43
  /** The date and time when this transaction was completed or failed. **/
38
44
  resolvedAt?: string | undefined;
39
45
 
40
- /** The hash of this transaction, so it can be uniquely identified on the Lightning Network. **/
46
+ /**
47
+ * The hash of this transaction, so it can be uniquely identified on the
48
+ * Lightning Network. *
49
+ */
41
50
  transactionHash?: string | undefined;
42
51
 
43
52
  /** If known, the channel this transaction was received from. **/
@@ -47,12 +56,16 @@ interface RoutingTransaction {
47
56
  outgoingChannelId?: string | undefined;
48
57
 
49
58
  /**
50
- * The fees collected by the node when routing this transaction. We subtract the outgoing amount to
51
- * the incoming amount to determine how much fees were collected.
59
+ * The fees collected by the node when routing this transaction.
60
+ * We subtract the outgoing amount to the incoming amount to determine how
61
+ * much fees were collected.
52
62
  **/
53
63
  fees?: CurrencyAmount | undefined;
54
64
 
55
- /** If applicable, user-facing error message describing why the routing failed. **/
65
+ /**
66
+ * If applicable, user-facing error message describing why the routing
67
+ * failed. *
68
+ */
56
69
  failureMessage?: RichText | undefined;
57
70
 
58
71
  /** If applicable, the reason why the routing failed. **/
@@ -1,10 +1,15 @@
1
1
  // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
2
 
3
- /** This is an enum of the potential reasons that an attempted routed transaction through a Lightspark node may have failed. **/
3
+ /**
4
+ * This is an enum of the potential reasons that an attempted routed
5
+ * transaction through a Lightspark node may have failed.
6
+ * *
7
+ */
4
8
  export enum RoutingTransactionFailureReason {
5
9
  /**
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.
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.
8
13
  */
9
14
  FUTURE_VALUE = "FUTURE_VALUE",
10
15
 
@@ -4,8 +4,9 @@ import ComplianceProvider from "./ComplianceProvider.js";
4
4
 
5
5
  interface ScreenNodeInput {
6
6
  /**
7
- * The compliance provider that is going to screen the node. You need to be a customer of the selected
8
- * provider and store the API key on the Lightspark account setting page.
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.
9
10
  **/
10
11
  provider: ComplianceProvider;
11
12
 
@@ -13,7 +13,10 @@ interface SendPaymentInput {
13
13
  /** The amount you will send to the destination node, expressed in msats. **/
14
14
  amountMsats: number;
15
15
 
16
- /** The maximum amount of fees that you want to pay for this payment to be sent, expressed in msats. **/
16
+ /**
17
+ * The maximum amount of fees that you want to pay for this payment to be
18
+ * sent, expressed in msats. *
19
+ */
17
20
  maximumFeesMsats: number;
18
21
  }
19
22
 
@@ -8,8 +8,9 @@ interface SetInvoicePaymentHashInput {
8
8
  paymentHash: string;
9
9
 
10
10
  /**
11
- * The 32-byte nonce used to generate the invoice preimage if applicable. It will later be included in
12
- * RELEASE_PAYMENT_PREIMAGE webhook to help recover the raw preimage.
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.
13
14
  **/
14
15
  preimageNonce?: string | undefined;
15
16
  }
@@ -4,8 +4,8 @@ import { type Query } from "@lightsparkdev/core";
4
4
 
5
5
  interface Signable {
6
6
  /**
7
- * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque
8
- * string.
7
+ * The unique identifier of this entity across all Lightspark systems.
8
+ * Should be treated as an opaque string.
9
9
  **/
10
10
  id: string;
11
11
 
@@ -5,8 +5,8 @@ import SignablePayloadStatus from "./SignablePayloadStatus.js";
5
5
 
6
6
  interface SignablePayload {
7
7
  /**
8
- * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque
9
- * string.
8
+ * The unique identifier of this entity across all Lightspark systems.
9
+ * Should be treated as an opaque string.
10
10
  **/
11
11
  id: string;
12
12
 
@@ -19,7 +19,10 @@ interface SignablePayload {
19
19
  /** The payload that needs to be signed. **/
20
20
  payload: string;
21
21
 
22
- /** The consistent method for generating the same set of accounts and wallets for a given private key **/
22
+ /**
23
+ * The consistent method for generating the same set of accounts and wallets
24
+ * for a given private key *
25
+ */
23
26
  derivationPath: string;
24
27
 
25
28
  /** The status of the payload. **/
@@ -2,8 +2,9 @@
2
2
 
3
3
  export enum SignablePayloadStatus {
4
4
  /**
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.
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.
7
8
  */
8
9
  FUTURE_VALUE = "FUTURE_VALUE",
9
10
 
@@ -26,11 +26,18 @@ import RoutingTransactionFailureReason from "./RoutingTransactionFailureReason.j
26
26
  import TransactionStatus from "./TransactionStatus.js";
27
27
  import type Withdrawal from "./Withdrawal.js";
28
28
 
29
- /** This object represents a payment transaction. The transaction can occur either on a Bitcoin Network, or over the Lightning Network. You can retrieve this object to receive specific information about a particular transaction tied to your Lightspark Node. **/
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.
35
+ * *
36
+ */
30
37
  interface Transaction {
31
38
  /**
32
- * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque
33
- * string.
39
+ * The unique identifier of this entity across all Lightspark systems.
40
+ * Should be treated as an opaque string.
34
41
  **/
35
42
  id: string;
36
43
 
@@ -52,7 +59,10 @@ interface Transaction {
52
59
  /** The date and time when this transaction was completed or failed. **/
53
60
  resolvedAt?: string | undefined;
54
61
 
55
- /** The hash of this transaction, so it can be uniquely identified on the Lightning Network. **/
62
+ /**
63
+ * The hash of this transaction, so it can be uniquely identified on the
64
+ * Lightning Network. *
65
+ */
56
66
  transactionHash?: string | undefined;
57
67
  }
58
68
 
@@ -3,7 +3,10 @@
3
3
  import PaymentFailureReason from "./PaymentFailureReason.js";
4
4
  import RoutingTransactionFailureReason from "./RoutingTransactionFailureReason.js";
5
5
 
6
- /** This object represents payment failures associated with your Lightspark Node. **/
6
+ /**
7
+ * This object represents payment failures associated with your Lightspark
8
+ * Node. *
9
+ */
7
10
  interface TransactionFailures {
8
11
  paymentFailures?: PaymentFailureReason[] | undefined;
9
12
 
@@ -1,10 +1,14 @@
1
1
  // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
2
 
3
- /** This is an enum of the potential statuses a transaction associated with your Lightspark Node can take. **/
3
+ /**
4
+ * This is an enum of the potential statuses a transaction associated with your
5
+ * Lightspark Node can take. *
6
+ */
4
7
  export enum TransactionStatus {
5
8
  /**
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
+ * This is an enum value that represents values that could be added in the
10
+ * future. Clients should support unknown values as more of them could be
11
+ * added without notice.
8
12
  */
9
13
  FUTURE_VALUE = "FUTURE_VALUE",
10
14
  /** Transaction succeeded.. **/
@@ -13,9 +17,16 @@ export enum TransactionStatus {
13
17
  FAILED = "FAILED",
14
18
  /** Transaction has been initiated and is currently in-flight. **/
15
19
  PENDING = "PENDING",
16
- /** For transaction type PAYMENT_REQUEST only. No payments have been made to a payment request. **/
20
+ /**
21
+ * For transaction type PAYMENT_REQUEST only.
22
+ * No payments have been made to a payment request.
23
+ * *
24
+ */
17
25
  NOT_STARTED = "NOT_STARTED",
18
- /** For transaction type PAYMENT_REQUEST only. A payment request has expired. **/
26
+ /**
27
+ * For transaction type PAYMENT_REQUEST only. A payment request has expired.
28
+ * *
29
+ */
19
30
  EXPIRED = "EXPIRED",
20
31
  /** For transaction type PAYMENT_REQUEST only. **/
21
32
  CANCELLED = "CANCELLED",
@@ -1,31 +1,53 @@
1
1
  // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
2
 
3
- /** This is an enum of the potential types of transactions that can be associated with your Lightspark Node. **/
3
+ /**
4
+ * This is an enum of the potential types of transactions that can be
5
+ * associated with your Lightspark Node.
6
+ * *
7
+ */
4
8
  export enum TransactionType {
5
9
  /**
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.
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.
8
13
  */
9
14
  FUTURE_VALUE = "FUTURE_VALUE",
10
15
  /** Transactions initiated from a Lightspark node on Lightning Network. **/
11
16
  OUTGOING_PAYMENT = "OUTGOING_PAYMENT",
12
17
  /** Transactions received by a Lightspark node on Lightning Network. **/
13
18
  INCOMING_PAYMENT = "INCOMING_PAYMENT",
14
- /** Transactions that forwarded payments through Lightspark nodes on Lightning Network. **/
19
+ /**
20
+ * Transactions that forwarded payments through Lightspark nodes on Lightning
21
+ * Network. *
22
+ */
15
23
  ROUTED = "ROUTED",
16
- /** Transactions on the Bitcoin blockchain to withdraw funds from a Lightspark node to a Bitcoin wallet. **/
24
+ /**
25
+ * Transactions on the Bitcoin blockchain to withdraw funds from a Lightspark
26
+ * node to a Bitcoin wallet. *
27
+ */
17
28
  L1_WITHDRAW = "L1_WITHDRAW",
18
29
  /** Transactions on Bitcoin blockchain to fund a Lightspark node's wallet. **/
19
30
  L1_DEPOSIT = "L1_DEPOSIT",
20
- /** Transactions on Bitcoin blockchain to open a channel on Lightning Network funded by the local Lightspark node. **/
31
+ /**
32
+ * Transactions on Bitcoin blockchain to open a channel on Lightning Network
33
+ * funded by the local Lightspark node.
34
+ * *
35
+ */
21
36
  CHANNEL_OPEN = "CHANNEL_OPEN",
22
- /** Transactions on Bitcoin blockchain to close a channel on Lightning Network where the balances are allocated back to local and remote nodes. **/
37
+ /**
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
+ * *
41
+ */
23
42
  CHANNEL_CLOSE = "CHANNEL_CLOSE",
24
43
  /** Transactions initiated from a Lightspark node on Lightning Network. **/
25
44
  PAYMENT = "PAYMENT",
26
45
  /** Payment requests from a Lightspark node on Lightning Network **/
27
46
  PAYMENT_REQUEST = "PAYMENT_REQUEST",
28
- /** Transactions that forwarded payments through Lightspark nodes on Lightning Network. **/
47
+ /**
48
+ * Transactions that forwarded payments through Lightspark nodes on Lightning
49
+ * Network. *
50
+ */
29
51
  ROUTE = "ROUTE",
30
52
  }
31
53
 
@@ -6,8 +6,8 @@ import TransactionStatus from "./TransactionStatus.js";
6
6
 
7
7
  type TransactionUpdate = {
8
8
  /**
9
- * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque
10
- * string.
9
+ * The unique identifier of this entity across all Lightspark systems.
10
+ * Should be treated as an opaque string.
11
11
  **/
12
12
  id: string;
13
13
 
@@ -29,7 +29,10 @@ type TransactionUpdate = {
29
29
  /** The date and time when this transaction was completed or failed. **/
30
30
  resolvedAt?: string;
31
31
 
32
- /** The hash of this transaction, so it can be uniquely identified on the Lightning Network. **/
32
+ /**
33
+ * The hash of this transaction, so it can be uniquely identified on the
34
+ * Lightning Network. *
35
+ */
33
36
  transactionHash?: string;
34
37
  };
35
38
 
@@ -0,0 +1,119 @@
1
+ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
+
3
+ import { type Query } from "@lightsparkdev/core";
4
+ import IncentivesIneligibilityReason from "./IncentivesIneligibilityReason.js";
5
+ import IncentivesStatus from "./IncentivesStatus.js";
6
+
7
+ /** This is an object representing an UMA.ME invitation. **/
8
+ interface UmaInvitation {
9
+ /**
10
+ * The unique identifier of this entity across all Lightspark systems.
11
+ * Should be treated as an opaque string.
12
+ **/
13
+ id: string;
14
+
15
+ /** The date and time when the entity was first created. **/
16
+ createdAt: string;
17
+
18
+ /** The date and time when the entity was last updated. **/
19
+ updatedAt: string;
20
+
21
+ /** The code that uniquely identifies this invitation. **/
22
+ code: string;
23
+
24
+ /** The URL where this invitation can be claimed. **/
25
+ url: string;
26
+
27
+ /** The UMA of the user who created the invitation. **/
28
+ inviterUma: string;
29
+
30
+ /**
31
+ * The current status of the incentives that may be tied to this invitation.
32
+ * *
33
+ */
34
+ incentivesStatus: IncentivesStatus;
35
+
36
+ /** The typename of the object **/
37
+ typename: string;
38
+
39
+ /** The UMA of the user who claimed the invitation. **/
40
+ inviteeUma?: string | undefined;
41
+
42
+ /**
43
+ * The reason why the invitation is not eligible for incentives, if
44
+ * applicable. *
45
+ */
46
+ incentivesIneligibilityReason?: IncentivesIneligibilityReason | undefined;
47
+ }
48
+
49
+ export const UmaInvitationFromJson = (obj: any): UmaInvitation => {
50
+ return {
51
+ id: obj["uma_invitation_id"],
52
+ createdAt: obj["uma_invitation_created_at"],
53
+ updatedAt: obj["uma_invitation_updated_at"],
54
+ code: obj["uma_invitation_code"],
55
+ url: obj["uma_invitation_url"],
56
+ inviterUma: obj["uma_invitation_inviter_uma"],
57
+ incentivesStatus:
58
+ IncentivesStatus[obj["uma_invitation_incentives_status"]] ??
59
+ IncentivesStatus.FUTURE_VALUE,
60
+ typename: "UmaInvitation",
61
+ inviteeUma: obj["uma_invitation_invitee_uma"],
62
+ incentivesIneligibilityReason: !!obj[
63
+ "uma_invitation_incentives_ineligibility_reason"
64
+ ]
65
+ ? IncentivesIneligibilityReason[
66
+ obj["uma_invitation_incentives_ineligibility_reason"]
67
+ ] ?? IncentivesIneligibilityReason.FUTURE_VALUE
68
+ : null,
69
+ } as UmaInvitation;
70
+ };
71
+ export const UmaInvitationToJson = (obj: UmaInvitation): any => {
72
+ return {
73
+ __typename: "UmaInvitation",
74
+ uma_invitation_id: obj.id,
75
+ uma_invitation_created_at: obj.createdAt,
76
+ uma_invitation_updated_at: obj.updatedAt,
77
+ uma_invitation_code: obj.code,
78
+ uma_invitation_url: obj.url,
79
+ uma_invitation_inviter_uma: obj.inviterUma,
80
+ uma_invitation_invitee_uma: obj.inviteeUma,
81
+ uma_invitation_incentives_status: obj.incentivesStatus,
82
+ uma_invitation_incentives_ineligibility_reason:
83
+ obj.incentivesIneligibilityReason,
84
+ };
85
+ };
86
+
87
+ export const FRAGMENT = `
88
+ fragment UmaInvitationFragment on UmaInvitation {
89
+ __typename
90
+ uma_invitation_id: id
91
+ uma_invitation_created_at: created_at
92
+ uma_invitation_updated_at: updated_at
93
+ uma_invitation_code: code
94
+ uma_invitation_url: url
95
+ uma_invitation_inviter_uma: inviter_uma
96
+ uma_invitation_invitee_uma: invitee_uma
97
+ uma_invitation_incentives_status: incentives_status
98
+ uma_invitation_incentives_ineligibility_reason: incentives_ineligibility_reason
99
+ }`;
100
+
101
+ export const getUmaInvitationQuery = (id: string): Query<UmaInvitation> => {
102
+ return {
103
+ queryPayload: `
104
+ query GetUmaInvitation($id: ID!) {
105
+ entity(id: $id) {
106
+ ... on UmaInvitation {
107
+ ...UmaInvitationFragment
108
+ }
109
+ }
110
+ }
111
+
112
+ ${FRAGMENT}
113
+ `,
114
+ variables: { id },
115
+ constructObject: (data: any) => UmaInvitationFromJson(data.entity),
116
+ };
117
+ };
118
+
119
+ export default UmaInvitation;
@@ -17,19 +17,28 @@ import { WalletToPaymentRequestsConnectionFromJson } from "./WalletToPaymentRequ
17
17
  import type WalletToTransactionsConnection from "./WalletToTransactionsConnection.js";
18
18
  import { WalletToTransactionsConnectionFromJson } from "./WalletToTransactionsConnection.js";
19
19
 
20
- /** This object represents a Lightspark Wallet, tied to your Lightspark account. Wallets can be used to send or receive funds over the Lightning Network. You can retrieve this object to receive information about a specific wallet tied to your Lightspark account. **/
20
+ /**
21
+ * This object represents a Lightspark Wallet, tied to your Lightspark account.
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. *
25
+ */
21
26
  class Wallet implements LightsparkNodeOwner, Entity {
22
27
  constructor(
23
28
  /**
24
- * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque
25
- * string.
29
+ * The unique identifier of this entity across all Lightspark systems.
30
+ * Should be treated as an opaque string.
26
31
  **/
27
32
  public readonly id: string,
28
33
  /** The date and time when the entity was first created. **/
29
34
  public readonly createdAt: string,
30
35
  /** The date and time when the entity was last updated. **/
31
36
  public readonly updatedAt: string,
32
- /** The unique identifier of this wallet, as provided by the Lightspark Customer during login. **/
37
+ /**
38
+ * The unique identifier of this wallet,
39
+ * as provided by the Lightspark Customer during login.
40
+ * *
41
+ */
33
42
  public readonly thirdPartyIdentifier: string,
34
43
  /** The status of this wallet. **/
35
44
  public readonly status: WalletStatus,
@@ -1,29 +1,56 @@
1
1
  // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
2
 
3
- /** This is an enum of the potential statuses that your Lightspark wallet can take. **/
3
+ /**
4
+ * This is an enum of the potential statuses that your Lightspark wallet can
5
+ * take. *
6
+ */
4
7
  export enum WalletStatus {
5
8
  /**
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
+ * This is an enum value that represents values that could be added in the
10
+ * future. Clients should support unknown values as more of them could be
11
+ * added without notice.
8
12
  */
9
13
  FUTURE_VALUE = "FUTURE_VALUE",
10
- /** The wallet has not been set up yet and is ready to be deployed. This is the default status after the first login. **/
14
+ /**
15
+ * The wallet has not been set up yet and is ready to be deployed.
16
+ * This is the default status after the first login.
17
+ * *
18
+ */
11
19
  NOT_SETUP = "NOT_SETUP",
12
- /** The wallet is currently being deployed in the Lightspark infrastructure. **/
20
+ /**
21
+ * The wallet is currently being deployed in the Lightspark infrastructure.
22
+ * *
23
+ */
13
24
  DEPLOYING = "DEPLOYING",
14
- /** The wallet has been deployed in the Lightspark infrastructure and is ready to be initialized. **/
25
+ /**
26
+ * The wallet has been deployed in the Lightspark infrastructure and is ready
27
+ * to be initialized. *
28
+ */
15
29
  DEPLOYED = "DEPLOYED",
16
30
  /** The wallet is currently being initialized. **/
17
31
  INITIALIZING = "INITIALIZING",
18
32
  /** The wallet is available and ready to be used. **/
19
33
  READY = "READY",
20
- /** The wallet is temporarily available, due to a transient issue or a scheduled maintenance. **/
34
+ /**
35
+ * The wallet is temporarily available,
36
+ * due to a transient issue or a scheduled maintenance.
37
+ * *
38
+ */
21
39
  UNAVAILABLE = "UNAVAILABLE",
22
- /** The wallet had an unrecoverable failure. This status is not expected to happend and will be investigated by the Lightspark team. **/
40
+ /**
41
+ * The wallet had an unrecoverable failure.
42
+ * This status is not expected to happend and will be investigated by the
43
+ * Lightspark team. *
44
+ */
23
45
  FAILED = "FAILED",
24
46
  /** The wallet is being terminated. **/
25
47
  TERMINATING = "TERMINATING",
26
- /** The wallet has been terminated and is not available in the Lightspark infrastructure anymore. It is not connected to the Lightning network and its funds can only be accessed using the Funds Recovery flow. **/
48
+ /**
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
+ * *
53
+ */
27
54
  TERMINATED = "TERMINATED",
28
55
  }
29
56
 
@@ -10,12 +10,16 @@ import {
10
10
 
11
11
  interface WalletToPaymentRequestsConnection {
12
12
  /**
13
- * The total count of objects in this connection, using the current filters. It is different from the
14
- * number of objects returned in the current page (in the `entities` field).
13
+ * The total count of objects in this connection, using the current filters.
14
+ * It is different from the number of objects returned in the current page
15
+ * (in the `entities` field).
15
16
  **/
16
17
  count: number;
17
18
 
18
- /** An object that holds pagination information about the objects in this connection. **/
19
+ /**
20
+ * An object that holds pagination information about the objects in this
21
+ * connection. *
22
+ */
19
23
  pageInfo: PageInfo;
20
24
 
21
25
  /** The payment requests for the current page of this connection. **/