@lightsparkdev/lightspark-sdk 1.7.1 → 1.8.1

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 (51) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/{chunk-DSWMAFFH.js → chunk-4KFNQOMH.js} +99 -41
  3. package/dist/{index-85107c9f.d.ts → index-9a69ef6a.d.ts} +18 -6
  4. package/dist/index.cjs +158 -94
  5. package/dist/index.d.cts +2 -2
  6. package/dist/index.d.ts +2 -2
  7. package/dist/index.js +4 -4
  8. package/dist/objects/index.cjs +112 -54
  9. package/dist/objects/index.d.cts +1 -1
  10. package/dist/objects/index.d.ts +1 -1
  11. package/dist/objects/index.js +1 -1
  12. package/package.json +2 -2
  13. package/src/client.ts +1 -1
  14. package/src/objects/Account.ts +9 -2
  15. package/src/objects/ApiToken.ts +5 -2
  16. package/src/objects/AuditLogActor.ts +5 -2
  17. package/src/objects/Channel.ts +5 -2
  18. package/src/objects/ChannelClosingTransaction.ts +5 -3
  19. package/src/objects/ChannelOpeningTransaction.ts +5 -3
  20. package/src/objects/ChannelSnapshot.ts +5 -2
  21. package/src/objects/CurrencyUnit.ts +1 -1
  22. package/src/objects/Deposit.ts +5 -2
  23. package/src/objects/Entity.ts +2 -0
  24. package/src/objects/GraphNode.ts +5 -2
  25. package/src/objects/Hop.ts +5 -2
  26. package/src/objects/IncomingPayment.ts +5 -2
  27. package/src/objects/IncomingPaymentAttempt.ts +5 -2
  28. package/src/objects/Invoice.ts +23 -2
  29. package/src/objects/LightningTransaction.ts +5 -2
  30. package/src/objects/LightsparkNode.ts +5 -2
  31. package/src/objects/LightsparkNodeOwner.ts +5 -2
  32. package/src/objects/LightsparkNodeWithOSK.ts +5 -3
  33. package/src/objects/LightsparkNodeWithRemoteSigning.ts +5 -3
  34. package/src/objects/Node.ts +5 -2
  35. package/src/objects/OnChainTransaction.ts +5 -2
  36. package/src/objects/OutgoingPayment.ts +5 -2
  37. package/src/objects/OutgoingPaymentAttempt.ts +5 -3
  38. package/src/objects/PaymentRequest.ts +11 -2
  39. package/src/objects/RegionCode.ts +2 -0
  40. package/src/objects/RoutingTransaction.ts +5 -2
  41. package/src/objects/Signable.ts +5 -2
  42. package/src/objects/SignablePayload.ts +5 -2
  43. package/src/objects/Transaction.ts +5 -2
  44. package/src/objects/TransactionStatus.ts +1 -1
  45. package/src/objects/UmaInvitation.ts +5 -2
  46. package/src/objects/Wallet.ts +7 -2
  47. package/src/objects/WalletStatus.ts +2 -2
  48. package/src/objects/Withdrawal.ts +5 -2
  49. package/src/objects/WithdrawalRequest.ts +5 -2
  50. package/src/tests/generated-objects.test.ts +93 -0
  51. package/src/tests/serialization.test.ts +0 -21
@@ -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 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 RequestInitiator, bn as RequestWithdrawalInput, bo as RequestWithdrawalOutput, bp as RichText, bq as RiskRating, br as RoutingTransaction, bt as RoutingTransactionFailureReason, bu as ScreenNodeInput, bv as ScreenNodeOutput, bw as Secret, bx as SendPaymentInput, by as SendPaymentOutput, bz as SetInvoicePaymentHashInput, bA as SetInvoicePaymentHashOutput, bB as SignInvoiceInput, bC as SignInvoiceOutput, bD as SignMessagesInput, bE as SignMessagesOutput, bF as Signable, bH as SignablePayload, bJ as SignablePayloadStatus, bK as SingleNodeDashboard, bL as Transaction, bN as TransactionFailures, bO as TransactionStatus, bP as TransactionType, bQ as TransactionUpdate, bR as UmaInvitation, bT as UpdateChannelPerCommitmentPointInput, bU as UpdateChannelPerCommitmentPointOutput, bV as UpdateNodeSharedSecretInput, bW as UpdateNodeSharedSecretOutput, bX as Wallet, bY as WalletStatus, bZ as WalletToPaymentRequestsConnection, b_ as WalletToTransactionsConnection, b$ as WalletToWithdrawalRequestsConnection, W as WebhookEventType, c0 as Withdrawal, c2 as WithdrawalFeeEstimateInput, c3 as WithdrawalFeeEstimateOutput, c4 as WithdrawalMode, c5 as WithdrawalRequest, c6 as WithdrawalRequestStatus, c7 as WithdrawalRequestToChannelClosingTransactionsConnection, c8 as WithdrawalRequestToChannelOpeningTransactionsConnection, c9 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, bs as getRoutingTransactionQuery, bI as getSignablePayloadQuery, bG as getSignableQuery, bM as getTransactionQuery, bS as getUmaInvitationQuery, c1 as getWithdrawalQuery } from '../index-85107c9f.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 RequestInitiator, bn as RequestWithdrawalInput, bo as RequestWithdrawalOutput, bp as RichText, bq as RiskRating, br as RoutingTransaction, bt as RoutingTransactionFailureReason, bu as ScreenNodeInput, bv as ScreenNodeOutput, bw as Secret, bx as SendPaymentInput, by as SendPaymentOutput, bz as SetInvoicePaymentHashInput, bA as SetInvoicePaymentHashOutput, bB as SignInvoiceInput, bC as SignInvoiceOutput, bD as SignMessagesInput, bE as SignMessagesOutput, bF as Signable, bH as SignablePayload, bJ as SignablePayloadStatus, bK as SingleNodeDashboard, bL as Transaction, bN as TransactionFailures, bO as TransactionStatus, bP as TransactionType, bQ as TransactionUpdate, bR as UmaInvitation, bT as UpdateChannelPerCommitmentPointInput, bU as UpdateChannelPerCommitmentPointOutput, bV as UpdateNodeSharedSecretInput, bW as UpdateNodeSharedSecretOutput, bX as Wallet, bY as WalletStatus, bZ as WalletToPaymentRequestsConnection, b_ as WalletToTransactionsConnection, b$ as WalletToWithdrawalRequestsConnection, W as WebhookEventType, c0 as Withdrawal, c2 as WithdrawalFeeEstimateInput, c3 as WithdrawalFeeEstimateOutput, c4 as WithdrawalMode, c5 as WithdrawalRequest, c6 as WithdrawalRequestStatus, c7 as WithdrawalRequestToChannelClosingTransactionsConnection, c8 as WithdrawalRequestToChannelOpeningTransactionsConnection, c9 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, bs as getRoutingTransactionQuery, bI as getSignablePayloadQuery, bG as getSignableQuery, bM as getTransactionQuery, bS as getUmaInvitationQuery, c1 as getWithdrawalQuery } from '../index-9a69ef6a.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 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 RequestInitiator, bn as RequestWithdrawalInput, bo as RequestWithdrawalOutput, bp as RichText, bq as RiskRating, br as RoutingTransaction, bt as RoutingTransactionFailureReason, bu as ScreenNodeInput, bv as ScreenNodeOutput, bw as Secret, bx as SendPaymentInput, by as SendPaymentOutput, bz as SetInvoicePaymentHashInput, bA as SetInvoicePaymentHashOutput, bB as SignInvoiceInput, bC as SignInvoiceOutput, bD as SignMessagesInput, bE as SignMessagesOutput, bF as Signable, bH as SignablePayload, bJ as SignablePayloadStatus, bK as SingleNodeDashboard, bL as Transaction, bN as TransactionFailures, bO as TransactionStatus, bP as TransactionType, bQ as TransactionUpdate, bR as UmaInvitation, bT as UpdateChannelPerCommitmentPointInput, bU as UpdateChannelPerCommitmentPointOutput, bV as UpdateNodeSharedSecretInput, bW as UpdateNodeSharedSecretOutput, bX as Wallet, bY as WalletStatus, bZ as WalletToPaymentRequestsConnection, b_ as WalletToTransactionsConnection, b$ as WalletToWithdrawalRequestsConnection, W as WebhookEventType, c0 as Withdrawal, c2 as WithdrawalFeeEstimateInput, c3 as WithdrawalFeeEstimateOutput, c4 as WithdrawalMode, c5 as WithdrawalRequest, c6 as WithdrawalRequestStatus, c7 as WithdrawalRequestToChannelClosingTransactionsConnection, c8 as WithdrawalRequestToChannelOpeningTransactionsConnection, c9 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, bs as getRoutingTransactionQuery, bI as getSignablePayloadQuery, bG as getSignableQuery, bM as getTransactionQuery, bS as getUmaInvitationQuery, c1 as getWithdrawalQuery } from '../index-85107c9f.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 RequestInitiator, bn as RequestWithdrawalInput, bo as RequestWithdrawalOutput, bp as RichText, bq as RiskRating, br as RoutingTransaction, bt as RoutingTransactionFailureReason, bu as ScreenNodeInput, bv as ScreenNodeOutput, bw as Secret, bx as SendPaymentInput, by as SendPaymentOutput, bz as SetInvoicePaymentHashInput, bA as SetInvoicePaymentHashOutput, bB as SignInvoiceInput, bC as SignInvoiceOutput, bD as SignMessagesInput, bE as SignMessagesOutput, bF as Signable, bH as SignablePayload, bJ as SignablePayloadStatus, bK as SingleNodeDashboard, bL as Transaction, bN as TransactionFailures, bO as TransactionStatus, bP as TransactionType, bQ as TransactionUpdate, bR as UmaInvitation, bT as UpdateChannelPerCommitmentPointInput, bU as UpdateChannelPerCommitmentPointOutput, bV as UpdateNodeSharedSecretInput, bW as UpdateNodeSharedSecretOutput, bX as Wallet, bY as WalletStatus, bZ as WalletToPaymentRequestsConnection, b_ as WalletToTransactionsConnection, b$ as WalletToWithdrawalRequestsConnection, W as WebhookEventType, c0 as Withdrawal, c2 as WithdrawalFeeEstimateInput, c3 as WithdrawalFeeEstimateOutput, c4 as WithdrawalMode, c5 as WithdrawalRequest, c6 as WithdrawalRequestStatus, c7 as WithdrawalRequestToChannelClosingTransactionsConnection, c8 as WithdrawalRequestToChannelOpeningTransactionsConnection, c9 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, bs as getRoutingTransactionQuery, bI as getSignablePayloadQuery, bG as getSignableQuery, bM as getTransactionQuery, bS as getUmaInvitationQuery, c1 as getWithdrawalQuery } from '../index-9a69ef6a.js';
2
2
  export { B as BitcoinNetwork } from '../BitcoinNetwork-4f6ea015.js';
3
3
  import '@lightsparkdev/core';
4
4
  import 'zen-observable';
@@ -59,7 +59,7 @@ import {
59
59
  getTransactionQuery,
60
60
  getUmaInvitationQuery,
61
61
  getWithdrawalQuery
62
- } from "../chunk-DSWMAFFH.js";
62
+ } from "../chunk-4KFNQOMH.js";
63
63
  import {
64
64
  BitcoinNetwork_default
65
65
  } from "../chunk-K6SAUSAX.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightsparkdev/lightspark-sdk",
3
- "version": "1.7.1",
3
+ "version": "1.8.1",
4
4
  "description": "Lightspark JS SDK",
5
5
  "author": "Lightspark Inc.",
6
6
  "keywords": [
@@ -85,7 +85,7 @@
85
85
  },
86
86
  "license": "Apache-2.0",
87
87
  "dependencies": {
88
- "@lightsparkdev/core": "1.1.0",
88
+ "@lightsparkdev/core": "1.2.1",
89
89
  "@lightsparkdev/crypto-wasm": "0.1.4",
90
90
  "crypto-browserify": "^3.12.0",
91
91
  "dayjs": "^1.11.7",
package/src/client.ts CHANGED
@@ -139,7 +139,7 @@ class LightsparkClient {
139
139
  * @param authProvider The auth provider to use for authentication. Defaults to a stub auth provider.
140
140
  * For server-side
141
141
  * use, you should use the `AccountTokenAuthProvider`.
142
- * @param serverUrl The base URL of the server to connect to. Defaults to lightspark production.
142
+ * @param serverUrl The base URL for the Lightspark environment you want to connect to. Your API credentials determine whether you're in test mode or live mode. Typically, you won't need to set this parameter unless you want to connect to a different Lightspark environment than the default production environment.
143
143
  * @param cryptoImpl The crypto implementation to use. Defaults to web and node compatible crypto.
144
144
  * For React Native, you should use the `ReactNativeCrypto`
145
145
  * implementation from `@lightsparkdev/react-native`.
@@ -1,6 +1,6 @@
1
1
  // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
2
 
3
- import { type Query } from "@lightsparkdev/core";
3
+ import { isObject, type Query } from "@lightsparkdev/core";
4
4
  import autoBind from "auto-bind";
5
5
  import type LightsparkClient from "../client.js";
6
6
  import type AccountToApiTokensConnection from "./AccountToApiTokensConnection.js";
@@ -1676,6 +1676,8 @@ query FetchAccountToPaymentRequestsConnection($first: Int, $after: String, $afte
1676
1676
  currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
1677
1677
  currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
1678
1678
  }
1679
+ invoice_is_uma: is_uma
1680
+ invoice_is_lnurl: is_lnurl
1679
1681
  }
1680
1682
  }
1681
1683
  }
@@ -1888,7 +1890,12 @@ query GetAccount {
1888
1890
  ${FRAGMENT}
1889
1891
  `,
1890
1892
  variables: {},
1891
- constructObject: (data: any) => AccountFromJson(data.current_account),
1893
+ constructObject: (data: unknown) =>
1894
+ isObject(data) &&
1895
+ "current_account" in data &&
1896
+ isObject(data.current_account)
1897
+ ? AccountFromJson(data.current_account)
1898
+ : null,
1892
1899
  };
1893
1900
  }
1894
1901
 
@@ -1,6 +1,6 @@
1
1
  // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
2
 
3
- import { type Query } from "@lightsparkdev/core";
3
+ import { isObject, type Query } from "@lightsparkdev/core";
4
4
  import Permission from "./Permission.js";
5
5
 
6
6
  /**
@@ -94,7 +94,10 @@ query GetApiToken($id: ID!) {
94
94
  ${FRAGMENT}
95
95
  `,
96
96
  variables: { id },
97
- constructObject: (data: any) => ApiTokenFromJson(data.entity),
97
+ constructObject: (data: unknown) =>
98
+ isObject(data) && "entity" in data && isObject(data.entity)
99
+ ? ApiTokenFromJson(data.entity)
100
+ : null,
98
101
  };
99
102
  };
100
103
 
@@ -1,6 +1,6 @@
1
1
  // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
2
 
3
- import { LightsparkException, type Query } from "@lightsparkdev/core";
3
+ import { LightsparkException, isObject, type Query } from "@lightsparkdev/core";
4
4
  import type ApiToken from "./ApiToken.js";
5
5
  import Permission from "./Permission.js";
6
6
 
@@ -89,7 +89,10 @@ query GetAuditLogActor($id: ID!) {
89
89
  ${FRAGMENT}
90
90
  `,
91
91
  variables: { id },
92
- constructObject: (data: any) => AuditLogActorFromJson(data.entity),
92
+ constructObject: (data: unknown) =>
93
+ isObject(data) && "entity" in data && isObject(data.entity)
94
+ ? AuditLogActorFromJson(data.entity)
95
+ : null,
93
96
  };
94
97
  };
95
98
 
@@ -1,6 +1,6 @@
1
1
  // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
2
 
3
- import { type Query } from "@lightsparkdev/core";
3
+ import { isObject, type Query } from "@lightsparkdev/core";
4
4
  import autoBind from "auto-bind";
5
5
  import type LightsparkClient from "../client.js";
6
6
  import type ChannelFees from "./ChannelFees.js";
@@ -181,7 +181,10 @@ query GetChannel($id: ID!) {
181
181
  ${FRAGMENT}
182
182
  `,
183
183
  variables: { id },
184
- constructObject: (data: any) => ChannelFromJson(data.entity),
184
+ constructObject: (data: unknown) =>
185
+ isObject(data) && "entity" in data && isObject(data.entity)
186
+ ? ChannelFromJson(data.entity)
187
+ : null,
185
188
  };
186
189
  }
187
190
 
@@ -1,6 +1,6 @@
1
1
  // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
2
 
3
- import { type Query } from "@lightsparkdev/core";
3
+ import { isObject, type Query } from "@lightsparkdev/core";
4
4
  import type CurrencyAmount from "./CurrencyAmount.js";
5
5
  import {
6
6
  CurrencyAmountFromJson,
@@ -163,8 +163,10 @@ query GetChannelClosingTransaction($id: ID!) {
163
163
  ${FRAGMENT}
164
164
  `,
165
165
  variables: { id },
166
- constructObject: (data: any) =>
167
- ChannelClosingTransactionFromJson(data.entity),
166
+ constructObject: (data: unknown) =>
167
+ isObject(data) && "entity" in data && isObject(data.entity)
168
+ ? ChannelClosingTransactionFromJson(data.entity)
169
+ : null,
168
170
  };
169
171
  };
170
172
 
@@ -1,6 +1,6 @@
1
1
  // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
2
 
3
- import { type Query } from "@lightsparkdev/core";
3
+ import { isObject, type Query } from "@lightsparkdev/core";
4
4
  import type CurrencyAmount from "./CurrencyAmount.js";
5
5
  import {
6
6
  CurrencyAmountFromJson,
@@ -163,8 +163,10 @@ query GetChannelOpeningTransaction($id: ID!) {
163
163
  ${FRAGMENT}
164
164
  `,
165
165
  variables: { id },
166
- constructObject: (data: any) =>
167
- ChannelOpeningTransactionFromJson(data.entity),
166
+ constructObject: (data: unknown) =>
167
+ isObject(data) && "entity" in data && isObject(data.entity)
168
+ ? ChannelOpeningTransactionFromJson(data.entity)
169
+ : null,
168
170
  };
169
171
  };
170
172
 
@@ -1,6 +1,6 @@
1
1
  // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
2
 
3
- import { type Query } from "@lightsparkdev/core";
3
+ import { isObject, type Query } from "@lightsparkdev/core";
4
4
  import type CurrencyAmount from "./CurrencyAmount.js";
5
5
  import {
6
6
  CurrencyAmountFromJson,
@@ -161,7 +161,10 @@ query GetChannelSnapshot($id: ID!) {
161
161
  ${FRAGMENT}
162
162
  `,
163
163
  variables: { id },
164
- constructObject: (data: any) => ChannelSnapshotFromJson(data.entity),
164
+ constructObject: (data: unknown) =>
165
+ isObject(data) && "entity" in data && isObject(data.entity)
166
+ ? ChannelSnapshotFromJson(data.entity)
167
+ : null,
165
168
  };
166
169
  };
167
170
 
@@ -18,7 +18,7 @@ export enum CurrencyUnit {
18
18
  */
19
19
  SATOSHI = "SATOSHI",
20
20
  /**
21
- * 0.001 Satoshi, or 10e-11 Bitcoin. We recommend using the Satoshi unit instead when possible.
21
+ * 0.001 Satoshi, or 10e-11 Bitcoin. We recommend using the Satoshi unit instead when possible. *
22
22
  */
23
23
  MILLISATOSHI = "MILLISATOSHI",
24
24
  /** United States Dollar. **/
@@ -1,6 +1,6 @@
1
1
  // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
2
 
3
- import { type Query } from "@lightsparkdev/core";
3
+ import { isObject, type Query } from "@lightsparkdev/core";
4
4
  import type CurrencyAmount from "./CurrencyAmount.js";
5
5
  import {
6
6
  CurrencyAmountFromJson,
@@ -155,7 +155,10 @@ query GetDeposit($id: ID!) {
155
155
  ${FRAGMENT}
156
156
  `,
157
157
  variables: { id },
158
- constructObject: (data: any) => DepositFromJson(data.entity),
158
+ constructObject: (data: unknown) =>
159
+ isObject(data) && "entity" in data && isObject(data.entity)
160
+ ? DepositFromJson(data.entity)
161
+ : null,
159
162
  };
160
163
  };
161
164
 
@@ -684,6 +684,8 @@ fragment EntityFragment on Entity {
684
684
  currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
685
685
  currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
686
686
  }
687
+ invoice_is_uma: is_uma
688
+ invoice_is_lnurl: is_lnurl
687
689
  }
688
690
  ... on LightsparkNodeWithOSK {
689
691
  __typename
@@ -1,6 +1,6 @@
1
1
  // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
2
 
3
- import { type Query } from "@lightsparkdev/core";
3
+ import { isObject, type Query } from "@lightsparkdev/core";
4
4
  import autoBind from "auto-bind";
5
5
  import type LightsparkClient from "../client.js";
6
6
  import BitcoinNetwork from "./BitcoinNetwork.js";
@@ -107,7 +107,10 @@ query GetGraphNode($id: ID!) {
107
107
  ${FRAGMENT}
108
108
  `,
109
109
  variables: { id },
110
- constructObject: (data: any) => GraphNodeFromJson(data.entity),
110
+ constructObject: (data: unknown) =>
111
+ isObject(data) && "entity" in data && isObject(data.entity)
112
+ ? GraphNodeFromJson(data.entity)
113
+ : null,
111
114
  };
112
115
  }
113
116
 
@@ -1,6 +1,6 @@
1
1
  // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
2
 
3
- import { type Query } from "@lightsparkdev/core";
3
+ import { isObject, type Query } from "@lightsparkdev/core";
4
4
  import type CurrencyAmount from "./CurrencyAmount.js";
5
5
  import {
6
6
  CurrencyAmountFromJson,
@@ -124,7 +124,10 @@ query GetHop($id: ID!) {
124
124
  ${FRAGMENT}
125
125
  `,
126
126
  variables: { id },
127
- constructObject: (data: any) => HopFromJson(data.entity),
127
+ constructObject: (data: unknown) =>
128
+ isObject(data) && "entity" in data && isObject(data.entity)
129
+ ? HopFromJson(data.entity)
130
+ : null,
128
131
  };
129
132
  };
130
133
 
@@ -1,6 +1,6 @@
1
1
  // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
2
 
3
- import { type Query } from "@lightsparkdev/core";
3
+ import { isObject, type Query } from "@lightsparkdev/core";
4
4
  import autoBind from "auto-bind";
5
5
  import type LightsparkClient from "../client.js";
6
6
  import type CurrencyAmount from "./CurrencyAmount.js";
@@ -139,7 +139,10 @@ query GetIncomingPayment($id: ID!) {
139
139
  ${FRAGMENT}
140
140
  `,
141
141
  variables: { id },
142
- constructObject: (data: any) => IncomingPaymentFromJson(data.entity),
142
+ constructObject: (data: unknown) =>
143
+ isObject(data) && "entity" in data && isObject(data.entity)
144
+ ? IncomingPaymentFromJson(data.entity)
145
+ : null,
143
146
  };
144
147
  }
145
148
 
@@ -1,6 +1,6 @@
1
1
  // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
2
 
3
- import { type Query } from "@lightsparkdev/core";
3
+ import { isObject, type Query } from "@lightsparkdev/core";
4
4
  import type CurrencyAmount from "./CurrencyAmount.js";
5
5
  import {
6
6
  CurrencyAmountFromJson,
@@ -110,7 +110,10 @@ query GetIncomingPaymentAttempt($id: ID!) {
110
110
  ${FRAGMENT}
111
111
  `,
112
112
  variables: { id },
113
- constructObject: (data: any) => IncomingPaymentAttemptFromJson(data.entity),
113
+ constructObject: (data: unknown) =>
114
+ isObject(data) && "entity" in data && isObject(data.entity)
115
+ ? IncomingPaymentAttemptFromJson(data.entity)
116
+ : null,
114
117
  };
115
118
  };
116
119
 
@@ -1,6 +1,6 @@
1
1
  // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
2
 
3
- import { type Query } from "@lightsparkdev/core";
3
+ import { isObject, type Query } from "@lightsparkdev/core";
4
4
  import type CurrencyAmount from "./CurrencyAmount.js";
5
5
  import {
6
6
  CurrencyAmountFromJson,
@@ -35,6 +35,18 @@ interface Invoice {
35
35
 
36
36
  /** The total amount that has been paid to this invoice. **/
37
37
  amountPaid?: CurrencyAmount | undefined;
38
+
39
+ /**
40
+ * Whether this invoice is an UMA invoice or not. NOTE: this field is only set if the invoice
41
+ * was created using the recommended `create_uma_invoice` function.
42
+ **/
43
+ isUma?: boolean | undefined;
44
+
45
+ /**
46
+ * Whether this invoice is an LNURL invoice or not. NOTE: this field is only set if the invoice
47
+ * was created using the recommended `create_lnurl_invoice` function.
48
+ **/
49
+ isLnurl?: boolean | undefined;
38
50
  }
39
51
 
40
52
  export const InvoiceFromJson = (obj: any): Invoice => {
@@ -50,6 +62,8 @@ export const InvoiceFromJson = (obj: any): Invoice => {
50
62
  amountPaid: !!obj["invoice_amount_paid"]
51
63
  ? CurrencyAmountFromJson(obj["invoice_amount_paid"])
52
64
  : undefined,
65
+ isUma: obj["invoice_is_uma"],
66
+ isLnurl: obj["invoice_is_lnurl"],
53
67
  } as Invoice;
54
68
  };
55
69
  export const InvoiceToJson = (obj: Invoice): any => {
@@ -63,6 +77,8 @@ export const InvoiceToJson = (obj: Invoice): any => {
63
77
  invoice_amount_paid: obj.amountPaid
64
78
  ? CurrencyAmountToJson(obj.amountPaid)
65
79
  : undefined,
80
+ invoice_is_uma: obj.isUma,
81
+ invoice_is_lnurl: obj.isLnurl,
66
82
  };
67
83
  };
68
84
 
@@ -372,6 +388,8 @@ fragment InvoiceFragment on Invoice {
372
388
  currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
373
389
  currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
374
390
  }
391
+ invoice_is_uma: is_uma
392
+ invoice_is_lnurl: is_lnurl
375
393
  }`;
376
394
 
377
395
  export const getInvoiceQuery = (id: string): Query<Invoice> => {
@@ -388,7 +406,10 @@ query GetInvoice($id: ID!) {
388
406
  ${FRAGMENT}
389
407
  `,
390
408
  variables: { id },
391
- constructObject: (data: any) => InvoiceFromJson(data.entity),
409
+ constructObject: (data: unknown) =>
410
+ isObject(data) && "entity" in data && isObject(data.entity)
411
+ ? InvoiceFromJson(data.entity)
412
+ : null,
392
413
  };
393
414
  };
394
415
 
@@ -1,6 +1,6 @@
1
1
  // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
2
 
3
- import { LightsparkException, type Query } from "@lightsparkdev/core";
3
+ import { LightsparkException, isObject, type Query } from "@lightsparkdev/core";
4
4
  import type CurrencyAmount from "./CurrencyAmount.js";
5
5
  import {
6
6
  CurrencyAmountFromJson,
@@ -679,7 +679,10 @@ query GetLightningTransaction($id: ID!) {
679
679
  ${FRAGMENT}
680
680
  `,
681
681
  variables: { id },
682
- constructObject: (data: any) => LightningTransactionFromJson(data.entity),
682
+ constructObject: (data: unknown) =>
683
+ isObject(data) && "entity" in data && isObject(data.entity)
684
+ ? LightningTransactionFromJson(data.entity)
685
+ : null,
683
686
  };
684
687
  };
685
688
 
@@ -1,6 +1,6 @@
1
1
  // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
2
 
3
- import { LightsparkException, type Query } from "@lightsparkdev/core";
3
+ import { LightsparkException, isObject, type Query } from "@lightsparkdev/core";
4
4
  import type LightsparkClient from "../client.js";
5
5
  import type Balances from "./Balances.js";
6
6
  import { BalancesFromJson, BalancesToJson } from "./Balances.js";
@@ -661,7 +661,10 @@ query GetLightsparkNode($id: ID!) {
661
661
  ${FRAGMENT}
662
662
  `,
663
663
  variables: { id },
664
- constructObject: (data: any) => LightsparkNodeFromJson(data.entity),
664
+ constructObject: (data: unknown) =>
665
+ isObject(data) && "entity" in data && isObject(data.entity)
666
+ ? LightsparkNodeFromJson(data.entity)
667
+ : null,
665
668
  };
666
669
  };
667
670
 
@@ -1,6 +1,6 @@
1
1
  // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
2
 
3
- import { LightsparkException, type Query } from "@lightsparkdev/core";
3
+ import { LightsparkException, isObject, type Query } from "@lightsparkdev/core";
4
4
  import Account from "./Account.js";
5
5
  import { BalancesFromJson, BalancesToJson } from "./Balances.js";
6
6
  import Wallet from "./Wallet.js";
@@ -154,7 +154,10 @@ query GetLightsparkNodeOwner($id: ID!) {
154
154
  ${FRAGMENT}
155
155
  `,
156
156
  variables: { id },
157
- constructObject: (data: any) => LightsparkNodeOwnerFromJson(data.entity),
157
+ constructObject: (data: unknown) =>
158
+ isObject(data) && "entity" in data && isObject(data.entity)
159
+ ? LightsparkNodeOwnerFromJson(data.entity)
160
+ : null,
158
161
  };
159
162
  };
160
163
 
@@ -1,6 +1,6 @@
1
1
  // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
2
 
3
- import { type Query } from "@lightsparkdev/core";
3
+ import { isObject, type Query } from "@lightsparkdev/core";
4
4
  import autoBind from "auto-bind";
5
5
  import type LightsparkClient from "../client.js";
6
6
  import type Balances from "./Balances.js";
@@ -360,8 +360,10 @@ query GetLightsparkNodeWithOSK($id: ID!) {
360
360
  ${FRAGMENT}
361
361
  `,
362
362
  variables: { id },
363
- constructObject: (data: any) =>
364
- LightsparkNodeWithOSKFromJson(data.entity),
363
+ constructObject: (data: unknown) =>
364
+ isObject(data) && "entity" in data && isObject(data.entity)
365
+ ? LightsparkNodeWithOSKFromJson(data.entity)
366
+ : null,
365
367
  };
366
368
  }
367
369
 
@@ -1,6 +1,6 @@
1
1
  // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
2
 
3
- import { type Query } from "@lightsparkdev/core";
3
+ import { isObject, type Query } from "@lightsparkdev/core";
4
4
  import autoBind from "auto-bind";
5
5
  import type LightsparkClient from "../client.js";
6
6
  import type Balances from "./Balances.js";
@@ -353,8 +353,10 @@ query GetLightsparkNodeWithRemoteSigning($id: ID!) {
353
353
  ${FRAGMENT}
354
354
  `,
355
355
  variables: { id },
356
- constructObject: (data: any) =>
357
- LightsparkNodeWithRemoteSigningFromJson(data.entity),
356
+ constructObject: (data: unknown) =>
357
+ isObject(data) && "entity" in data && isObject(data.entity)
358
+ ? LightsparkNodeWithRemoteSigningFromJson(data.entity)
359
+ : null,
358
360
  };
359
361
  }
360
362
 
@@ -1,6 +1,6 @@
1
1
  // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
2
 
3
- import { LightsparkException, type Query } from "@lightsparkdev/core";
3
+ import { LightsparkException, isObject, type Query } from "@lightsparkdev/core";
4
4
  import type LightsparkClient from "../client.js";
5
5
  import { BalancesFromJson, BalancesToJson } from "./Balances.js";
6
6
  import BitcoinNetwork from "./BitcoinNetwork.js";
@@ -630,7 +630,10 @@ query GetNode($id: ID!) {
630
630
  ${FRAGMENT}
631
631
  `,
632
632
  variables: { id },
633
- constructObject: (data: any) => NodeFromJson(data.entity),
633
+ constructObject: (data: unknown) =>
634
+ isObject(data) && "entity" in data && isObject(data.entity)
635
+ ? NodeFromJson(data.entity)
636
+ : null,
634
637
  };
635
638
  };
636
639
 
@@ -1,6 +1,6 @@
1
1
  // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
2
 
3
- import { LightsparkException, type Query } from "@lightsparkdev/core";
3
+ import { LightsparkException, isObject, type Query } from "@lightsparkdev/core";
4
4
  import type ChannelClosingTransaction from "./ChannelClosingTransaction.js";
5
5
  import type ChannelOpeningTransaction from "./ChannelOpeningTransaction.js";
6
6
  import type CurrencyAmount from "./CurrencyAmount.js";
@@ -425,7 +425,10 @@ query GetOnChainTransaction($id: ID!) {
425
425
  ${FRAGMENT}
426
426
  `,
427
427
  variables: { id },
428
- constructObject: (data: any) => OnChainTransactionFromJson(data.entity),
428
+ constructObject: (data: unknown) =>
429
+ isObject(data) && "entity" in data && isObject(data.entity)
430
+ ? OnChainTransactionFromJson(data.entity)
431
+ : null,
429
432
  };
430
433
  };
431
434
 
@@ -1,6 +1,6 @@
1
1
  // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
2
 
3
- import { type Query } from "@lightsparkdev/core";
3
+ import { isObject, type Query } from "@lightsparkdev/core";
4
4
  import autoBind from "auto-bind";
5
5
  import type LightsparkClient from "../client.js";
6
6
  import type CurrencyAmount from "./CurrencyAmount.js";
@@ -163,7 +163,10 @@ query GetOutgoingPayment($id: ID!) {
163
163
  ${FRAGMENT}
164
164
  `,
165
165
  variables: { id },
166
- constructObject: (data: any) => OutgoingPaymentFromJson(data.entity),
166
+ constructObject: (data: unknown) =>
167
+ isObject(data) && "entity" in data && isObject(data.entity)
168
+ ? OutgoingPaymentFromJson(data.entity)
169
+ : null,
167
170
  };
168
171
  }
169
172
 
@@ -1,6 +1,6 @@
1
1
  // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
2
 
3
- import { type Query } from "@lightsparkdev/core";
3
+ import { isObject, type Query } from "@lightsparkdev/core";
4
4
  import autoBind from "auto-bind";
5
5
  import type LightsparkClient from "../client.js";
6
6
  import type CurrencyAmount from "./CurrencyAmount.js";
@@ -143,8 +143,10 @@ query GetOutgoingPaymentAttempt($id: ID!) {
143
143
  ${FRAGMENT}
144
144
  `,
145
145
  variables: { id },
146
- constructObject: (data: any) =>
147
- OutgoingPaymentAttemptFromJson(data.entity),
146
+ constructObject: (data: unknown) =>
147
+ isObject(data) && "entity" in data && isObject(data.entity)
148
+ ? OutgoingPaymentAttemptFromJson(data.entity)
149
+ : null,
148
150
  };
149
151
  }
150
152