@lightsparkdev/lightspark-sdk 1.3.1 → 1.5.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 (92) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/{BitcoinNetwork-972b1d01.d.ts → BitcoinNetwork-4f6ea015.d.ts} +2 -2
  3. package/dist/{chunk-Y55D3PD4.js → chunk-ENYS5WAU.js} +712 -476
  4. package/dist/env.d.cts +1 -1
  5. package/dist/env.d.ts +1 -1
  6. package/dist/{index-a5028d74.d.ts → index-f100aa27.d.ts} +726 -702
  7. package/dist/index.cjs +402 -24
  8. package/dist/index.d.cts +3 -3
  9. package/dist/index.d.ts +3 -3
  10. package/dist/index.js +148 -2
  11. package/dist/objects/index.cjs +1339 -1126
  12. package/dist/objects/index.d.cts +2 -2
  13. package/dist/objects/index.d.ts +2 -2
  14. package/dist/objects/index.js +1 -1
  15. package/package.json +1 -1
  16. package/src/client.ts +121 -1
  17. package/src/graphql/RegisterPayment.ts +21 -0
  18. package/src/graphql/ScreenNode.ts +15 -0
  19. package/src/graphql/WithdrawalFeeEstimate.ts +21 -0
  20. package/src/objects/Account.ts +98 -5
  21. package/src/objects/AccountToApiTokensConnection.ts +2 -3
  22. package/src/objects/AccountToChannelsConnection.ts +2 -3
  23. package/src/objects/AccountToNodesConnection.ts +2 -3
  24. package/src/objects/AccountToPaymentRequestsConnection.ts +2 -3
  25. package/src/objects/AccountToTransactionsConnection.ts +6 -7
  26. package/src/objects/AccountToWalletsConnection.ts +2 -3
  27. package/src/objects/AccountToWithdrawalRequestsConnection.ts +71 -0
  28. package/src/objects/ApiToken.ts +5 -6
  29. package/src/objects/Balances.ts +9 -12
  30. package/src/objects/BitcoinNetwork.ts +2 -2
  31. package/src/objects/Channel.ts +7 -10
  32. package/src/objects/ChannelClosingTransaction.ts +3 -4
  33. package/src/objects/ChannelOpeningTransaction.ts +3 -4
  34. package/src/objects/ChannelStatus.ts +5 -9
  35. package/src/objects/ChannelToTransactionsConnection.ts +6 -7
  36. package/src/objects/Connection.ts +85 -3
  37. package/src/objects/CreateApiTokenOutput.ts +3 -3
  38. package/src/objects/CreateLnurlInvoiceInput.ts +2 -3
  39. package/src/objects/CreateTestModePaymentInput.ts +2 -2
  40. package/src/objects/CreateTestModePaymentoutput.ts +2 -3
  41. package/src/objects/CurrencyUnit.ts +11 -17
  42. package/src/objects/Deposit.ts +5 -6
  43. package/src/objects/Entity.ts +21 -6
  44. package/src/objects/FeeEstimate.ts +2 -3
  45. package/src/objects/GraphNode.ts +10 -12
  46. package/src/objects/Hop.ts +5 -6
  47. package/src/objects/IncentivesStatus.ts +2 -3
  48. package/src/objects/IncomingPayment.ts +7 -7
  49. package/src/objects/IncomingPaymentAttempt.ts +2 -2
  50. package/src/objects/IncomingPaymentToAttemptsConnection.ts +2 -3
  51. package/src/objects/Invoice.ts +2 -2
  52. package/src/objects/InvoiceData.ts +4 -5
  53. package/src/objects/LightningTransaction.ts +5 -5
  54. package/src/objects/LightsparkNode.ts +8 -10
  55. package/src/objects/LightsparkNodeOwner.ts +2 -2
  56. package/src/objects/LightsparkNodeToChannelsConnection.ts +2 -3
  57. package/src/objects/LightsparkNodeWithOSK.ts +7 -8
  58. package/src/objects/LightsparkNodeWithRemoteSigning.ts +7 -8
  59. package/src/objects/Node.ts +9 -11
  60. package/src/objects/NodeToAddressesConnection.ts +2 -3
  61. package/src/objects/OnChainTransaction.ts +5 -6
  62. package/src/objects/OutgoingPayment.ts +5 -6
  63. package/src/objects/OutgoingPaymentAttempt.ts +12 -14
  64. package/src/objects/OutgoingPaymentAttemptToHopsConnection.ts +2 -3
  65. package/src/objects/OutgoingPaymentToAttemptsConnection.ts +2 -3
  66. package/src/objects/PageInfo.ts +3 -3
  67. package/src/objects/PaymentRequest.ts +2 -2
  68. package/src/objects/PaymentRequestData.ts +1 -2
  69. package/src/objects/RegisterPaymentInput.ts +7 -8
  70. package/src/objects/RequestWithdrawalInput.ts +2 -2
  71. package/src/objects/RiskRating.ts +1 -2
  72. package/src/objects/RoutingTransaction.ts +6 -8
  73. package/src/objects/ScreenNodeInput.ts +2 -3
  74. package/src/objects/SetInvoicePaymentHashInput.ts +2 -3
  75. package/src/objects/Signable.ts +2 -2
  76. package/src/objects/SignablePayload.ts +2 -2
  77. package/src/objects/Transaction.ts +3 -4
  78. package/src/objects/TransactionStatus.ts +1 -2
  79. package/src/objects/UmaInvitation.ts +2 -2
  80. package/src/objects/Wallet.ts +97 -8
  81. package/src/objects/WalletStatus.ts +5 -7
  82. package/src/objects/WalletToPaymentRequestsConnection.ts +2 -3
  83. package/src/objects/WalletToTransactionsConnection.ts +2 -3
  84. package/src/objects/WalletToWithdrawalRequestsConnection.ts +70 -0
  85. package/src/objects/Withdrawal.ts +5 -5
  86. package/src/objects/WithdrawalFeeEstimateInput.ts +40 -0
  87. package/src/objects/WithdrawalFeeEstimateOutput.ts +46 -0
  88. package/src/objects/WithdrawalRequest.ts +43 -7
  89. package/src/objects/WithdrawalRequestToChannelClosingTransactionsConnection.ts +2 -3
  90. package/src/objects/WithdrawalRequestToChannelOpeningTransactionsConnection.ts +2 -3
  91. package/src/objects/index.ts +4 -0
  92. package/src/tests/integration/general-regtest.test.ts +9 -0
package/dist/index.d.cts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { AuthProvider } from '@lightsparkdev/core';
2
- import { W as WebhookEventType, L as LightsparkClient } from './index-a5028d74.js';
3
- export { A as Account, a as AccountToApiTokensConnection, b as AccountToChannelsConnection, c as AccountToNodesConnection, d as AccountToPaymentRequestsConnection, e as AccountToTransactionsConnection, f as AccountToWalletsConnection, g as ApiToken, B as Balances, i as BlockchainBalance, C as CancelInvoiceInput, j as CancelInvoiceOutput, k as Channel, l as ChannelClosingTransaction, n as ChannelFees, o as ChannelOpeningTransaction, q as ChannelSnapshot, r as ChannelStatus, s as ChannelToTransactionsConnection, t as ClaimUmaInvitationInput, u as ClaimUmaInvitationOutput, v as ClaimUmaInvitationWithIncentivesInput, w as ClaimUmaInvitationWithIncentivesOutput, x as ComplianceProvider, y as Connection, z as CreateApiTokenInput, D as CreateApiTokenOutput, E as CreateInvitationWithIncentivesInput, F as CreateInvitationWithIncentivesOutput, G as CreateInvoiceInput, H as CreateInvoiceOutput, I as CreateLnurlInvoiceInput, J as CreateNodeWalletAddressInput, K as CreateNodeWalletAddressOutput, M as CreateTestModeInvoiceInput, N as CreateTestModeInvoiceOutput, O as CreateTestModePaymentInput, P as CreateTestModePaymentoutput, Q as CreateUmaInvitationInput, R as CreateUmaInvitationOutput, S as CreateUmaInvoiceInput, T as CurrencyAmount, U as CurrencyUnit, V as DeclineToSignMessagesInput, X as DeclineToSignMessagesOutput, Y as DeleteApiTokenInput, Z as DeleteApiTokenOutput, _ as Deposit, a0 as Entity, a1 as FeeEstimate, a2 as FundNodeInput, a3 as FundNodeOutput, a4 as GraphNode, a5 as Hop, a7 as HtlcAttemptFailureCode, a8 as IdAndSignature, a9 as IncentivesIneligibilityReason, aa as IncentivesStatus, ab as IncomingPayment, ac as IncomingPaymentAttempt, ae as IncomingPaymentAttemptStatus, af as IncomingPaymentToAttemptsConnection, ag as Invoice, ai as InvoiceData, aj as InvoiceType, ak as LightningFeeEstimateForInvoiceInput, al as LightningFeeEstimateForNodeInput, am as LightningFeeEstimateOutput, an as LightningTransaction, ap as LightsparkNode, ar as LightsparkNodeOwner, at as LightsparkNodeStatus, au as LightsparkNodeToChannelsConnection, av as LightsparkNodeWithOSK, aw as LightsparkNodeWithRemoteSigning, ax as Node, az as NodeAddress, aA as NodeAddressType, aB as NodeToAddressesConnection, aC as OnChainTransaction, aE as OutgoingPayment, aF as OutgoingPaymentAttempt, aG as OutgoingPaymentAttemptStatus, aH as OutgoingPaymentAttemptToHopsConnection, aI as OutgoingPaymentToAttemptsConnection, aJ as OutgoingPaymentsForInvoiceQueryInput, aK as OutgoingPaymentsForInvoiceQueryOutput, aL as PageInfo, aM as PayInvoiceInput, aN as PayInvoiceOutput, aO as PayUmaInvoiceInput, aP as PaymentDirection, aQ as PaymentFailureReason, aR as PaymentRequest, aT as PaymentRequestData, aU as PaymentRequestStatus, aV as Permission, aW as PostTransactionData, aX as RegionCode, aY as RegisterPaymentInput, aZ as RegisterPaymentOutput, a_ as ReleaseChannelPerCommitmentSecretInput, a$ as ReleaseChannelPerCommitmentSecretOutput, b0 as ReleasePaymentPreimageInput, b1 as ReleasePaymentPreimageOutput, b2 as RemoteSigningSubEventType, b3 as RequestWithdrawalInput, b4 as RequestWithdrawalOutput, b5 as RichText, b6 as RiskRating, b7 as RoutingTransaction, b9 as RoutingTransactionFailureReason, ba as ScreenNodeInput, bb as ScreenNodeOutput, bc as Secret, bd as SendPaymentInput, be as SendPaymentOutput, bf as SetInvoicePaymentHashInput, bg as SetInvoicePaymentHashOutput, bh as SignInvoiceInput, bi as SignInvoiceOutput, bj as SignMessagesInput, bk as SignMessagesOutput, bl as Signable, bn as SignablePayload, bp as SignablePayloadStatus, bq as SingleNodeDashboard, br as Transaction, bt as TransactionFailures, bu as TransactionStatus, bv as TransactionType, bw as TransactionUpdate, bx as UmaInvitation, bz as UpdateChannelPerCommitmentPointInput, bA as UpdateChannelPerCommitmentPointOutput, bB as UpdateNodeSharedSecretInput, bC as UpdateNodeSharedSecretOutput, bD as Wallet, bE as WalletStatus, bF as WalletToPaymentRequestsConnection, bG as WalletToTransactionsConnection, bH as Withdrawal, bJ as WithdrawalMode, bK as WithdrawalRequest, bL as WithdrawalRequestStatus, bM as WithdrawalRequestToChannelClosingTransactionsConnection, bN as WithdrawalRequestToChannelOpeningTransactionsConnection, h as getApiTokenQuery, m as getChannelClosingTransactionQuery, p as getChannelOpeningTransactionQuery, $ as getDepositQuery, a6 as getHopQuery, ad as getIncomingPaymentAttemptQuery, ah as getInvoiceQuery, ao as getLightningTransactionQuery, as as getLightsparkNodeOwnerQuery, aq as getLightsparkNodeQuery, ay as getNodeQuery, aD as getOnChainTransactionQuery, aS as getPaymentRequestQuery, b8 as getRoutingTransactionQuery, bo as getSignablePayloadQuery, bm as getSignableQuery, bs as getTransactionQuery, by as getUmaInvitationQuery, bI as getWithdrawalQuery } from './index-a5028d74.js';
4
- import { B as BitcoinNetwork } from './BitcoinNetwork-972b1d01.js';
2
+ import { W as WebhookEventType, L as LightsparkClient } from './index-f100aa27.js';
3
+ export { A as Account, a as AccountToApiTokensConnection, b as AccountToChannelsConnection, c as AccountToNodesConnection, d as AccountToPaymentRequestsConnection, e as AccountToTransactionsConnection, f as AccountToWalletsConnection, g as AccountToWithdrawalRequestsConnection, h as ApiToken, B as Balances, j as BlockchainBalance, C as CancelInvoiceInput, k as CancelInvoiceOutput, l as Channel, m as ChannelClosingTransaction, o as ChannelFees, p as ChannelOpeningTransaction, r as ChannelSnapshot, s as ChannelStatus, t as ChannelToTransactionsConnection, u as ClaimUmaInvitationInput, v as ClaimUmaInvitationOutput, w as ClaimUmaInvitationWithIncentivesInput, x as ClaimUmaInvitationWithIncentivesOutput, y as ComplianceProvider, z as Connection, D as CreateApiTokenInput, E as CreateApiTokenOutput, F as CreateInvitationWithIncentivesInput, G as CreateInvitationWithIncentivesOutput, H as CreateInvoiceInput, I as CreateInvoiceOutput, J as CreateLnurlInvoiceInput, K as CreateNodeWalletAddressInput, M as CreateNodeWalletAddressOutput, N as CreateTestModeInvoiceInput, O as CreateTestModeInvoiceOutput, P as CreateTestModePaymentInput, Q as CreateTestModePaymentoutput, R as CreateUmaInvitationInput, S as CreateUmaInvitationOutput, T as CreateUmaInvoiceInput, U as CurrencyAmount, V as CurrencyUnit, X as DeclineToSignMessagesInput, Y as DeclineToSignMessagesOutput, Z as DeleteApiTokenInput, _ as DeleteApiTokenOutput, $ as Deposit, a1 as Entity, a2 as FeeEstimate, a3 as FundNodeInput, a4 as FundNodeOutput, a5 as GraphNode, a6 as Hop, a8 as HtlcAttemptFailureCode, a9 as IdAndSignature, aa as IncentivesIneligibilityReason, ab as IncentivesStatus, ac as IncomingPayment, ad as IncomingPaymentAttempt, af as IncomingPaymentAttemptStatus, ag as IncomingPaymentToAttemptsConnection, ah as Invoice, aj as InvoiceData, ak as InvoiceType, al as LightningFeeEstimateForInvoiceInput, am as LightningFeeEstimateForNodeInput, an as LightningFeeEstimateOutput, ao as LightningTransaction, aq as LightsparkNode, as as LightsparkNodeOwner, au as LightsparkNodeStatus, av as LightsparkNodeToChannelsConnection, aw as LightsparkNodeWithOSK, ax as LightsparkNodeWithRemoteSigning, ay as Node, aA as NodeAddress, aB as NodeAddressType, aC as NodeToAddressesConnection, aD as OnChainTransaction, aF as OutgoingPayment, aG as OutgoingPaymentAttempt, aH as OutgoingPaymentAttemptStatus, aI as OutgoingPaymentAttemptToHopsConnection, aJ as OutgoingPaymentToAttemptsConnection, aK as OutgoingPaymentsForInvoiceQueryInput, aL as OutgoingPaymentsForInvoiceQueryOutput, aM as PageInfo, aN as PayInvoiceInput, aO as PayInvoiceOutput, aP as PayUmaInvoiceInput, aQ as PaymentDirection, aR as PaymentFailureReason, aS as PaymentRequest, aU as PaymentRequestData, aV as PaymentRequestStatus, aW as Permission, aX as PostTransactionData, aY as RegionCode, aZ as RegisterPaymentInput, a_ as RegisterPaymentOutput, a$ as ReleaseChannelPerCommitmentSecretInput, b0 as ReleaseChannelPerCommitmentSecretOutput, b1 as ReleasePaymentPreimageInput, b2 as ReleasePaymentPreimageOutput, b3 as RemoteSigningSubEventType, b4 as RequestWithdrawalInput, b5 as RequestWithdrawalOutput, b6 as RichText, b7 as RiskRating, b8 as RoutingTransaction, ba as RoutingTransactionFailureReason, bb as ScreenNodeInput, bc as ScreenNodeOutput, bd as Secret, be as SendPaymentInput, bf as SendPaymentOutput, bg as SetInvoicePaymentHashInput, bh as SetInvoicePaymentHashOutput, bi as SignInvoiceInput, bj as SignInvoiceOutput, bk as SignMessagesInput, bl as SignMessagesOutput, bm as Signable, bo as SignablePayload, bq as SignablePayloadStatus, br as SingleNodeDashboard, bs as Transaction, bu as TransactionFailures, bv as TransactionStatus, bw as TransactionType, bx as TransactionUpdate, by as UmaInvitation, bA as UpdateChannelPerCommitmentPointInput, bB as UpdateChannelPerCommitmentPointOutput, bC as UpdateNodeSharedSecretInput, bD as UpdateNodeSharedSecretOutput, bE as Wallet, bF as WalletStatus, bG as WalletToPaymentRequestsConnection, bH as WalletToTransactionsConnection, bI as WalletToWithdrawalRequestsConnection, bJ as Withdrawal, bL as WithdrawalFeeEstimateInput, bM as WithdrawalFeeEstimateOutput, bN as WithdrawalMode, bO as WithdrawalRequest, bP as WithdrawalRequestStatus, bQ as WithdrawalRequestToChannelClosingTransactionsConnection, bR as WithdrawalRequestToChannelOpeningTransactionsConnection, i as getApiTokenQuery, n as getChannelClosingTransactionQuery, q as getChannelOpeningTransactionQuery, a0 as getDepositQuery, a7 as getHopQuery, ae as getIncomingPaymentAttemptQuery, ai as getInvoiceQuery, ap as getLightningTransactionQuery, at as getLightsparkNodeOwnerQuery, ar as getLightsparkNodeQuery, az as getNodeQuery, aE as getOnChainTransactionQuery, aT as getPaymentRequestQuery, b9 as getRoutingTransactionQuery, bp as getSignablePayloadQuery, bn as getSignableQuery, bt as getTransactionQuery, bz as getUmaInvitationQuery, bK as getWithdrawalQuery } from './index-f100aa27.js';
4
+ import { B as BitcoinNetwork } from './BitcoinNetwork-4f6ea015.js';
5
5
  import 'zen-observable';
6
6
 
7
7
  declare class AccountTokenAuthProvider implements AuthProvider {
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { AuthProvider } from '@lightsparkdev/core';
2
- import { W as WebhookEventType, L as LightsparkClient } from './index-a5028d74.js';
3
- export { A as Account, a as AccountToApiTokensConnection, b as AccountToChannelsConnection, c as AccountToNodesConnection, d as AccountToPaymentRequestsConnection, e as AccountToTransactionsConnection, f as AccountToWalletsConnection, g as ApiToken, B as Balances, i as BlockchainBalance, C as CancelInvoiceInput, j as CancelInvoiceOutput, k as Channel, l as ChannelClosingTransaction, n as ChannelFees, o as ChannelOpeningTransaction, q as ChannelSnapshot, r as ChannelStatus, s as ChannelToTransactionsConnection, t as ClaimUmaInvitationInput, u as ClaimUmaInvitationOutput, v as ClaimUmaInvitationWithIncentivesInput, w as ClaimUmaInvitationWithIncentivesOutput, x as ComplianceProvider, y as Connection, z as CreateApiTokenInput, D as CreateApiTokenOutput, E as CreateInvitationWithIncentivesInput, F as CreateInvitationWithIncentivesOutput, G as CreateInvoiceInput, H as CreateInvoiceOutput, I as CreateLnurlInvoiceInput, J as CreateNodeWalletAddressInput, K as CreateNodeWalletAddressOutput, M as CreateTestModeInvoiceInput, N as CreateTestModeInvoiceOutput, O as CreateTestModePaymentInput, P as CreateTestModePaymentoutput, Q as CreateUmaInvitationInput, R as CreateUmaInvitationOutput, S as CreateUmaInvoiceInput, T as CurrencyAmount, U as CurrencyUnit, V as DeclineToSignMessagesInput, X as DeclineToSignMessagesOutput, Y as DeleteApiTokenInput, Z as DeleteApiTokenOutput, _ as Deposit, a0 as Entity, a1 as FeeEstimate, a2 as FundNodeInput, a3 as FundNodeOutput, a4 as GraphNode, a5 as Hop, a7 as HtlcAttemptFailureCode, a8 as IdAndSignature, a9 as IncentivesIneligibilityReason, aa as IncentivesStatus, ab as IncomingPayment, ac as IncomingPaymentAttempt, ae as IncomingPaymentAttemptStatus, af as IncomingPaymentToAttemptsConnection, ag as Invoice, ai as InvoiceData, aj as InvoiceType, ak as LightningFeeEstimateForInvoiceInput, al as LightningFeeEstimateForNodeInput, am as LightningFeeEstimateOutput, an as LightningTransaction, ap as LightsparkNode, ar as LightsparkNodeOwner, at as LightsparkNodeStatus, au as LightsparkNodeToChannelsConnection, av as LightsparkNodeWithOSK, aw as LightsparkNodeWithRemoteSigning, ax as Node, az as NodeAddress, aA as NodeAddressType, aB as NodeToAddressesConnection, aC as OnChainTransaction, aE as OutgoingPayment, aF as OutgoingPaymentAttempt, aG as OutgoingPaymentAttemptStatus, aH as OutgoingPaymentAttemptToHopsConnection, aI as OutgoingPaymentToAttemptsConnection, aJ as OutgoingPaymentsForInvoiceQueryInput, aK as OutgoingPaymentsForInvoiceQueryOutput, aL as PageInfo, aM as PayInvoiceInput, aN as PayInvoiceOutput, aO as PayUmaInvoiceInput, aP as PaymentDirection, aQ as PaymentFailureReason, aR as PaymentRequest, aT as PaymentRequestData, aU as PaymentRequestStatus, aV as Permission, aW as PostTransactionData, aX as RegionCode, aY as RegisterPaymentInput, aZ as RegisterPaymentOutput, a_ as ReleaseChannelPerCommitmentSecretInput, a$ as ReleaseChannelPerCommitmentSecretOutput, b0 as ReleasePaymentPreimageInput, b1 as ReleasePaymentPreimageOutput, b2 as RemoteSigningSubEventType, b3 as RequestWithdrawalInput, b4 as RequestWithdrawalOutput, b5 as RichText, b6 as RiskRating, b7 as RoutingTransaction, b9 as RoutingTransactionFailureReason, ba as ScreenNodeInput, bb as ScreenNodeOutput, bc as Secret, bd as SendPaymentInput, be as SendPaymentOutput, bf as SetInvoicePaymentHashInput, bg as SetInvoicePaymentHashOutput, bh as SignInvoiceInput, bi as SignInvoiceOutput, bj as SignMessagesInput, bk as SignMessagesOutput, bl as Signable, bn as SignablePayload, bp as SignablePayloadStatus, bq as SingleNodeDashboard, br as Transaction, bt as TransactionFailures, bu as TransactionStatus, bv as TransactionType, bw as TransactionUpdate, bx as UmaInvitation, bz as UpdateChannelPerCommitmentPointInput, bA as UpdateChannelPerCommitmentPointOutput, bB as UpdateNodeSharedSecretInput, bC as UpdateNodeSharedSecretOutput, bD as Wallet, bE as WalletStatus, bF as WalletToPaymentRequestsConnection, bG as WalletToTransactionsConnection, bH as Withdrawal, bJ as WithdrawalMode, bK as WithdrawalRequest, bL as WithdrawalRequestStatus, bM as WithdrawalRequestToChannelClosingTransactionsConnection, bN as WithdrawalRequestToChannelOpeningTransactionsConnection, h as getApiTokenQuery, m as getChannelClosingTransactionQuery, p as getChannelOpeningTransactionQuery, $ as getDepositQuery, a6 as getHopQuery, ad as getIncomingPaymentAttemptQuery, ah as getInvoiceQuery, ao as getLightningTransactionQuery, as as getLightsparkNodeOwnerQuery, aq as getLightsparkNodeQuery, ay as getNodeQuery, aD as getOnChainTransactionQuery, aS as getPaymentRequestQuery, b8 as getRoutingTransactionQuery, bo as getSignablePayloadQuery, bm as getSignableQuery, bs as getTransactionQuery, by as getUmaInvitationQuery, bI as getWithdrawalQuery } from './index-a5028d74.js';
4
- import { B as BitcoinNetwork } from './BitcoinNetwork-972b1d01.js';
2
+ import { W as WebhookEventType, L as LightsparkClient } from './index-f100aa27.js';
3
+ export { A as Account, a as AccountToApiTokensConnection, b as AccountToChannelsConnection, c as AccountToNodesConnection, d as AccountToPaymentRequestsConnection, e as AccountToTransactionsConnection, f as AccountToWalletsConnection, g as AccountToWithdrawalRequestsConnection, h as ApiToken, B as Balances, j as BlockchainBalance, C as CancelInvoiceInput, k as CancelInvoiceOutput, l as Channel, m as ChannelClosingTransaction, o as ChannelFees, p as ChannelOpeningTransaction, r as ChannelSnapshot, s as ChannelStatus, t as ChannelToTransactionsConnection, u as ClaimUmaInvitationInput, v as ClaimUmaInvitationOutput, w as ClaimUmaInvitationWithIncentivesInput, x as ClaimUmaInvitationWithIncentivesOutput, y as ComplianceProvider, z as Connection, D as CreateApiTokenInput, E as CreateApiTokenOutput, F as CreateInvitationWithIncentivesInput, G as CreateInvitationWithIncentivesOutput, H as CreateInvoiceInput, I as CreateInvoiceOutput, J as CreateLnurlInvoiceInput, K as CreateNodeWalletAddressInput, M as CreateNodeWalletAddressOutput, N as CreateTestModeInvoiceInput, O as CreateTestModeInvoiceOutput, P as CreateTestModePaymentInput, Q as CreateTestModePaymentoutput, R as CreateUmaInvitationInput, S as CreateUmaInvitationOutput, T as CreateUmaInvoiceInput, U as CurrencyAmount, V as CurrencyUnit, X as DeclineToSignMessagesInput, Y as DeclineToSignMessagesOutput, Z as DeleteApiTokenInput, _ as DeleteApiTokenOutput, $ as Deposit, a1 as Entity, a2 as FeeEstimate, a3 as FundNodeInput, a4 as FundNodeOutput, a5 as GraphNode, a6 as Hop, a8 as HtlcAttemptFailureCode, a9 as IdAndSignature, aa as IncentivesIneligibilityReason, ab as IncentivesStatus, ac as IncomingPayment, ad as IncomingPaymentAttempt, af as IncomingPaymentAttemptStatus, ag as IncomingPaymentToAttemptsConnection, ah as Invoice, aj as InvoiceData, ak as InvoiceType, al as LightningFeeEstimateForInvoiceInput, am as LightningFeeEstimateForNodeInput, an as LightningFeeEstimateOutput, ao as LightningTransaction, aq as LightsparkNode, as as LightsparkNodeOwner, au as LightsparkNodeStatus, av as LightsparkNodeToChannelsConnection, aw as LightsparkNodeWithOSK, ax as LightsparkNodeWithRemoteSigning, ay as Node, aA as NodeAddress, aB as NodeAddressType, aC as NodeToAddressesConnection, aD as OnChainTransaction, aF as OutgoingPayment, aG as OutgoingPaymentAttempt, aH as OutgoingPaymentAttemptStatus, aI as OutgoingPaymentAttemptToHopsConnection, aJ as OutgoingPaymentToAttemptsConnection, aK as OutgoingPaymentsForInvoiceQueryInput, aL as OutgoingPaymentsForInvoiceQueryOutput, aM as PageInfo, aN as PayInvoiceInput, aO as PayInvoiceOutput, aP as PayUmaInvoiceInput, aQ as PaymentDirection, aR as PaymentFailureReason, aS as PaymentRequest, aU as PaymentRequestData, aV as PaymentRequestStatus, aW as Permission, aX as PostTransactionData, aY as RegionCode, aZ as RegisterPaymentInput, a_ as RegisterPaymentOutput, a$ as ReleaseChannelPerCommitmentSecretInput, b0 as ReleaseChannelPerCommitmentSecretOutput, b1 as ReleasePaymentPreimageInput, b2 as ReleasePaymentPreimageOutput, b3 as RemoteSigningSubEventType, b4 as RequestWithdrawalInput, b5 as RequestWithdrawalOutput, b6 as RichText, b7 as RiskRating, b8 as RoutingTransaction, ba as RoutingTransactionFailureReason, bb as ScreenNodeInput, bc as ScreenNodeOutput, bd as Secret, be as SendPaymentInput, bf as SendPaymentOutput, bg as SetInvoicePaymentHashInput, bh as SetInvoicePaymentHashOutput, bi as SignInvoiceInput, bj as SignInvoiceOutput, bk as SignMessagesInput, bl as SignMessagesOutput, bm as Signable, bo as SignablePayload, bq as SignablePayloadStatus, br as SingleNodeDashboard, bs as Transaction, bu as TransactionFailures, bv as TransactionStatus, bw as TransactionType, bx as TransactionUpdate, by as UmaInvitation, bA as UpdateChannelPerCommitmentPointInput, bB as UpdateChannelPerCommitmentPointOutput, bC as UpdateNodeSharedSecretInput, bD as UpdateNodeSharedSecretOutput, bE as Wallet, bF as WalletStatus, bG as WalletToPaymentRequestsConnection, bH as WalletToTransactionsConnection, bI as WalletToWithdrawalRequestsConnection, bJ as Withdrawal, bL as WithdrawalFeeEstimateInput, bM as WithdrawalFeeEstimateOutput, bN as WithdrawalMode, bO as WithdrawalRequest, bP as WithdrawalRequestStatus, bQ as WithdrawalRequestToChannelClosingTransactionsConnection, bR as WithdrawalRequestToChannelOpeningTransactionsConnection, i as getApiTokenQuery, n as getChannelClosingTransactionQuery, q as getChannelOpeningTransactionQuery, a0 as getDepositQuery, a7 as getHopQuery, ae as getIncomingPaymentAttemptQuery, ai as getInvoiceQuery, ap as getLightningTransactionQuery, at as getLightsparkNodeOwnerQuery, ar as getLightsparkNodeQuery, az as getNodeQuery, aE as getOnChainTransactionQuery, aT as getPaymentRequestQuery, b9 as getRoutingTransactionQuery, bp as getSignablePayloadQuery, bn as getSignableQuery, bt as getTransactionQuery, bz as getUmaInvitationQuery, bK as getWithdrawalQuery } from './index-f100aa27.js';
4
+ import { B as BitcoinNetwork } from './BitcoinNetwork-4f6ea015.js';
5
5
  import 'zen-observable';
6
6
 
7
7
  declare class AccountTokenAuthProvider implements AuthProvider {
package/dist/index.js CHANGED
@@ -17,6 +17,7 @@ import {
17
17
  FRAGMENT11,
18
18
  FRAGMENT12,
19
19
  FRAGMENT13,
20
+ FRAGMENT14,
20
21
  FRAGMENT2,
21
22
  FRAGMENT3,
22
23
  FRAGMENT4,
@@ -63,6 +64,7 @@ import {
63
64
  Wallet_default,
64
65
  WebhookEventType,
65
66
  WebhookEventType_default,
67
+ WithdrawalFeeEstimateOutputFromJson,
66
68
  WithdrawalMode_default,
67
69
  WithdrawalRequestFromJson,
68
70
  WithdrawalRequestStatus_default,
@@ -86,7 +88,7 @@ import {
86
88
  getTransactionQuery,
87
89
  getUmaInvitationQuery,
88
90
  getWithdrawalQuery
89
- } from "./chunk-Y55D3PD4.js";
91
+ } from "./chunk-ENYS5WAU.js";
90
92
  import {
91
93
  BitcoinNetwork_default
92
94
  } from "./chunk-K6SAUSAX.js";
@@ -144,7 +146,7 @@ import {
144
146
  // package.json
145
147
  var package_default = {
146
148
  name: "@lightsparkdev/lightspark-sdk",
147
- version: "1.3.1",
149
+ version: "1.5.0",
148
150
  description: "Lightspark JS SDK",
149
151
  author: "Lightspark Inc.",
150
152
  keywords: [
@@ -944,6 +946,27 @@ query PaymentRequestsForNode(
944
946
  ${FRAGMENT10}
945
947
  `;
946
948
 
949
+ // src/graphql/RegisterPayment.ts
950
+ var RegisterPayment = `
951
+ mutation RegisterPayment(
952
+ $provider: ComplianceProvider!
953
+ $payment_id: ID!
954
+ $node_pubkey: String!
955
+ $direction: PaymentDirection!
956
+ ) {
957
+ register_payment(input: {
958
+ provider: $provider
959
+ payment_id: $payment_id
960
+ node_pubkey: $node_pubkey
961
+ direction: $direction
962
+ }) {
963
+ payment {
964
+ id
965
+ }
966
+ }
967
+ }
968
+ `;
969
+
947
970
  // src/graphql/RequestWithdrawal.ts
948
971
  var RequestWithdrawal = `
949
972
  mutation RequestWithdrawal(
@@ -967,6 +990,21 @@ var RequestWithdrawal = `
967
990
  ${FRAGMENT11}
968
991
  `;
969
992
 
993
+ // src/graphql/ScreenNode.ts
994
+ var ScreenNode = `
995
+ mutation ScreenNode(
996
+ $provider: ComplianceProvider!
997
+ $node_pubkey: String!
998
+ ) {
999
+ screen_node(input: {
1000
+ provider: $provider
1001
+ node_pubkey: $node_pubkey
1002
+ }) {
1003
+ rating
1004
+ }
1005
+ }
1006
+ `;
1007
+
970
1008
  // src/graphql/SendPayment.ts
971
1009
  var SendPayment = `
972
1010
  mutation SendPayment(
@@ -1159,6 +1197,25 @@ ${FRAGMENT12}
1159
1197
  ${FRAGMENT}
1160
1198
  `;
1161
1199
 
1200
+ // src/graphql/WithdrawalFeeEstimate.ts
1201
+ var WithdrawalFeeEstimate = `
1202
+ query WithdrawalFeeEstimate(
1203
+ $node_id: ID!
1204
+ $amount_sats: Long!
1205
+ $withdrawal_mode: WithdrawalMode!
1206
+ ) {
1207
+ withdrawal_fee_estimate(input: {
1208
+ node_id: $node_id,
1209
+ amount_sats: $amount_sats,
1210
+ withdrawal_mode: $withdrawal_mode
1211
+ }) {
1212
+ ...WithdrawalFeeEstimateOutputFragment
1213
+ }
1214
+ }
1215
+
1216
+ ${FRAGMENT14}
1217
+ `;
1218
+
1162
1219
  // src/client.ts
1163
1220
  var sdkVersion = package_default.version;
1164
1221
  var LightsparkClient = class {
@@ -1647,6 +1704,37 @@ var LightsparkClient = class {
1647
1704
  response.lightning_fee_estimate_for_node.lightning_fee_estimate_output_fee_estimate
1648
1705
  );
1649
1706
  }
1707
+ /**
1708
+ * Returns an estimated amount for the L1 withdrawal fees for the specified node, amount, and
1709
+ * strategy.
1710
+ *
1711
+ * @param nodeId The node from which you'd like to make the withdrawal.
1712
+ * @param amountSats The amount you want to withdraw from this node in Satoshis. Use the special value -1 to withdrawal all funds from this node.
1713
+ * @param withdrawalMode The strategy that should be used to withdraw the funds from this node.
1714
+ * @returns An estimated amount for the L1 withdrawal fees for the specified node, amount, and strategy.
1715
+ */
1716
+ async getWithrawalFeeEstimate(nodeId, amountSats, withdrawalMode) {
1717
+ const response = await this.executeRawQuery({
1718
+ queryPayload: WithdrawalFeeEstimate,
1719
+ variables: {
1720
+ node_id: nodeId,
1721
+ amount_sats: amountSats,
1722
+ withdrawal_mode: withdrawalMode
1723
+ },
1724
+ constructObject: (response2) => {
1725
+ return WithdrawalFeeEstimateOutputFromJson(
1726
+ response2.withdrawal_fee_estimate
1727
+ );
1728
+ }
1729
+ });
1730
+ if (!response) {
1731
+ throw new LightsparkException(
1732
+ "WithdrawalFeeEstimateError",
1733
+ "Null or invalid fee estimate response from server"
1734
+ );
1735
+ }
1736
+ return response.feeEstimate;
1737
+ }
1650
1738
  /**
1651
1739
  * Directly unlocks a node with a signing private key or alias.
1652
1740
  *
@@ -1981,6 +2069,64 @@ var LightsparkClient = class {
1981
2069
  }
1982
2070
  });
1983
2071
  }
2072
+ /**
2073
+ * Performs sanction screening on a lightning node against a given compliance provider.
2074
+ *
2075
+ * @param complianceProvider The provider that you want to use to perform the screening. You must have a valid
2076
+ * API token for the provider set in your Lightspark account settings.
2077
+ * @param nodePubKey The public key of the node that needs to be screened.
2078
+ * @returns A RiskRating for the node.
2079
+ */
2080
+ async screenNode(complianceProvider, nodePubKey) {
2081
+ return await this.requester.executeQuery({
2082
+ queryPayload: ScreenNode,
2083
+ variables: {
2084
+ node_pubkey: nodePubKey,
2085
+ provider: complianceProvider
2086
+ },
2087
+ constructObject: (responseJson) => {
2088
+ if (responseJson.screen_node?.rating === void 0) {
2089
+ throw new LightsparkException(
2090
+ "ScreenNodeError",
2091
+ "Unable to screen node"
2092
+ );
2093
+ }
2094
+ const rating = responseJson.screen_node.rating;
2095
+ return RiskRating_default[rating] ?? RiskRating_default.FUTURE_VALUE;
2096
+ }
2097
+ });
2098
+ }
2099
+ /**
2100
+ * Registers a succeeded payment with a compliance provider for monitoring.
2101
+ *
2102
+ * @param complianceProvider The provider that you want to use to register the payment. You must have
2103
+ * a valid API token for the provider set in your Lightspark account settings.
2104
+ * @param paymentId The unique ID of the payment
2105
+ * @param nodePubKey The public key of the counterparty node which is the recipient node if the
2106
+ * payment is an outgoing payment and the sender node if the payment is an incoming payment.
2107
+ * @param paymentDirection Indicates whether the payment is an incoming or outgoing payment.
2108
+ * @returns The ID of the payment that was registered.
2109
+ */
2110
+ async registerPayment(complianceProvider, paymentId, nodePubKey, paymentDirection) {
2111
+ return await this.requester.executeQuery({
2112
+ queryPayload: RegisterPayment,
2113
+ variables: {
2114
+ payment_id: paymentId,
2115
+ node_pubkey: nodePubKey,
2116
+ direction: paymentDirection,
2117
+ provider: complianceProvider
2118
+ },
2119
+ constructObject: (responseJson) => {
2120
+ if (!responseJson.register_payment?.payment?.id) {
2121
+ throw new LightsparkException(
2122
+ "RegisterPaymentError",
2123
+ "Unable to register payment"
2124
+ );
2125
+ }
2126
+ return responseJson.register_payment.payment.id;
2127
+ }
2128
+ });
2129
+ }
1984
2130
  /**
1985
2131
  * Creates an UMA invitation. If you are part of the incentive program,
1986
2132
  * you should use [createUmaInvitationWithIncentives].