@lightsparkdev/lightspark-sdk 1.2.2 → 1.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/{BitcoinNetwork-a816c0be.d.ts → BitcoinNetwork-37e9f091.d.ts} +8 -3
  3. package/dist/env.d.cts +1 -1
  4. package/dist/env.d.ts +1 -1
  5. package/dist/{index-eb604025.d.ts → index-449c9f58.d.ts} +1461 -675
  6. package/dist/index.cjs +341 -307
  7. package/dist/index.d.cts +3 -3
  8. package/dist/index.d.ts +3 -3
  9. package/dist/index.js +323 -289
  10. package/dist/objects/index.d.cts +2 -2
  11. package/dist/objects/index.d.ts +2 -2
  12. package/dist/objects/index.js +1 -1
  13. package/package.json +4 -4
  14. package/src/NodeKeyLoaderCache.ts +4 -3
  15. package/src/SigningKeyLoader.ts +12 -7
  16. package/src/client.ts +99 -65
  17. package/src/env.ts +3 -1
  18. package/src/objects/Account.ts +7 -3
  19. package/src/objects/AccountToApiTokensConnection.ts +7 -3
  20. package/src/objects/AccountToChannelsConnection.ts +3 -2
  21. package/src/objects/AccountToNodesConnection.ts +7 -3
  22. package/src/objects/AccountToPaymentRequestsConnection.ts +7 -3
  23. package/src/objects/AccountToTransactionsConnection.ts +13 -9
  24. package/src/objects/AccountToWalletsConnection.ts +7 -3
  25. package/src/objects/ApiToken.ts +13 -7
  26. package/src/objects/Balances.ts +22 -12
  27. package/src/objects/BitcoinNetwork.ts +8 -3
  28. package/src/objects/BlockchainBalance.ts +4 -1
  29. package/src/objects/Channel.ts +37 -14
  30. package/src/objects/ChannelClosingTransaction.ts +22 -11
  31. package/src/objects/ChannelFees.ts +4 -1
  32. package/src/objects/ChannelOpeningTransaction.ts +22 -11
  33. package/src/objects/ChannelStatus.ts +33 -8
  34. package/src/objects/ChannelToTransactionsConnection.ts +9 -8
  35. package/src/objects/ComplianceProvider.ts +3 -2
  36. package/src/objects/Connection.ts +7 -3
  37. package/src/objects/CreateApiTokenInput.ts +4 -1
  38. package/src/objects/CreateApiTokenOutput.ts +3 -3
  39. package/src/objects/CreateLnurlInvoiceInput.ts +3 -2
  40. package/src/objects/CreateTestModePaymentInput.ts +2 -2
  41. package/src/objects/CreateTestModePaymentoutput.ts +5 -1
  42. package/src/objects/CurrencyAmount.ts +6 -4
  43. package/src/objects/CurrencyUnit.ts +36 -9
  44. package/src/objects/Deposit.ts +22 -11
  45. package/src/objects/Entity.ts +8 -3
  46. package/src/objects/FeeEstimate.ts +5 -1
  47. package/src/objects/GraphNode.ts +30 -14
  48. package/src/objects/Hop.ts +12 -4
  49. package/src/objects/HtlcAttemptFailureCode.ts +7 -3
  50. package/src/objects/IncentivesIneligibilityReason.ts +33 -9
  51. package/src/objects/IncentivesStatus.ts +14 -4
  52. package/src/objects/IncomingPayment.ts +18 -7
  53. package/src/objects/IncomingPaymentAttempt.ts +8 -3
  54. package/src/objects/IncomingPaymentAttemptStatus.ts +7 -3
  55. package/src/objects/IncomingPaymentToAttemptsConnection.ts +7 -3
  56. package/src/objects/Invoice.ts +2 -2
  57. package/src/objects/InvoiceData.ts +7 -3
  58. package/src/objects/InvoiceType.ts +3 -2
  59. package/src/objects/LightningFeeEstimateForInvoiceInput.ts +2 -2
  60. package/src/objects/LightningTransaction.ts +12 -4
  61. package/src/objects/LightsparkNode.ts +33 -18
  62. package/src/objects/LightsparkNodeOwner.ts +2 -2
  63. package/src/objects/LightsparkNodeStatus.ts +3 -2
  64. package/src/objects/LightsparkNodeToChannelsConnection.ts +7 -3
  65. package/src/objects/LightsparkNodeWithOSK.ts +35 -19
  66. package/src/objects/LightsparkNodeWithRemoteSigning.ts +31 -18
  67. package/src/objects/Node.ts +28 -14
  68. package/src/objects/NodeAddressType.ts +7 -3
  69. package/src/objects/NodeToAddressesConnection.ts +7 -3
  70. package/src/objects/OnChainTransaction.ts +23 -11
  71. package/src/objects/OutgoingPayment.ts +24 -7
  72. package/src/objects/OutgoingPaymentAttempt.ts +28 -13
  73. package/src/objects/OutgoingPaymentAttemptStatus.ts +7 -3
  74. package/src/objects/OutgoingPaymentAttemptToHopsConnection.ts +12 -4
  75. package/src/objects/OutgoingPaymentToAttemptsConnection.ts +7 -3
  76. package/src/objects/PageInfo.ts +6 -1
  77. package/src/objects/PayInvoiceInput.ts +6 -3
  78. package/src/objects/PaymentDirection.ts +3 -2
  79. package/src/objects/PaymentFailureReason.ts +7 -3
  80. package/src/objects/PaymentRequest.ts +8 -3
  81. package/src/objects/PaymentRequestData.ts +5 -1
  82. package/src/objects/PaymentRequestStatus.ts +7 -3
  83. package/src/objects/Permission.ts +7 -3
  84. package/src/objects/PostTransactionData.ts +6 -3
  85. package/src/objects/RegionCode.ts +43 -12
  86. package/src/objects/RegisterPaymentInput.ts +12 -7
  87. package/src/objects/RemoteSigningSubEventType.ts +7 -3
  88. package/src/objects/RequestWithdrawalInput.ts +2 -2
  89. package/src/objects/RiskRating.ts +8 -3
  90. package/src/objects/RoutingTransaction.ts +20 -7
  91. package/src/objects/RoutingTransactionFailureReason.ts +8 -3
  92. package/src/objects/ScreenNodeInput.ts +3 -2
  93. package/src/objects/SendPaymentInput.ts +4 -1
  94. package/src/objects/SetInvoicePaymentHashInput.ts +3 -2
  95. package/src/objects/Signable.ts +2 -2
  96. package/src/objects/SignablePayload.ts +6 -3
  97. package/src/objects/SignablePayloadStatus.ts +3 -2
  98. package/src/objects/Transaction.ts +14 -4
  99. package/src/objects/TransactionFailures.ts +4 -1
  100. package/src/objects/TransactionStatus.ts +16 -5
  101. package/src/objects/TransactionType.ts +30 -8
  102. package/src/objects/TransactionUpdate.ts +6 -3
  103. package/src/objects/UmaInvitation.ts +10 -4
  104. package/src/objects/Wallet.ts +13 -4
  105. package/src/objects/WalletStatus.ts +36 -9
  106. package/src/objects/WalletToPaymentRequestsConnection.ts +7 -3
  107. package/src/objects/WalletToTransactionsConnection.ts +7 -3
  108. package/src/objects/WebhookEventType.ts +7 -3
  109. package/src/objects/Withdrawal.ts +22 -11
  110. package/src/objects/WithdrawalMode.ts +7 -3
  111. package/src/objects/WithdrawalRequest.ts +15 -6
  112. package/src/objects/WithdrawalRequestStatus.ts +3 -2
  113. package/src/objects/WithdrawalRequestToChannelClosingTransactionsConnection.ts +11 -4
  114. package/src/objects/WithdrawalRequestToChannelOpeningTransactionsConnection.ts +11 -4
  115. package/src/objects/index.ts +6 -6
  116. package/src/tests/integration/general-regtest.test.ts +1 -1
  117. /package/dist/{chunk-GLL4KTUT.js → chunk-NCPWHRFO.js} +0 -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 ApiToken, B as Balances, i as BlockchainBalance, C as Channel, j as ChannelClosingTransaction, l as ChannelFees, m as ChannelOpeningTransaction, o as ChannelSnapshot, p as ChannelStatus, q as ChannelToTransactionsConnection, r as ClaimUmaInvitationInput, s as ClaimUmaInvitationOutput, t as ClaimUmaInvitationWithIncentivesInput, u as ClaimUmaInvitationWithIncentivesOutput, v as ComplianceProvider, w as Connection, x as CreateApiTokenInput, y as CreateApiTokenOutput, z as CreateInvitationWithIncentivesInput, D as CreateInvitationWithIncentivesOutput, E as CreateInvoiceInput, F as CreateInvoiceOutput, G as CreateLnurlInvoiceInput, H as CreateNodeWalletAddressInput, I as CreateNodeWalletAddressOutput, J as CreateTestModeInvoiceInput, K as CreateTestModeInvoiceOutput, M as CreateTestModePaymentInput, N as CreateTestModePaymentoutput, O as CreateUmaInvitationInput, P as CreateUmaInvitationOutput, Q as CreateUmaInvoiceInput, R as CurrencyAmount, S as CurrencyUnit, T as DeclineToSignMessagesInput, U as DeclineToSignMessagesOutput, V as DeleteApiTokenInput, X as DeleteApiTokenOutput, Y as Deposit, _ as Entity, $ as FeeEstimate, a0 as FundNodeInput, a1 as FundNodeOutput, a2 as GraphNode, a3 as Hop, a5 as HtlcAttemptFailureCode, a6 as IdAndSignature, a7 as IncentivesIneligibilityReason, a8 as IncentivesStatus, a9 as IncomingPayment, aa as IncomingPaymentAttempt, ac as IncomingPaymentAttemptStatus, ad as IncomingPaymentToAttemptsConnection, ae as Invoice, ag as InvoiceData, ah as InvoiceType, ai as LightningFeeEstimateForInvoiceInput, aj as LightningFeeEstimateForNodeInput, ak as LightningFeeEstimateOutput, al as LightningTransaction, an as LightsparkNode, ap as LightsparkNodeOwner, ar as LightsparkNodeStatus, as as LightsparkNodeToChannelsConnection, at as LightsparkNodeWithOSK, au as LightsparkNodeWithRemoteSigning, av as Node, ax as NodeAddress, ay as NodeAddressType, az as NodeToAddressesConnection, aA as OnChainTransaction, aC as OutgoingPayment, aD as OutgoingPaymentAttempt, aE as OutgoingPaymentAttemptStatus, aF as OutgoingPaymentAttemptToHopsConnection, aI as OutgoingPaymentToAttemptsConnection, aG as OutgoingPaymentsForInvoiceQueryInput, aH as OutgoingPaymentsForInvoiceQueryOutput, aJ as PageInfo, aK as PayInvoiceInput, aL as PayInvoiceOutput, aS as PayUmaInvoiceInput, aM as PaymentDirection, aN as PaymentFailureReason, aO as PaymentRequest, aQ as PaymentRequestData, aR as PaymentRequestStatus, aT as Permission, aU as PostTransactionData, aV as RegionCode, aW as RegisterPaymentInput, aX as RegisterPaymentOutput, aY as ReleaseChannelPerCommitmentSecretInput, aZ as ReleaseChannelPerCommitmentSecretOutput, a_ as ReleasePaymentPreimageInput, a$ as ReleasePaymentPreimageOutput, b0 as RemoteSigningSubEventType, b1 as RequestWithdrawalInput, b2 as RequestWithdrawalOutput, b3 as RichText, b4 as RiskRating, b5 as RoutingTransaction, b7 as RoutingTransactionFailureReason, b8 as ScreenNodeInput, b9 as ScreenNodeOutput, ba as Secret, bb as SendPaymentInput, bc as SendPaymentOutput, bd as SetInvoicePaymentHashInput, be as SetInvoicePaymentHashOutput, bk as SignInvoiceInput, bl as SignInvoiceOutput, bm as SignMessagesInput, bn as SignMessagesOutput, bf as Signable, bh as SignablePayload, bj as SignablePayloadStatus, bo as SingleNodeDashboard, bp as Transaction, br as TransactionFailures, bs as TransactionStatus, bt as TransactionType, bu as TransactionUpdate, bv as UmaInvitation, bx as UpdateChannelPerCommitmentPointInput, by as UpdateChannelPerCommitmentPointOutput, bz as UpdateNodeSharedSecretInput, bA as UpdateNodeSharedSecretOutput, bB as Wallet, bC as WalletStatus, bD as WalletToPaymentRequestsConnection, bE as WalletToTransactionsConnection, W as WebhookEventType, bF as Withdrawal, bH as WithdrawalMode, bI as WithdrawalRequest, bJ as WithdrawalRequestStatus, bK as WithdrawalRequestToChannelClosingTransactionsConnection, bL as WithdrawalRequestToChannelOpeningTransactionsConnection, h as getApiTokenQuery, k as getChannelClosingTransactionQuery, n as getChannelOpeningTransactionQuery, Z as getDepositQuery, a4 as getHopQuery, ab as getIncomingPaymentAttemptQuery, af as getInvoiceQuery, am as getLightningTransactionQuery, aq as getLightsparkNodeOwnerQuery, ao as getLightsparkNodeQuery, aw as getNodeQuery, aB as getOnChainTransactionQuery, aP as getPaymentRequestQuery, b6 as getRoutingTransactionQuery, bi as getSignablePayloadQuery, bg as getSignableQuery, bq as getTransactionQuery, bw as getUmaInvitationQuery, bG as getWithdrawalQuery } from '../index-eb604025.js';
2
- export { B as BitcoinNetwork } from '../BitcoinNetwork-a816c0be.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 ApiToken, B as Balances, i as BlockchainBalance, C as Channel, j as ChannelClosingTransaction, l as ChannelFees, m as ChannelOpeningTransaction, o as ChannelSnapshot, p as ChannelStatus, q as ChannelToTransactionsConnection, r as ClaimUmaInvitationInput, s as ClaimUmaInvitationOutput, t as ClaimUmaInvitationWithIncentivesInput, u as ClaimUmaInvitationWithIncentivesOutput, v as ComplianceProvider, w as Connection, x as CreateApiTokenInput, y as CreateApiTokenOutput, z as CreateInvitationWithIncentivesInput, D as CreateInvitationWithIncentivesOutput, E as CreateInvoiceInput, F as CreateInvoiceOutput, G as CreateLnurlInvoiceInput, H as CreateNodeWalletAddressInput, I as CreateNodeWalletAddressOutput, J as CreateTestModeInvoiceInput, K as CreateTestModeInvoiceOutput, M as CreateTestModePaymentInput, N as CreateTestModePaymentoutput, O as CreateUmaInvitationInput, P as CreateUmaInvitationOutput, Q as CreateUmaInvoiceInput, R as CurrencyAmount, S as CurrencyUnit, T as DeclineToSignMessagesInput, U as DeclineToSignMessagesOutput, V as DeleteApiTokenInput, X as DeleteApiTokenOutput, Y as Deposit, _ as Entity, $ as FeeEstimate, a0 as FundNodeInput, a1 as FundNodeOutput, a2 as GraphNode, a3 as Hop, a5 as HtlcAttemptFailureCode, a6 as IdAndSignature, a7 as IncentivesIneligibilityReason, a8 as IncentivesStatus, a9 as IncomingPayment, aa as IncomingPaymentAttempt, ac as IncomingPaymentAttemptStatus, ad as IncomingPaymentToAttemptsConnection, ae as Invoice, ag as InvoiceData, ah as InvoiceType, ai as LightningFeeEstimateForInvoiceInput, aj as LightningFeeEstimateForNodeInput, ak as LightningFeeEstimateOutput, al as LightningTransaction, an as LightsparkNode, ap as LightsparkNodeOwner, ar as LightsparkNodeStatus, as as LightsparkNodeToChannelsConnection, at as LightsparkNodeWithOSK, au as LightsparkNodeWithRemoteSigning, av as Node, ax as NodeAddress, ay as NodeAddressType, az as NodeToAddressesConnection, aA as OnChainTransaction, aC as OutgoingPayment, aD as OutgoingPaymentAttempt, aE as OutgoingPaymentAttemptStatus, aF as OutgoingPaymentAttemptToHopsConnection, aG as OutgoingPaymentToAttemptsConnection, aH as OutgoingPaymentsForInvoiceQueryInput, aI as OutgoingPaymentsForInvoiceQueryOutput, aJ as PageInfo, aK as PayInvoiceInput, aL as PayInvoiceOutput, aM as PayUmaInvoiceInput, aN as PaymentDirection, aO as PaymentFailureReason, aP as PaymentRequest, aR as PaymentRequestData, aS as PaymentRequestStatus, aT as Permission, aU as PostTransactionData, aV as RegionCode, aW as RegisterPaymentInput, aX as RegisterPaymentOutput, aY as ReleaseChannelPerCommitmentSecretInput, aZ as ReleaseChannelPerCommitmentSecretOutput, a_ as ReleasePaymentPreimageInput, a$ as ReleasePaymentPreimageOutput, b0 as RemoteSigningSubEventType, b1 as RequestWithdrawalInput, b2 as RequestWithdrawalOutput, b3 as RichText, b4 as RiskRating, b5 as RoutingTransaction, b7 as RoutingTransactionFailureReason, b8 as ScreenNodeInput, b9 as ScreenNodeOutput, ba as Secret, bb as SendPaymentInput, bc as SendPaymentOutput, bd as SetInvoicePaymentHashInput, be as SetInvoicePaymentHashOutput, bf as SignInvoiceInput, bg as SignInvoiceOutput, bh as SignMessagesInput, bi as SignMessagesOutput, bj as Signable, bl as SignablePayload, bn as SignablePayloadStatus, bo as SingleNodeDashboard, bp as Transaction, br as TransactionFailures, bs as TransactionStatus, bt as TransactionType, bu as TransactionUpdate, bv as UmaInvitation, bx as UpdateChannelPerCommitmentPointInput, by as UpdateChannelPerCommitmentPointOutput, bz as UpdateNodeSharedSecretInput, bA as UpdateNodeSharedSecretOutput, bB as Wallet, bC as WalletStatus, bD as WalletToPaymentRequestsConnection, bE as WalletToTransactionsConnection, W as WebhookEventType, bF as Withdrawal, bH as WithdrawalMode, bI as WithdrawalRequest, bJ as WithdrawalRequestStatus, bK as WithdrawalRequestToChannelClosingTransactionsConnection, bL as WithdrawalRequestToChannelOpeningTransactionsConnection, h as getApiTokenQuery, k as getChannelClosingTransactionQuery, n as getChannelOpeningTransactionQuery, Z as getDepositQuery, a4 as getHopQuery, ab as getIncomingPaymentAttemptQuery, af as getInvoiceQuery, am as getLightningTransactionQuery, aq as getLightsparkNodeOwnerQuery, ao as getLightsparkNodeQuery, aw as getNodeQuery, aB as getOnChainTransactionQuery, aQ as getPaymentRequestQuery, b6 as getRoutingTransactionQuery, bm as getSignablePayloadQuery, bk as getSignableQuery, bq as getTransactionQuery, bw as getUmaInvitationQuery, bG as getWithdrawalQuery } from '../index-449c9f58.js';
2
+ export { B as BitcoinNetwork } from '../BitcoinNetwork-37e9f091.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 ApiToken, B as Balances, i as BlockchainBalance, C as Channel, j as ChannelClosingTransaction, l as ChannelFees, m as ChannelOpeningTransaction, o as ChannelSnapshot, p as ChannelStatus, q as ChannelToTransactionsConnection, r as ClaimUmaInvitationInput, s as ClaimUmaInvitationOutput, t as ClaimUmaInvitationWithIncentivesInput, u as ClaimUmaInvitationWithIncentivesOutput, v as ComplianceProvider, w as Connection, x as CreateApiTokenInput, y as CreateApiTokenOutput, z as CreateInvitationWithIncentivesInput, D as CreateInvitationWithIncentivesOutput, E as CreateInvoiceInput, F as CreateInvoiceOutput, G as CreateLnurlInvoiceInput, H as CreateNodeWalletAddressInput, I as CreateNodeWalletAddressOutput, J as CreateTestModeInvoiceInput, K as CreateTestModeInvoiceOutput, M as CreateTestModePaymentInput, N as CreateTestModePaymentoutput, O as CreateUmaInvitationInput, P as CreateUmaInvitationOutput, Q as CreateUmaInvoiceInput, R as CurrencyAmount, S as CurrencyUnit, T as DeclineToSignMessagesInput, U as DeclineToSignMessagesOutput, V as DeleteApiTokenInput, X as DeleteApiTokenOutput, Y as Deposit, _ as Entity, $ as FeeEstimate, a0 as FundNodeInput, a1 as FundNodeOutput, a2 as GraphNode, a3 as Hop, a5 as HtlcAttemptFailureCode, a6 as IdAndSignature, a7 as IncentivesIneligibilityReason, a8 as IncentivesStatus, a9 as IncomingPayment, aa as IncomingPaymentAttempt, ac as IncomingPaymentAttemptStatus, ad as IncomingPaymentToAttemptsConnection, ae as Invoice, ag as InvoiceData, ah as InvoiceType, ai as LightningFeeEstimateForInvoiceInput, aj as LightningFeeEstimateForNodeInput, ak as LightningFeeEstimateOutput, al as LightningTransaction, an as LightsparkNode, ap as LightsparkNodeOwner, ar as LightsparkNodeStatus, as as LightsparkNodeToChannelsConnection, at as LightsparkNodeWithOSK, au as LightsparkNodeWithRemoteSigning, av as Node, ax as NodeAddress, ay as NodeAddressType, az as NodeToAddressesConnection, aA as OnChainTransaction, aC as OutgoingPayment, aD as OutgoingPaymentAttempt, aE as OutgoingPaymentAttemptStatus, aF as OutgoingPaymentAttemptToHopsConnection, aI as OutgoingPaymentToAttemptsConnection, aG as OutgoingPaymentsForInvoiceQueryInput, aH as OutgoingPaymentsForInvoiceQueryOutput, aJ as PageInfo, aK as PayInvoiceInput, aL as PayInvoiceOutput, aS as PayUmaInvoiceInput, aM as PaymentDirection, aN as PaymentFailureReason, aO as PaymentRequest, aQ as PaymentRequestData, aR as PaymentRequestStatus, aT as Permission, aU as PostTransactionData, aV as RegionCode, aW as RegisterPaymentInput, aX as RegisterPaymentOutput, aY as ReleaseChannelPerCommitmentSecretInput, aZ as ReleaseChannelPerCommitmentSecretOutput, a_ as ReleasePaymentPreimageInput, a$ as ReleasePaymentPreimageOutput, b0 as RemoteSigningSubEventType, b1 as RequestWithdrawalInput, b2 as RequestWithdrawalOutput, b3 as RichText, b4 as RiskRating, b5 as RoutingTransaction, b7 as RoutingTransactionFailureReason, b8 as ScreenNodeInput, b9 as ScreenNodeOutput, ba as Secret, bb as SendPaymentInput, bc as SendPaymentOutput, bd as SetInvoicePaymentHashInput, be as SetInvoicePaymentHashOutput, bk as SignInvoiceInput, bl as SignInvoiceOutput, bm as SignMessagesInput, bn as SignMessagesOutput, bf as Signable, bh as SignablePayload, bj as SignablePayloadStatus, bo as SingleNodeDashboard, bp as Transaction, br as TransactionFailures, bs as TransactionStatus, bt as TransactionType, bu as TransactionUpdate, bv as UmaInvitation, bx as UpdateChannelPerCommitmentPointInput, by as UpdateChannelPerCommitmentPointOutput, bz as UpdateNodeSharedSecretInput, bA as UpdateNodeSharedSecretOutput, bB as Wallet, bC as WalletStatus, bD as WalletToPaymentRequestsConnection, bE as WalletToTransactionsConnection, W as WebhookEventType, bF as Withdrawal, bH as WithdrawalMode, bI as WithdrawalRequest, bJ as WithdrawalRequestStatus, bK as WithdrawalRequestToChannelClosingTransactionsConnection, bL as WithdrawalRequestToChannelOpeningTransactionsConnection, h as getApiTokenQuery, k as getChannelClosingTransactionQuery, n as getChannelOpeningTransactionQuery, Z as getDepositQuery, a4 as getHopQuery, ab as getIncomingPaymentAttemptQuery, af as getInvoiceQuery, am as getLightningTransactionQuery, aq as getLightsparkNodeOwnerQuery, ao as getLightsparkNodeQuery, aw as getNodeQuery, aB as getOnChainTransactionQuery, aP as getPaymentRequestQuery, b6 as getRoutingTransactionQuery, bi as getSignablePayloadQuery, bg as getSignableQuery, bq as getTransactionQuery, bw as getUmaInvitationQuery, bG as getWithdrawalQuery } from '../index-eb604025.js';
2
- export { B as BitcoinNetwork } from '../BitcoinNetwork-a816c0be.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 ApiToken, B as Balances, i as BlockchainBalance, C as Channel, j as ChannelClosingTransaction, l as ChannelFees, m as ChannelOpeningTransaction, o as ChannelSnapshot, p as ChannelStatus, q as ChannelToTransactionsConnection, r as ClaimUmaInvitationInput, s as ClaimUmaInvitationOutput, t as ClaimUmaInvitationWithIncentivesInput, u as ClaimUmaInvitationWithIncentivesOutput, v as ComplianceProvider, w as Connection, x as CreateApiTokenInput, y as CreateApiTokenOutput, z as CreateInvitationWithIncentivesInput, D as CreateInvitationWithIncentivesOutput, E as CreateInvoiceInput, F as CreateInvoiceOutput, G as CreateLnurlInvoiceInput, H as CreateNodeWalletAddressInput, I as CreateNodeWalletAddressOutput, J as CreateTestModeInvoiceInput, K as CreateTestModeInvoiceOutput, M as CreateTestModePaymentInput, N as CreateTestModePaymentoutput, O as CreateUmaInvitationInput, P as CreateUmaInvitationOutput, Q as CreateUmaInvoiceInput, R as CurrencyAmount, S as CurrencyUnit, T as DeclineToSignMessagesInput, U as DeclineToSignMessagesOutput, V as DeleteApiTokenInput, X as DeleteApiTokenOutput, Y as Deposit, _ as Entity, $ as FeeEstimate, a0 as FundNodeInput, a1 as FundNodeOutput, a2 as GraphNode, a3 as Hop, a5 as HtlcAttemptFailureCode, a6 as IdAndSignature, a7 as IncentivesIneligibilityReason, a8 as IncentivesStatus, a9 as IncomingPayment, aa as IncomingPaymentAttempt, ac as IncomingPaymentAttemptStatus, ad as IncomingPaymentToAttemptsConnection, ae as Invoice, ag as InvoiceData, ah as InvoiceType, ai as LightningFeeEstimateForInvoiceInput, aj as LightningFeeEstimateForNodeInput, ak as LightningFeeEstimateOutput, al as LightningTransaction, an as LightsparkNode, ap as LightsparkNodeOwner, ar as LightsparkNodeStatus, as as LightsparkNodeToChannelsConnection, at as LightsparkNodeWithOSK, au as LightsparkNodeWithRemoteSigning, av as Node, ax as NodeAddress, ay as NodeAddressType, az as NodeToAddressesConnection, aA as OnChainTransaction, aC as OutgoingPayment, aD as OutgoingPaymentAttempt, aE as OutgoingPaymentAttemptStatus, aF as OutgoingPaymentAttemptToHopsConnection, aG as OutgoingPaymentToAttemptsConnection, aH as OutgoingPaymentsForInvoiceQueryInput, aI as OutgoingPaymentsForInvoiceQueryOutput, aJ as PageInfo, aK as PayInvoiceInput, aL as PayInvoiceOutput, aM as PayUmaInvoiceInput, aN as PaymentDirection, aO as PaymentFailureReason, aP as PaymentRequest, aR as PaymentRequestData, aS as PaymentRequestStatus, aT as Permission, aU as PostTransactionData, aV as RegionCode, aW as RegisterPaymentInput, aX as RegisterPaymentOutput, aY as ReleaseChannelPerCommitmentSecretInput, aZ as ReleaseChannelPerCommitmentSecretOutput, a_ as ReleasePaymentPreimageInput, a$ as ReleasePaymentPreimageOutput, b0 as RemoteSigningSubEventType, b1 as RequestWithdrawalInput, b2 as RequestWithdrawalOutput, b3 as RichText, b4 as RiskRating, b5 as RoutingTransaction, b7 as RoutingTransactionFailureReason, b8 as ScreenNodeInput, b9 as ScreenNodeOutput, ba as Secret, bb as SendPaymentInput, bc as SendPaymentOutput, bd as SetInvoicePaymentHashInput, be as SetInvoicePaymentHashOutput, bf as SignInvoiceInput, bg as SignInvoiceOutput, bh as SignMessagesInput, bi as SignMessagesOutput, bj as Signable, bl as SignablePayload, bn as SignablePayloadStatus, bo as SingleNodeDashboard, bp as Transaction, br as TransactionFailures, bs as TransactionStatus, bt as TransactionType, bu as TransactionUpdate, bv as UmaInvitation, bx as UpdateChannelPerCommitmentPointInput, by as UpdateChannelPerCommitmentPointOutput, bz as UpdateNodeSharedSecretInput, bA as UpdateNodeSharedSecretOutput, bB as Wallet, bC as WalletStatus, bD as WalletToPaymentRequestsConnection, bE as WalletToTransactionsConnection, W as WebhookEventType, bF as Withdrawal, bH as WithdrawalMode, bI as WithdrawalRequest, bJ as WithdrawalRequestStatus, bK as WithdrawalRequestToChannelClosingTransactionsConnection, bL as WithdrawalRequestToChannelOpeningTransactionsConnection, h as getApiTokenQuery, k as getChannelClosingTransactionQuery, n as getChannelOpeningTransactionQuery, Z as getDepositQuery, a4 as getHopQuery, ab as getIncomingPaymentAttemptQuery, af as getInvoiceQuery, am as getLightningTransactionQuery, aq as getLightsparkNodeOwnerQuery, ao as getLightsparkNodeQuery, aw as getNodeQuery, aB as getOnChainTransactionQuery, aQ as getPaymentRequestQuery, b6 as getRoutingTransactionQuery, bm as getSignablePayloadQuery, bk as getSignableQuery, bq as getTransactionQuery, bw as getUmaInvitationQuery, bG as getWithdrawalQuery } from '../index-449c9f58.js';
2
+ export { B as BitcoinNetwork } from '../BitcoinNetwork-37e9f091.js';
3
3
  import '@lightsparkdev/core';
4
4
  import 'zen-observable';
@@ -55,7 +55,7 @@ import {
55
55
  getTransactionQuery,
56
56
  getUmaInvitationQuery,
57
57
  getWithdrawalQuery
58
- } from "../chunk-GLL4KTUT.js";
58
+ } from "../chunk-NCPWHRFO.js";
59
59
  import {
60
60
  BitcoinNetwork_default
61
61
  } from "../chunk-K6SAUSAX.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightsparkdev/lightspark-sdk",
3
- "version": "1.2.2",
3
+ "version": "1.2.3",
4
4
  "description": "Lightspark JS SDK",
5
5
  "author": "Lightspark Inc.",
6
6
  "keywords": [
@@ -69,7 +69,7 @@
69
69
  ],
70
70
  "scripts": {
71
71
  "build": "yarn tsc && tsup",
72
- "build:watch": "yarn build --watch",
72
+ "build:watch": "yarn build --watch --clean=false",
73
73
  "clean": "rm -rf .turbo && rm -rf dist",
74
74
  "dev": "yarn build -- --watch",
75
75
  "docs": "typedoc src",
@@ -88,7 +88,7 @@
88
88
  },
89
89
  "license": "Apache-2.0",
90
90
  "dependencies": {
91
- "@lightsparkdev/core": "1.0.10",
91
+ "@lightsparkdev/core": "1.0.11",
92
92
  "@lightsparkdev/crypto-wasm": "0.1.2",
93
93
  "auto-bind": "^5.0.1",
94
94
  "crypto-browserify": "^3.12.0",
@@ -115,6 +115,6 @@
115
115
  "tsc-absolute": "^1.0.1",
116
116
  "tsup": "^7.2.0",
117
117
  "typedoc": "^0.24.7",
118
- "typescript": "^4.9.5"
118
+ "typescript": "^5.0.0"
119
119
  }
120
120
  }
@@ -7,10 +7,10 @@ import {
7
7
  type SigningKey,
8
8
  } from "@lightsparkdev/core";
9
9
  import {
10
- isMasterSeedSigningKeyLoaderArgs,
11
- isNodeIdAndPasswordSigningKeyLoaderArgs,
12
10
  MasterSeedSigningKeyLoader,
13
11
  NodeIdAndPasswordSigningKeyLoader,
12
+ isMasterSeedSigningKeyLoaderArgs,
13
+ isNodeIdAndPasswordSigningKeyLoaderArgs,
14
14
  type SigningKeyLoader,
15
15
  type SigningKeyLoaderArgs,
16
16
  } from "./SigningKeyLoader.js";
@@ -30,7 +30,8 @@ export default class NodeKeyLoaderCache {
30
30
 
31
31
  /**
32
32
  * Sets the signing key loader for a node.
33
- * Instantiates a signing key loader based on the type of args passed in by the user.
33
+ * Instantiates a signing key loader based on the type of args passed in by
34
+ * the user.
34
35
  *
35
36
  * @param nodeId The ID of the node to get the key for
36
37
  * @param loaderArgs Loader arguments for loading the key
@@ -1,8 +1,8 @@
1
1
  import {
2
- b64encode,
3
- isBrowser,
4
2
  LightsparkSigningException,
5
3
  SigningKeyType,
4
+ b64encode,
5
+ isBrowser,
6
6
  type CryptoInterface,
7
7
  type Maybe,
8
8
  type Requester,
@@ -21,15 +21,18 @@ export type SigningKeyLoaderArgs =
21
21
 
22
22
  /**
23
23
  * Args for creating a new SigningKeyLoader from a node ID and password.
24
- * This cannot be used if you are using remote signing. It is used to recover an RSA operation signing key using
25
- * the password you chose when setting up your node. For REGTEST nodes, the password is "1234!@#$".
24
+ * This cannot be used if you are using remote signing.
25
+ * It is used to recover an RSA operation signing key using the password you
26
+ * chose when setting up your node. For REGTEST nodes, the password is
27
+ * "1234!@#$".
26
28
  */
27
29
  export interface NodeIdAndPasswordSigningKeyLoaderArgs {
28
30
  password: string;
29
31
  }
30
32
 
31
33
  /**
32
- * Internal version of NodeIdAndPasswordSigningKeyLoaderArgs that includes the node ID.
34
+ * Internal version of NodeIdAndPasswordSigningKeyLoaderArgs that includes the
35
+ * node ID.
33
36
  */
34
37
  interface NodeIdAndPasswordSigningKeyLoaderArgsInternal
35
38
  extends NodeIdAndPasswordSigningKeyLoaderArgs {
@@ -38,7 +41,8 @@ interface NodeIdAndPasswordSigningKeyLoaderArgsInternal
38
41
 
39
42
  /**
40
43
  * Args for creating a new SigningKeyLoader from a master seed and network.
41
- * This should be used if you are using remote signing, rather than an RSA operation signing key.
44
+ * This should be used if you are using remote signing,
45
+ * rather than an RSA operation signing key.
42
46
  */
43
47
  export interface MasterSeedSigningKeyLoaderArgs {
44
48
  masterSeed: Uint8Array;
@@ -70,7 +74,8 @@ export function isMasterSeedSigningKeyLoaderArgs(
70
74
  }
71
75
 
72
76
  /**
73
- * Key loader that loads an RSA signing key by providing a node ID and password to recover the key from Lightspark.
77
+ * Key loader that loads an RSA signing key by providing a node ID and password
78
+ * to recover the key from Lightspark.
74
79
  */
75
80
  export class NodeIdAndPasswordSigningKeyLoader implements SigningKeyLoader {
76
81
  private readonly nodeId: string;
package/src/client.ts CHANGED
@@ -12,18 +12,20 @@ import type {
12
12
  SigningKey,
13
13
  } from "@lightsparkdev/core";
14
14
  import {
15
- createSha256Hash,
16
15
  DefaultCrypto,
17
16
  LightsparkAuthException,
18
17
  LightsparkException,
19
18
  LightsparkSigningException,
20
19
  NodeKeyCache,
21
- pollUntil,
22
20
  Requester,
23
21
  SigningKeyType,
24
22
  StubAuthProvider,
23
+ createSha256Hash,
24
+ pollUntil,
25
25
  } from "@lightsparkdev/core";
26
26
  import packageJson from "../package.json";
27
+ import NodeKeyLoaderCache from "./NodeKeyLoaderCache.js";
28
+ import { type SigningKeyLoaderArgs } from "./SigningKeyLoader.js";
27
29
  import { BitcoinFeeEstimate as BitcoinFeeEstimateQuery } from "./graphql/BitcoinFeeEstimate.js";
28
30
  import { ClaimUmaInvitation } from "./graphql/ClaimUmaInvitation.js";
29
31
  import { ClaimUmaInvitationWithIncentives } from "./graphql/ClaimUmaInvitationWithIncentives.js";
@@ -45,14 +47,14 @@ import { LightningFeeEstimateForNode } from "./graphql/LightningFeeEstimateForNo
45
47
  import type { AccountDashboard } from "./graphql/MultiNodeDashboard.js";
46
48
  import { MultiNodeDashboard } from "./graphql/MultiNodeDashboard.js";
47
49
  import { PayInvoice } from "./graphql/PayInvoice.js";
48
- import { PaymentRequestsForNode } from "./graphql/PaymentRequestsForNode.js";
49
50
  import { PayUmaInvoice } from "./graphql/PayUmaInvoice.js";
51
+ import { PaymentRequestsForNode } from "./graphql/PaymentRequestsForNode.js";
50
52
  import { RequestWithdrawal } from "./graphql/RequestWithdrawal.js";
51
53
  import { SendPayment } from "./graphql/SendPayment.js";
52
54
  import { SingleNodeDashboard as SingleNodeDashboardQuery } from "./graphql/SingleNodeDashboard.js";
53
- import { TransactionsForNode } from "./graphql/TransactionsForNode.js";
54
55
  import { TransactionSubscription } from "./graphql/TransactionSubscription.js";
55
- import NodeKeyLoaderCache from "./NodeKeyLoaderCache.js";
56
+ import { TransactionsForNode } from "./graphql/TransactionsForNode.js";
57
+ import { TransactionStatus } from "./index.js";
56
58
  import Account from "./objects/Account.js";
57
59
  import { ApiTokenFromJson } from "./objects/ApiToken.js";
58
60
  import BitcoinNetwork from "./objects/BitcoinNetwork.js";
@@ -76,10 +78,9 @@ import type RegionCode from "./objects/RegionCode.js";
76
78
  import type SingleNodeDashboard from "./objects/SingleNodeDashboard.js";
77
79
  import type Transaction from "./objects/Transaction.js";
78
80
  import {
79
- getTransactionQuery,
80
81
  TransactionFromJson,
82
+ getTransactionQuery,
81
83
  } from "./objects/Transaction.js";
82
- import TransactionStatus from "./objects/TransactionStatus.js";
83
84
  import type TransactionUpdate from "./objects/TransactionUpdate.js";
84
85
  import { TransactionUpdateFromJson } from "./objects/TransactionUpdate.js";
85
86
  import type UmaInvitation from "./objects/UmaInvitation.js";
@@ -87,12 +88,12 @@ import { UmaInvitationFromJson } from "./objects/UmaInvitation.js";
87
88
  import type WithdrawalMode from "./objects/WithdrawalMode.js";
88
89
  import type WithdrawalRequest from "./objects/WithdrawalRequest.js";
89
90
  import { WithdrawalRequestFromJson } from "./objects/WithdrawalRequest.js";
90
- import { type SigningKeyLoaderArgs } from "./SigningKeyLoader.js";
91
91
 
92
92
  const sdkVersion = packageJson.version;
93
93
 
94
94
  /**
95
- * The LightsparkClient is the main entrypoint for interacting with the Lightspark API.
95
+ * The LightsparkClient is the main entrypoint for interacting with the
96
+ * Lightspark API.
96
97
  *
97
98
  * ```ts
98
99
  * const lightsparkClient = new LightsparkClient(
@@ -129,7 +130,8 @@ class LightsparkClient {
129
130
  * use, you should use the `AccountTokenAuthProvider`.
130
131
  * @param serverUrl The base URL of the server to connect to. Defaults to lightspark production.
131
132
  * @param cryptoImpl The crypto implementation to use. Defaults to web and node compatible crypto.
132
- * For React Native, you should use the `ReactNativeCrypto` implementation from `@lightsparkdev/react-native`.
133
+ * For React Native, you should use the `ReactNativeCrypto`
134
+ * implementation from `@lightsparkdev/react-native`.
133
135
  */
134
136
  constructor(
135
137
  private authProvider: AuthProvider = new StubAuthProvider(),
@@ -154,9 +156,11 @@ class LightsparkClient {
154
156
  }
155
157
 
156
158
  /**
157
- * Sets the key loader for a node. This unlocks client operations that require a private key.
158
- * Passing in [NodeIdAndPasswordSigningKeyLoaderArgs] loads the RSA key for an OSK node.
159
- * Passing in [MasterSeedSigningKeyLoaderArgs] loads the Secp256k1 key for a remote signing node.
159
+ * Sets the key loader for a node. This unlocks client operations that
160
+ * require a private key. Passing in [NodeIdAndPasswordSigningKeyLoaderArgs]
161
+ * loads the RSA key for an OSK node.
162
+ * Passing in [MasterSeedSigningKeyLoaderArgs] loads the Secp256k1 key for a
163
+ * remote signing node.
160
164
  *
161
165
  * @param nodeId The ID of the node the key is for
162
166
  * @param loader The loader for the key
@@ -171,7 +175,8 @@ class LightsparkClient {
171
175
  }
172
176
 
173
177
  /**
174
- * Gets the signing key for a node. Must have previously called [loadNodeSigningKey].
178
+ * Gets the signing key for a node. Must have previously called
179
+ * [loadNodeSigningKey].
175
180
  *
176
181
  * @param nodeId The ID of the node the key is for
177
182
  * @returns The signing key for the node
@@ -183,7 +188,8 @@ class LightsparkClient {
183
188
  }
184
189
 
185
190
  /**
186
- * Sets the auth provider for the client. This is useful for switching between auth providers if you are using
191
+ * Sets the auth provider for the client.
192
+ * This is useful for switching between auth providers if you are using
187
193
  * multiple accounts or waiting for the user to log in.
188
194
  *
189
195
  * @param authProvider
@@ -282,7 +288,8 @@ class LightsparkClient {
282
288
  }
283
289
 
284
290
  /**
285
- * Starts listening for new transactions or updates to existing transactions for a list of nodes.
291
+ * Starts listening for new transactions or updates to existing transactions
292
+ * for a list of nodes.
286
293
  *
287
294
  * @param nodeIds The node IDs for which to listen to transactions.
288
295
  * @returns A zen-observable that emits transaction updates for the given node IDs.
@@ -305,8 +312,8 @@ class LightsparkClient {
305
312
  }
306
313
 
307
314
  /**
308
- * Retrieves a dashboard of basic info for the authenticated account. See `AccountDashboard` for which info is
309
- * included.
315
+ * Retrieves a dashboard of basic info for the authenticated account.
316
+ * See `AccountDashboard` for which info is included.
310
317
  *
311
318
  * @param nodeIds The node IDs to include in the dashboard. Defaults to undefined (all nodes).
312
319
  * @param bitcoinNetwork The bitcoin network to include in the dashboard. Defaults to MAINNET.
@@ -397,8 +404,8 @@ class LightsparkClient {
397
404
  }
398
405
 
399
406
  /**
400
- * Gets a basic dashboard for a single node, including recent transactions. See `SingleNodeDashboard` for which info is
401
- * included.
407
+ * Gets a basic dashboard for a single node, including recent transactions.
408
+ * See `SingleNodeDashboard` for which info is included.
402
409
  *
403
410
  * @param nodeId The node ID for which to get a dashboard.
404
411
  * @param bitcoinNetwork The bitcoin network for which to get a dashboard. Defaults to MAINNET.
@@ -479,7 +486,8 @@ class LightsparkClient {
479
486
  /**
480
487
  * Creates an invoice for the given node.
481
488
  *
482
- * Test mode note: You can simulate a payment of this invoice in test move using [createTestModePayment].
489
+ * Test mode note: You can simulate a payment of this invoice in test move
490
+ * using [createTestModePayment].
483
491
  *
484
492
  * @param nodeId The node ID for which to create an invoice.
485
493
  * @param amountMsats The amount of the invoice in msats. You can create a zero-amount invoice to accept any payment amount.
@@ -514,11 +522,13 @@ class LightsparkClient {
514
522
  }
515
523
 
516
524
  /**
517
- * Generates a Lightning Invoice (follows the Bolt 11 specification) to request a payment
518
- * from another Lightning Node. This should only be used for generating invoices for LNURLs,
525
+ * Generates a Lightning Invoice (follows the Bolt 11 specification) to
526
+ * request a payment from another Lightning Node.
527
+ * This should only be used for generating invoices for LNURLs,
519
528
  * with [createInvoice] preferred in the general case.
520
529
  *
521
- * Test mode note: You can simulate a payment of this invoice in test move using [createTestModePayment].
530
+ * Test mode note: You can simulate a payment of this invoice in test move
531
+ * using [createTestModePayment].
522
532
  *
523
533
  * @param nodeId The node ID for which to create an invoice.
524
534
  * @param amountMsats The amount of the invoice in msats. You can create a zero-amount invoice to accept any payment amount.
@@ -555,10 +565,12 @@ class LightsparkClient {
555
565
  }
556
566
 
557
567
  /**
558
- * Creates a new invoice for the UMA protocol. The metadata is hashed and included in the invoice.
559
- * This API generates a Lightning Invoice (follows the Bolt 11 specification) to request a payment
560
- * from another Lightning Node. This should only be used for generating invoices for UMA, with `createInvoice`
561
- * preferred in the general case.
568
+ * Creates a new invoice for the UMA protocol.
569
+ * The metadata is hashed and included in the invoice.
570
+ * This API generates a Lightning Invoice (follows the Bolt 11 specification)
571
+ * to request a payment from another Lightning Node.
572
+ * This should only be used for generating invoices for UMA,
573
+ * with `createInvoice` preferred in the general case.
562
574
  *
563
575
  * @param nodeId The node ID for which to create an invoice.
564
576
  * @param amountMsats The amount of the invoice in msats. You can create a zero-amount invoice to accept any payment amount.
@@ -606,7 +618,8 @@ class LightsparkClient {
606
618
  }
607
619
 
608
620
  /**
609
- * Gets an estimate of the fee for sending a payment over the given bitcoin network.
621
+ * Gets an estimate of the fee for sending a payment over the given bitcoin
622
+ * network.
610
623
  *
611
624
  * @param bitcoinNetwork The bitcoin network for which to get a fee estimate. Defaults to MAINNET.
612
625
  * @returns A fee estimate for the given bitcoin network including a minimum fee rate, and a max-speed fee rate.
@@ -652,7 +665,8 @@ class LightsparkClient {
652
665
  }
653
666
 
654
667
  /**
655
- * Returns an estimate of the fees that will be paid to send a payment to another Lightning node.
668
+ * Returns an estimate of the fees that will be paid to send a payment to
669
+ * another Lightning node.
656
670
  *
657
671
  * @param nodeId The node from where you want to send the payment.
658
672
  * @param destinationNodePublicKey The public key of the node that you want to pay.
@@ -698,17 +712,20 @@ class LightsparkClient {
698
712
  /**
699
713
  * Sends a lightning payment for a given invoice.
700
714
  *
701
- * Test mode note: For test mode, you can use the [createTestModeInvoice] function to create an invoice you can
702
- * pay in test mode.
715
+ * Test mode note: For test mode, you can use the [createTestModeInvoice]
716
+ * function to create an invoice you can pay in test mode.
703
717
  *
704
718
  * @param payerNodeId The ID of the node that will pay the invoice.
705
719
  * @param encodedInvoice The encoded invoice to pay.
706
720
  * @param maximumFeesMsats Maximum fees (in msats) to pay for the payment. This parameter is required.
707
- * As guidance, a maximum fee of 16 basis points should make almost all transactions succeed. For example,
708
- * for a transaction between 10k sats and 100k sats, this would mean a fee limit of 16 to 160 sats.
721
+ * As guidance, a maximum fee of 16 basis points should make almost all
722
+ * transactions succeed. For example,
723
+ * for a transaction between 10k sats and 100k sats,
724
+ * this would mean a fee limit of 16 to 160 sats.
709
725
  * @param timeoutSecs A timeout for the payment in seconds. Defaults to 60 seconds.
710
726
  * @param amountMsats The amount to pay in msats for a zero-amount invoice. Defaults to the full amount of the
711
- * invoice. NOTE: This parameter can only be passed for a zero-amount invoice. Otherwise, the call will fail.
727
+ * invoice. NOTE: This parameter can only be passed for a zero-amount
728
+ * invoice. Otherwise, the call will fail.
712
729
  * @returns An `OutgoingPayment` object if the payment was successful, or undefined if the payment failed.
713
730
  */
714
731
  public async payInvoice(
@@ -749,18 +766,23 @@ class LightsparkClient {
749
766
  }
750
767
 
751
768
  /**
752
- * sends an UMA payment to a node on the Lightning Network, based on the invoice
753
- * (as defined by the BOLT11 specification) that you provide.
754
- * This should only be used for paying UMA invoices, with `payInvoice` preferred in the general case.
769
+ * sends an UMA payment to a node on the Lightning Network,
770
+ * based on the invoice (as defined by the BOLT11 specification) that you
771
+ * provide.
772
+ * This should only be used for paying UMA invoices,
773
+ * with `payInvoice` preferred in the general case.
755
774
  *
756
775
  * @param payerNodeId The ID of the node that will pay the invoice.
757
776
  * @param encodedInvoice The encoded invoice to pay.
758
777
  * @param maximumFeesMsats Maximum fees (in msats) to pay for the payment. This parameter is required.
759
- * As guidance, a maximum fee of 16 basis points should make almost all transactions succeed. For example,
760
- * for a transaction between 10k sats and 100k sats, this would mean a fee limit of 16 to 160 sats.
778
+ * As guidance, a maximum fee of 16 basis points should make almost all
779
+ * transactions succeed. For example,
780
+ * for a transaction between 10k sats and 100k sats,
781
+ * this would mean a fee limit of 16 to 160 sats.
761
782
  * @param timeoutSecs A timeout for the payment in seconds. Defaults to 60 seconds.
762
783
  * @param amountMsats The amount to pay in msats for a zero-amount invoice. Defaults to the full amount of the
763
- * invoice. NOTE: This parameter can only be passed for a zero-amount invoice. Otherwise, the call will fail.
784
+ * invoice. NOTE: This parameter can only be passed for a zero-amount
785
+ * invoice. Otherwise, the call will fail.
764
786
  * @returns An `OutgoingPayment` object if the payment was successful, or undefined if the payment failed.
765
787
  */
766
788
  public async payUmaInvoice(
@@ -801,7 +823,8 @@ class LightsparkClient {
801
823
  }
802
824
 
803
825
  /**
804
- * Waits for a transaction to have a completed status, and returns the transaction.
826
+ * Waits for a transaction to have a completed status, and returns the
827
+ * transaction.
805
828
  *
806
829
  * @param transactionId The ID of the transaction to wait for
807
830
  * @param pollTimeoutSecs The timeout in seconds that we will wait before throwing an exception
@@ -848,15 +871,18 @@ class LightsparkClient {
848
871
  }
849
872
 
850
873
  /**
851
- * Sends a payment directly to a node on the Lightning Network through the public key of the node without an invoice.
874
+ * Sends a payment directly to a node on the Lightning Network through the
875
+ * public key of the node without an invoice.
852
876
  *
853
877
  * @param payerNodeId The ID of the node that will send the payment.
854
878
  * @param destinationPublicKey The public key of the destination node.
855
879
  * @param timeoutSecs The timeout in seconds that we will try to make the payment.
856
880
  * @param amountMsats The amount to pay in msats.
857
881
  * @param maximumFeesMsats Maximum fees (in msats) to pay for the payment. This parameter is required.
858
- * As guidance, a maximum fee of 15 basis points should make almost all transactions succeed. For example,
859
- * for a transaction between 10k sats and 100k sats, this would mean a fee limit of 15 to 150 sats.
882
+ * As guidance, a maximum fee of 15 basis points should make almost all
883
+ * transactions succeed. For example,
884
+ * for a transaction between 10k sats and 100k sats,
885
+ * this would mean a fee limit of 15 to 150 sats.
860
886
  * @returns An `OutgoingPayment` object if the payment was successful, or undefined if the payment failed.
861
887
  */
862
888
  public async sendPayment(
@@ -894,7 +920,8 @@ class LightsparkClient {
894
920
  }
895
921
 
896
922
  /**
897
- * Creates an L1 Bitcoin wallet address for a given node which can be used to deposit or withdraw funds.
923
+ * Creates an L1 Bitcoin wallet address for a given node which can be used to
924
+ * deposit or withdraw funds.
898
925
  *
899
926
  * @param nodeId The ID of the node to create a wallet address for.
900
927
  * @returns A string containing the wallet address for the given node.
@@ -908,12 +935,15 @@ class LightsparkClient {
908
935
  }
909
936
 
910
937
  /**
911
- * Withdraws funds from the account and sends it to the requested bitcoin address.
938
+ * Withdraws funds from the account and sends it to the requested bitcoin
939
+ * address.
912
940
  *
913
- * Depending on the chosen mode, it will first take the funds from the wallet, and if applicable, close channels
914
- * appropriately to recover enough funds and reopen channels with the remaining funds.
915
- * The process is asynchronous and may take up to a few minutes. You can check the progress by polling the
916
- * `WithdrawalRequest` that is created, or by subscribing to a webhook.
941
+ * Depending on the chosen mode, it will first take the funds from the
942
+ * wallet, and if applicable, close channels appropriately to recover enough
943
+ * funds and reopen channels with the remaining funds.
944
+ * The process is asynchronous and may take up to a few minutes.
945
+ * You can check the progress by polling the `WithdrawalRequest` that is
946
+ * created, or by subscribing to a webhook.
917
947
  *
918
948
  * @param nodeId The ID of the node from which to withdraw funds.
919
949
  * @param amountSats The amount of funds to withdraw in satoshis.
@@ -940,9 +970,10 @@ class LightsparkClient {
940
970
  }
941
971
 
942
972
  /**
943
- * Adds funds to a Lightspark node on the REGTEST network. If the amount is not specified, 10,000,000 SATOSHI will be
944
- * added. This API only functions for nodes created on the REGTEST network and will return an error when called for
945
- * any non-REGTEST node.
973
+ * Adds funds to a Lightspark node on the REGTEST network.
974
+ * If the amount is not specified, 10,000,000 SATOSHI will be added.
975
+ * This API only functions for nodes created on the REGTEST network and will
976
+ * return an error when called for any non-REGTEST node.
946
977
  *
947
978
  * @param nodeId The ID of the node to fund. Must be a REGTEST node.
948
979
  * @param amountSats The amount of funds to add to the node in satoshis. Defaults to 10,000,000 SATOSHI.
@@ -960,8 +991,8 @@ class LightsparkClient {
960
991
  }
961
992
 
962
993
  /**
963
- * Creates a new API token that can be used to authenticate requests for this account when using the Lightspark APIs
964
- * and SDKs.
994
+ * Creates a new API token that can be used to authenticate requests for this
995
+ * account when using the Lightspark APIs and SDKs.
965
996
  *
966
997
  * @param name Creates a new API token that can be used to authenticate requests for this account when using the
967
998
  * Lightspark APIs and SDKs.
@@ -1005,8 +1036,9 @@ class LightsparkClient {
1005
1036
  }
1006
1037
 
1007
1038
  /**
1008
- * In test mode, generates a Lightning Invoice which can be paid by a local node.
1009
- * This call is only valid in test mode. You can then pay the invoice using [payInvoice].
1039
+ * In test mode, generates a Lightning Invoice which can be paid by a local
1040
+ * node. This call is only valid in test mode.
1041
+ * You can then pay the invoice using [payInvoice].
1010
1042
  *
1011
1043
  * @param localNodeId The ID of the node that will pay the invoice.
1012
1044
  * @param amountMsats The amount to pay in milli-satoshis.
@@ -1046,8 +1078,9 @@ class LightsparkClient {
1046
1078
  }
1047
1079
 
1048
1080
  /**
1049
- * In test mode, simulates a payment of a Lightning Invoice from another node.
1050
- * This can only be used in test mode and should be used with invoices generated by [createInvoice].
1081
+ * In test mode, simulates a payment of a Lightning Invoice from another
1082
+ * node. This can only be used in test mode and should be used with invoices
1083
+ * generated by [createInvoice].
1051
1084
  *
1052
1085
  * @param localNodeId The ID of the node that will receive the payment.
1053
1086
  * @param encodedInvoice The encoded invoice to pay.
@@ -1079,8 +1112,8 @@ class LightsparkClient {
1079
1112
  }
1080
1113
 
1081
1114
  /**
1082
- * Creates an UMA invitation. If you are part of the incentive program, you should use
1083
- * [createUmaInvitationWithIncentives].
1115
+ * Creates an UMA invitation. If you are part of the incentive program,
1116
+ * you should use [createUmaInvitationWithIncentives].
1084
1117
  *
1085
1118
  * @param inviterUma The UMA of the inviter.
1086
1119
  * @returns The invitation that was created.
@@ -1150,8 +1183,8 @@ class LightsparkClient {
1150
1183
  }
1151
1184
 
1152
1185
  /**
1153
- * Claims an UMA invitation. If you are part of the incentive program, you should use
1154
- * [claimUmaInvitationWithIncentives].
1186
+ * Claims an UMA invitation. If you are part of the incentive program,
1187
+ * you should use [claimUmaInvitationWithIncentives].
1155
1188
  *
1156
1189
  * @param invitationCode The invitation code to claim.
1157
1190
  * @param inviteeUma The UMA of the invitee.
@@ -1266,7 +1299,8 @@ class LightsparkClient {
1266
1299
  /**
1267
1300
  * Executes a raw `Query` against the Lightspark API.
1268
1301
  *
1269
- * This generally should not be used directly, but is exposed for advanced use cases and for internal use to retrieve
1302
+ * This generally should not be used directly,
1303
+ * but is exposed for advanced use cases and for internal use to retrieve
1270
1304
  * complex fields from objects.
1271
1305
  *
1272
1306
  * @param query The `Query` to execute.
package/src/env.ts CHANGED
@@ -1,6 +1,8 @@
1
1
  // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
2
 
3
- /* These utils are only needed in NodeJS contexts and so the file is exported separately
3
+ /*
4
+ * These utils are only needed in NodeJS contexts and so the file is exported
5
+ * separately
4
6
  in the package to avoid eg unnecessary browser bundling */
5
7
  import dotenv from "dotenv";
6
8
  import { getBitcoinNetworkOrThrow } from "./helpers.js";
@@ -26,12 +26,16 @@ import type TransactionFailures from "./TransactionFailures.js";
26
26
  import type TransactionStatus from "./TransactionStatus.js";
27
27
  import type TransactionType from "./TransactionType.js";
28
28
 
29
- /** This is an object representing the connected Lightspark account. You can retrieve this object to see your account information and objects tied to your account. **/
29
+ /**
30
+ * This is an object representing the connected Lightspark account.
31
+ * You can retrieve this object to see your account information and objects
32
+ * tied to your account. *
33
+ */
30
34
  class Account implements LightsparkNodeOwner, Entity {
31
35
  constructor(
32
36
  /**
33
- * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque
34
- * string.
37
+ * The unique identifier of this entity across all Lightspark systems.
38
+ * Should be treated as an opaque string.
35
39
  **/
36
40
  public readonly id: string,
37
41
  /** The date and time when the entity was first created. **/
@@ -7,12 +7,16 @@ import { PageInfoFromJson, PageInfoToJson } from "./PageInfo.js";
7
7
 
8
8
  interface AccountToApiTokensConnection {
9
9
  /**
10
- * The total count of objects in this connection, using the current filters. It is different from the
11
- * number of objects returned in the current page (in the `entities` field).
10
+ * The total count of objects in this connection, using the current filters.
11
+ * It is different from the number of objects returned in the current page
12
+ * (in the `entities` field).
12
13
  **/
13
14
  count: number;
14
15
 
15
- /** An object that holds pagination information about the objects in this connection. **/
16
+ /**
17
+ * An object that holds pagination information about the objects in this
18
+ * connection. *
19
+ */
16
20
  pageInfo: PageInfo;
17
21
 
18
22
  /** The API tokens for the current page of this connection. **/
@@ -7,8 +7,9 @@ import { ChannelFromJson } from "./Channel.js";
7
7
  class AccountToChannelsConnection {
8
8
  constructor(
9
9
  /**
10
- * The total count of objects in this connection, using the current filters. It is different from the
11
- * number of objects returned in the current page (in the `entities` field).
10
+ * The total count of objects in this connection, using the current
11
+ * filters. It is different from the number of objects returned in the
12
+ * current page (in the `entities` field).
12
13
  **/
13
14
  public readonly count: number,
14
15
  /** The channels for the current page of this connection. **/