@lightsparkdev/lightspark-sdk 1.1.3 → 1.1.5

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 (36) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/{chunk-PZMOKVDK.js → chunk-7UNNCH5S.js} +88 -6
  3. package/dist/{index-827d336f.d.ts → index-5235e43b.d.ts} +64 -8
  4. package/dist/index.cjs +127 -10
  5. package/dist/index.d.ts +2 -2
  6. package/dist/index.js +41 -5
  7. package/dist/objects/index.cjs +88 -6
  8. package/dist/objects/index.d.ts +1 -1
  9. package/dist/objects/index.js +1 -1
  10. package/package.json +2 -4
  11. package/src/client.ts +49 -0
  12. package/src/objects/Account.ts +1 -0
  13. package/src/objects/ChannelSnapshot.ts +57 -0
  14. package/src/objects/Entity.ts +28 -0
  15. package/src/objects/IdAndSignature.ts +2 -0
  16. package/src/objects/LightningTransaction.ts +2 -0
  17. package/src/objects/OutgoingPayment.ts +30 -0
  18. package/src/objects/OutgoingPaymentAttempt.ts +35 -0
  19. package/src/objects/RegisterPaymentInput.ts +14 -0
  20. package/src/objects/ReleaseChannelPerCommitmentSecretInput.ts +3 -0
  21. package/src/objects/ReleaseChannelPerCommitmentSecretOutput.ts +1 -0
  22. package/src/objects/ReleasePaymentPreimageOutput.ts +1 -0
  23. package/src/objects/RemoteSigningSubEventType.ts +2 -0
  24. package/src/objects/ScreenNodeInput.ts +5 -0
  25. package/src/objects/SetInvoicePaymentHashInput.ts +5 -2
  26. package/src/objects/SignInvoiceInput.ts +3 -0
  27. package/src/objects/SignInvoiceOutput.ts +1 -0
  28. package/src/objects/SignMessagesInput.ts +1 -0
  29. package/src/objects/SignMessagesOutput.ts +1 -0
  30. package/src/objects/SignablePayloadStatus.ts +2 -0
  31. package/src/objects/Transaction.ts +2 -0
  32. package/src/objects/Wallet.ts +1 -0
  33. package/src/objects/WebhookEventType.ts +6 -0
  34. package/src/objects/WithdrawalRequestStatus.ts +2 -0
  35. package/src/objects/index.ts +1 -0
  36. package/src/tests/integration/client.test.ts +8 -22
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @lightsparkdev/lightspark-sdk
2
2
 
3
+ ## 1.1.5
4
+
5
+ ### Patch Changes
6
+
7
+ - a59d636: Regenerate SDK objects. Add channel snapshot and payment preimage
8
+ - Updated dependencies [a59d636]
9
+ - @lightsparkdev/core@1.0.8
10
+
11
+ ## 1.1.4
12
+
13
+ ### Patch Changes
14
+
15
+ - 1372f3a: Move transaction polling into new client method
16
+ - Updated dependencies [24782f5]
17
+ - @lightsparkdev/core@1.0.7
18
+
3
19
  ## 1.1.3
4
20
 
5
21
  ### Patch Changes
@@ -2941,6 +2941,15 @@ import autoBind10 from "auto-bind";
2941
2941
  // src/objects/OutgoingPaymentAttempt.ts
2942
2942
  import autoBind9 from "auto-bind";
2943
2943
 
2944
+ // src/objects/ChannelSnapshot.ts
2945
+ var ChannelSnapshotFromJson = (obj) => {
2946
+ return {
2947
+ localBalance: !!obj["channel_snapshot_local_balance"] ? CurrencyAmountFromJson(obj["channel_snapshot_local_balance"]) : void 0,
2948
+ localUnsettledBalance: !!obj["channel_snapshot_local_unsettled_balance"] ? CurrencyAmountFromJson(obj["channel_snapshot_local_unsettled_balance"]) : void 0,
2949
+ localChannelReserve: !!obj["channel_snapshot_local_channel_reserve"] ? CurrencyAmountFromJson(obj["channel_snapshot_local_channel_reserve"]) : void 0
2950
+ };
2951
+ };
2952
+
2944
2953
  // src/objects/HtlcAttemptFailureCode.ts
2945
2954
  var HtlcAttemptFailureCode = /* @__PURE__ */ ((HtlcAttemptFailureCode2) => {
2946
2955
  HtlcAttemptFailureCode2["FUTURE_VALUE"] = "FUTURE_VALUE";
@@ -3063,7 +3072,7 @@ var OutgoingPaymentAttemptToHopsConnectionFromJson = (obj) => {
3063
3072
 
3064
3073
  // src/objects/OutgoingPaymentAttempt.ts
3065
3074
  var OutgoingPaymentAttempt = class {
3066
- constructor(id, createdAt, updatedAt, status, outgoingPaymentId, typename, failureCode, failureSourceIndex, resolvedAt, amount, fees) {
3075
+ constructor(id, createdAt, updatedAt, status, outgoingPaymentId, typename, failureCode, failureSourceIndex, resolvedAt, amount, fees, channelSnapshot) {
3067
3076
  this.id = id;
3068
3077
  this.createdAt = createdAt;
3069
3078
  this.updatedAt = updatedAt;
@@ -3075,6 +3084,7 @@ var OutgoingPaymentAttempt = class {
3075
3084
  this.resolvedAt = resolvedAt;
3076
3085
  this.amount = amount;
3077
3086
  this.fees = fees;
3087
+ this.channelSnapshot = channelSnapshot;
3078
3088
  autoBind9(this);
3079
3089
  }
3080
3090
  async getHops(client, first = void 0, after = void 0) {
@@ -3163,7 +3173,10 @@ var OutgoingPaymentAttemptFromJson = (obj) => {
3163
3173
  obj["outgoing_payment_attempt_failure_source_index"],
3164
3174
  obj["outgoing_payment_attempt_resolved_at"],
3165
3175
  !!obj["outgoing_payment_attempt_amount"] ? CurrencyAmountFromJson(obj["outgoing_payment_attempt_amount"]) : void 0,
3166
- !!obj["outgoing_payment_attempt_fees"] ? CurrencyAmountFromJson(obj["outgoing_payment_attempt_fees"]) : void 0
3176
+ !!obj["outgoing_payment_attempt_fees"] ? CurrencyAmountFromJson(obj["outgoing_payment_attempt_fees"]) : void 0,
3177
+ !!obj["outgoing_payment_attempt_channel_snapshot"] ? ChannelSnapshotFromJson(
3178
+ obj["outgoing_payment_attempt_channel_snapshot"]
3179
+ ) : void 0
3167
3180
  );
3168
3181
  };
3169
3182
  var FRAGMENT14 = `
@@ -3195,6 +3208,33 @@ fragment OutgoingPaymentAttemptFragment on OutgoingPaymentAttempt {
3195
3208
  outgoing_payment_attempt_outgoing_payment: outgoing_payment {
3196
3209
  id
3197
3210
  }
3211
+ outgoing_payment_attempt_channel_snapshot: channel_snapshot {
3212
+ __typename
3213
+ channel_snapshot_local_balance: local_balance {
3214
+ __typename
3215
+ currency_amount_original_value: original_value
3216
+ currency_amount_original_unit: original_unit
3217
+ currency_amount_preferred_currency_unit: preferred_currency_unit
3218
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
3219
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
3220
+ }
3221
+ channel_snapshot_local_unsettled_balance: local_unsettled_balance {
3222
+ __typename
3223
+ currency_amount_original_value: original_value
3224
+ currency_amount_original_unit: original_unit
3225
+ currency_amount_preferred_currency_unit: preferred_currency_unit
3226
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
3227
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
3228
+ }
3229
+ channel_snapshot_local_channel_reserve: local_channel_reserve {
3230
+ __typename
3231
+ currency_amount_original_value: original_value
3232
+ currency_amount_original_unit: original_unit
3233
+ currency_amount_preferred_currency_unit: preferred_currency_unit
3234
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
3235
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
3236
+ }
3237
+ }
3198
3238
  }`;
3199
3239
  var OutgoingPaymentAttempt_default = OutgoingPaymentAttempt;
3200
3240
 
@@ -3260,7 +3300,7 @@ var RichTextFromJson = (obj) => {
3260
3300
 
3261
3301
  // src/objects/OutgoingPayment.ts
3262
3302
  var OutgoingPayment = class {
3263
- constructor(id, createdAt, updatedAt, status, amount, originId, typename, resolvedAt, transactionHash, destinationId, fees, paymentRequestData, failureReason, failureMessage, umaPostTransactionData) {
3303
+ constructor(id, createdAt, updatedAt, status, amount, originId, typename, resolvedAt, transactionHash, destinationId, fees, paymentRequestData, failureReason, failureMessage, umaPostTransactionData, paymentPreimage) {
3264
3304
  this.id = id;
3265
3305
  this.createdAt = createdAt;
3266
3306
  this.updatedAt = updatedAt;
@@ -3276,6 +3316,7 @@ var OutgoingPayment = class {
3276
3316
  this.failureReason = failureReason;
3277
3317
  this.failureMessage = failureMessage;
3278
3318
  this.umaPostTransactionData = umaPostTransactionData;
3319
+ this.paymentPreimage = paymentPreimage;
3279
3320
  autoBind10(this);
3280
3321
  }
3281
3322
  async getAttempts(client, first = void 0, after = void 0) {
@@ -3322,6 +3363,33 @@ query FetchOutgoingPaymentToAttemptsConnection($entity_id: ID!, $first: Int, $af
3322
3363
  outgoing_payment_attempt_outgoing_payment: outgoing_payment {
3323
3364
  id
3324
3365
  }
3366
+ outgoing_payment_attempt_channel_snapshot: channel_snapshot {
3367
+ __typename
3368
+ channel_snapshot_local_balance: local_balance {
3369
+ __typename
3370
+ currency_amount_original_value: original_value
3371
+ currency_amount_original_unit: original_unit
3372
+ currency_amount_preferred_currency_unit: preferred_currency_unit
3373
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
3374
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
3375
+ }
3376
+ channel_snapshot_local_unsettled_balance: local_unsettled_balance {
3377
+ __typename
3378
+ currency_amount_original_value: original_value
3379
+ currency_amount_original_unit: original_unit
3380
+ currency_amount_preferred_currency_unit: preferred_currency_unit
3381
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
3382
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
3383
+ }
3384
+ channel_snapshot_local_channel_reserve: local_channel_reserve {
3385
+ __typename
3386
+ currency_amount_original_value: original_value
3387
+ currency_amount_original_unit: original_unit
3388
+ currency_amount_preferred_currency_unit: preferred_currency_unit
3389
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
3390
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
3391
+ }
3392
+ }
3325
3393
  }
3326
3394
  }
3327
3395
  }
@@ -3371,7 +3439,8 @@ var OutgoingPaymentFromJson = (obj) => {
3371
3439
  !!obj["outgoing_payment_failure_message"] ? RichTextFromJson(obj["outgoing_payment_failure_message"]) : void 0,
3372
3440
  obj["outgoing_payment_uma_post_transaction_data"]?.map(
3373
3441
  (e) => PostTransactionDataFromJson(e)
3374
- )
3442
+ ),
3443
+ obj["outgoing_payment_payment_preimage"]
3375
3444
  );
3376
3445
  };
3377
3446
  var FRAGMENT15 = `
@@ -3662,6 +3731,7 @@ fragment OutgoingPaymentFragment on OutgoingPayment {
3662
3731
  currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
3663
3732
  }
3664
3733
  }
3734
+ outgoing_payment_payment_preimage: payment_preimage
3665
3735
  }`;
3666
3736
  var OutgoingPayment_default = OutgoingPayment;
3667
3737
 
@@ -3768,7 +3838,8 @@ var TransactionFromJson = (obj) => {
3768
3838
  !!obj["outgoing_payment_failure_message"] ? RichTextFromJson(obj["outgoing_payment_failure_message"]) : void 0,
3769
3839
  obj["outgoing_payment_uma_post_transaction_data"]?.map(
3770
3840
  (e) => PostTransactionDataFromJson(e)
3771
- )
3841
+ ),
3842
+ obj["outgoing_payment_payment_preimage"]
3772
3843
  );
3773
3844
  }
3774
3845
  if (obj["__typename"] == "RoutingTransaction") {
@@ -4232,6 +4303,7 @@ fragment TransactionFragment on Transaction {
4232
4303
  currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
4233
4304
  }
4234
4305
  }
4306
+ outgoing_payment_payment_preimage: payment_preimage
4235
4307
  }
4236
4308
  ... on RoutingTransaction {
4237
4309
  __typename
@@ -4853,6 +4925,7 @@ query FetchWalletToTransactionsConnection($entity_id: ID!, $first: Int, $after:
4853
4925
  currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
4854
4926
  }
4855
4927
  }
4928
+ outgoing_payment_payment_preimage: payment_preimage
4856
4929
  }
4857
4930
  ... on RoutingTransaction {
4858
4931
  __typename
@@ -6403,6 +6476,7 @@ query FetchAccountToTransactionsConnection($first: Int, $after: String, $types:
6403
6476
  currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
6404
6477
  }
6405
6478
  }
6479
+ outgoing_payment_payment_preimage: payment_preimage
6406
6480
  }
6407
6481
  ... on RoutingTransaction {
6408
6482
  __typename
@@ -7055,6 +7129,7 @@ var SignablePayloadStatus = /* @__PURE__ */ ((SignablePayloadStatus2) => {
7055
7129
  SignablePayloadStatus2["CREATED"] = "CREATED";
7056
7130
  SignablePayloadStatus2["SIGNED"] = "SIGNED";
7057
7131
  SignablePayloadStatus2["VALIDATION_FAILED"] = "VALIDATION_FAILED";
7132
+ SignablePayloadStatus2["INVALID_SIGNATURE"] = "INVALID_SIGNATURE";
7058
7133
  return SignablePayloadStatus2;
7059
7134
  })(SignablePayloadStatus || {});
7060
7135
  var SignablePayloadStatus_default = SignablePayloadStatus;
@@ -7542,7 +7617,8 @@ var LightningTransactionFromJson = (obj) => {
7542
7617
  !!obj["outgoing_payment_failure_message"] ? RichTextFromJson(obj["outgoing_payment_failure_message"]) : void 0,
7543
7618
  obj["outgoing_payment_uma_post_transaction_data"]?.map(
7544
7619
  (e) => PostTransactionDataFromJson(e)
7545
- )
7620
+ ),
7621
+ obj["outgoing_payment_payment_preimage"]
7546
7622
  );
7547
7623
  }
7548
7624
  if (obj["__typename"] == "RoutingTransaction") {
@@ -7892,6 +7968,7 @@ fragment LightningTransactionFragment on LightningTransaction {
7892
7968
  currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
7893
7969
  }
7894
7970
  }
7971
+ outgoing_payment_payment_preimage: payment_preimage
7895
7972
  }
7896
7973
  ... on RoutingTransaction {
7897
7974
  __typename
@@ -8295,6 +8372,7 @@ var RemoteSigningSubEventType = /* @__PURE__ */ ((RemoteSigningSubEventType2) =>
8295
8372
  RemoteSigningSubEventType2["DERIVE_KEY_AND_SIGN"] = "DERIVE_KEY_AND_SIGN";
8296
8373
  RemoteSigningSubEventType2["RELEASE_PAYMENT_PREIMAGE"] = "RELEASE_PAYMENT_PREIMAGE";
8297
8374
  RemoteSigningSubEventType2["REQUEST_INVOICE_PAYMENT_HASH"] = "REQUEST_INVOICE_PAYMENT_HASH";
8375
+ RemoteSigningSubEventType2["REVEAL_COUNTERPARTY_PER_COMMITMENT_SECRET"] = "REVEAL_COUNTERPARTY_PER_COMMITMENT_SECRET";
8298
8376
  return RemoteSigningSubEventType2;
8299
8377
  })(RemoteSigningSubEventType || {});
8300
8378
  var RemoteSigningSubEventType_default = RemoteSigningSubEventType;
@@ -8478,6 +8556,8 @@ fragment TransactionUpdateFragment on Transaction {
8478
8556
  var WebhookEventType = /* @__PURE__ */ ((WebhookEventType2) => {
8479
8557
  WebhookEventType2["FUTURE_VALUE"] = "FUTURE_VALUE";
8480
8558
  WebhookEventType2["PAYMENT_FINISHED"] = "PAYMENT_FINISHED";
8559
+ WebhookEventType2["WITHDRAWAL_FINISHED"] = "WITHDRAWAL_FINISHED";
8560
+ WebhookEventType2["FUNDS_RECEIVED"] = "FUNDS_RECEIVED";
8481
8561
  WebhookEventType2["NODE_STATUS"] = "NODE_STATUS";
8482
8562
  WebhookEventType2["WALLET_STATUS"] = "WALLET_STATUS";
8483
8563
  WebhookEventType2["WALLET_OUTGOING_PAYMENT_FINISHED"] = "WALLET_OUTGOING_PAYMENT_FINISHED";
@@ -8485,6 +8565,7 @@ var WebhookEventType = /* @__PURE__ */ ((WebhookEventType2) => {
8485
8565
  WebhookEventType2["WALLET_WITHDRAWAL_FINISHED"] = "WALLET_WITHDRAWAL_FINISHED";
8486
8566
  WebhookEventType2["WALLET_FUNDS_RECEIVED"] = "WALLET_FUNDS_RECEIVED";
8487
8567
  WebhookEventType2["REMOTE_SIGNING"] = "REMOTE_SIGNING";
8568
+ WebhookEventType2["LOW_BALANCE"] = "LOW_BALANCE";
8488
8569
  return WebhookEventType2;
8489
8570
  })(WebhookEventType || {});
8490
8571
  var WebhookEventType_default = WebhookEventType;
@@ -8565,6 +8646,7 @@ import autoBind13 from "auto-bind";
8565
8646
  // src/objects/WithdrawalRequestStatus.ts
8566
8647
  var WithdrawalRequestStatus = /* @__PURE__ */ ((WithdrawalRequestStatus2) => {
8567
8648
  WithdrawalRequestStatus2["FUTURE_VALUE"] = "FUTURE_VALUE";
8649
+ WithdrawalRequestStatus2["CREATED"] = "CREATED";
8568
8650
  WithdrawalRequestStatus2["FAILED"] = "FAILED";
8569
8651
  WithdrawalRequestStatus2["IN_PROGRESS"] = "IN_PROGRESS";
8570
8652
  WithdrawalRequestStatus2["SUCCESSFUL"] = "SUCCESSFUL";
@@ -923,6 +923,12 @@ declare enum InvoiceType {
923
923
  AMP = "AMP"
924
924
  }
925
925
 
926
+ type ChannelSnapshot = {
927
+ localBalance?: CurrencyAmount;
928
+ localUnsettledBalance?: CurrencyAmount;
929
+ localChannelReserve?: CurrencyAmount;
930
+ };
931
+
926
932
  /** This is an enum representing a particular reason why an htlc sent over the Lightning Network may have failed. **/
927
933
  declare enum HtlcAttemptFailureCode {
928
934
  /**
@@ -1027,7 +1033,8 @@ declare class OutgoingPaymentAttempt implements Entity {
1027
1033
  readonly resolvedAt?: string | undefined;
1028
1034
  readonly amount?: CurrencyAmount | undefined;
1029
1035
  readonly fees?: CurrencyAmount | undefined;
1030
- constructor(id: string, createdAt: string, updatedAt: string, status: OutgoingPaymentAttemptStatus, outgoingPaymentId: string, typename: string, failureCode?: HtlcAttemptFailureCode | undefined, failureSourceIndex?: number | undefined, resolvedAt?: string | undefined, amount?: CurrencyAmount | undefined, fees?: CurrencyAmount | undefined);
1036
+ readonly channelSnapshot?: ChannelSnapshot | undefined;
1037
+ constructor(id: string, createdAt: string, updatedAt: string, status: OutgoingPaymentAttemptStatus, outgoingPaymentId: string, typename: string, failureCode?: HtlcAttemptFailureCode | undefined, failureSourceIndex?: number | undefined, resolvedAt?: string | undefined, amount?: CurrencyAmount | undefined, fees?: CurrencyAmount | undefined, channelSnapshot?: ChannelSnapshot | undefined);
1031
1038
  getHops(client: LightsparkClient, first?: number | undefined, after?: string | undefined): Promise<OutgoingPaymentAttemptToHopsConnection>;
1032
1039
  static getOutgoingPaymentAttemptQuery(id: string): Query<OutgoingPaymentAttempt>;
1033
1040
  }
@@ -1068,7 +1075,8 @@ declare class OutgoingPayment implements LightningTransaction {
1068
1075
  readonly failureReason?: PaymentFailureReason | undefined;
1069
1076
  readonly failureMessage?: RichText | undefined;
1070
1077
  readonly umaPostTransactionData?: PostTransactionData[] | undefined;
1071
- constructor(id: string, createdAt: string, updatedAt: string, status: TransactionStatus, amount: CurrencyAmount, originId: string, typename: string, resolvedAt?: string | undefined, transactionHash?: string | undefined, destinationId?: string | undefined, fees?: CurrencyAmount | undefined, paymentRequestData?: PaymentRequestData | undefined, failureReason?: PaymentFailureReason | undefined, failureMessage?: RichText | undefined, umaPostTransactionData?: PostTransactionData[] | undefined);
1078
+ readonly paymentPreimage?: string | undefined;
1079
+ constructor(id: string, createdAt: string, updatedAt: string, status: TransactionStatus, amount: CurrencyAmount, originId: string, typename: string, resolvedAt?: string | undefined, transactionHash?: string | undefined, destinationId?: string | undefined, fees?: CurrencyAmount | undefined, paymentRequestData?: PaymentRequestData | undefined, failureReason?: PaymentFailureReason | undefined, failureMessage?: RichText | undefined, umaPostTransactionData?: PostTransactionData[] | undefined, paymentPreimage?: string | undefined);
1072
1080
  getAttempts(client: LightsparkClient, first?: number | undefined, after?: string | undefined): Promise<OutgoingPaymentToAttemptsConnection>;
1073
1081
  static getOutgoingPaymentQuery(id: string): Query<OutgoingPayment>;
1074
1082
  }
@@ -1136,6 +1144,7 @@ declare enum WithdrawalRequestStatus {
1136
1144
  * Clients should support unknown values as more of them could be added without notice.
1137
1145
  */
1138
1146
  FUTURE_VALUE = "FUTURE_VALUE",
1147
+ CREATED = "CREATED",
1139
1148
  FAILED = "FAILED",
1140
1149
  IN_PROGRESS = "IN_PROGRESS",
1141
1150
  SUCCESSFUL = "SUCCESSFUL"
@@ -1578,6 +1587,13 @@ declare class LightsparkClient {
1578
1587
  * @returns An `OutgoingPayment` object if the payment was successful, or undefined if the payment failed.
1579
1588
  */
1580
1589
  payUmaInvoice(payerNodeId: string, encodedInvoice: string, maximumFeesMsats: number, timeoutSecs?: number, amountMsats?: number | undefined): Promise<OutgoingPayment | undefined>;
1590
+ /**
1591
+ * Waits for a transaction to have a completed status, and returns the transaction.
1592
+ *
1593
+ * @param transactionId The ID of the transaction to wait for
1594
+ * @param pollTimeoutSecs The timeout in seconds that we will wait before throwing an exception
1595
+ */
1596
+ waitForTransactionComplete(transactionId: string, pollTimeoutSecs?: number): Promise<Transaction>;
1581
1597
  /**
1582
1598
  * Sends a payment directly to a node on the Lightning Network through the public key of the node without an invoice.
1583
1599
  *
@@ -1781,7 +1797,8 @@ declare enum SignablePayloadStatus {
1781
1797
  FUTURE_VALUE = "FUTURE_VALUE",
1782
1798
  CREATED = "CREATED",
1783
1799
  SIGNED = "SIGNED",
1784
- VALIDATION_FAILED = "VALIDATION_FAILED"
1800
+ VALIDATION_FAILED = "VALIDATION_FAILED",
1801
+ INVALID_SIGNATURE = "INVALID_SIGNATURE"
1785
1802
  }
1786
1803
 
1787
1804
  type SignablePayload = Entity & {
@@ -1895,7 +1912,9 @@ declare class GraphNode implements Node {
1895
1912
  }
1896
1913
 
1897
1914
  type IdAndSignature = {
1915
+ /** The id of the message. **/
1898
1916
  id: string;
1917
+ /** The signature of the message. **/
1899
1918
  signature: string;
1900
1919
  };
1901
1920
 
@@ -2035,9 +2054,23 @@ type PayUmaInvoiceInput = {
2035
2054
  };
2036
2055
 
2037
2056
  type RegisterPaymentInput = {
2057
+ /**
2058
+ * The compliance provider that is going to screen the node. You need to be a customer of the selected
2059
+ * provider and store the API key on the Lightspark account setting page.
2060
+ **/
2038
2061
  provider: ComplianceProvider;
2062
+ /**
2063
+ * The Lightspark ID of the lightning payment you want to register. It can be the id of either an
2064
+ * OutgoingPayment or an IncomingPayment.
2065
+ **/
2039
2066
  paymentId: string;
2067
+ /**
2068
+ * The public key of the counterparty lightning node, which would be the public key of the recipient
2069
+ * node if it is to register an outgoing payment, or the public key of the sender node if it is to
2070
+ * register an incoming payment.
2071
+ **/
2040
2072
  nodePubkey: string;
2073
+ /** Indicates whether this payment is an OutgoingPayment or an IncomingPayment. **/
2041
2074
  direction: PaymentDirection;
2042
2075
  };
2043
2076
 
@@ -2046,12 +2079,16 @@ type RegisterPaymentOutput = {
2046
2079
  };
2047
2080
 
2048
2081
  type ReleaseChannelPerCommitmentSecretInput = {
2082
+ /** The unique identifier of the channel. **/
2049
2083
  channelId: string;
2084
+ /** The per-commitment secret to be released. **/
2050
2085
  perCommitmentSecret: string;
2086
+ /** The index associated with the per-commitment secret. **/
2051
2087
  perCommitmentIndex: number;
2052
2088
  };
2053
2089
 
2054
2090
  type ReleaseChannelPerCommitmentSecretOutput = {
2091
+ /** The channel object after the per-commitment secret release operation. **/
2055
2092
  channelId: string;
2056
2093
  };
2057
2094
 
@@ -2063,6 +2100,7 @@ type ReleasePaymentPreimageInput = {
2063
2100
  };
2064
2101
 
2065
2102
  type ReleasePaymentPreimageOutput = {
2103
+ /** The invoice of the transaction. **/
2066
2104
  invoiceId: string;
2067
2105
  };
2068
2106
 
@@ -2079,7 +2117,8 @@ declare enum RemoteSigningSubEventType {
2079
2117
  SIGN_INVOICE = "SIGN_INVOICE",
2080
2118
  DERIVE_KEY_AND_SIGN = "DERIVE_KEY_AND_SIGN",
2081
2119
  RELEASE_PAYMENT_PREIMAGE = "RELEASE_PAYMENT_PREIMAGE",
2082
- REQUEST_INVOICE_PAYMENT_HASH = "REQUEST_INVOICE_PAYMENT_HASH"
2120
+ REQUEST_INVOICE_PAYMENT_HASH = "REQUEST_INVOICE_PAYMENT_HASH",
2121
+ REVEAL_COUNTERPARTY_PER_COMMITMENT_SECRET = "REVEAL_COUNTERPARTY_PER_COMMITMENT_SECRET"
2083
2122
  }
2084
2123
 
2085
2124
  type RequestWithdrawalInput = {
@@ -2151,7 +2190,12 @@ type RoutingTransaction = LightningTransaction & Transaction & Entity & {
2151
2190
  declare const getRoutingTransactionQuery: (id: string) => Query<RoutingTransaction>;
2152
2191
 
2153
2192
  type ScreenNodeInput = {
2193
+ /**
2194
+ * The compliance provider that is going to screen the node. You need to be a customer of the selected
2195
+ * provider and store the API key on the Lightspark account setting page.
2196
+ **/
2154
2197
  provider: ComplianceProvider;
2198
+ /** The public key of the lightning node that needs to be screened. **/
2155
2199
  nodePubkey: string;
2156
2200
  };
2157
2201
 
@@ -2182,8 +2226,11 @@ type SetInvoicePaymentHashInput = {
2182
2226
  invoiceId: string;
2183
2227
  /** The 32-byte hash of the payment preimage. **/
2184
2228
  paymentHash: string;
2185
- /** The 32-byte nonce used to generate the invoice preimage. **/
2186
- preimageNonce: string;
2229
+ /**
2230
+ * The 32-byte nonce used to generate the invoice preimage if applicable. It will later be included in
2231
+ * RELEASE_PAYMENT_PREIMAGE webhook to help recover the raw preimage.
2232
+ **/
2233
+ preimageNonce?: string;
2187
2234
  };
2188
2235
 
2189
2236
  type SetInvoicePaymentHashOutput = {
@@ -2206,20 +2253,26 @@ type Signable = Entity & {
2206
2253
  declare const getSignableQuery: (id: string) => Query<Signable>;
2207
2254
 
2208
2255
  type SignInvoiceInput = {
2256
+ /** The unique identifier of the invoice to be signed. **/
2209
2257
  invoiceId: string;
2258
+ /** The cryptographic signature for the invoice. **/
2210
2259
  signature: string;
2260
+ /** The recovery identifier for the signature. **/
2211
2261
  recoveryId: number;
2212
2262
  };
2213
2263
 
2214
2264
  type SignInvoiceOutput = {
2265
+ /** The signed invoice object. **/
2215
2266
  invoiceId: string;
2216
2267
  };
2217
2268
 
2218
2269
  type SignMessagesInput = {
2270
+ /** The list of the message ids and signatures. **/
2219
2271
  signatures: IdAndSignature[];
2220
2272
  };
2221
2273
 
2222
2274
  type SignMessagesOutput = {
2275
+ /** The list of signed payloads. **/
2223
2276
  signedPayloads: SignablePayload[];
2224
2277
  };
2225
2278
 
@@ -2250,13 +2303,16 @@ declare enum WebhookEventType {
2250
2303
  */
2251
2304
  FUTURE_VALUE = "FUTURE_VALUE",
2252
2305
  PAYMENT_FINISHED = "PAYMENT_FINISHED",
2306
+ WITHDRAWAL_FINISHED = "WITHDRAWAL_FINISHED",
2307
+ FUNDS_RECEIVED = "FUNDS_RECEIVED",
2253
2308
  NODE_STATUS = "NODE_STATUS",
2254
2309
  WALLET_STATUS = "WALLET_STATUS",
2255
2310
  WALLET_OUTGOING_PAYMENT_FINISHED = "WALLET_OUTGOING_PAYMENT_FINISHED",
2256
2311
  WALLET_INCOMING_PAYMENT_FINISHED = "WALLET_INCOMING_PAYMENT_FINISHED",
2257
2312
  WALLET_WITHDRAWAL_FINISHED = "WALLET_WITHDRAWAL_FINISHED",
2258
2313
  WALLET_FUNDS_RECEIVED = "WALLET_FUNDS_RECEIVED",
2259
- REMOTE_SIGNING = "REMOTE_SIGNING"
2314
+ REMOTE_SIGNING = "REMOTE_SIGNING",
2315
+ LOW_BALANCE = "LOW_BALANCE"
2260
2316
  }
2261
2317
 
2262
2318
  /** This object represents an L1 withdrawal from your Lightspark Node to any Bitcoin wallet. You can retrieve this object to receive detailed information about any L1 withdrawal associated with your Lightspark Node or account. **/
@@ -2304,4 +2360,4 @@ type Withdrawal = OnChainTransaction & Transaction & Entity & {
2304
2360
  };
2305
2361
  declare const getWithdrawalQuery: (id: string) => Query<Withdrawal>;
2306
2362
 
2307
- export { IncomingPaymentAttempt as $, Account as A, Balances as B, Channel as C, CreateTestModeInvoiceOutput as D, CreateTestModePaymentInput as E, CreateTestModePaymentoutput as F, CreateUmaInvoiceInput as G, CurrencyAmount as H, CurrencyUnit as I, DeclineToSignMessagesInput as J, DeclineToSignMessagesOutput as K, LightsparkClient as L, DeleteApiTokenInput as M, DeleteApiTokenOutput as N, Deposit as O, getDepositQuery as P, Entity as Q, FeeEstimate as R, FundNodeInput as S, FundNodeOutput as T, GraphNode as U, Hop as V, WebhookEventType as W, getHopQuery as X, HtlcAttemptFailureCode as Y, IdAndSignature as Z, IncomingPayment as _, AccountToApiTokensConnection as a, SetInvoicePaymentHashInput as a$, getIncomingPaymentAttemptQuery as a0, IncomingPaymentAttemptStatus as a1, IncomingPaymentToAttemptsConnection as a2, Invoice as a3, getInvoiceQuery as a4, InvoiceData as a5, InvoiceType as a6, LightningFeeEstimateForInvoiceInput as a7, LightningFeeEstimateForNodeInput as a8, LightningFeeEstimateOutput as a9, PaymentFailureReason as aA, PaymentRequest as aB, getPaymentRequestQuery as aC, PaymentRequestData as aD, PaymentRequestStatus as aE, PayUmaInvoiceInput as aF, Permission as aG, PostTransactionData as aH, RegisterPaymentInput as aI, RegisterPaymentOutput as aJ, ReleaseChannelPerCommitmentSecretInput as aK, ReleaseChannelPerCommitmentSecretOutput as aL, ReleasePaymentPreimageInput as aM, ReleasePaymentPreimageOutput as aN, RemoteSigningSubEventType as aO, RequestWithdrawalInput as aP, RequestWithdrawalOutput as aQ, RichText as aR, RiskRating as aS, RoutingTransaction as aT, getRoutingTransactionQuery as aU, RoutingTransactionFailureReason as aV, ScreenNodeInput as aW, ScreenNodeOutput as aX, Secret as aY, SendPaymentInput as aZ, SendPaymentOutput as a_, LightningTransaction as aa, getLightningTransactionQuery as ab, LightsparkNode as ac, LightsparkNodeOwner as ad, getLightsparkNodeOwnerQuery as ae, LightsparkNodeStatus as af, LightsparkNodeToChannelsConnection as ag, LightsparkNodeWithOSK as ah, LightsparkNodeWithRemoteSigning as ai, Node as aj, NodeAddress as ak, NodeAddressType as al, NodeToAddressesConnection as am, OnChainTransaction as an, getOnChainTransactionQuery as ao, OutgoingPayment as ap, OutgoingPaymentAttempt as aq, OutgoingPaymentAttemptStatus as ar, OutgoingPaymentAttemptToHopsConnection as as, OutgoingPaymentsForInvoiceQueryInput as at, OutgoingPaymentsForInvoiceQueryOutput as au, OutgoingPaymentToAttemptsConnection as av, PageInfo as aw, PayInvoiceInput as ax, PayInvoiceOutput as ay, PaymentDirection as az, AccountToChannelsConnection as b, SetInvoicePaymentHashOutput as b0, Signable as b1, getSignableQuery as b2, SignablePayload as b3, getSignablePayloadQuery as b4, SignablePayloadStatus as b5, SignInvoiceInput as b6, SignInvoiceOutput as b7, SignMessagesInput as b8, SignMessagesOutput as b9, SingleNodeDashboard as ba, Transaction as bb, getTransactionQuery as bc, TransactionFailures as bd, TransactionStatus as be, TransactionType as bf, TransactionUpdate as bg, UpdateChannelPerCommitmentPointInput as bh, UpdateChannelPerCommitmentPointOutput as bi, UpdateNodeSharedSecretInput as bj, UpdateNodeSharedSecretOutput as bk, Wallet as bl, WalletStatus as bm, WalletToPaymentRequestsConnection as bn, WalletToTransactionsConnection as bo, Withdrawal as bp, getWithdrawalQuery as bq, WithdrawalMode as br, WithdrawalRequest as bs, WithdrawalRequestStatus as bt, WithdrawalRequestToChannelClosingTransactionsConnection as bu, WithdrawalRequestToChannelOpeningTransactionsConnection as bv, AccountToNodesConnection as c, AccountToPaymentRequestsConnection as d, AccountToTransactionsConnection as e, AccountToWalletsConnection as f, ApiToken as g, getApiTokenQuery as h, BlockchainBalance as i, ChannelClosingTransaction as j, getChannelClosingTransactionQuery as k, ChannelFees as l, ChannelOpeningTransaction as m, getChannelOpeningTransactionQuery as n, ChannelStatus as o, ChannelToTransactionsConnection as p, ComplianceProvider as q, Connection as r, CreateApiTokenInput as s, CreateApiTokenOutput as t, CreateInvoiceInput as u, CreateInvoiceOutput as v, CreateLnurlInvoiceInput as w, CreateNodeWalletAddressInput as x, CreateNodeWalletAddressOutput as y, CreateTestModeInvoiceInput as z };
2363
+ export { IncomingPayment as $, Account as A, Balances as B, Channel as C, CreateTestModeInvoiceInput as D, CreateTestModeInvoiceOutput as E, CreateTestModePaymentInput as F, CreateTestModePaymentoutput as G, CreateUmaInvoiceInput as H, CurrencyAmount as I, CurrencyUnit as J, DeclineToSignMessagesInput as K, LightsparkClient as L, DeclineToSignMessagesOutput as M, DeleteApiTokenInput as N, DeleteApiTokenOutput as O, Deposit as P, getDepositQuery as Q, Entity as R, FeeEstimate as S, FundNodeInput as T, FundNodeOutput as U, GraphNode as V, WebhookEventType as W, Hop as X, getHopQuery as Y, HtlcAttemptFailureCode as Z, IdAndSignature as _, AccountToApiTokensConnection as a, SendPaymentOutput as a$, IncomingPaymentAttempt as a0, getIncomingPaymentAttemptQuery as a1, IncomingPaymentAttemptStatus as a2, IncomingPaymentToAttemptsConnection as a3, Invoice as a4, getInvoiceQuery as a5, InvoiceData as a6, InvoiceType as a7, LightningFeeEstimateForInvoiceInput as a8, LightningFeeEstimateForNodeInput as a9, PaymentDirection as aA, PaymentFailureReason as aB, PaymentRequest as aC, getPaymentRequestQuery as aD, PaymentRequestData as aE, PaymentRequestStatus as aF, PayUmaInvoiceInput as aG, Permission as aH, PostTransactionData as aI, RegisterPaymentInput as aJ, RegisterPaymentOutput as aK, ReleaseChannelPerCommitmentSecretInput as aL, ReleaseChannelPerCommitmentSecretOutput as aM, ReleasePaymentPreimageInput as aN, ReleasePaymentPreimageOutput as aO, RemoteSigningSubEventType as aP, RequestWithdrawalInput as aQ, RequestWithdrawalOutput as aR, RichText as aS, RiskRating as aT, RoutingTransaction as aU, getRoutingTransactionQuery as aV, RoutingTransactionFailureReason as aW, ScreenNodeInput as aX, ScreenNodeOutput as aY, Secret as aZ, SendPaymentInput as a_, LightningFeeEstimateOutput as aa, LightningTransaction as ab, getLightningTransactionQuery as ac, LightsparkNode as ad, LightsparkNodeOwner as ae, getLightsparkNodeOwnerQuery as af, LightsparkNodeStatus as ag, LightsparkNodeToChannelsConnection as ah, LightsparkNodeWithOSK as ai, LightsparkNodeWithRemoteSigning as aj, Node as ak, NodeAddress as al, NodeAddressType as am, NodeToAddressesConnection as an, OnChainTransaction as ao, getOnChainTransactionQuery as ap, OutgoingPayment as aq, OutgoingPaymentAttempt as ar, OutgoingPaymentAttemptStatus as as, OutgoingPaymentAttemptToHopsConnection as at, OutgoingPaymentsForInvoiceQueryInput as au, OutgoingPaymentsForInvoiceQueryOutput as av, OutgoingPaymentToAttemptsConnection as aw, PageInfo as ax, PayInvoiceInput as ay, PayInvoiceOutput as az, AccountToChannelsConnection as b, SetInvoicePaymentHashInput as b0, SetInvoicePaymentHashOutput as b1, Signable as b2, getSignableQuery as b3, SignablePayload as b4, getSignablePayloadQuery as b5, SignablePayloadStatus as b6, SignInvoiceInput as b7, SignInvoiceOutput as b8, SignMessagesInput as b9, SignMessagesOutput as ba, SingleNodeDashboard as bb, Transaction as bc, getTransactionQuery as bd, TransactionFailures as be, TransactionStatus as bf, TransactionType as bg, TransactionUpdate as bh, UpdateChannelPerCommitmentPointInput as bi, UpdateChannelPerCommitmentPointOutput as bj, UpdateNodeSharedSecretInput as bk, UpdateNodeSharedSecretOutput as bl, Wallet as bm, WalletStatus as bn, WalletToPaymentRequestsConnection as bo, WalletToTransactionsConnection as bp, Withdrawal as bq, getWithdrawalQuery as br, WithdrawalMode as bs, WithdrawalRequest as bt, WithdrawalRequestStatus as bu, WithdrawalRequestToChannelClosingTransactionsConnection as bv, WithdrawalRequestToChannelOpeningTransactionsConnection as bw, AccountToNodesConnection as c, AccountToPaymentRequestsConnection as d, AccountToTransactionsConnection as e, AccountToWalletsConnection as f, ApiToken as g, getApiTokenQuery as h, BlockchainBalance as i, ChannelClosingTransaction as j, getChannelClosingTransactionQuery as k, ChannelFees as l, ChannelOpeningTransaction as m, getChannelOpeningTransactionQuery as n, ChannelSnapshot as o, ChannelStatus as p, ChannelToTransactionsConnection as q, ComplianceProvider as r, Connection as s, CreateApiTokenInput as t, CreateApiTokenOutput as u, CreateInvoiceInput as v, CreateInvoiceOutput as w, CreateLnurlInvoiceInput as x, CreateNodeWalletAddressInput as y, CreateNodeWalletAddressOutput as z };