@lightsparkdev/lightspark-sdk 1.1.7 → 1.2.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 (136) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/{chunk-5RDIWPBE.js → chunk-D32EWIPX.js} +3 -1
  3. package/dist/{chunk-7UT6YX37.js → chunk-VTPDR6P4.js} +393 -275
  4. package/dist/env.cjs +3 -1
  5. package/dist/env.d.cts +17 -0
  6. package/dist/env.js +2 -2
  7. package/dist/{index-d31f4469.d.ts → index-5acc6526.d.ts} +1403 -408
  8. package/dist/index.cjs +424 -296
  9. package/dist/index.d.cts +41 -0
  10. package/dist/index.d.ts +3 -3
  11. package/dist/index.js +32 -27
  12. package/dist/objects/index.cjs +395 -277
  13. package/dist/objects/index.d.cts +4 -0
  14. package/dist/objects/index.d.ts +1 -1
  15. package/dist/objects/index.js +6 -6
  16. package/dist/{text-encoding-MDIPJAHL.js → text-encoding-26SMKBAQ.js} +3 -1
  17. package/package.json +5 -5
  18. package/src/auth/AccountTokenAuthProvider.ts +15 -11
  19. package/src/client.ts +7 -6
  20. package/src/helpers.ts +3 -1
  21. package/src/objects/Account.ts +21 -2
  22. package/src/objects/AccountToApiTokensConnection.ts +16 -5
  23. package/src/objects/AccountToChannelsConnection.ts +14 -0
  24. package/src/objects/AccountToNodesConnection.ts +19 -5
  25. package/src/objects/AccountToPaymentRequestsConnection.ts +21 -5
  26. package/src/objects/AccountToTransactionsConnection.ts +33 -9
  27. package/src/objects/AccountToWalletsConnection.ts +13 -4
  28. package/src/objects/ApiToken.ts +13 -3
  29. package/src/objects/Balances.ts +17 -3
  30. package/src/objects/BlockchainBalance.ts +34 -9
  31. package/src/objects/Channel.ts +92 -16
  32. package/src/objects/ChannelClosingTransaction.ts +81 -61
  33. package/src/objects/ChannelFees.ts +16 -5
  34. package/src/objects/ChannelOpeningTransaction.ts +81 -61
  35. package/src/objects/ChannelSnapshot.ts +32 -8
  36. package/src/objects/ChannelToTransactionsConnection.ts +26 -6
  37. package/src/objects/Connection.ts +205 -10
  38. package/src/objects/CreateApiTokenInput.ts +8 -2
  39. package/src/objects/CreateApiTokenOutput.ts +9 -3
  40. package/src/objects/CreateInvoiceInput.ts +14 -5
  41. package/src/objects/CreateInvoiceOutput.ts +7 -2
  42. package/src/objects/CreateLnurlInvoiceInput.ts +13 -3
  43. package/src/objects/CreateNodeWalletAddressInput.ts +9 -2
  44. package/src/objects/CreateNodeWalletAddressOutput.ts +10 -2
  45. package/src/objects/CreateTestModeInvoiceInput.ts +14 -4
  46. package/src/objects/CreateTestModeInvoiceOutput.ts +10 -2
  47. package/src/objects/CreateTestModePaymentInput.ts +12 -3
  48. package/src/objects/CreateTestModePaymentoutput.ts +12 -2
  49. package/src/objects/CreateUmaInvoiceInput.ts +13 -3
  50. package/src/objects/CurrencyAmount.ts +13 -2
  51. package/src/objects/DeclineToSignMessagesInput.ts +9 -2
  52. package/src/objects/DeclineToSignMessagesOutput.ts +15 -3
  53. package/src/objects/DeleteApiTokenInput.ts +7 -2
  54. package/src/objects/DeleteApiTokenOutput.ts +7 -2
  55. package/src/objects/Deposit.ts +77 -61
  56. package/src/objects/Entity.ts +2 -2
  57. package/src/objects/FeeEstimate.ts +12 -3
  58. package/src/objects/FundNodeInput.ts +9 -3
  59. package/src/objects/FundNodeOutput.ts +11 -3
  60. package/src/objects/GraphNode.ts +49 -5
  61. package/src/objects/Hop.ts +27 -9
  62. package/src/objects/IdAndSignature.ts +8 -2
  63. package/src/objects/IncomingPayment.ts +50 -7
  64. package/src/objects/IncomingPaymentAttempt.ts +21 -5
  65. package/src/objects/IncomingPaymentToAttemptsConnection.ts +21 -5
  66. package/src/objects/Invoice.ts +37 -24
  67. package/src/objects/InvoiceData.ts +21 -6
  68. package/src/objects/LightningFeeEstimateForInvoiceInput.ts +13 -3
  69. package/src/objects/LightningFeeEstimateForNodeInput.ts +12 -2
  70. package/src/objects/LightningFeeEstimateOutput.ts +15 -3
  71. package/src/objects/LightningTransaction.ts +117 -28
  72. package/src/objects/LightsparkNode.ts +250 -210
  73. package/src/objects/LightsparkNodeOwner.ts +35 -4
  74. package/src/objects/LightsparkNodeToChannelsConnection.ts +17 -4
  75. package/src/objects/LightsparkNodeWithOSK.ts +127 -17
  76. package/src/objects/LightsparkNodeWithRemoteSigning.ts +122 -15
  77. package/src/objects/Node.ts +209 -68
  78. package/src/objects/NodeAddress.ts +8 -2
  79. package/src/objects/NodeToAddressesConnection.ts +13 -3
  80. package/src/objects/OnChainTransaction.ts +156 -44
  81. package/src/objects/OutgoingPayment.ts +72 -14
  82. package/src/objects/OutgoingPaymentAttempt.ts +63 -8
  83. package/src/objects/OutgoingPaymentAttemptToHopsConnection.ts +18 -5
  84. package/src/objects/OutgoingPaymentToAttemptsConnection.ts +17 -4
  85. package/src/objects/OutgoingPaymentsForInvoiceQueryInput.ts +12 -3
  86. package/src/objects/OutgoingPaymentsForInvoiceQueryOutput.ts +11 -2
  87. package/src/objects/PageInfo.ts +14 -6
  88. package/src/objects/PayInvoiceInput.ts +12 -3
  89. package/src/objects/PayInvoiceOutput.ts +7 -2
  90. package/src/objects/PayUmaInvoiceInput.ts +12 -3
  91. package/src/objects/PaymentRequest.ts +27 -5
  92. package/src/objects/PaymentRequestData.ts +27 -4
  93. package/src/objects/PostTransactionData.ts +12 -3
  94. package/src/objects/RegisterPaymentInput.ts +10 -2
  95. package/src/objects/RegisterPaymentOutput.ts +9 -2
  96. package/src/objects/ReleaseChannelPerCommitmentSecretInput.ts +13 -2
  97. package/src/objects/ReleaseChannelPerCommitmentSecretOutput.ts +9 -2
  98. package/src/objects/ReleasePaymentPreimageInput.ts +10 -2
  99. package/src/objects/ReleasePaymentPreimageOutput.ts +9 -2
  100. package/src/objects/RequestWithdrawalInput.ts +12 -2
  101. package/src/objects/RequestWithdrawalOutput.ts +9 -2
  102. package/src/objects/RichText.ts +7 -2
  103. package/src/objects/RoutingTransaction.ts +62 -41
  104. package/src/objects/ScreenNodeInput.ts +8 -2
  105. package/src/objects/ScreenNodeOutput.ts +7 -2
  106. package/src/objects/Secret.ts +8 -2
  107. package/src/objects/SendPaymentInput.ts +11 -2
  108. package/src/objects/SendPaymentOutput.ts +7 -2
  109. package/src/objects/SetInvoicePaymentHashInput.ts +12 -3
  110. package/src/objects/SetInvoicePaymentHashOutput.ts +9 -2
  111. package/src/objects/SignInvoiceInput.ts +9 -2
  112. package/src/objects/SignInvoiceOutput.ts +7 -2
  113. package/src/objects/SignMessagesInput.ts +13 -3
  114. package/src/objects/SignMessagesOutput.ts +13 -3
  115. package/src/objects/Signable.ts +10 -3
  116. package/src/objects/SignablePayload.ts +18 -5
  117. package/src/objects/Transaction.ts +206 -9
  118. package/src/objects/TransactionFailures.ts +11 -4
  119. package/src/objects/UpdateChannelPerCommitmentPointInput.ts +13 -2
  120. package/src/objects/UpdateChannelPerCommitmentPointOutput.ts +9 -2
  121. package/src/objects/UpdateNodeSharedSecretInput.ts +10 -2
  122. package/src/objects/UpdateNodeSharedSecretOutput.ts +9 -2
  123. package/src/objects/Wallet.ts +34 -5
  124. package/src/objects/WalletToPaymentRequestsConnection.ts +21 -5
  125. package/src/objects/WalletToTransactionsConnection.ts +16 -5
  126. package/src/objects/Withdrawal.ts +77 -61
  127. package/src/objects/WithdrawalRequest.ts +42 -4
  128. package/src/objects/WithdrawalRequestToChannelClosingTransactionsConnection.ts +19 -4
  129. package/src/objects/WithdrawalRequestToChannelOpeningTransactionsConnection.ts +19 -4
  130. package/src/objects/index.ts +5 -2
  131. package/src/tests/integration/constants.ts +13 -0
  132. package/src/tests/integration/general-regtest.test.ts +652 -0
  133. package/src/tests/serialization.test.ts +21 -0
  134. package/src/webhooks.ts +1 -1
  135. package/src/tests/integration/client.test.ts +0 -207
  136. /package/dist/{chunk-NIMBE7W3.js → chunk-BMTV3EA2.js} +0 -0
@@ -42,11 +42,9 @@ __export(objects_exports, {
42
42
  IncomingPayment: () => IncomingPayment_default,
43
43
  IncomingPaymentAttemptStatus: () => IncomingPaymentAttemptStatus_default,
44
44
  InvoiceType: () => InvoiceType_default,
45
- LightsparkNode: () => LightsparkNode_default,
46
45
  LightsparkNodeStatus: () => LightsparkNodeStatus_default,
47
46
  LightsparkNodeWithOSK: () => LightsparkNodeWithOSK_default,
48
47
  LightsparkNodeWithRemoteSigning: () => LightsparkNodeWithRemoteSigning_default,
49
- Node: () => Node_default,
50
48
  NodeAddressType: () => NodeAddressType_default,
51
49
  OutgoingPayment: () => OutgoingPayment_default,
52
50
  OutgoingPaymentAttempt: () => OutgoingPaymentAttempt_default,
@@ -76,6 +74,8 @@ __export(objects_exports, {
76
74
  getInvoiceQuery: () => getInvoiceQuery,
77
75
  getLightningTransactionQuery: () => getLightningTransactionQuery,
78
76
  getLightsparkNodeOwnerQuery: () => getLightsparkNodeOwnerQuery,
77
+ getLightsparkNodeQuery: () => getLightsparkNodeQuery,
78
+ getNodeQuery: () => getNodeQuery,
79
79
  getOnChainTransactionQuery: () => getOnChainTransactionQuery,
80
80
  getPaymentRequestQuery: () => getPaymentRequestQuery,
81
81
  getRoutingTransactionQuery: () => getRoutingTransactionQuery,
@@ -87,7 +87,7 @@ __export(objects_exports, {
87
87
  module.exports = __toCommonJS(objects_exports);
88
88
 
89
89
  // src/objects/Account.ts
90
- var import_auto_bind12 = __toESM(require("auto-bind"), 1);
90
+ var import_auto_bind10 = __toESM(require("auto-bind"), 1);
91
91
 
92
92
  // src/objects/Permission.ts
93
93
  var Permission = /* @__PURE__ */ ((Permission2) => {
@@ -204,6 +204,15 @@ var CurrencyAmountFromJson = (obj) => {
204
204
  preferredCurrencyValueApprox: obj["currency_amount_preferred_currency_value_approx"]
205
205
  };
206
206
  };
207
+ var CurrencyAmountToJson = (obj) => {
208
+ return {
209
+ currency_amount_original_value: obj.originalValue,
210
+ currency_amount_original_unit: obj.originalUnit,
211
+ currency_amount_preferred_currency_unit: obj.preferredCurrencyUnit,
212
+ currency_amount_preferred_currency_value_rounded: obj.preferredCurrencyValueRounded,
213
+ currency_amount_preferred_currency_value_approx: obj.preferredCurrencyValueApprox
214
+ };
215
+ };
207
216
 
208
217
  // src/objects/ChannelFees.ts
209
218
  var ChannelFeesFromJson = (obj) => {
@@ -212,6 +221,12 @@ var ChannelFeesFromJson = (obj) => {
212
221
  feeRatePerMil: obj["channel_fees_fee_rate_per_mil"]
213
222
  };
214
223
  };
224
+ var ChannelFeesToJson = (obj) => {
225
+ return {
226
+ channel_fees_base_fee: obj.baseFee ? CurrencyAmountToJson(obj.baseFee) : void 0,
227
+ channel_fees_fee_rate_per_mil: obj.feeRatePerMil
228
+ };
229
+ };
215
230
 
216
231
  // src/objects/ChannelStatus.ts
217
232
  var ChannelStatus = /* @__PURE__ */ ((ChannelStatus2) => {
@@ -356,6 +371,29 @@ ${FRAGMENT2}
356
371
  constructObject: (data) => ChannelFromJson(data.entity)
357
372
  };
358
373
  }
374
+ toJson() {
375
+ return {
376
+ __typename: "Channel",
377
+ channel_id: this.id,
378
+ channel_created_at: this.createdAt,
379
+ channel_updated_at: this.updatedAt,
380
+ channel_funding_transaction: { id: this.fundingTransactionId },
381
+ channel_capacity: this.capacity ? CurrencyAmountToJson(this.capacity) : void 0,
382
+ channel_local_balance: this.localBalance ? CurrencyAmountToJson(this.localBalance) : void 0,
383
+ channel_local_unsettled_balance: this.localUnsettledBalance ? CurrencyAmountToJson(this.localUnsettledBalance) : void 0,
384
+ channel_remote_balance: this.remoteBalance ? CurrencyAmountToJson(this.remoteBalance) : void 0,
385
+ channel_remote_unsettled_balance: this.remoteUnsettledBalance ? CurrencyAmountToJson(this.remoteUnsettledBalance) : void 0,
386
+ channel_unsettled_balance: this.unsettledBalance ? CurrencyAmountToJson(this.unsettledBalance) : void 0,
387
+ channel_total_balance: this.totalBalance ? CurrencyAmountToJson(this.totalBalance) : void 0,
388
+ channel_status: this.status,
389
+ channel_estimated_force_closure_wait_minutes: this.estimatedForceClosureWaitMinutes,
390
+ channel_commit_fee: this.commitFee ? CurrencyAmountToJson(this.commitFee) : void 0,
391
+ channel_fees: this.fees ? ChannelFeesToJson(this.fees) : void 0,
392
+ channel_remote_node: { id: this.remoteNodeId },
393
+ channel_local_node: { id: this.localNodeId },
394
+ channel_short_channel_id: this.shortChannelId
395
+ };
396
+ }
359
397
  };
360
398
  var ChannelFromJson = (obj) => {
361
399
  return new Channel(
@@ -484,6 +522,14 @@ var AccountToChannelsConnection = class {
484
522
  this.entities = entities;
485
523
  (0, import_auto_bind2.default)(this);
486
524
  }
525
+ toJson() {
526
+ return {
527
+ account_to_channels_connection_count: this.count,
528
+ account_to_channels_connection_entities: this.entities.map(
529
+ (e) => e.toJson()
530
+ )
531
+ };
532
+ }
487
533
  };
488
534
  var AccountToChannelsConnectionFromJson = (obj) => {
489
535
  return new AccountToChannelsConnection(
@@ -497,7 +543,6 @@ var AccountToChannelsConnection_default = AccountToChannelsConnection;
497
543
 
498
544
  // src/objects/LightsparkNode.ts
499
545
  var import_core = require("@lightsparkdev/core");
500
- var import_auto_bind5 = __toESM(require("auto-bind"), 1);
501
546
 
502
547
  // src/objects/Balances.ts
503
548
  var BalancesFromJson = (obj) => {
@@ -511,6 +556,17 @@ var BalancesFromJson = (obj) => {
511
556
  )
512
557
  };
513
558
  };
559
+ var BalancesToJson = (obj) => {
560
+ return {
561
+ balances_owned_balance: CurrencyAmountToJson(obj.ownedBalance),
562
+ balances_available_to_send_balance: CurrencyAmountToJson(
563
+ obj.availableToSendBalance
564
+ ),
565
+ balances_available_to_withdraw_balance: CurrencyAmountToJson(
566
+ obj.availableToWithdrawBalance
567
+ )
568
+ };
569
+ };
514
570
 
515
571
  // src/objects/BitcoinNetwork.ts
516
572
  var BitcoinNetwork = /* @__PURE__ */ ((BitcoinNetwork2) => {
@@ -534,6 +590,16 @@ var BlockchainBalanceFromJson = (obj) => {
534
590
  availableBalance: !!obj["blockchain_balance_available_balance"] ? CurrencyAmountFromJson(obj["blockchain_balance_available_balance"]) : void 0
535
591
  };
536
592
  };
593
+ var BlockchainBalanceToJson = (obj) => {
594
+ return {
595
+ blockchain_balance_total_balance: obj.totalBalance ? CurrencyAmountToJson(obj.totalBalance) : void 0,
596
+ blockchain_balance_confirmed_balance: obj.confirmedBalance ? CurrencyAmountToJson(obj.confirmedBalance) : void 0,
597
+ blockchain_balance_unconfirmed_balance: obj.unconfirmedBalance ? CurrencyAmountToJson(obj.unconfirmedBalance) : void 0,
598
+ blockchain_balance_locked_balance: obj.lockedBalance ? CurrencyAmountToJson(obj.lockedBalance) : void 0,
599
+ blockchain_balance_required_reserve: obj.requiredReserve ? CurrencyAmountToJson(obj.requiredReserve) : void 0,
600
+ blockchain_balance_available_balance: obj.availableBalance ? CurrencyAmountToJson(obj.availableBalance) : void 0
601
+ };
602
+ };
537
603
 
538
604
  // src/objects/LightsparkNodeStatus.ts
539
605
  var LightsparkNodeStatus = /* @__PURE__ */ ((LightsparkNodeStatus2) => {
@@ -552,6 +618,9 @@ var LightsparkNodeStatus = /* @__PURE__ */ ((LightsparkNodeStatus2) => {
552
618
  })(LightsparkNodeStatus || {});
553
619
  var LightsparkNodeStatus_default = LightsparkNodeStatus;
554
620
 
621
+ // src/objects/LightsparkNodeWithOSK.ts
622
+ var import_auto_bind3 = __toESM(require("auto-bind"), 1);
623
+
555
624
  // src/objects/LightsparkNodeToChannelsConnection.ts
556
625
  var LightsparkNodeToChannelsConnectionFromJson = (obj) => {
557
626
  return {
@@ -566,9 +635,6 @@ var LightsparkNodeToChannelsConnectionFromJson = (obj) => {
566
635
  };
567
636
  };
568
637
 
569
- // src/objects/LightsparkNodeWithOSK.ts
570
- var import_auto_bind3 = __toESM(require("auto-bind"), 1);
571
-
572
638
  // src/objects/NodeAddressType.ts
573
639
  var NodeAddressType = /* @__PURE__ */ ((NodeAddressType2) => {
574
640
  NodeAddressType2["FUTURE_VALUE"] = "FUTURE_VALUE";
@@ -604,6 +670,12 @@ var SecretFromJson = (obj) => {
604
670
  cipher: obj["secret_cipher"]
605
671
  };
606
672
  };
673
+ var SecretToJson = (obj) => {
674
+ return {
675
+ secret_encrypted_value: obj.encryptedValue,
676
+ secret_cipher: obj.cipher
677
+ };
678
+ };
607
679
 
608
680
  // src/objects/LightsparkNodeWithOSK.ts
609
681
  var LightsparkNodeWithOSK = class {
@@ -800,6 +872,30 @@ ${FRAGMENT3}
800
872
  constructObject: (data) => LightsparkNodeWithOSKFromJson(data.entity)
801
873
  };
802
874
  }
875
+ toJson() {
876
+ return {
877
+ __typename: "LightsparkNodeWithOSK",
878
+ lightspark_node_with_o_s_k_id: this.id,
879
+ lightspark_node_with_o_s_k_created_at: this.createdAt,
880
+ lightspark_node_with_o_s_k_updated_at: this.updatedAt,
881
+ lightspark_node_with_o_s_k_alias: this.alias,
882
+ lightspark_node_with_o_s_k_bitcoin_network: this.bitcoinNetwork,
883
+ lightspark_node_with_o_s_k_color: this.color,
884
+ lightspark_node_with_o_s_k_conductivity: this.conductivity,
885
+ lightspark_node_with_o_s_k_display_name: this.displayName,
886
+ lightspark_node_with_o_s_k_public_key: this.publicKey,
887
+ lightspark_node_with_o_s_k_owner: { id: this.ownerId },
888
+ lightspark_node_with_o_s_k_status: this.status,
889
+ lightspark_node_with_o_s_k_total_balance: this.totalBalance ? CurrencyAmountToJson(this.totalBalance) : void 0,
890
+ lightspark_node_with_o_s_k_total_local_balance: this.totalLocalBalance ? CurrencyAmountToJson(this.totalLocalBalance) : void 0,
891
+ lightspark_node_with_o_s_k_local_balance: this.localBalance ? CurrencyAmountToJson(this.localBalance) : void 0,
892
+ lightspark_node_with_o_s_k_remote_balance: this.remoteBalance ? CurrencyAmountToJson(this.remoteBalance) : void 0,
893
+ lightspark_node_with_o_s_k_blockchain_balance: this.blockchainBalance ? BlockchainBalanceToJson(this.blockchainBalance) : void 0,
894
+ lightspark_node_with_o_s_k_uma_prescreening_utxos: this.umaPrescreeningUtxos,
895
+ lightspark_node_with_o_s_k_balances: this.balances ? BalancesToJson(this.balances) : void 0,
896
+ lightspark_node_with_o_s_k_encrypted_signing_private_key: this.encryptedSigningPrivateKey ? SecretToJson(this.encryptedSigningPrivateKey) : void 0
897
+ };
898
+ }
803
899
  };
804
900
  var LightsparkNodeWithOSKFromJson = (obj) => {
805
901
  return new LightsparkNodeWithOSK(
@@ -1161,6 +1257,29 @@ ${FRAGMENT4}
1161
1257
  constructObject: (data) => LightsparkNodeWithRemoteSigningFromJson(data.entity)
1162
1258
  };
1163
1259
  }
1260
+ toJson() {
1261
+ return {
1262
+ __typename: "LightsparkNodeWithRemoteSigning",
1263
+ lightspark_node_with_remote_signing_id: this.id,
1264
+ lightspark_node_with_remote_signing_created_at: this.createdAt,
1265
+ lightspark_node_with_remote_signing_updated_at: this.updatedAt,
1266
+ lightspark_node_with_remote_signing_alias: this.alias,
1267
+ lightspark_node_with_remote_signing_bitcoin_network: this.bitcoinNetwork,
1268
+ lightspark_node_with_remote_signing_color: this.color,
1269
+ lightspark_node_with_remote_signing_conductivity: this.conductivity,
1270
+ lightspark_node_with_remote_signing_display_name: this.displayName,
1271
+ lightspark_node_with_remote_signing_public_key: this.publicKey,
1272
+ lightspark_node_with_remote_signing_owner: { id: this.ownerId },
1273
+ lightspark_node_with_remote_signing_status: this.status,
1274
+ lightspark_node_with_remote_signing_total_balance: this.totalBalance ? CurrencyAmountToJson(this.totalBalance) : void 0,
1275
+ lightspark_node_with_remote_signing_total_local_balance: this.totalLocalBalance ? CurrencyAmountToJson(this.totalLocalBalance) : void 0,
1276
+ lightspark_node_with_remote_signing_local_balance: this.localBalance ? CurrencyAmountToJson(this.localBalance) : void 0,
1277
+ lightspark_node_with_remote_signing_remote_balance: this.remoteBalance ? CurrencyAmountToJson(this.remoteBalance) : void 0,
1278
+ lightspark_node_with_remote_signing_blockchain_balance: this.blockchainBalance ? BlockchainBalanceToJson(this.blockchainBalance) : void 0,
1279
+ lightspark_node_with_remote_signing_uma_prescreening_utxos: this.umaPrescreeningUtxos,
1280
+ lightspark_node_with_remote_signing_balances: this.balances ? BalancesToJson(this.balances) : void 0
1281
+ };
1282
+ }
1164
1283
  };
1165
1284
  var LightsparkNodeWithRemoteSigningFromJson = (obj) => {
1166
1285
  return new LightsparkNodeWithRemoteSigning(
@@ -1326,200 +1445,6 @@ fragment LightsparkNodeWithRemoteSigningFragment on LightsparkNodeWithRemoteSign
1326
1445
  var LightsparkNodeWithRemoteSigning_default = LightsparkNodeWithRemoteSigning;
1327
1446
 
1328
1447
  // src/objects/LightsparkNode.ts
1329
- var LightsparkNode = class {
1330
- constructor(id, createdAt, updatedAt, bitcoinNetwork, displayName, ownerId, umaPrescreeningUtxos, typename, alias, color, conductivity, publicKey, status, totalBalance, totalLocalBalance, localBalance, remoteBalance, blockchainBalance, balances) {
1331
- this.id = id;
1332
- this.createdAt = createdAt;
1333
- this.updatedAt = updatedAt;
1334
- this.bitcoinNetwork = bitcoinNetwork;
1335
- this.displayName = displayName;
1336
- this.ownerId = ownerId;
1337
- this.umaPrescreeningUtxos = umaPrescreeningUtxos;
1338
- this.typename = typename;
1339
- this.alias = alias;
1340
- this.color = color;
1341
- this.conductivity = conductivity;
1342
- this.publicKey = publicKey;
1343
- this.status = status;
1344
- this.totalBalance = totalBalance;
1345
- this.totalLocalBalance = totalLocalBalance;
1346
- this.localBalance = localBalance;
1347
- this.remoteBalance = remoteBalance;
1348
- this.blockchainBalance = blockchainBalance;
1349
- this.balances = balances;
1350
- (0, import_auto_bind5.default)(this);
1351
- }
1352
- async getAddresses(client, first = void 0, types = void 0) {
1353
- return await client.executeRawQuery({
1354
- queryPayload: `
1355
- query FetchNodeToAddressesConnection($entity_id: ID!, $first: Int, $types: [NodeAddressType!]) {
1356
- entity(id: $entity_id) {
1357
- ... on LightsparkNode {
1358
- addresses(, first: $first, types: $types) {
1359
- __typename
1360
- node_to_addresses_connection_count: count
1361
- node_to_addresses_connection_entities: entities {
1362
- __typename
1363
- node_address_address: address
1364
- node_address_type: type
1365
- }
1366
- }
1367
- }
1368
- }
1369
- }
1370
- `,
1371
- variables: { entity_id: this.id, first, types },
1372
- constructObject: (json) => {
1373
- const connection = json["entity"]["addresses"];
1374
- return NodeToAddressesConnectionFromJson(connection);
1375
- }
1376
- });
1377
- }
1378
- async getChannels(client, first = void 0, statuses = void 0, after = void 0) {
1379
- return await client.executeRawQuery({
1380
- queryPayload: `
1381
- query FetchLightsparkNodeToChannelsConnection($entity_id: ID!, $first: Int, $statuses: [ChannelStatus!], $after: String) {
1382
- entity(id: $entity_id) {
1383
- ... on LightsparkNode {
1384
- channels(, first: $first, statuses: $statuses, after: $after) {
1385
- __typename
1386
- lightspark_node_to_channels_connection_count: count
1387
- lightspark_node_to_channels_connection_page_info: page_info {
1388
- __typename
1389
- page_info_has_next_page: has_next_page
1390
- page_info_has_previous_page: has_previous_page
1391
- page_info_start_cursor: start_cursor
1392
- page_info_end_cursor: end_cursor
1393
- }
1394
- lightspark_node_to_channels_connection_entities: entities {
1395
- __typename
1396
- channel_id: id
1397
- channel_created_at: created_at
1398
- channel_updated_at: updated_at
1399
- channel_funding_transaction: funding_transaction {
1400
- id
1401
- }
1402
- channel_capacity: capacity {
1403
- __typename
1404
- currency_amount_original_value: original_value
1405
- currency_amount_original_unit: original_unit
1406
- currency_amount_preferred_currency_unit: preferred_currency_unit
1407
- currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
1408
- currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
1409
- }
1410
- channel_local_balance: local_balance {
1411
- __typename
1412
- currency_amount_original_value: original_value
1413
- currency_amount_original_unit: original_unit
1414
- currency_amount_preferred_currency_unit: preferred_currency_unit
1415
- currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
1416
- currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
1417
- }
1418
- channel_local_unsettled_balance: local_unsettled_balance {
1419
- __typename
1420
- currency_amount_original_value: original_value
1421
- currency_amount_original_unit: original_unit
1422
- currency_amount_preferred_currency_unit: preferred_currency_unit
1423
- currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
1424
- currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
1425
- }
1426
- channel_remote_balance: remote_balance {
1427
- __typename
1428
- currency_amount_original_value: original_value
1429
- currency_amount_original_unit: original_unit
1430
- currency_amount_preferred_currency_unit: preferred_currency_unit
1431
- currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
1432
- currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
1433
- }
1434
- channel_remote_unsettled_balance: remote_unsettled_balance {
1435
- __typename
1436
- currency_amount_original_value: original_value
1437
- currency_amount_original_unit: original_unit
1438
- currency_amount_preferred_currency_unit: preferred_currency_unit
1439
- currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
1440
- currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
1441
- }
1442
- channel_unsettled_balance: unsettled_balance {
1443
- __typename
1444
- currency_amount_original_value: original_value
1445
- currency_amount_original_unit: original_unit
1446
- currency_amount_preferred_currency_unit: preferred_currency_unit
1447
- currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
1448
- currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
1449
- }
1450
- channel_total_balance: total_balance {
1451
- __typename
1452
- currency_amount_original_value: original_value
1453
- currency_amount_original_unit: original_unit
1454
- currency_amount_preferred_currency_unit: preferred_currency_unit
1455
- currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
1456
- currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
1457
- }
1458
- channel_status: status
1459
- channel_estimated_force_closure_wait_minutes: estimated_force_closure_wait_minutes
1460
- channel_commit_fee: commit_fee {
1461
- __typename
1462
- currency_amount_original_value: original_value
1463
- currency_amount_original_unit: original_unit
1464
- currency_amount_preferred_currency_unit: preferred_currency_unit
1465
- currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
1466
- currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
1467
- }
1468
- channel_fees: fees {
1469
- __typename
1470
- channel_fees_base_fee: base_fee {
1471
- __typename
1472
- currency_amount_original_value: original_value
1473
- currency_amount_original_unit: original_unit
1474
- currency_amount_preferred_currency_unit: preferred_currency_unit
1475
- currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
1476
- currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
1477
- }
1478
- channel_fees_fee_rate_per_mil: fee_rate_per_mil
1479
- }
1480
- channel_remote_node: remote_node {
1481
- id
1482
- }
1483
- channel_local_node: local_node {
1484
- id
1485
- }
1486
- channel_short_channel_id: short_channel_id
1487
- }
1488
- }
1489
- }
1490
- }
1491
- }
1492
- `,
1493
- variables: {
1494
- entity_id: this.id,
1495
- first,
1496
- statuses,
1497
- after
1498
- },
1499
- constructObject: (json) => {
1500
- const connection = json["entity"]["channels"];
1501
- return LightsparkNodeToChannelsConnectionFromJson(connection);
1502
- }
1503
- });
1504
- }
1505
- static getLightsparkNodeQuery(id) {
1506
- return {
1507
- queryPayload: `
1508
- query GetLightsparkNode($id: ID!) {
1509
- entity(id: $id) {
1510
- ... on LightsparkNode {
1511
- ...LightsparkNodeFragment
1512
- }
1513
- }
1514
- }
1515
-
1516
- ${FRAGMENT5}
1517
- `,
1518
- variables: { id },
1519
- constructObject: (data) => LightsparkNodeFromJson(data.entity)
1520
- };
1521
- }
1522
- };
1523
1448
  var LightsparkNodeFromJson = (obj) => {
1524
1449
  if (obj["__typename"] == "LightsparkNodeWithOSK") {
1525
1450
  return new LightsparkNodeWithOSK_default(
@@ -1858,7 +1783,23 @@ fragment LightsparkNodeFragment on LightsparkNode {
1858
1783
  }
1859
1784
  }
1860
1785
  }`;
1861
- var LightsparkNode_default = LightsparkNode;
1786
+ var getLightsparkNodeQuery = (id) => {
1787
+ return {
1788
+ queryPayload: `
1789
+ query GetLightsparkNode($id: ID!) {
1790
+ entity(id: $id) {
1791
+ ... on LightsparkNode {
1792
+ ...LightsparkNodeFragment
1793
+ }
1794
+ }
1795
+ }
1796
+
1797
+ ${FRAGMENT5}
1798
+ `,
1799
+ variables: { id },
1800
+ constructObject: (data) => LightsparkNodeFromJson(data.entity)
1801
+ };
1802
+ };
1862
1803
 
1863
1804
  // src/objects/AccountToNodesConnection.ts
1864
1805
  var AccountToNodesConnectionFromJson = (obj) => {
@@ -1877,10 +1818,9 @@ var import_core3 = require("@lightsparkdev/core");
1877
1818
 
1878
1819
  // src/objects/Node.ts
1879
1820
  var import_core2 = require("@lightsparkdev/core");
1880
- var import_auto_bind7 = __toESM(require("auto-bind"), 1);
1881
1821
 
1882
1822
  // src/objects/GraphNode.ts
1883
- var import_auto_bind6 = __toESM(require("auto-bind"), 1);
1823
+ var import_auto_bind5 = __toESM(require("auto-bind"), 1);
1884
1824
  var GraphNode = class {
1885
1825
  constructor(id, createdAt, updatedAt, bitcoinNetwork, displayName, typename, alias, color, conductivity, publicKey) {
1886
1826
  this.id = id;
@@ -1893,7 +1833,7 @@ var GraphNode = class {
1893
1833
  this.color = color;
1894
1834
  this.conductivity = conductivity;
1895
1835
  this.publicKey = publicKey;
1896
- (0, import_auto_bind6.default)(this);
1836
+ (0, import_auto_bind5.default)(this);
1897
1837
  }
1898
1838
  async getAddresses(client, first = void 0, types = void 0) {
1899
1839
  return await client.executeRawQuery({
@@ -1938,6 +1878,20 @@ ${FRAGMENT6}
1938
1878
  constructObject: (data) => GraphNodeFromJson(data.entity)
1939
1879
  };
1940
1880
  }
1881
+ toJson() {
1882
+ return {
1883
+ __typename: "GraphNode",
1884
+ graph_node_id: this.id,
1885
+ graph_node_created_at: this.createdAt,
1886
+ graph_node_updated_at: this.updatedAt,
1887
+ graph_node_alias: this.alias,
1888
+ graph_node_bitcoin_network: this.bitcoinNetwork,
1889
+ graph_node_color: this.color,
1890
+ graph_node_conductivity: this.conductivity,
1891
+ graph_node_display_name: this.displayName,
1892
+ graph_node_public_key: this.publicKey
1893
+ };
1894
+ }
1941
1895
  };
1942
1896
  var GraphNodeFromJson = (obj) => {
1943
1897
  return new GraphNode(
@@ -1969,64 +1923,6 @@ fragment GraphNodeFragment on GraphNode {
1969
1923
  var GraphNode_default = GraphNode;
1970
1924
 
1971
1925
  // src/objects/Node.ts
1972
- var Node = class {
1973
- constructor(id, createdAt, updatedAt, bitcoinNetwork, displayName, typename, alias, color, conductivity, publicKey) {
1974
- this.id = id;
1975
- this.createdAt = createdAt;
1976
- this.updatedAt = updatedAt;
1977
- this.bitcoinNetwork = bitcoinNetwork;
1978
- this.displayName = displayName;
1979
- this.typename = typename;
1980
- this.alias = alias;
1981
- this.color = color;
1982
- this.conductivity = conductivity;
1983
- this.publicKey = publicKey;
1984
- (0, import_auto_bind7.default)(this);
1985
- }
1986
- async getAddresses(client, first = void 0, types = void 0) {
1987
- return await client.executeRawQuery({
1988
- queryPayload: `
1989
- query FetchNodeToAddressesConnection($entity_id: ID!, $first: Int, $types: [NodeAddressType!]) {
1990
- entity(id: $entity_id) {
1991
- ... on Node {
1992
- addresses(, first: $first, types: $types) {
1993
- __typename
1994
- node_to_addresses_connection_count: count
1995
- node_to_addresses_connection_entities: entities {
1996
- __typename
1997
- node_address_address: address
1998
- node_address_type: type
1999
- }
2000
- }
2001
- }
2002
- }
2003
- }
2004
- `,
2005
- variables: { entity_id: this.id, first, types },
2006
- constructObject: (json) => {
2007
- const connection = json["entity"]["addresses"];
2008
- return NodeToAddressesConnectionFromJson(connection);
2009
- }
2010
- });
2011
- }
2012
- static getNodeQuery(id) {
2013
- return {
2014
- queryPayload: `
2015
- query GetNode($id: ID!) {
2016
- entity(id: $id) {
2017
- ... on Node {
2018
- ...NodeFragment
2019
- }
2020
- }
2021
- }
2022
-
2023
- ${FRAGMENT7}
2024
- `,
2025
- variables: { id },
2026
- constructObject: (data) => NodeFromJson(data.entity)
2027
- };
2028
- }
2029
- };
2030
1926
  var NodeFromJson = (obj) => {
2031
1927
  if (obj["__typename"] == "GraphNode") {
2032
1928
  return new GraphNode_default(
@@ -2116,6 +2012,82 @@ var NodeFromJson = (obj) => {
2116
2012
  `Couldn't find a concrete type for interface Node corresponding to the typename=${obj["__typename"]}`
2117
2013
  );
2118
2014
  };
2015
+ var NodeToJson = (obj) => {
2016
+ if (obj.typename == "GraphNode") {
2017
+ const graphNode = obj;
2018
+ return {
2019
+ __typename: "GraphNode",
2020
+ graph_node_id: graphNode.id,
2021
+ graph_node_created_at: graphNode.createdAt,
2022
+ graph_node_updated_at: graphNode.updatedAt,
2023
+ graph_node_alias: graphNode.alias,
2024
+ graph_node_bitcoin_network: graphNode.bitcoinNetwork,
2025
+ graph_node_color: graphNode.color,
2026
+ graph_node_conductivity: graphNode.conductivity,
2027
+ graph_node_display_name: graphNode.displayName,
2028
+ graph_node_public_key: graphNode.publicKey
2029
+ };
2030
+ }
2031
+ if (obj.typename == "LightsparkNodeWithOSK") {
2032
+ const lightsparkNodeWithOSK = obj;
2033
+ return {
2034
+ __typename: "LightsparkNodeWithOSK",
2035
+ lightspark_node_with_o_s_k_id: lightsparkNodeWithOSK.id,
2036
+ lightspark_node_with_o_s_k_created_at: lightsparkNodeWithOSK.createdAt,
2037
+ lightspark_node_with_o_s_k_updated_at: lightsparkNodeWithOSK.updatedAt,
2038
+ lightspark_node_with_o_s_k_alias: lightsparkNodeWithOSK.alias,
2039
+ lightspark_node_with_o_s_k_bitcoin_network: lightsparkNodeWithOSK.bitcoinNetwork,
2040
+ lightspark_node_with_o_s_k_color: lightsparkNodeWithOSK.color,
2041
+ lightspark_node_with_o_s_k_conductivity: lightsparkNodeWithOSK.conductivity,
2042
+ lightspark_node_with_o_s_k_display_name: lightsparkNodeWithOSK.displayName,
2043
+ lightspark_node_with_o_s_k_public_key: lightsparkNodeWithOSK.publicKey,
2044
+ lightspark_node_with_o_s_k_owner: { id: lightsparkNodeWithOSK.ownerId },
2045
+ lightspark_node_with_o_s_k_status: lightsparkNodeWithOSK.status,
2046
+ lightspark_node_with_o_s_k_total_balance: lightsparkNodeWithOSK.totalBalance ? CurrencyAmountToJson(lightsparkNodeWithOSK.totalBalance) : void 0,
2047
+ lightspark_node_with_o_s_k_total_local_balance: lightsparkNodeWithOSK.totalLocalBalance ? CurrencyAmountToJson(lightsparkNodeWithOSK.totalLocalBalance) : void 0,
2048
+ lightspark_node_with_o_s_k_local_balance: lightsparkNodeWithOSK.localBalance ? CurrencyAmountToJson(lightsparkNodeWithOSK.localBalance) : void 0,
2049
+ lightspark_node_with_o_s_k_remote_balance: lightsparkNodeWithOSK.remoteBalance ? CurrencyAmountToJson(lightsparkNodeWithOSK.remoteBalance) : void 0,
2050
+ lightspark_node_with_o_s_k_blockchain_balance: lightsparkNodeWithOSK.blockchainBalance ? BlockchainBalanceToJson(lightsparkNodeWithOSK.blockchainBalance) : void 0,
2051
+ lightspark_node_with_o_s_k_uma_prescreening_utxos: lightsparkNodeWithOSK.umaPrescreeningUtxos,
2052
+ lightspark_node_with_o_s_k_balances: lightsparkNodeWithOSK.balances ? BalancesToJson(lightsparkNodeWithOSK.balances) : void 0,
2053
+ lightspark_node_with_o_s_k_encrypted_signing_private_key: lightsparkNodeWithOSK.encryptedSigningPrivateKey ? SecretToJson(lightsparkNodeWithOSK.encryptedSigningPrivateKey) : void 0
2054
+ };
2055
+ }
2056
+ if (obj.typename == "LightsparkNodeWithRemoteSigning") {
2057
+ const lightsparkNodeWithRemoteSigning = obj;
2058
+ return {
2059
+ __typename: "LightsparkNodeWithRemoteSigning",
2060
+ lightspark_node_with_remote_signing_id: lightsparkNodeWithRemoteSigning.id,
2061
+ lightspark_node_with_remote_signing_created_at: lightsparkNodeWithRemoteSigning.createdAt,
2062
+ lightspark_node_with_remote_signing_updated_at: lightsparkNodeWithRemoteSigning.updatedAt,
2063
+ lightspark_node_with_remote_signing_alias: lightsparkNodeWithRemoteSigning.alias,
2064
+ lightspark_node_with_remote_signing_bitcoin_network: lightsparkNodeWithRemoteSigning.bitcoinNetwork,
2065
+ lightspark_node_with_remote_signing_color: lightsparkNodeWithRemoteSigning.color,
2066
+ lightspark_node_with_remote_signing_conductivity: lightsparkNodeWithRemoteSigning.conductivity,
2067
+ lightspark_node_with_remote_signing_display_name: lightsparkNodeWithRemoteSigning.displayName,
2068
+ lightspark_node_with_remote_signing_public_key: lightsparkNodeWithRemoteSigning.publicKey,
2069
+ lightspark_node_with_remote_signing_owner: {
2070
+ id: lightsparkNodeWithRemoteSigning.ownerId
2071
+ },
2072
+ lightspark_node_with_remote_signing_status: lightsparkNodeWithRemoteSigning.status,
2073
+ lightspark_node_with_remote_signing_total_balance: lightsparkNodeWithRemoteSigning.totalBalance ? CurrencyAmountToJson(lightsparkNodeWithRemoteSigning.totalBalance) : void 0,
2074
+ lightspark_node_with_remote_signing_total_local_balance: lightsparkNodeWithRemoteSigning.totalLocalBalance ? CurrencyAmountToJson(
2075
+ lightsparkNodeWithRemoteSigning.totalLocalBalance
2076
+ ) : void 0,
2077
+ lightspark_node_with_remote_signing_local_balance: lightsparkNodeWithRemoteSigning.localBalance ? CurrencyAmountToJson(lightsparkNodeWithRemoteSigning.localBalance) : void 0,
2078
+ lightspark_node_with_remote_signing_remote_balance: lightsparkNodeWithRemoteSigning.remoteBalance ? CurrencyAmountToJson(lightsparkNodeWithRemoteSigning.remoteBalance) : void 0,
2079
+ lightspark_node_with_remote_signing_blockchain_balance: lightsparkNodeWithRemoteSigning.blockchainBalance ? BlockchainBalanceToJson(
2080
+ lightsparkNodeWithRemoteSigning.blockchainBalance
2081
+ ) : void 0,
2082
+ lightspark_node_with_remote_signing_uma_prescreening_utxos: lightsparkNodeWithRemoteSigning.umaPrescreeningUtxos,
2083
+ lightspark_node_with_remote_signing_balances: lightsparkNodeWithRemoteSigning.balances ? BalancesToJson(lightsparkNodeWithRemoteSigning.balances) : void 0
2084
+ };
2085
+ }
2086
+ throw new import_core2.LightsparkException(
2087
+ "DeserializationError",
2088
+ `Couldn't find a concrete type for interface Node corresponding to the typename=${obj.typename}`
2089
+ );
2090
+ };
2119
2091
  var FRAGMENT7 = `
2120
2092
  fragment NodeFragment on Node {
2121
2093
  __typename
@@ -2391,7 +2363,23 @@ fragment NodeFragment on Node {
2391
2363
  }
2392
2364
  }
2393
2365
  }`;
2394
- var Node_default = Node;
2366
+ var getNodeQuery = (id) => {
2367
+ return {
2368
+ queryPayload: `
2369
+ query GetNode($id: ID!) {
2370
+ entity(id: $id) {
2371
+ ... on Node {
2372
+ ...NodeFragment
2373
+ }
2374
+ }
2375
+ }
2376
+
2377
+ ${FRAGMENT7}
2378
+ `,
2379
+ variables: { id },
2380
+ constructObject: (data) => NodeFromJson(data.entity)
2381
+ };
2382
+ };
2395
2383
 
2396
2384
  // src/objects/InvoiceData.ts
2397
2385
  var InvoiceDataFromJson = (obj) => {
@@ -2781,7 +2769,7 @@ var AccountToPaymentRequestsConnectionFromJson = (obj) => {
2781
2769
  var import_core5 = require("@lightsparkdev/core");
2782
2770
 
2783
2771
  // src/objects/IncomingPayment.ts
2784
- var import_auto_bind8 = __toESM(require("auto-bind"), 1);
2772
+ var import_auto_bind6 = __toESM(require("auto-bind"), 1);
2785
2773
 
2786
2774
  // src/objects/IncomingPaymentAttemptStatus.ts
2787
2775
  var IncomingPaymentAttemptStatus = /* @__PURE__ */ ((IncomingPaymentAttemptStatus2) => {
@@ -2866,6 +2854,12 @@ var PostTransactionDataFromJson = (obj) => {
2866
2854
  amount: CurrencyAmountFromJson(obj["post_transaction_data_amount"])
2867
2855
  };
2868
2856
  };
2857
+ var PostTransactionDataToJson = (obj) => {
2858
+ return {
2859
+ post_transaction_data_utxo: obj.utxo,
2860
+ post_transaction_data_amount: CurrencyAmountToJson(obj.amount)
2861
+ };
2862
+ };
2869
2863
 
2870
2864
  // src/objects/TransactionStatus.ts
2871
2865
  var TransactionStatus = /* @__PURE__ */ ((TransactionStatus2) => {
@@ -2894,7 +2888,7 @@ var IncomingPayment = class {
2894
2888
  this.transactionHash = transactionHash;
2895
2889
  this.paymentRequestId = paymentRequestId;
2896
2890
  this.umaPostTransactionData = umaPostTransactionData;
2897
- (0, import_auto_bind8.default)(this);
2891
+ (0, import_auto_bind6.default)(this);
2898
2892
  }
2899
2893
  async getAttempts(client, first = void 0, statuses = void 0, after = void 0) {
2900
2894
  return await client.executeRawQuery({
@@ -2965,6 +2959,21 @@ ${FRAGMENT10}
2965
2959
  constructObject: (data) => IncomingPaymentFromJson(data.entity)
2966
2960
  };
2967
2961
  }
2962
+ toJson() {
2963
+ return {
2964
+ __typename: "IncomingPayment",
2965
+ incoming_payment_id: this.id,
2966
+ incoming_payment_created_at: this.createdAt,
2967
+ incoming_payment_updated_at: this.updatedAt,
2968
+ incoming_payment_status: this.status,
2969
+ incoming_payment_resolved_at: this.resolvedAt,
2970
+ incoming_payment_amount: CurrencyAmountToJson(this.amount),
2971
+ incoming_payment_transaction_hash: this.transactionHash,
2972
+ incoming_payment_destination: { id: this.destinationId },
2973
+ incoming_payment_payment_request: { id: this.paymentRequestId },
2974
+ incoming_payment_uma_post_transaction_data: this.umaPostTransactionData?.map((e) => PostTransactionDataToJson(e))
2975
+ };
2976
+ }
2968
2977
  };
2969
2978
  var IncomingPaymentFromJson = (obj) => {
2970
2979
  return new IncomingPayment(
@@ -3022,10 +3031,10 @@ fragment IncomingPaymentFragment on IncomingPayment {
3022
3031
  var IncomingPayment_default = IncomingPayment;
3023
3032
 
3024
3033
  // src/objects/OutgoingPayment.ts
3025
- var import_auto_bind10 = __toESM(require("auto-bind"), 1);
3034
+ var import_auto_bind8 = __toESM(require("auto-bind"), 1);
3026
3035
 
3027
3036
  // src/objects/OutgoingPaymentAttempt.ts
3028
- var import_auto_bind9 = __toESM(require("auto-bind"), 1);
3037
+ var import_auto_bind7 = __toESM(require("auto-bind"), 1);
3029
3038
 
3030
3039
  // src/objects/ChannelSnapshot.ts
3031
3040
  var ChannelSnapshotFromJson = (obj) => {
@@ -3039,6 +3048,17 @@ var ChannelSnapshotFromJson = (obj) => {
3039
3048
  remoteUnsettledBalance: !!obj["channel_snapshot_remote_unsettled_balance"] ? CurrencyAmountFromJson(obj["channel_snapshot_remote_unsettled_balance"]) : void 0
3040
3049
  };
3041
3050
  };
3051
+ var ChannelSnapshotToJson = (obj) => {
3052
+ return {
3053
+ channel_snapshot_channel: { id: obj.channelId },
3054
+ channel_snapshot_timestamp: obj.timestamp,
3055
+ channel_snapshot_local_balance: obj.localBalance ? CurrencyAmountToJson(obj.localBalance) : void 0,
3056
+ channel_snapshot_local_unsettled_balance: obj.localUnsettledBalance ? CurrencyAmountToJson(obj.localUnsettledBalance) : void 0,
3057
+ channel_snapshot_local_channel_reserve: obj.localChannelReserve ? CurrencyAmountToJson(obj.localChannelReserve) : void 0,
3058
+ channel_snapshot_remote_balance: obj.remoteBalance ? CurrencyAmountToJson(obj.remoteBalance) : void 0,
3059
+ channel_snapshot_remote_unsettled_balance: obj.remoteUnsettledBalance ? CurrencyAmountToJson(obj.remoteUnsettledBalance) : void 0
3060
+ };
3061
+ };
3042
3062
 
3043
3063
  // src/objects/HtlcAttemptFailureCode.ts
3044
3064
  var HtlcAttemptFailureCode = /* @__PURE__ */ ((HtlcAttemptFailureCode2) => {
@@ -3176,7 +3196,7 @@ var OutgoingPaymentAttempt = class {
3176
3196
  this.amount = amount;
3177
3197
  this.fees = fees;
3178
3198
  this.channelSnapshot = channelSnapshot;
3179
- (0, import_auto_bind9.default)(this);
3199
+ (0, import_auto_bind7.default)(this);
3180
3200
  }
3181
3201
  async getHops(client, first = void 0, after = void 0) {
3182
3202
  return await client.executeRawQuery({
@@ -3251,6 +3271,22 @@ ${FRAGMENT12}
3251
3271
  constructObject: (data) => OutgoingPaymentAttemptFromJson(data.entity)
3252
3272
  };
3253
3273
  }
3274
+ toJson() {
3275
+ return {
3276
+ __typename: "OutgoingPaymentAttempt",
3277
+ outgoing_payment_attempt_id: this.id,
3278
+ outgoing_payment_attempt_created_at: this.createdAt,
3279
+ outgoing_payment_attempt_updated_at: this.updatedAt,
3280
+ outgoing_payment_attempt_status: this.status,
3281
+ outgoing_payment_attempt_failure_code: this.failureCode,
3282
+ outgoing_payment_attempt_failure_source_index: this.failureSourceIndex,
3283
+ outgoing_payment_attempt_resolved_at: this.resolvedAt,
3284
+ outgoing_payment_attempt_amount: this.amount ? CurrencyAmountToJson(this.amount) : void 0,
3285
+ outgoing_payment_attempt_fees: this.fees ? CurrencyAmountToJson(this.fees) : void 0,
3286
+ outgoing_payment_attempt_outgoing_payment: { id: this.outgoingPaymentId },
3287
+ outgoing_payment_attempt_channel_snapshot: this.channelSnapshot ? ChannelSnapshotToJson(this.channelSnapshot) : void 0
3288
+ };
3289
+ }
3254
3290
  };
3255
3291
  var OutgoingPaymentAttemptFromJson = (obj) => {
3256
3292
  return new OutgoingPaymentAttempt(
@@ -3401,6 +3437,26 @@ var PaymentRequestDataFromJson = (obj) => {
3401
3437
  `Couldn't find a concrete type for interface PaymentRequestData corresponding to the typename=${obj["__typename"]}`
3402
3438
  );
3403
3439
  };
3440
+ var PaymentRequestDataToJson = (obj) => {
3441
+ if (obj.typename == "InvoiceData") {
3442
+ const invoiceData = obj;
3443
+ return {
3444
+ __typename: "InvoiceData",
3445
+ invoice_data_encoded_payment_request: invoiceData.encodedPaymentRequest,
3446
+ invoice_data_bitcoin_network: invoiceData.bitcoinNetwork,
3447
+ invoice_data_payment_hash: invoiceData.paymentHash,
3448
+ invoice_data_amount: CurrencyAmountToJson(invoiceData.amount),
3449
+ invoice_data_created_at: invoiceData.createdAt,
3450
+ invoice_data_expires_at: invoiceData.expiresAt,
3451
+ invoice_data_memo: invoiceData.memo,
3452
+ invoice_data_destination: NodeToJson(invoiceData.destination)
3453
+ };
3454
+ }
3455
+ throw new import_core4.LightsparkException(
3456
+ "DeserializationError",
3457
+ `Couldn't find a concrete type for interface PaymentRequestData corresponding to the typename=${obj.typename}`
3458
+ );
3459
+ };
3404
3460
 
3405
3461
  // src/objects/RichText.ts
3406
3462
  var RichTextFromJson = (obj) => {
@@ -3408,6 +3464,11 @@ var RichTextFromJson = (obj) => {
3408
3464
  text: obj["rich_text_text"]
3409
3465
  };
3410
3466
  };
3467
+ var RichTextToJson = (obj) => {
3468
+ return {
3469
+ rich_text_text: obj.text
3470
+ };
3471
+ };
3411
3472
 
3412
3473
  // src/objects/OutgoingPayment.ts
3413
3474
  var OutgoingPayment = class {
@@ -3428,7 +3489,7 @@ var OutgoingPayment = class {
3428
3489
  this.failureMessage = failureMessage;
3429
3490
  this.umaPostTransactionData = umaPostTransactionData;
3430
3491
  this.paymentPreimage = paymentPreimage;
3431
- (0, import_auto_bind10.default)(this);
3492
+ (0, import_auto_bind8.default)(this);
3432
3493
  }
3433
3494
  async getAttempts(client, first = void 0, after = void 0) {
3434
3495
  return await client.executeRawQuery({
@@ -3551,6 +3612,26 @@ ${FRAGMENT13}
3551
3612
  constructObject: (data) => OutgoingPaymentFromJson(data.entity)
3552
3613
  };
3553
3614
  }
3615
+ toJson() {
3616
+ return {
3617
+ __typename: "OutgoingPayment",
3618
+ outgoing_payment_id: this.id,
3619
+ outgoing_payment_created_at: this.createdAt,
3620
+ outgoing_payment_updated_at: this.updatedAt,
3621
+ outgoing_payment_status: this.status,
3622
+ outgoing_payment_resolved_at: this.resolvedAt,
3623
+ outgoing_payment_amount: CurrencyAmountToJson(this.amount),
3624
+ outgoing_payment_transaction_hash: this.transactionHash,
3625
+ outgoing_payment_origin: { id: this.originId },
3626
+ outgoing_payment_destination: { id: this.destinationId },
3627
+ outgoing_payment_fees: this.fees ? CurrencyAmountToJson(this.fees) : void 0,
3628
+ outgoing_payment_payment_request_data: this.paymentRequestData ? PaymentRequestDataToJson(this.paymentRequestData) : void 0,
3629
+ outgoing_payment_failure_reason: this.failureReason,
3630
+ outgoing_payment_failure_message: this.failureMessage ? RichTextToJson(this.failureMessage) : void 0,
3631
+ outgoing_payment_uma_post_transaction_data: this.umaPostTransactionData?.map((e) => PostTransactionDataToJson(e)),
3632
+ outgoing_payment_payment_preimage: this.paymentPreimage
3633
+ };
3634
+ }
3554
3635
  };
3555
3636
  var OutgoingPaymentFromJson = (obj) => {
3556
3637
  return new OutgoingPayment(
@@ -4655,7 +4736,7 @@ var AccountToTransactionsConnectionFromJson = (obj) => {
4655
4736
  };
4656
4737
 
4657
4738
  // src/objects/Wallet.ts
4658
- var import_auto_bind11 = __toESM(require("auto-bind"), 1);
4739
+ var import_auto_bind9 = __toESM(require("auto-bind"), 1);
4659
4740
 
4660
4741
  // src/objects/WalletStatus.ts
4661
4742
  var WalletStatus = /* @__PURE__ */ ((WalletStatus2) => {
@@ -4713,7 +4794,7 @@ var Wallet = class {
4713
4794
  this.lastLoginAt = lastLoginAt;
4714
4795
  this.balances = balances;
4715
4796
  this.accountId = accountId;
4716
- (0, import_auto_bind11.default)(this);
4797
+ (0, import_auto_bind9.default)(this);
4717
4798
  }
4718
4799
  async getTransactions(client, first = void 0, after = void 0, createdAfterDate = void 0, createdBeforeDate = void 0, statuses = void 0, types = void 0) {
4719
4800
  return await client.executeRawQuery({
@@ -5714,6 +5795,19 @@ ${FRAGMENT15}
5714
5795
  constructObject: (data) => WalletFromJson(data.entity)
5715
5796
  };
5716
5797
  }
5798
+ toJson() {
5799
+ return {
5800
+ __typename: "Wallet",
5801
+ wallet_id: this.id,
5802
+ wallet_created_at: this.createdAt,
5803
+ wallet_updated_at: this.updatedAt,
5804
+ wallet_last_login_at: this.lastLoginAt,
5805
+ wallet_balances: this.balances ? BalancesToJson(this.balances) : void 0,
5806
+ wallet_third_party_identifier: this.thirdPartyIdentifier,
5807
+ wallet_account: { id: this.accountId },
5808
+ wallet_status: this.status
5809
+ };
5810
+ }
5717
5811
  };
5718
5812
  var WalletFromJson = (obj) => {
5719
5813
  return new Wallet(
@@ -5790,7 +5884,7 @@ var Account = class {
5790
5884
  this.updatedAt = updatedAt;
5791
5885
  this.typename = typename;
5792
5886
  this.name = name;
5793
- (0, import_auto_bind12.default)(this);
5887
+ (0, import_auto_bind10.default)(this);
5794
5888
  }
5795
5889
  async getApiTokens(client, first = void 0, after = void 0) {
5796
5890
  return await client.executeRawQuery({
@@ -7439,6 +7533,15 @@ ${FRAGMENT16}
7439
7533
  constructObject: (data) => AccountFromJson(data.current_account)
7440
7534
  };
7441
7535
  }
7536
+ toJson() {
7537
+ return {
7538
+ __typename: "Account",
7539
+ account_id: this.id,
7540
+ account_created_at: this.createdAt,
7541
+ account_updated_at: this.updatedAt,
7542
+ account_name: this.name
7543
+ };
7544
+ }
7442
7545
  };
7443
7546
  var AccountFromJson = (obj) => {
7444
7547
  return new Account(
@@ -9171,7 +9274,7 @@ ${FRAGMENT27}
9171
9274
  };
9172
9275
 
9173
9276
  // src/objects/WithdrawalRequest.ts
9174
- var import_auto_bind13 = __toESM(require("auto-bind"), 1);
9277
+ var import_auto_bind11 = __toESM(require("auto-bind"), 1);
9175
9278
 
9176
9279
  // src/objects/WithdrawalRequestStatus.ts
9177
9280
  var WithdrawalRequestStatus = /* @__PURE__ */ ((WithdrawalRequestStatus2) => {
@@ -9220,7 +9323,7 @@ var WithdrawalRequest = class {
9220
9323
  this.estimatedAmount = estimatedAmount;
9221
9324
  this.completedAt = completedAt;
9222
9325
  this.withdrawalId = withdrawalId;
9223
- (0, import_auto_bind13.default)(this);
9326
+ (0, import_auto_bind11.default)(this);
9224
9327
  }
9225
9328
  async getChannelClosingTransactions(client, first = void 0) {
9226
9329
  return await client.executeRawQuery({
@@ -9363,6 +9466,21 @@ ${FRAGMENT28}
9363
9466
  constructObject: (data) => WithdrawalRequestFromJson(data.entity)
9364
9467
  };
9365
9468
  }
9469
+ toJson() {
9470
+ return {
9471
+ __typename: "WithdrawalRequest",
9472
+ withdrawal_request_id: this.id,
9473
+ withdrawal_request_created_at: this.createdAt,
9474
+ withdrawal_request_updated_at: this.updatedAt,
9475
+ withdrawal_request_amount: CurrencyAmountToJson(this.amount),
9476
+ withdrawal_request_estimated_amount: this.estimatedAmount ? CurrencyAmountToJson(this.estimatedAmount) : void 0,
9477
+ withdrawal_request_bitcoin_address: this.bitcoinAddress,
9478
+ withdrawal_request_withdrawal_mode: this.withdrawalMode,
9479
+ withdrawal_request_status: this.status,
9480
+ withdrawal_request_completed_at: this.completedAt,
9481
+ withdrawal_request_withdrawal: { id: this.withdrawalId }
9482
+ };
9483
+ }
9366
9484
  };
9367
9485
  var WithdrawalRequestFromJson = (obj) => {
9368
9486
  return new WithdrawalRequest(
@@ -9424,11 +9542,9 @@ var WithdrawalRequest_default = WithdrawalRequest;
9424
9542
  IncomingPayment,
9425
9543
  IncomingPaymentAttemptStatus,
9426
9544
  InvoiceType,
9427
- LightsparkNode,
9428
9545
  LightsparkNodeStatus,
9429
9546
  LightsparkNodeWithOSK,
9430
9547
  LightsparkNodeWithRemoteSigning,
9431
- Node,
9432
9548
  NodeAddressType,
9433
9549
  OutgoingPayment,
9434
9550
  OutgoingPaymentAttempt,
@@ -9458,6 +9574,8 @@ var WithdrawalRequest_default = WithdrawalRequest;
9458
9574
  getInvoiceQuery,
9459
9575
  getLightningTransactionQuery,
9460
9576
  getLightsparkNodeOwnerQuery,
9577
+ getLightsparkNodeQuery,
9578
+ getNodeQuery,
9461
9579
  getOnChainTransactionQuery,
9462
9580
  getPaymentRequestQuery,
9463
9581
  getRoutingTransactionQuery,