@lightsparkdev/lightspark-sdk 1.5.13 → 1.6.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 (54) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/{chunk-FGFVWCTL.js → chunk-UHTZSOPX.js} +272 -144
  3. package/dist/{index-2b493387.d.ts → index-145ff316.d.ts} +232 -87
  4. package/dist/index.cjs +351 -142
  5. package/dist/index.d.cts +2 -2
  6. package/dist/index.d.ts +2 -2
  7. package/dist/index.js +85 -3
  8. package/dist/objects/index.cjs +262 -133
  9. package/dist/objects/index.d.cts +1 -1
  10. package/dist/objects/index.d.ts +1 -1
  11. package/dist/objects/index.js +3 -1
  12. package/package.json +2 -2
  13. package/src/client.ts +62 -0
  14. package/src/graphql/InvoiceForPaymentHash.ts +17 -0
  15. package/src/graphql/OutgoingPaymentsForPaymentHash.ts +21 -0
  16. package/src/objects/Account.ts +14 -2
  17. package/src/objects/ChannelClosingTransaction.ts +1 -4
  18. package/src/objects/ChannelOpeningTransaction.ts +1 -4
  19. package/src/objects/Connection.ts +116 -0
  20. package/src/objects/Deposit.ts +1 -4
  21. package/src/objects/Entity.ts +10 -0
  22. package/src/objects/FailHtlcsInput.ts +27 -0
  23. package/src/objects/FailHtlcsOutput.ts +26 -0
  24. package/src/objects/InvoiceForPaymentHashInput.ts +23 -0
  25. package/src/objects/InvoiceForPaymentHashOutput.ts +30 -0
  26. package/src/objects/LightningTransaction.ts +3 -0
  27. package/src/objects/LightsparkNode.ts +3 -1
  28. package/src/objects/LightsparkNodeWithOSK.ts +8 -4
  29. package/src/objects/LightsparkNodeWithRemoteSigning.ts +8 -4
  30. package/src/objects/OnChainFeeTarget.ts +19 -0
  31. package/src/objects/OnChainTransaction.ts +1 -4
  32. package/src/objects/OutgoingPayment.ts +5 -0
  33. package/src/objects/OutgoingPaymentForIdempotencyKeyInput.ts +24 -0
  34. package/src/objects/OutgoingPaymentForIdempotencyKeyOutput.ts +33 -0
  35. package/src/objects/OutgoingPaymentsForInvoiceQueryOutput.ts +1 -0
  36. package/src/objects/OutgoingPaymentsForPaymentHashQueryInput.ts +34 -0
  37. package/src/objects/OutgoingPaymentsForPaymentHashQueryOutput.ts +37 -0
  38. package/src/objects/PayInvoiceInput.ts +8 -0
  39. package/src/objects/PayUmaInvoiceInput.ts +4 -0
  40. package/src/objects/PaymentFailureReason.ts +2 -0
  41. package/src/objects/RemoteSigningSubEventType.ts +2 -0
  42. package/src/objects/RequestWithdrawalInput.ts +29 -0
  43. package/src/objects/SendPaymentInput.ts +8 -0
  44. package/src/objects/Transaction.ts +3 -0
  45. package/src/objects/TransactionStatus.ts +1 -1
  46. package/src/objects/Wallet.ts +10 -0
  47. package/src/objects/Withdrawal.ts +1 -4
  48. package/src/objects/WithdrawalRequest.ts +107 -11
  49. package/src/objects/WithdrawalRequestStatus.ts +2 -0
  50. package/src/objects/WithdrawalRequestToChannelClosingTransactionsConnection.ts +15 -10
  51. package/src/objects/WithdrawalRequestToChannelOpeningTransactionsConnection.ts +15 -10
  52. package/src/objects/WithdrawalRequestToWithdrawalsConnection.ts +47 -0
  53. package/src/objects/index.ts +10 -0
  54. package/src/webhooks.ts +3 -0
@@ -1,4 +1,4 @@
1
- export { A as Account, a as AccountToApiTokensConnection, b as AccountToChannelsConnection, c as AccountToNodesConnection, d as AccountToPaymentRequestsConnection, e as AccountToTransactionsConnection, f as AccountToWalletsConnection, g as AccountToWithdrawalRequestsConnection, h as ApiToken, j as AuditLogActor, B as Balances, l as BlockchainBalance, C as CancelInvoiceInput, m as CancelInvoiceOutput, n as Channel, o as ChannelClosingTransaction, q as ChannelFees, r as ChannelOpeningTransaction, t as ChannelSnapshot, v as ChannelStatus, w as ChannelToTransactionsConnection, x as ClaimUmaInvitationInput, y as ClaimUmaInvitationOutput, z as ClaimUmaInvitationWithIncentivesInput, D as ClaimUmaInvitationWithIncentivesOutput, E as ComplianceProvider, F as Connection, G as CreateApiTokenInput, H as CreateApiTokenOutput, I as CreateInvitationWithIncentivesInput, J as CreateInvitationWithIncentivesOutput, K as CreateInvoiceInput, M as CreateInvoiceOutput, N as CreateLnurlInvoiceInput, O as CreateNodeWalletAddressInput, P as CreateNodeWalletAddressOutput, Q as CreateTestModeInvoiceInput, R as CreateTestModeInvoiceOutput, S as CreateTestModePaymentInput, T as CreateTestModePaymentoutput, U as CreateUmaInvitationInput, V as CreateUmaInvitationOutput, X as CreateUmaInvoiceInput, Y as CurrencyAmount, Z as CurrencyUnit, _ as DailyLiquidityForecast, $ as DeclineToSignMessagesInput, a0 as DeclineToSignMessagesOutput, a1 as DeleteApiTokenInput, a2 as DeleteApiTokenOutput, a3 as Deposit, a5 as Entity, a6 as FeeEstimate, a7 as FundNodeInput, a8 as FundNodeOutput, a9 as GraphNode, aa as Hop, ac as HtlcAttemptFailureCode, ad as IdAndSignature, ae as IncentivesIneligibilityReason, af as IncentivesStatus, ag as IncomingPayment, ah as IncomingPaymentAttempt, aj as IncomingPaymentAttemptStatus, ak as IncomingPaymentToAttemptsConnection, al as IncomingPaymentsForInvoiceQueryInput, am as IncomingPaymentsForInvoiceQueryOutput, an as Invoice, ap as InvoiceData, aq as InvoiceType, ar as LightningFeeEstimateForInvoiceInput, as as LightningFeeEstimateForNodeInput, at as LightningFeeEstimateOutput, au as LightningPaymentDirection, av as LightningTransaction, ax as LightsparkNode, az as LightsparkNodeOwner, aB as LightsparkNodeStatus, aC as LightsparkNodeToChannelsConnection, aD as LightsparkNodeToDailyLiquidityForecastsConnection, aE as LightsparkNodeWithOSK, aF as LightsparkNodeWithRemoteSigning, aG as MultiSigAddressValidationParameters, aH as Node, aJ as NodeAddress, aK as NodeAddressType, aL as NodeToAddressesConnection, aM as OnChainTransaction, aO as OutgoingPayment, aP as OutgoingPaymentAttempt, aQ as OutgoingPaymentAttemptStatus, aR as OutgoingPaymentAttemptToHopsConnection, aS as OutgoingPaymentToAttemptsConnection, aT as OutgoingPaymentsForInvoiceQueryInput, aU as OutgoingPaymentsForInvoiceQueryOutput, aV as PageInfo, aW as PayInvoiceInput, aX as PayInvoiceOutput, aY as PayUmaInvoiceInput, aZ as PaymentDirection, a_ as PaymentFailureReason, a$ as PaymentRequest, b1 as PaymentRequestData, b2 as PaymentRequestStatus, b3 as Permission, b4 as PostTransactionData, b5 as RegionCode, b6 as RegisterPaymentInput, b7 as RegisterPaymentOutput, b8 as ReleaseChannelPerCommitmentSecretInput, b9 as ReleaseChannelPerCommitmentSecretOutput, ba as ReleasePaymentPreimageInput, bb as ReleasePaymentPreimageOutput, bc as RemoteSigningSubEventType, bd as RequestWithdrawalInput, be as RequestWithdrawalOutput, bf as RichText, bg as RiskRating, bh as RoutingTransaction, bj as RoutingTransactionFailureReason, bk as ScreenNodeInput, bl as ScreenNodeOutput, bm as Secret, bn as SendPaymentInput, bo as SendPaymentOutput, bp as SetInvoicePaymentHashInput, bq as SetInvoicePaymentHashOutput, br as SignInvoiceInput, bs as SignInvoiceOutput, bt as SignMessagesInput, bu as SignMessagesOutput, bv as Signable, bx as SignablePayload, bz as SignablePayloadStatus, bA as SingleNodeDashboard, bB as Transaction, bD as TransactionFailures, bE as TransactionStatus, bF as TransactionType, bG as TransactionUpdate, bH as UmaInvitation, bJ as UpdateChannelPerCommitmentPointInput, bK as UpdateChannelPerCommitmentPointOutput, bL as UpdateNodeSharedSecretInput, bM as UpdateNodeSharedSecretOutput, bN as Wallet, bO as WalletStatus, bP as WalletToPaymentRequestsConnection, bQ as WalletToTransactionsConnection, bR as WalletToWithdrawalRequestsConnection, W as WebhookEventType, bS as Withdrawal, bU as WithdrawalFeeEstimateInput, bV as WithdrawalFeeEstimateOutput, bW as WithdrawalMode, bX as WithdrawalRequest, bY as WithdrawalRequestStatus, bZ as WithdrawalRequestToChannelClosingTransactionsConnection, b_ as WithdrawalRequestToChannelOpeningTransactionsConnection, i as getApiTokenQuery, k as getAuditLogActorQuery, p as getChannelClosingTransactionQuery, s as getChannelOpeningTransactionQuery, u as getChannelSnapshotQuery, a4 as getDepositQuery, ab as getHopQuery, ai as getIncomingPaymentAttemptQuery, ao as getInvoiceQuery, aw as getLightningTransactionQuery, aA as getLightsparkNodeOwnerQuery, ay as getLightsparkNodeQuery, aI as getNodeQuery, aN as getOnChainTransactionQuery, b0 as getPaymentRequestQuery, bi as getRoutingTransactionQuery, by as getSignablePayloadQuery, bw as getSignableQuery, bC as getTransactionQuery, bI as getUmaInvitationQuery, bT as getWithdrawalQuery } from '../index-2b493387.js';
1
+ export { A as Account, a as AccountToApiTokensConnection, b as AccountToChannelsConnection, c as AccountToNodesConnection, d as AccountToPaymentRequestsConnection, e as AccountToTransactionsConnection, f as AccountToWalletsConnection, g as AccountToWithdrawalRequestsConnection, h as ApiToken, j as AuditLogActor, B as Balances, l as BlockchainBalance, C as CancelInvoiceInput, m as CancelInvoiceOutput, n as Channel, o as ChannelClosingTransaction, q as ChannelFees, r as ChannelOpeningTransaction, t as ChannelSnapshot, v as ChannelStatus, w as ChannelToTransactionsConnection, x as ClaimUmaInvitationInput, y as ClaimUmaInvitationOutput, z as ClaimUmaInvitationWithIncentivesInput, D as ClaimUmaInvitationWithIncentivesOutput, E as ComplianceProvider, F as Connection, G as CreateApiTokenInput, H as CreateApiTokenOutput, I as CreateInvitationWithIncentivesInput, J as CreateInvitationWithIncentivesOutput, K as CreateInvoiceInput, M as CreateInvoiceOutput, N as CreateLnurlInvoiceInput, O as CreateNodeWalletAddressInput, P as CreateNodeWalletAddressOutput, Q as CreateTestModeInvoiceInput, R as CreateTestModeInvoiceOutput, S as CreateTestModePaymentInput, T as CreateTestModePaymentoutput, U as CreateUmaInvitationInput, V as CreateUmaInvitationOutput, X as CreateUmaInvoiceInput, Y as CurrencyAmount, Z as CurrencyUnit, _ as DailyLiquidityForecast, $ as DeclineToSignMessagesInput, a0 as DeclineToSignMessagesOutput, a1 as DeleteApiTokenInput, a2 as DeleteApiTokenOutput, a3 as Deposit, a5 as Entity, a6 as FailHtlcsInput, a7 as FailHtlcsOutput, a8 as FeeEstimate, a9 as FundNodeInput, aa as FundNodeOutput, ab as GraphNode, ac as Hop, ae as HtlcAttemptFailureCode, af as IdAndSignature, ag as IncentivesIneligibilityReason, ah as IncentivesStatus, ai as IncomingPayment, aj as IncomingPaymentAttempt, al as IncomingPaymentAttemptStatus, am as IncomingPaymentToAttemptsConnection, an as IncomingPaymentsForInvoiceQueryInput, ao as IncomingPaymentsForInvoiceQueryOutput, ap as Invoice, ar as InvoiceData, as as InvoiceForPaymentHashInput, at as InvoiceForPaymentHashOutput, au as InvoiceType, av as LightningFeeEstimateForInvoiceInput, aw as LightningFeeEstimateForNodeInput, ax as LightningFeeEstimateOutput, ay as LightningPaymentDirection, az as LightningTransaction, aB as LightsparkNode, aD as LightsparkNodeOwner, aF as LightsparkNodeStatus, aG as LightsparkNodeToChannelsConnection, aH as LightsparkNodeToDailyLiquidityForecastsConnection, aI as LightsparkNodeWithOSK, aJ as LightsparkNodeWithRemoteSigning, aK as MultiSigAddressValidationParameters, aL as Node, aN as NodeAddress, aO as NodeAddressType, aP as NodeToAddressesConnection, aQ as OnChainFeeTarget, aR as OnChainTransaction, aT as OutgoingPayment, aU as OutgoingPaymentAttempt, aV as OutgoingPaymentAttemptStatus, aW as OutgoingPaymentAttemptToHopsConnection, aX as OutgoingPaymentForIdempotencyKeyInput, aY as OutgoingPaymentForIdempotencyKeyOutput, aZ as OutgoingPaymentToAttemptsConnection, a_ as OutgoingPaymentsForInvoiceQueryInput, a$ as OutgoingPaymentsForInvoiceQueryOutput, b0 as OutgoingPaymentsForPaymentHashQueryInput, b1 as OutgoingPaymentsForPaymentHashQueryOutput, b2 as PageInfo, b3 as PayInvoiceInput, b4 as PayInvoiceOutput, b5 as PayUmaInvoiceInput, b6 as PaymentDirection, b7 as PaymentFailureReason, b8 as PaymentRequest, ba as PaymentRequestData, bb as PaymentRequestStatus, bc as Permission, bd as PostTransactionData, be as RegionCode, bf as RegisterPaymentInput, bg as RegisterPaymentOutput, bh as ReleaseChannelPerCommitmentSecretInput, bi as ReleaseChannelPerCommitmentSecretOutput, bj as ReleasePaymentPreimageInput, bk as ReleasePaymentPreimageOutput, bl as RemoteSigningSubEventType, bm as RequestWithdrawalInput, bn as RequestWithdrawalOutput, bo as RichText, bp as RiskRating, bq as RoutingTransaction, bs as RoutingTransactionFailureReason, bt as ScreenNodeInput, bu as ScreenNodeOutput, bv as Secret, bw as SendPaymentInput, bx as SendPaymentOutput, by as SetInvoicePaymentHashInput, bz as SetInvoicePaymentHashOutput, bA as SignInvoiceInput, bB as SignInvoiceOutput, bC as SignMessagesInput, bD as SignMessagesOutput, bE as Signable, bG as SignablePayload, bI as SignablePayloadStatus, bJ as SingleNodeDashboard, bK as Transaction, bM as TransactionFailures, bN as TransactionStatus, bO as TransactionType, bP as TransactionUpdate, bQ as UmaInvitation, bS as UpdateChannelPerCommitmentPointInput, bT as UpdateChannelPerCommitmentPointOutput, bU as UpdateNodeSharedSecretInput, bV as UpdateNodeSharedSecretOutput, bW as Wallet, bX as WalletStatus, bY as WalletToPaymentRequestsConnection, bZ as WalletToTransactionsConnection, b_ as WalletToWithdrawalRequestsConnection, W as WebhookEventType, b$ as Withdrawal, c1 as WithdrawalFeeEstimateInput, c2 as WithdrawalFeeEstimateOutput, c3 as WithdrawalMode, c4 as WithdrawalRequest, c5 as WithdrawalRequestStatus, c6 as WithdrawalRequestToChannelClosingTransactionsConnection, c7 as WithdrawalRequestToChannelOpeningTransactionsConnection, c8 as WithdrawalRequestToWithdrawalsConnection, i as getApiTokenQuery, k as getAuditLogActorQuery, p as getChannelClosingTransactionQuery, s as getChannelOpeningTransactionQuery, u as getChannelSnapshotQuery, a4 as getDepositQuery, ad as getHopQuery, ak as getIncomingPaymentAttemptQuery, aq as getInvoiceQuery, aA as getLightningTransactionQuery, aE as getLightsparkNodeOwnerQuery, aC as getLightsparkNodeQuery, aM as getNodeQuery, aS as getOnChainTransactionQuery, b9 as getPaymentRequestQuery, br as getRoutingTransactionQuery, bH as getSignablePayloadQuery, bF as getSignableQuery, bL as getTransactionQuery, bR as getUmaInvitationQuery, c0 as getWithdrawalQuery } from '../index-145ff316.js';
2
2
  export { B as BitcoinNetwork } from '../BitcoinNetwork-4f6ea015.js';
3
3
  import '@lightsparkdev/core';
4
4
  import 'zen-observable';
@@ -1,4 +1,4 @@
1
- export { A as Account, a as AccountToApiTokensConnection, b as AccountToChannelsConnection, c as AccountToNodesConnection, d as AccountToPaymentRequestsConnection, e as AccountToTransactionsConnection, f as AccountToWalletsConnection, g as AccountToWithdrawalRequestsConnection, h as ApiToken, j as AuditLogActor, B as Balances, l as BlockchainBalance, C as CancelInvoiceInput, m as CancelInvoiceOutput, n as Channel, o as ChannelClosingTransaction, q as ChannelFees, r as ChannelOpeningTransaction, t as ChannelSnapshot, v as ChannelStatus, w as ChannelToTransactionsConnection, x as ClaimUmaInvitationInput, y as ClaimUmaInvitationOutput, z as ClaimUmaInvitationWithIncentivesInput, D as ClaimUmaInvitationWithIncentivesOutput, E as ComplianceProvider, F as Connection, G as CreateApiTokenInput, H as CreateApiTokenOutput, I as CreateInvitationWithIncentivesInput, J as CreateInvitationWithIncentivesOutput, K as CreateInvoiceInput, M as CreateInvoiceOutput, N as CreateLnurlInvoiceInput, O as CreateNodeWalletAddressInput, P as CreateNodeWalletAddressOutput, Q as CreateTestModeInvoiceInput, R as CreateTestModeInvoiceOutput, S as CreateTestModePaymentInput, T as CreateTestModePaymentoutput, U as CreateUmaInvitationInput, V as CreateUmaInvitationOutput, X as CreateUmaInvoiceInput, Y as CurrencyAmount, Z as CurrencyUnit, _ as DailyLiquidityForecast, $ as DeclineToSignMessagesInput, a0 as DeclineToSignMessagesOutput, a1 as DeleteApiTokenInput, a2 as DeleteApiTokenOutput, a3 as Deposit, a5 as Entity, a6 as FeeEstimate, a7 as FundNodeInput, a8 as FundNodeOutput, a9 as GraphNode, aa as Hop, ac as HtlcAttemptFailureCode, ad as IdAndSignature, ae as IncentivesIneligibilityReason, af as IncentivesStatus, ag as IncomingPayment, ah as IncomingPaymentAttempt, aj as IncomingPaymentAttemptStatus, ak as IncomingPaymentToAttemptsConnection, al as IncomingPaymentsForInvoiceQueryInput, am as IncomingPaymentsForInvoiceQueryOutput, an as Invoice, ap as InvoiceData, aq as InvoiceType, ar as LightningFeeEstimateForInvoiceInput, as as LightningFeeEstimateForNodeInput, at as LightningFeeEstimateOutput, au as LightningPaymentDirection, av as LightningTransaction, ax as LightsparkNode, az as LightsparkNodeOwner, aB as LightsparkNodeStatus, aC as LightsparkNodeToChannelsConnection, aD as LightsparkNodeToDailyLiquidityForecastsConnection, aE as LightsparkNodeWithOSK, aF as LightsparkNodeWithRemoteSigning, aG as MultiSigAddressValidationParameters, aH as Node, aJ as NodeAddress, aK as NodeAddressType, aL as NodeToAddressesConnection, aM as OnChainTransaction, aO as OutgoingPayment, aP as OutgoingPaymentAttempt, aQ as OutgoingPaymentAttemptStatus, aR as OutgoingPaymentAttemptToHopsConnection, aS as OutgoingPaymentToAttemptsConnection, aT as OutgoingPaymentsForInvoiceQueryInput, aU as OutgoingPaymentsForInvoiceQueryOutput, aV as PageInfo, aW as PayInvoiceInput, aX as PayInvoiceOutput, aY as PayUmaInvoiceInput, aZ as PaymentDirection, a_ as PaymentFailureReason, a$ as PaymentRequest, b1 as PaymentRequestData, b2 as PaymentRequestStatus, b3 as Permission, b4 as PostTransactionData, b5 as RegionCode, b6 as RegisterPaymentInput, b7 as RegisterPaymentOutput, b8 as ReleaseChannelPerCommitmentSecretInput, b9 as ReleaseChannelPerCommitmentSecretOutput, ba as ReleasePaymentPreimageInput, bb as ReleasePaymentPreimageOutput, bc as RemoteSigningSubEventType, bd as RequestWithdrawalInput, be as RequestWithdrawalOutput, bf as RichText, bg as RiskRating, bh as RoutingTransaction, bj as RoutingTransactionFailureReason, bk as ScreenNodeInput, bl as ScreenNodeOutput, bm as Secret, bn as SendPaymentInput, bo as SendPaymentOutput, bp as SetInvoicePaymentHashInput, bq as SetInvoicePaymentHashOutput, br as SignInvoiceInput, bs as SignInvoiceOutput, bt as SignMessagesInput, bu as SignMessagesOutput, bv as Signable, bx as SignablePayload, bz as SignablePayloadStatus, bA as SingleNodeDashboard, bB as Transaction, bD as TransactionFailures, bE as TransactionStatus, bF as TransactionType, bG as TransactionUpdate, bH as UmaInvitation, bJ as UpdateChannelPerCommitmentPointInput, bK as UpdateChannelPerCommitmentPointOutput, bL as UpdateNodeSharedSecretInput, bM as UpdateNodeSharedSecretOutput, bN as Wallet, bO as WalletStatus, bP as WalletToPaymentRequestsConnection, bQ as WalletToTransactionsConnection, bR as WalletToWithdrawalRequestsConnection, W as WebhookEventType, bS as Withdrawal, bU as WithdrawalFeeEstimateInput, bV as WithdrawalFeeEstimateOutput, bW as WithdrawalMode, bX as WithdrawalRequest, bY as WithdrawalRequestStatus, bZ as WithdrawalRequestToChannelClosingTransactionsConnection, b_ as WithdrawalRequestToChannelOpeningTransactionsConnection, i as getApiTokenQuery, k as getAuditLogActorQuery, p as getChannelClosingTransactionQuery, s as getChannelOpeningTransactionQuery, u as getChannelSnapshotQuery, a4 as getDepositQuery, ab as getHopQuery, ai as getIncomingPaymentAttemptQuery, ao as getInvoiceQuery, aw as getLightningTransactionQuery, aA as getLightsparkNodeOwnerQuery, ay as getLightsparkNodeQuery, aI as getNodeQuery, aN as getOnChainTransactionQuery, b0 as getPaymentRequestQuery, bi as getRoutingTransactionQuery, by as getSignablePayloadQuery, bw as getSignableQuery, bC as getTransactionQuery, bI as getUmaInvitationQuery, bT as getWithdrawalQuery } from '../index-2b493387.js';
1
+ export { A as Account, a as AccountToApiTokensConnection, b as AccountToChannelsConnection, c as AccountToNodesConnection, d as AccountToPaymentRequestsConnection, e as AccountToTransactionsConnection, f as AccountToWalletsConnection, g as AccountToWithdrawalRequestsConnection, h as ApiToken, j as AuditLogActor, B as Balances, l as BlockchainBalance, C as CancelInvoiceInput, m as CancelInvoiceOutput, n as Channel, o as ChannelClosingTransaction, q as ChannelFees, r as ChannelOpeningTransaction, t as ChannelSnapshot, v as ChannelStatus, w as ChannelToTransactionsConnection, x as ClaimUmaInvitationInput, y as ClaimUmaInvitationOutput, z as ClaimUmaInvitationWithIncentivesInput, D as ClaimUmaInvitationWithIncentivesOutput, E as ComplianceProvider, F as Connection, G as CreateApiTokenInput, H as CreateApiTokenOutput, I as CreateInvitationWithIncentivesInput, J as CreateInvitationWithIncentivesOutput, K as CreateInvoiceInput, M as CreateInvoiceOutput, N as CreateLnurlInvoiceInput, O as CreateNodeWalletAddressInput, P as CreateNodeWalletAddressOutput, Q as CreateTestModeInvoiceInput, R as CreateTestModeInvoiceOutput, S as CreateTestModePaymentInput, T as CreateTestModePaymentoutput, U as CreateUmaInvitationInput, V as CreateUmaInvitationOutput, X as CreateUmaInvoiceInput, Y as CurrencyAmount, Z as CurrencyUnit, _ as DailyLiquidityForecast, $ as DeclineToSignMessagesInput, a0 as DeclineToSignMessagesOutput, a1 as DeleteApiTokenInput, a2 as DeleteApiTokenOutput, a3 as Deposit, a5 as Entity, a6 as FailHtlcsInput, a7 as FailHtlcsOutput, a8 as FeeEstimate, a9 as FundNodeInput, aa as FundNodeOutput, ab as GraphNode, ac as Hop, ae as HtlcAttemptFailureCode, af as IdAndSignature, ag as IncentivesIneligibilityReason, ah as IncentivesStatus, ai as IncomingPayment, aj as IncomingPaymentAttempt, al as IncomingPaymentAttemptStatus, am as IncomingPaymentToAttemptsConnection, an as IncomingPaymentsForInvoiceQueryInput, ao as IncomingPaymentsForInvoiceQueryOutput, ap as Invoice, ar as InvoiceData, as as InvoiceForPaymentHashInput, at as InvoiceForPaymentHashOutput, au as InvoiceType, av as LightningFeeEstimateForInvoiceInput, aw as LightningFeeEstimateForNodeInput, ax as LightningFeeEstimateOutput, ay as LightningPaymentDirection, az as LightningTransaction, aB as LightsparkNode, aD as LightsparkNodeOwner, aF as LightsparkNodeStatus, aG as LightsparkNodeToChannelsConnection, aH as LightsparkNodeToDailyLiquidityForecastsConnection, aI as LightsparkNodeWithOSK, aJ as LightsparkNodeWithRemoteSigning, aK as MultiSigAddressValidationParameters, aL as Node, aN as NodeAddress, aO as NodeAddressType, aP as NodeToAddressesConnection, aQ as OnChainFeeTarget, aR as OnChainTransaction, aT as OutgoingPayment, aU as OutgoingPaymentAttempt, aV as OutgoingPaymentAttemptStatus, aW as OutgoingPaymentAttemptToHopsConnection, aX as OutgoingPaymentForIdempotencyKeyInput, aY as OutgoingPaymentForIdempotencyKeyOutput, aZ as OutgoingPaymentToAttemptsConnection, a_ as OutgoingPaymentsForInvoiceQueryInput, a$ as OutgoingPaymentsForInvoiceQueryOutput, b0 as OutgoingPaymentsForPaymentHashQueryInput, b1 as OutgoingPaymentsForPaymentHashQueryOutput, b2 as PageInfo, b3 as PayInvoiceInput, b4 as PayInvoiceOutput, b5 as PayUmaInvoiceInput, b6 as PaymentDirection, b7 as PaymentFailureReason, b8 as PaymentRequest, ba as PaymentRequestData, bb as PaymentRequestStatus, bc as Permission, bd as PostTransactionData, be as RegionCode, bf as RegisterPaymentInput, bg as RegisterPaymentOutput, bh as ReleaseChannelPerCommitmentSecretInput, bi as ReleaseChannelPerCommitmentSecretOutput, bj as ReleasePaymentPreimageInput, bk as ReleasePaymentPreimageOutput, bl as RemoteSigningSubEventType, bm as RequestWithdrawalInput, bn as RequestWithdrawalOutput, bo as RichText, bp as RiskRating, bq as RoutingTransaction, bs as RoutingTransactionFailureReason, bt as ScreenNodeInput, bu as ScreenNodeOutput, bv as Secret, bw as SendPaymentInput, bx as SendPaymentOutput, by as SetInvoicePaymentHashInput, bz as SetInvoicePaymentHashOutput, bA as SignInvoiceInput, bB as SignInvoiceOutput, bC as SignMessagesInput, bD as SignMessagesOutput, bE as Signable, bG as SignablePayload, bI as SignablePayloadStatus, bJ as SingleNodeDashboard, bK as Transaction, bM as TransactionFailures, bN as TransactionStatus, bO as TransactionType, bP as TransactionUpdate, bQ as UmaInvitation, bS as UpdateChannelPerCommitmentPointInput, bT as UpdateChannelPerCommitmentPointOutput, bU as UpdateNodeSharedSecretInput, bV as UpdateNodeSharedSecretOutput, bW as Wallet, bX as WalletStatus, bY as WalletToPaymentRequestsConnection, bZ as WalletToTransactionsConnection, b_ as WalletToWithdrawalRequestsConnection, W as WebhookEventType, b$ as Withdrawal, c1 as WithdrawalFeeEstimateInput, c2 as WithdrawalFeeEstimateOutput, c3 as WithdrawalMode, c4 as WithdrawalRequest, c5 as WithdrawalRequestStatus, c6 as WithdrawalRequestToChannelClosingTransactionsConnection, c7 as WithdrawalRequestToChannelOpeningTransactionsConnection, c8 as WithdrawalRequestToWithdrawalsConnection, i as getApiTokenQuery, k as getAuditLogActorQuery, p as getChannelClosingTransactionQuery, s as getChannelOpeningTransactionQuery, u as getChannelSnapshotQuery, a4 as getDepositQuery, ad as getHopQuery, ak as getIncomingPaymentAttemptQuery, aq as getInvoiceQuery, aA as getLightningTransactionQuery, aE as getLightsparkNodeOwnerQuery, aC as getLightsparkNodeQuery, aM as getNodeQuery, aS as getOnChainTransactionQuery, b9 as getPaymentRequestQuery, br as getRoutingTransactionQuery, bH as getSignablePayloadQuery, bF as getSignableQuery, bL as getTransactionQuery, bR as getUmaInvitationQuery, c0 as getWithdrawalQuery } from '../index-145ff316.js';
2
2
  export { B as BitcoinNetwork } from '../BitcoinNetwork-4f6ea015.js';
3
3
  import '@lightsparkdev/core';
4
4
  import 'zen-observable';
@@ -16,6 +16,7 @@ import {
16
16
  LightsparkNodeWithOSK_default,
17
17
  LightsparkNodeWithRemoteSigning_default,
18
18
  NodeAddressType_default,
19
+ OnChainFeeTarget_default,
19
20
  OutgoingPaymentAttemptStatus_default,
20
21
  OutgoingPaymentAttempt_default,
21
22
  OutgoingPayment_default,
@@ -57,7 +58,7 @@ import {
57
58
  getTransactionQuery,
58
59
  getUmaInvitationQuery,
59
60
  getWithdrawalQuery
60
- } from "../chunk-FGFVWCTL.js";
61
+ } from "../chunk-UHTZSOPX.js";
61
62
  import {
62
63
  BitcoinNetwork_default
63
64
  } from "../chunk-K6SAUSAX.js";
@@ -81,6 +82,7 @@ export {
81
82
  LightsparkNodeWithOSK_default as LightsparkNodeWithOSK,
82
83
  LightsparkNodeWithRemoteSigning_default as LightsparkNodeWithRemoteSigning,
83
84
  NodeAddressType_default as NodeAddressType,
85
+ OnChainFeeTarget_default as OnChainFeeTarget,
84
86
  OutgoingPayment_default as OutgoingPayment,
85
87
  OutgoingPaymentAttempt_default as OutgoingPaymentAttempt,
86
88
  OutgoingPaymentAttemptStatus_default as OutgoingPaymentAttemptStatus,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightsparkdev/lightspark-sdk",
3
- "version": "1.5.13",
3
+ "version": "1.6.0",
4
4
  "description": "Lightspark JS SDK",
5
5
  "author": "Lightspark Inc.",
6
6
  "keywords": [
@@ -86,7 +86,7 @@
86
86
  "license": "Apache-2.0",
87
87
  "dependencies": {
88
88
  "@lightsparkdev/core": "1.1.0",
89
- "@lightsparkdev/crypto-wasm": "0.1.3",
89
+ "@lightsparkdev/crypto-wasm": "0.1.4",
90
90
  "crypto-browserify": "^3.12.0",
91
91
  "dayjs": "^1.11.7",
92
92
  "dotenv": "^16.3.1",
package/src/client.ts CHANGED
@@ -43,10 +43,12 @@ import { DecodeInvoice } from "./graphql/DecodeInvoice.js";
43
43
  import { DeleteApiToken } from "./graphql/DeleteApiToken.js";
44
44
  import { FetchUmaInvitation } from "./graphql/FetchUmaInvitation.js";
45
45
  import { FundNode } from "./graphql/FundNode.js";
46
+ import { InvoiceForPaymentHash } from "./graphql/InvoiceForPaymentHash.js";
46
47
  import { LightningFeeEstimateForInvoice } from "./graphql/LightningFeeEstimateForInvoice.js";
47
48
  import { LightningFeeEstimateForNode } from "./graphql/LightningFeeEstimateForNode.js";
48
49
  import type { AccountDashboard } from "./graphql/MultiNodeDashboard.js";
49
50
  import { MultiNodeDashboard } from "./graphql/MultiNodeDashboard.js";
51
+ import { OutgoingPaymentsForPaymentHash } from "./graphql/OutgoingPaymentsForPaymentHash.js";
50
52
  import { PayInvoice } from "./graphql/PayInvoice.js";
51
53
  import { PayUmaInvoice } from "./graphql/PayUmaInvoice.js";
52
54
  import { PaymentRequestsForNode } from "./graphql/PaymentRequestsForNode.js";
@@ -1423,6 +1425,66 @@ class LightsparkClient {
1423
1425
  });
1424
1426
  }
1425
1427
 
1428
+ /**
1429
+ * Fetches a created invoice by its payment hash.
1430
+ *
1431
+ * @param paymentHash
1432
+ * @returns The invoice if there is one corresponding to the payment hash, or null if no invoice exists with that payment hash.
1433
+ */
1434
+ public async invoiceForPaymentHash(
1435
+ paymentHash: string,
1436
+ ): Promise<Invoice | null> {
1437
+ return await this.executeRawQuery({
1438
+ queryPayload: InvoiceForPaymentHash,
1439
+ variables: {
1440
+ payment_hash: paymentHash,
1441
+ },
1442
+ constructObject: (responseJson: {
1443
+ invoice_for_payment_hash: any; // eslint-disable-line @typescript-eslint/no-explicit-any
1444
+ }) => {
1445
+ if (
1446
+ !responseJson.invoice_for_payment_hash ||
1447
+ !responseJson.invoice_for_payment_hash.invoice
1448
+ ) {
1449
+ return null;
1450
+ }
1451
+ return InvoiceFromJson(responseJson.invoice_for_payment_hash.invoice);
1452
+ },
1453
+ });
1454
+ }
1455
+
1456
+ /**
1457
+ * Fetches outgoing payments for a given payment hash if there are any.
1458
+ *
1459
+ * @param paymentHash
1460
+ * @param statuses Filter to only include payments with the given statuses. If not provided, all statuses are included.
1461
+ */
1462
+ public async outgoingPaymentsForPaymentHash(
1463
+ paymentHash: string,
1464
+ statuses: TransactionStatus[] | undefined = undefined,
1465
+ ): Promise<OutgoingPayment[]> {
1466
+ return await this.executeRawQuery({
1467
+ queryPayload: OutgoingPaymentsForPaymentHash,
1468
+ variables: {
1469
+ payment_hash: paymentHash,
1470
+ statuses: statuses,
1471
+ },
1472
+ constructObject: (responseJson: {
1473
+ outgoing_payments_for_payment_hash: any; // eslint-disable-line @typescript-eslint/no-explicit-any
1474
+ }) => {
1475
+ if (
1476
+ !responseJson.outgoing_payments_for_payment_hash ||
1477
+ !responseJson.outgoing_payments_for_payment_hash.payments
1478
+ ) {
1479
+ return [];
1480
+ }
1481
+ return responseJson.outgoing_payments_for_payment_hash.payments.map(
1482
+ (payment) => OutgoingPaymentFromJson(payment),
1483
+ );
1484
+ },
1485
+ });
1486
+ }
1487
+
1426
1488
  private async hashPhoneNumber(e164PhoneNumber: string): Promise<string> {
1427
1489
  const e164PhoneRegex = /^\+[1-9]\d{1,14}$/;
1428
1490
  if (!e164PhoneRegex.test(e164PhoneNumber)) {
@@ -0,0 +1,17 @@
1
+ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
+
3
+ import { FRAGMENT as InvoiceFragment } from "../objects/Invoice.js";
4
+
5
+ export const InvoiceForPaymentHash = `
6
+ query InvoiceForPaymentHash($payment_hash: Hash32!) {
7
+ invoice_for_payment_hash(input: {
8
+ payment_hash: $payment_hash
9
+ }) {
10
+ invoice {
11
+ ...InvoiceFragment
12
+ }
13
+ }
14
+ }
15
+
16
+ ${InvoiceFragment}
17
+ `;
@@ -0,0 +1,21 @@
1
+ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
+
3
+ import { FRAGMENT as OutgoingPaymentFragment } from "../objects/OutgoingPayment.js";
4
+
5
+ export const OutgoingPaymentsForPaymentHash = `
6
+ query OutgoingPaymentsForPaymentHash(
7
+ $payment_hash: Hash32!
8
+ $statuses: [TransactionStatus!]
9
+ ) {
10
+ outgoing_payments_for_payment_hash(input: {
11
+ payment_hash: $payment_hash
12
+ statuses: $statuses
13
+ }) {
14
+ payments {
15
+ ...OutgoingPaymentFragment
16
+ }
17
+ }
18
+ }
19
+
20
+ ${OutgoingPaymentFragment}
21
+ `;
@@ -1251,6 +1251,7 @@ query FetchAccountToTransactionsConnection($first: Int, $after: String, $types:
1251
1251
  }
1252
1252
  outgoing_payment_payment_preimage: payment_preimage
1253
1253
  outgoing_payment_is_internal_payment: is_internal_payment
1254
+ outgoing_payment_idempotency_key: idempotency_key
1254
1255
  }
1255
1256
  ... on RoutingTransaction {
1256
1257
  __typename
@@ -1704,15 +1705,16 @@ query FetchAccountToPaymentRequestsConnection($first: Int, $after: String, $afte
1704
1705
  bitcoinNetworks: BitcoinNetwork[] | undefined = undefined,
1705
1706
  statuses: WithdrawalRequestStatus[] | undefined = undefined,
1706
1707
  nodeIds: string[] | undefined = undefined,
1708
+ idempotencyKeys: string[] | undefined = undefined,
1707
1709
  afterDate: string | undefined = undefined,
1708
1710
  beforeDate: string | undefined = undefined,
1709
1711
  ): Promise<AccountToWithdrawalRequestsConnection> {
1710
1712
  return (await client.executeRawQuery({
1711
1713
  queryPayload: `
1712
- query FetchAccountToWithdrawalRequestsConnection($first: Int, $after: String, $bitcoin_networks: [BitcoinNetwork!], $statuses: [WithdrawalRequestStatus!], $node_ids: [ID!], $after_date: DateTime, $before_date: DateTime) {
1714
+ query FetchAccountToWithdrawalRequestsConnection($first: Int, $after: String, $bitcoin_networks: [BitcoinNetwork!], $statuses: [WithdrawalRequestStatus!], $node_ids: [ID!], $idempotency_keys: [String!], $after_date: DateTime, $before_date: DateTime) {
1713
1715
  current_account {
1714
1716
  ... on Account {
1715
- withdrawal_requests(, first: $first, after: $after, bitcoin_networks: $bitcoin_networks, statuses: $statuses, node_ids: $node_ids, after_date: $after_date, before_date: $before_date) {
1717
+ withdrawal_requests(, first: $first, after: $after, bitcoin_networks: $bitcoin_networks, statuses: $statuses, node_ids: $node_ids, idempotency_keys: $idempotency_keys, after_date: $after_date, before_date: $before_date) {
1716
1718
  __typename
1717
1719
  account_to_withdrawal_requests_connection_count: count
1718
1720
  account_to_withdrawal_requests_connection_page_info: page_info {
@@ -1759,6 +1761,14 @@ query FetchAccountToWithdrawalRequestsConnection($first: Int, $after: String, $b
1759
1761
  currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
1760
1762
  currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
1761
1763
  }
1764
+ withdrawal_request_total_fees: total_fees {
1765
+ __typename
1766
+ currency_amount_original_value: original_value
1767
+ currency_amount_original_unit: original_unit
1768
+ currency_amount_preferred_currency_unit: preferred_currency_unit
1769
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
1770
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
1771
+ }
1762
1772
  withdrawal_request_bitcoin_address: bitcoin_address
1763
1773
  withdrawal_request_withdrawal_mode: withdrawal_mode
1764
1774
  withdrawal_request_status: status
@@ -1766,6 +1776,7 @@ query FetchAccountToWithdrawalRequestsConnection($first: Int, $after: String, $b
1766
1776
  withdrawal_request_withdrawal: withdrawal {
1767
1777
  id
1768
1778
  }
1779
+ withdrawal_request_idempotency_key: idempotency_key
1769
1780
  }
1770
1781
  }
1771
1782
  }
@@ -1778,6 +1789,7 @@ query FetchAccountToWithdrawalRequestsConnection($first: Int, $after: String, $b
1778
1789
  bitcoin_networks: bitcoinNetworks,
1779
1790
  statuses: statuses,
1780
1791
  node_ids: nodeIds,
1792
+ idempotency_keys: idempotencyKeys,
1781
1793
  after_date: afterDate,
1782
1794
  before_date: beforeDate,
1783
1795
  },
@@ -49,10 +49,7 @@ interface ChannelClosingTransaction {
49
49
  /** The hash of this transaction, so it can be uniquely identified on the Lightning Network. **/
50
50
  transactionHash?: string | undefined;
51
51
 
52
- /**
53
- * The fees that were paid by the wallet sending the transaction to commit it to the Bitcoin
54
- * blockchain.
55
- **/
52
+ /** The fees that were paid by the node for this transaction. **/
56
53
  fees?: CurrencyAmount | undefined;
57
54
 
58
55
  /**
@@ -49,10 +49,7 @@ interface ChannelOpeningTransaction {
49
49
  /** The hash of this transaction, so it can be uniquely identified on the Lightning Network. **/
50
50
  transactionHash?: string | undefined;
51
51
 
52
- /**
53
- * The fees that were paid by the wallet sending the transaction to commit it to the Bitcoin
54
- * blockchain.
55
- **/
52
+ /** The fees that were paid by the node for this transaction. **/
56
53
  fees?: CurrencyAmount | undefined;
57
54
 
58
55
  /**
@@ -10,6 +10,14 @@ import type AccountToWalletsConnection from "./AccountToWalletsConnection.js";
10
10
  import type AccountToWithdrawalRequestsConnection from "./AccountToWithdrawalRequestsConnection.js";
11
11
  import { ApiTokenFromJson, ApiTokenToJson } from "./ApiToken.js";
12
12
  import { ChannelFromJson } from "./Channel.js";
13
+ import {
14
+ ChannelClosingTransactionFromJson,
15
+ ChannelClosingTransactionToJson,
16
+ } from "./ChannelClosingTransaction.js";
17
+ import {
18
+ ChannelOpeningTransactionFromJson,
19
+ ChannelOpeningTransactionToJson,
20
+ } from "./ChannelOpeningTransaction.js";
13
21
  import {
14
22
  CurrencyAmountFromJson,
15
23
  CurrencyAmountToJson,
@@ -40,6 +48,8 @@ import type WalletToPaymentRequestsConnection from "./WalletToPaymentRequestsCon
40
48
  import type WalletToTransactionsConnection from "./WalletToTransactionsConnection.js";
41
49
  import type WalletToWithdrawalRequestsConnection from "./WalletToWithdrawalRequestsConnection.js";
42
50
  import { WithdrawalRequestFromJson } from "./WithdrawalRequest.js";
51
+ import type WithdrawalRequestToChannelClosingTransactionsConnection from "./WithdrawalRequestToChannelClosingTransactionsConnection.js";
52
+ import type WithdrawalRequestToChannelOpeningTransactionsConnection from "./WithdrawalRequestToChannelOpeningTransactionsConnection.js";
43
53
 
44
54
  interface Connection {
45
55
  /**
@@ -241,6 +251,46 @@ export const ConnectionFromJson = (obj: any): Connection => {
241
251
  typename: "WalletToWithdrawalRequestsConnection",
242
252
  } as WalletToWithdrawalRequestsConnection;
243
253
  }
254
+ if (
255
+ obj["__typename"] ==
256
+ "WithdrawalRequestToChannelClosingTransactionsConnection"
257
+ ) {
258
+ return {
259
+ count:
260
+ obj[
261
+ "withdrawal_request_to_channel_closing_transactions_connection_count"
262
+ ],
263
+ pageInfo: PageInfoFromJson(
264
+ obj[
265
+ "withdrawal_request_to_channel_closing_transactions_connection_page_info"
266
+ ],
267
+ ),
268
+ entities: obj[
269
+ "withdrawal_request_to_channel_closing_transactions_connection_entities"
270
+ ].map((e) => ChannelClosingTransactionFromJson(e)),
271
+ typename: "WithdrawalRequestToChannelClosingTransactionsConnection",
272
+ } as WithdrawalRequestToChannelClosingTransactionsConnection;
273
+ }
274
+ if (
275
+ obj["__typename"] ==
276
+ "WithdrawalRequestToChannelOpeningTransactionsConnection"
277
+ ) {
278
+ return {
279
+ count:
280
+ obj[
281
+ "withdrawal_request_to_channel_opening_transactions_connection_count"
282
+ ],
283
+ pageInfo: PageInfoFromJson(
284
+ obj[
285
+ "withdrawal_request_to_channel_opening_transactions_connection_page_info"
286
+ ],
287
+ ),
288
+ entities: obj[
289
+ "withdrawal_request_to_channel_opening_transactions_connection_entities"
290
+ ].map((e) => ChannelOpeningTransactionFromJson(e)),
291
+ typename: "WithdrawalRequestToChannelOpeningTransactionsConnection",
292
+ } as WithdrawalRequestToChannelOpeningTransactionsConnection;
293
+ }
244
294
  throw new LightsparkException(
245
295
  "DeserializationError",
246
296
  `Couldn't find a concrete type for interface Connection corresponding to the typename=${obj["__typename"]}`,
@@ -464,6 +514,44 @@ export const ConnectionToJson = (obj: Connection): any => {
464
514
  walletToWithdrawalRequestsConnection.entities.map((e) => e.toJson()),
465
515
  };
466
516
  }
517
+ if (
518
+ obj.typename == "WithdrawalRequestToChannelClosingTransactionsConnection"
519
+ ) {
520
+ const withdrawalRequestToChannelClosingTransactionsConnection =
521
+ obj as WithdrawalRequestToChannelClosingTransactionsConnection;
522
+ return {
523
+ __typename: "WithdrawalRequestToChannelClosingTransactionsConnection",
524
+ withdrawal_request_to_channel_closing_transactions_connection_count:
525
+ withdrawalRequestToChannelClosingTransactionsConnection.count,
526
+ withdrawal_request_to_channel_closing_transactions_connection_page_info:
527
+ PageInfoToJson(
528
+ withdrawalRequestToChannelClosingTransactionsConnection.pageInfo,
529
+ ),
530
+ withdrawal_request_to_channel_closing_transactions_connection_entities:
531
+ withdrawalRequestToChannelClosingTransactionsConnection.entities.map(
532
+ (e) => ChannelClosingTransactionToJson(e),
533
+ ),
534
+ };
535
+ }
536
+ if (
537
+ obj.typename == "WithdrawalRequestToChannelOpeningTransactionsConnection"
538
+ ) {
539
+ const withdrawalRequestToChannelOpeningTransactionsConnection =
540
+ obj as WithdrawalRequestToChannelOpeningTransactionsConnection;
541
+ return {
542
+ __typename: "WithdrawalRequestToChannelOpeningTransactionsConnection",
543
+ withdrawal_request_to_channel_opening_transactions_connection_count:
544
+ withdrawalRequestToChannelOpeningTransactionsConnection.count,
545
+ withdrawal_request_to_channel_opening_transactions_connection_page_info:
546
+ PageInfoToJson(
547
+ withdrawalRequestToChannelOpeningTransactionsConnection.pageInfo,
548
+ ),
549
+ withdrawal_request_to_channel_opening_transactions_connection_entities:
550
+ withdrawalRequestToChannelOpeningTransactionsConnection.entities.map(
551
+ (e) => ChannelOpeningTransactionToJson(e),
552
+ ),
553
+ };
554
+ }
467
555
  throw new LightsparkException(
468
556
  "DeserializationError",
469
557
  `Couldn't find a concrete type for interface Connection corresponding to the typename=${obj.typename}`,
@@ -693,6 +781,34 @@ fragment ConnectionFragment on Connection {
693
781
  id
694
782
  }
695
783
  }
784
+ ... on WithdrawalRequestToChannelClosingTransactionsConnection {
785
+ __typename
786
+ withdrawal_request_to_channel_closing_transactions_connection_count: count
787
+ withdrawal_request_to_channel_closing_transactions_connection_page_info: page_info {
788
+ __typename
789
+ page_info_has_next_page: has_next_page
790
+ page_info_has_previous_page: has_previous_page
791
+ page_info_start_cursor: start_cursor
792
+ page_info_end_cursor: end_cursor
793
+ }
794
+ withdrawal_request_to_channel_closing_transactions_connection_entities: entities {
795
+ id
796
+ }
797
+ }
798
+ ... on WithdrawalRequestToChannelOpeningTransactionsConnection {
799
+ __typename
800
+ withdrawal_request_to_channel_opening_transactions_connection_count: count
801
+ withdrawal_request_to_channel_opening_transactions_connection_page_info: page_info {
802
+ __typename
803
+ page_info_has_next_page: has_next_page
804
+ page_info_has_previous_page: has_previous_page
805
+ page_info_start_cursor: start_cursor
806
+ page_info_end_cursor: end_cursor
807
+ }
808
+ withdrawal_request_to_channel_opening_transactions_connection_entities: entities {
809
+ id
810
+ }
811
+ }
696
812
  }`;
697
813
 
698
814
  export default Connection;
@@ -53,10 +53,7 @@ interface Deposit {
53
53
  /** The hash of this transaction, so it can be uniquely identified on the Lightning Network. **/
54
54
  transactionHash?: string | undefined;
55
55
 
56
- /**
57
- * The fees that were paid by the wallet sending the transaction to commit it to the Bitcoin
58
- * blockchain.
59
- **/
56
+ /** The fees that were paid by the node for this transaction. **/
60
57
  fees?: CurrencyAmount | undefined;
61
58
 
62
59
  /**
@@ -1288,6 +1288,7 @@ fragment EntityFragment on Entity {
1288
1288
  }
1289
1289
  outgoing_payment_payment_preimage: payment_preimage
1290
1290
  outgoing_payment_is_internal_payment: is_internal_payment
1291
+ outgoing_payment_idempotency_key: idempotency_key
1291
1292
  }
1292
1293
  ... on OutgoingPaymentAttempt {
1293
1294
  __typename
@@ -1498,6 +1499,14 @@ fragment EntityFragment on Entity {
1498
1499
  currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
1499
1500
  currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
1500
1501
  }
1502
+ withdrawal_request_total_fees: total_fees {
1503
+ __typename
1504
+ currency_amount_original_value: original_value
1505
+ currency_amount_original_unit: original_unit
1506
+ currency_amount_preferred_currency_unit: preferred_currency_unit
1507
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
1508
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
1509
+ }
1501
1510
  withdrawal_request_bitcoin_address: bitcoin_address
1502
1511
  withdrawal_request_withdrawal_mode: withdrawal_mode
1503
1512
  withdrawal_request_status: status
@@ -1505,6 +1514,7 @@ fragment EntityFragment on Entity {
1505
1514
  withdrawal_request_withdrawal: withdrawal {
1506
1515
  id
1507
1516
  }
1517
+ withdrawal_request_idempotency_key: idempotency_key
1508
1518
  }
1509
1519
  }`;
1510
1520
 
@@ -0,0 +1,27 @@
1
+ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
+
3
+ interface FailHtlcsInput {
4
+ /** The id of invoice which the pending HTLCs that need to be failed are paying for. **/
5
+ invoiceId: string;
6
+
7
+ /**
8
+ * Whether the invoice needs to be canceled after failing the htlcs. If yes, the invoice cannot
9
+ * be paid anymore.
10
+ **/
11
+ cancelInvoice: boolean;
12
+ }
13
+
14
+ export const FailHtlcsInputFromJson = (obj: any): FailHtlcsInput => {
15
+ return {
16
+ invoiceId: obj["fail_htlcs_input_invoice_id"],
17
+ cancelInvoice: obj["fail_htlcs_input_cancel_invoice"],
18
+ } as FailHtlcsInput;
19
+ };
20
+ export const FailHtlcsInputToJson = (obj: FailHtlcsInput): any => {
21
+ return {
22
+ fail_htlcs_input_invoice_id: obj.invoiceId,
23
+ fail_htlcs_input_cancel_invoice: obj.cancelInvoice,
24
+ };
25
+ };
26
+
27
+ export default FailHtlcsInput;
@@ -0,0 +1,26 @@
1
+ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
+
3
+ interface FailHtlcsOutput {
4
+ invoiceId: string;
5
+ }
6
+
7
+ export const FailHtlcsOutputFromJson = (obj: any): FailHtlcsOutput => {
8
+ return {
9
+ invoiceId: obj["fail_htlcs_output_invoice"].id,
10
+ } as FailHtlcsOutput;
11
+ };
12
+ export const FailHtlcsOutputToJson = (obj: FailHtlcsOutput): any => {
13
+ return {
14
+ fail_htlcs_output_invoice: { id: obj.invoiceId },
15
+ };
16
+ };
17
+
18
+ export const FRAGMENT = `
19
+ fragment FailHtlcsOutputFragment on FailHtlcsOutput {
20
+ __typename
21
+ fail_htlcs_output_invoice: invoice {
22
+ id
23
+ }
24
+ }`;
25
+
26
+ export default FailHtlcsOutput;
@@ -0,0 +1,23 @@
1
+ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
+
3
+ interface InvoiceForPaymentHashInput {
4
+ /** The 32-byte hash of the payment preimage for which to fetch an invoice. **/
5
+ paymentHash: string;
6
+ }
7
+
8
+ export const InvoiceForPaymentHashInputFromJson = (
9
+ obj: any,
10
+ ): InvoiceForPaymentHashInput => {
11
+ return {
12
+ paymentHash: obj["invoice_for_payment_hash_input_payment_hash"],
13
+ } as InvoiceForPaymentHashInput;
14
+ };
15
+ export const InvoiceForPaymentHashInputToJson = (
16
+ obj: InvoiceForPaymentHashInput,
17
+ ): any => {
18
+ return {
19
+ invoice_for_payment_hash_input_payment_hash: obj.paymentHash,
20
+ };
21
+ };
22
+
23
+ export default InvoiceForPaymentHashInput;
@@ -0,0 +1,30 @@
1
+ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
+
3
+ interface InvoiceForPaymentHashOutput {
4
+ invoiceId?: string | undefined;
5
+ }
6
+
7
+ export const InvoiceForPaymentHashOutputFromJson = (
8
+ obj: any,
9
+ ): InvoiceForPaymentHashOutput => {
10
+ return {
11
+ invoiceId: obj["invoice_for_payment_hash_output_invoice"]?.id ?? undefined,
12
+ } as InvoiceForPaymentHashOutput;
13
+ };
14
+ export const InvoiceForPaymentHashOutputToJson = (
15
+ obj: InvoiceForPaymentHashOutput,
16
+ ): any => {
17
+ return {
18
+ invoice_for_payment_hash_output_invoice: { id: obj.invoiceId } ?? undefined,
19
+ };
20
+ };
21
+
22
+ export const FRAGMENT = `
23
+ fragment InvoiceForPaymentHashOutputFragment on InvoiceForPaymentHashOutput {
24
+ __typename
25
+ invoice_for_payment_hash_output_invoice: invoice {
26
+ id
27
+ }
28
+ }`;
29
+
30
+ export default InvoiceForPaymentHashOutput;
@@ -113,6 +113,7 @@ export const LightningTransactionFromJson = (
113
113
  PostTransactionDataFromJson(e),
114
114
  ),
115
115
  obj["outgoing_payment_payment_preimage"],
116
+ obj["outgoing_payment_idempotency_key"],
116
117
  );
117
118
  }
118
119
  if (obj["__typename"] == "RoutingTransaction") {
@@ -203,6 +204,7 @@ export const LightningTransactionToJson = (obj: LightningTransaction): any => {
203
204
  ),
204
205
  outgoing_payment_payment_preimage: outgoingPayment.paymentPreimage,
205
206
  outgoing_payment_is_internal_payment: outgoingPayment.isInternalPayment,
207
+ outgoing_payment_idempotency_key: outgoingPayment.idempotencyKey,
206
208
  };
207
209
  }
208
210
  if (obj.typename == "RoutingTransaction") {
@@ -621,6 +623,7 @@ fragment LightningTransactionFragment on LightningTransaction {
621
623
  }
622
624
  outgoing_payment_payment_preimage: payment_preimage
623
625
  outgoing_payment_is_internal_payment: is_internal_payment
626
+ outgoing_payment_idempotency_key: idempotency_key
624
627
  }
625
628
  ... on RoutingTransaction {
626
629
  __typename
@@ -142,8 +142,10 @@ interface LightsparkNode {
142
142
  getChannels(
143
143
  client: LightsparkClient,
144
144
  first?: number | undefined,
145
- statuses?: ChannelStatus[] | undefined,
146
145
  after?: string | undefined,
146
+ beforeDate?: string | undefined,
147
+ afterDate?: string | undefined,
148
+ statuses?: ChannelStatus[] | undefined,
147
149
  ): Promise<LightsparkNodeToChannelsConnection>;
148
150
 
149
151
  getDailyLiquidityForecasts(