@lightsparkdev/lightspark-sdk 1.3.1 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/{BitcoinNetwork-972b1d01.d.ts → BitcoinNetwork-4f6ea015.d.ts} +2 -2
  3. package/dist/{chunk-Y55D3PD4.js → chunk-ENYS5WAU.js} +712 -476
  4. package/dist/env.d.cts +1 -1
  5. package/dist/env.d.ts +1 -1
  6. package/dist/{index-a5028d74.d.ts → index-f100aa27.d.ts} +726 -702
  7. package/dist/index.cjs +402 -24
  8. package/dist/index.d.cts +3 -3
  9. package/dist/index.d.ts +3 -3
  10. package/dist/index.js +148 -2
  11. package/dist/objects/index.cjs +1339 -1126
  12. package/dist/objects/index.d.cts +2 -2
  13. package/dist/objects/index.d.ts +2 -2
  14. package/dist/objects/index.js +1 -1
  15. package/package.json +1 -1
  16. package/src/client.ts +121 -1
  17. package/src/graphql/RegisterPayment.ts +21 -0
  18. package/src/graphql/ScreenNode.ts +15 -0
  19. package/src/graphql/WithdrawalFeeEstimate.ts +21 -0
  20. package/src/objects/Account.ts +98 -5
  21. package/src/objects/AccountToApiTokensConnection.ts +2 -3
  22. package/src/objects/AccountToChannelsConnection.ts +2 -3
  23. package/src/objects/AccountToNodesConnection.ts +2 -3
  24. package/src/objects/AccountToPaymentRequestsConnection.ts +2 -3
  25. package/src/objects/AccountToTransactionsConnection.ts +6 -7
  26. package/src/objects/AccountToWalletsConnection.ts +2 -3
  27. package/src/objects/AccountToWithdrawalRequestsConnection.ts +71 -0
  28. package/src/objects/ApiToken.ts +5 -6
  29. package/src/objects/Balances.ts +9 -12
  30. package/src/objects/BitcoinNetwork.ts +2 -2
  31. package/src/objects/Channel.ts +7 -10
  32. package/src/objects/ChannelClosingTransaction.ts +3 -4
  33. package/src/objects/ChannelOpeningTransaction.ts +3 -4
  34. package/src/objects/ChannelStatus.ts +5 -9
  35. package/src/objects/ChannelToTransactionsConnection.ts +6 -7
  36. package/src/objects/Connection.ts +85 -3
  37. package/src/objects/CreateApiTokenOutput.ts +3 -3
  38. package/src/objects/CreateLnurlInvoiceInput.ts +2 -3
  39. package/src/objects/CreateTestModePaymentInput.ts +2 -2
  40. package/src/objects/CreateTestModePaymentoutput.ts +2 -3
  41. package/src/objects/CurrencyUnit.ts +11 -17
  42. package/src/objects/Deposit.ts +5 -6
  43. package/src/objects/Entity.ts +21 -6
  44. package/src/objects/FeeEstimate.ts +2 -3
  45. package/src/objects/GraphNode.ts +10 -12
  46. package/src/objects/Hop.ts +5 -6
  47. package/src/objects/IncentivesStatus.ts +2 -3
  48. package/src/objects/IncomingPayment.ts +7 -7
  49. package/src/objects/IncomingPaymentAttempt.ts +2 -2
  50. package/src/objects/IncomingPaymentToAttemptsConnection.ts +2 -3
  51. package/src/objects/Invoice.ts +2 -2
  52. package/src/objects/InvoiceData.ts +4 -5
  53. package/src/objects/LightningTransaction.ts +5 -5
  54. package/src/objects/LightsparkNode.ts +8 -10
  55. package/src/objects/LightsparkNodeOwner.ts +2 -2
  56. package/src/objects/LightsparkNodeToChannelsConnection.ts +2 -3
  57. package/src/objects/LightsparkNodeWithOSK.ts +7 -8
  58. package/src/objects/LightsparkNodeWithRemoteSigning.ts +7 -8
  59. package/src/objects/Node.ts +9 -11
  60. package/src/objects/NodeToAddressesConnection.ts +2 -3
  61. package/src/objects/OnChainTransaction.ts +5 -6
  62. package/src/objects/OutgoingPayment.ts +5 -6
  63. package/src/objects/OutgoingPaymentAttempt.ts +12 -14
  64. package/src/objects/OutgoingPaymentAttemptToHopsConnection.ts +2 -3
  65. package/src/objects/OutgoingPaymentToAttemptsConnection.ts +2 -3
  66. package/src/objects/PageInfo.ts +3 -3
  67. package/src/objects/PaymentRequest.ts +2 -2
  68. package/src/objects/PaymentRequestData.ts +1 -2
  69. package/src/objects/RegisterPaymentInput.ts +7 -8
  70. package/src/objects/RequestWithdrawalInput.ts +2 -2
  71. package/src/objects/RiskRating.ts +1 -2
  72. package/src/objects/RoutingTransaction.ts +6 -8
  73. package/src/objects/ScreenNodeInput.ts +2 -3
  74. package/src/objects/SetInvoicePaymentHashInput.ts +2 -3
  75. package/src/objects/Signable.ts +2 -2
  76. package/src/objects/SignablePayload.ts +2 -2
  77. package/src/objects/Transaction.ts +3 -4
  78. package/src/objects/TransactionStatus.ts +1 -2
  79. package/src/objects/UmaInvitation.ts +2 -2
  80. package/src/objects/Wallet.ts +97 -8
  81. package/src/objects/WalletStatus.ts +5 -7
  82. package/src/objects/WalletToPaymentRequestsConnection.ts +2 -3
  83. package/src/objects/WalletToTransactionsConnection.ts +2 -3
  84. package/src/objects/WalletToWithdrawalRequestsConnection.ts +70 -0
  85. package/src/objects/Withdrawal.ts +5 -5
  86. package/src/objects/WithdrawalFeeEstimateInput.ts +40 -0
  87. package/src/objects/WithdrawalFeeEstimateOutput.ts +46 -0
  88. package/src/objects/WithdrawalRequest.ts +43 -7
  89. package/src/objects/WithdrawalRequestToChannelClosingTransactionsConnection.ts +2 -3
  90. package/src/objects/WithdrawalRequestToChannelOpeningTransactionsConnection.ts +2 -3
  91. package/src/objects/index.ts +4 -0
  92. package/src/tests/integration/general-regtest.test.ts +9 -0
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-K6SAUSAX.js";
4
4
 
5
5
  // src/objects/Account.ts
6
- import autoBind10 from "auto-bind";
6
+ import autoBind11 from "auto-bind";
7
7
 
8
8
  // src/objects/Permission.ts
9
9
  var Permission = /* @__PURE__ */ ((Permission2) => {
@@ -4947,7 +4947,7 @@ var AccountToTransactionsConnectionFromJson = (obj) => {
4947
4947
  };
4948
4948
 
4949
4949
  // src/objects/Wallet.ts
4950
- import autoBind9 from "auto-bind";
4950
+ import autoBind10 from "auto-bind";
4951
4951
 
4952
4952
  // src/objects/WalletStatus.ts
4953
4953
  var WalletStatus = /* @__PURE__ */ ((WalletStatus2) => {
@@ -4993,71 +4993,514 @@ var WalletToTransactionsConnectionFromJson = (obj) => {
4993
4993
  };
4994
4994
  };
4995
4995
 
4996
- // src/objects/Wallet.ts
4997
- var Wallet = class {
4998
- constructor(id, createdAt, updatedAt, thirdPartyIdentifier, status, typename, lastLoginAt, balances, accountId) {
4996
+ // src/objects/WithdrawalRequest.ts
4997
+ import autoBind9 from "auto-bind";
4998
+
4999
+ // src/objects/WithdrawalMode.ts
5000
+ var WithdrawalMode = /* @__PURE__ */ ((WithdrawalMode2) => {
5001
+ WithdrawalMode2["FUTURE_VALUE"] = "FUTURE_VALUE";
5002
+ WithdrawalMode2["WALLET_ONLY"] = "WALLET_ONLY";
5003
+ WithdrawalMode2["WALLET_THEN_CHANNELS"] = "WALLET_THEN_CHANNELS";
5004
+ return WithdrawalMode2;
5005
+ })(WithdrawalMode || {});
5006
+ var WithdrawalMode_default = WithdrawalMode;
5007
+
5008
+ // src/objects/WithdrawalRequestStatus.ts
5009
+ var WithdrawalRequestStatus = /* @__PURE__ */ ((WithdrawalRequestStatus2) => {
5010
+ WithdrawalRequestStatus2["FUTURE_VALUE"] = "FUTURE_VALUE";
5011
+ WithdrawalRequestStatus2["CREATED"] = "CREATED";
5012
+ WithdrawalRequestStatus2["FAILED"] = "FAILED";
5013
+ WithdrawalRequestStatus2["IN_PROGRESS"] = "IN_PROGRESS";
5014
+ WithdrawalRequestStatus2["SUCCESSFUL"] = "SUCCESSFUL";
5015
+ return WithdrawalRequestStatus2;
5016
+ })(WithdrawalRequestStatus || {});
5017
+ var WithdrawalRequestStatus_default = WithdrawalRequestStatus;
5018
+
5019
+ // src/objects/ChannelClosingTransaction.ts
5020
+ var ChannelClosingTransactionFromJson = (obj) => {
5021
+ return {
5022
+ id: obj["channel_closing_transaction_id"],
5023
+ createdAt: obj["channel_closing_transaction_created_at"],
5024
+ updatedAt: obj["channel_closing_transaction_updated_at"],
5025
+ status: TransactionStatus_default[obj["channel_closing_transaction_status"]] ?? TransactionStatus_default.FUTURE_VALUE,
5026
+ amount: CurrencyAmountFromJson(obj["channel_closing_transaction_amount"]),
5027
+ blockHeight: obj["channel_closing_transaction_block_height"],
5028
+ destinationAddresses: obj["channel_closing_transaction_destination_addresses"],
5029
+ typename: "ChannelClosingTransaction",
5030
+ resolvedAt: obj["channel_closing_transaction_resolved_at"],
5031
+ transactionHash: obj["channel_closing_transaction_transaction_hash"],
5032
+ fees: !!obj["channel_closing_transaction_fees"] ? CurrencyAmountFromJson(obj["channel_closing_transaction_fees"]) : void 0,
5033
+ blockHash: obj["channel_closing_transaction_block_hash"],
5034
+ numConfirmations: obj["channel_closing_transaction_num_confirmations"],
5035
+ channelId: obj["channel_closing_transaction_channel"]?.id ?? void 0
5036
+ };
5037
+ };
5038
+ var FRAGMENT17 = `
5039
+ fragment ChannelClosingTransactionFragment on ChannelClosingTransaction {
5040
+ __typename
5041
+ channel_closing_transaction_id: id
5042
+ channel_closing_transaction_created_at: created_at
5043
+ channel_closing_transaction_updated_at: updated_at
5044
+ channel_closing_transaction_status: status
5045
+ channel_closing_transaction_resolved_at: resolved_at
5046
+ channel_closing_transaction_amount: amount {
5047
+ __typename
5048
+ currency_amount_original_value: original_value
5049
+ currency_amount_original_unit: original_unit
5050
+ currency_amount_preferred_currency_unit: preferred_currency_unit
5051
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
5052
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
5053
+ }
5054
+ channel_closing_transaction_transaction_hash: transaction_hash
5055
+ channel_closing_transaction_fees: fees {
5056
+ __typename
5057
+ currency_amount_original_value: original_value
5058
+ currency_amount_original_unit: original_unit
5059
+ currency_amount_preferred_currency_unit: preferred_currency_unit
5060
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
5061
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
5062
+ }
5063
+ channel_closing_transaction_block_hash: block_hash
5064
+ channel_closing_transaction_block_height: block_height
5065
+ channel_closing_transaction_destination_addresses: destination_addresses
5066
+ channel_closing_transaction_num_confirmations: num_confirmations
5067
+ channel_closing_transaction_channel: channel {
5068
+ id
5069
+ }
5070
+ }`;
5071
+ var getChannelClosingTransactionQuery = (id) => {
5072
+ return {
5073
+ queryPayload: `
5074
+ query GetChannelClosingTransaction($id: ID!) {
5075
+ entity(id: $id) {
5076
+ ... on ChannelClosingTransaction {
5077
+ ...ChannelClosingTransactionFragment
5078
+ }
5079
+ }
5080
+ }
5081
+
5082
+ ${FRAGMENT17}
5083
+ `,
5084
+ variables: { id },
5085
+ constructObject: (data) => ChannelClosingTransactionFromJson(data.entity)
5086
+ };
5087
+ };
5088
+
5089
+ // src/objects/WithdrawalRequestToChannelClosingTransactionsConnection.ts
5090
+ var WithdrawalRequestToChannelClosingTransactionsConnectionFromJson = (obj) => {
5091
+ return {
5092
+ pageInfo: PageInfoFromJson(
5093
+ obj["withdrawal_request_to_channel_closing_transactions_connection_page_info"]
5094
+ ),
5095
+ count: obj["withdrawal_request_to_channel_closing_transactions_connection_count"],
5096
+ entities: obj["withdrawal_request_to_channel_closing_transactions_connection_entities"].map((e) => ChannelClosingTransactionFromJson(e))
5097
+ };
5098
+ };
5099
+
5100
+ // src/objects/ChannelOpeningTransaction.ts
5101
+ var ChannelOpeningTransactionFromJson = (obj) => {
5102
+ return {
5103
+ id: obj["channel_opening_transaction_id"],
5104
+ createdAt: obj["channel_opening_transaction_created_at"],
5105
+ updatedAt: obj["channel_opening_transaction_updated_at"],
5106
+ status: TransactionStatus_default[obj["channel_opening_transaction_status"]] ?? TransactionStatus_default.FUTURE_VALUE,
5107
+ amount: CurrencyAmountFromJson(obj["channel_opening_transaction_amount"]),
5108
+ blockHeight: obj["channel_opening_transaction_block_height"],
5109
+ destinationAddresses: obj["channel_opening_transaction_destination_addresses"],
5110
+ typename: "ChannelOpeningTransaction",
5111
+ resolvedAt: obj["channel_opening_transaction_resolved_at"],
5112
+ transactionHash: obj["channel_opening_transaction_transaction_hash"],
5113
+ fees: !!obj["channel_opening_transaction_fees"] ? CurrencyAmountFromJson(obj["channel_opening_transaction_fees"]) : void 0,
5114
+ blockHash: obj["channel_opening_transaction_block_hash"],
5115
+ numConfirmations: obj["channel_opening_transaction_num_confirmations"],
5116
+ channelId: obj["channel_opening_transaction_channel"]?.id ?? void 0
5117
+ };
5118
+ };
5119
+ var FRAGMENT18 = `
5120
+ fragment ChannelOpeningTransactionFragment on ChannelOpeningTransaction {
5121
+ __typename
5122
+ channel_opening_transaction_id: id
5123
+ channel_opening_transaction_created_at: created_at
5124
+ channel_opening_transaction_updated_at: updated_at
5125
+ channel_opening_transaction_status: status
5126
+ channel_opening_transaction_resolved_at: resolved_at
5127
+ channel_opening_transaction_amount: amount {
5128
+ __typename
5129
+ currency_amount_original_value: original_value
5130
+ currency_amount_original_unit: original_unit
5131
+ currency_amount_preferred_currency_unit: preferred_currency_unit
5132
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
5133
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
5134
+ }
5135
+ channel_opening_transaction_transaction_hash: transaction_hash
5136
+ channel_opening_transaction_fees: fees {
5137
+ __typename
5138
+ currency_amount_original_value: original_value
5139
+ currency_amount_original_unit: original_unit
5140
+ currency_amount_preferred_currency_unit: preferred_currency_unit
5141
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
5142
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
5143
+ }
5144
+ channel_opening_transaction_block_hash: block_hash
5145
+ channel_opening_transaction_block_height: block_height
5146
+ channel_opening_transaction_destination_addresses: destination_addresses
5147
+ channel_opening_transaction_num_confirmations: num_confirmations
5148
+ channel_opening_transaction_channel: channel {
5149
+ id
5150
+ }
5151
+ }`;
5152
+ var getChannelOpeningTransactionQuery = (id) => {
5153
+ return {
5154
+ queryPayload: `
5155
+ query GetChannelOpeningTransaction($id: ID!) {
5156
+ entity(id: $id) {
5157
+ ... on ChannelOpeningTransaction {
5158
+ ...ChannelOpeningTransactionFragment
5159
+ }
5160
+ }
5161
+ }
5162
+
5163
+ ${FRAGMENT18}
5164
+ `,
5165
+ variables: { id },
5166
+ constructObject: (data) => ChannelOpeningTransactionFromJson(data.entity)
5167
+ };
5168
+ };
5169
+
5170
+ // src/objects/WithdrawalRequestToChannelOpeningTransactionsConnection.ts
5171
+ var WithdrawalRequestToChannelOpeningTransactionsConnectionFromJson = (obj) => {
5172
+ return {
5173
+ pageInfo: PageInfoFromJson(
5174
+ obj["withdrawal_request_to_channel_opening_transactions_connection_page_info"]
5175
+ ),
5176
+ count: obj["withdrawal_request_to_channel_opening_transactions_connection_count"],
5177
+ entities: obj["withdrawal_request_to_channel_opening_transactions_connection_entities"].map((e) => ChannelOpeningTransactionFromJson(e))
5178
+ };
5179
+ };
5180
+
5181
+ // src/objects/WithdrawalRequest.ts
5182
+ var WithdrawalRequest = class {
5183
+ constructor(id, createdAt, updatedAt, requestedAmount, amount, bitcoinAddress, withdrawalMode, status, typename, estimatedAmount, amountWithdrawn, completedAt, withdrawalId) {
4999
5184
  this.id = id;
5000
5185
  this.createdAt = createdAt;
5001
5186
  this.updatedAt = updatedAt;
5002
- this.thirdPartyIdentifier = thirdPartyIdentifier;
5187
+ this.requestedAmount = requestedAmount;
5188
+ this.amount = amount;
5189
+ this.bitcoinAddress = bitcoinAddress;
5190
+ this.withdrawalMode = withdrawalMode;
5003
5191
  this.status = status;
5004
5192
  this.typename = typename;
5005
- this.lastLoginAt = lastLoginAt;
5006
- this.balances = balances;
5007
- this.accountId = accountId;
5193
+ this.estimatedAmount = estimatedAmount;
5194
+ this.amountWithdrawn = amountWithdrawn;
5195
+ this.completedAt = completedAt;
5196
+ this.withdrawalId = withdrawalId;
5008
5197
  autoBind9(this);
5009
5198
  }
5010
- async getTransactions(client, first = void 0, after = void 0, createdAfterDate = void 0, createdBeforeDate = void 0, statuses = void 0, types = void 0) {
5199
+ async getChannelClosingTransactions(client, first = void 0) {
5011
5200
  return await client.executeRawQuery({
5012
5201
  queryPayload: `
5013
- query FetchWalletToTransactionsConnection($entity_id: ID!, $first: Int, $after: ID, $created_after_date: DateTime, $created_before_date: DateTime, $statuses: [TransactionStatus!], $types: [TransactionType!]) {
5202
+ query FetchWithdrawalRequestToChannelClosingTransactionsConnection($entity_id: ID!, $first: Int) {
5014
5203
  entity(id: $entity_id) {
5015
- ... on Wallet {
5016
- transactions(, first: $first, after: $after, created_after_date: $created_after_date, created_before_date: $created_before_date, statuses: $statuses, types: $types) {
5204
+ ... on WithdrawalRequest {
5205
+ channel_closing_transactions(, first: $first) {
5017
5206
  __typename
5018
- wallet_to_transactions_connection_count: count
5019
- wallet_to_transactions_connection_page_info: page_info {
5207
+ withdrawal_request_to_channel_closing_transactions_connection_page_info: page_info {
5020
5208
  __typename
5021
5209
  page_info_has_next_page: has_next_page
5022
5210
  page_info_has_previous_page: has_previous_page
5023
5211
  page_info_start_cursor: start_cursor
5024
5212
  page_info_end_cursor: end_cursor
5025
5213
  }
5026
- wallet_to_transactions_connection_entities: entities {
5214
+ withdrawal_request_to_channel_closing_transactions_connection_count: count
5215
+ withdrawal_request_to_channel_closing_transactions_connection_entities: entities {
5027
5216
  __typename
5028
- ... on ChannelClosingTransaction {
5217
+ channel_closing_transaction_id: id
5218
+ channel_closing_transaction_created_at: created_at
5219
+ channel_closing_transaction_updated_at: updated_at
5220
+ channel_closing_transaction_status: status
5221
+ channel_closing_transaction_resolved_at: resolved_at
5222
+ channel_closing_transaction_amount: amount {
5029
5223
  __typename
5030
- channel_closing_transaction_id: id
5031
- channel_closing_transaction_created_at: created_at
5032
- channel_closing_transaction_updated_at: updated_at
5033
- channel_closing_transaction_status: status
5034
- channel_closing_transaction_resolved_at: resolved_at
5035
- channel_closing_transaction_amount: amount {
5036
- __typename
5037
- currency_amount_original_value: original_value
5038
- currency_amount_original_unit: original_unit
5039
- currency_amount_preferred_currency_unit: preferred_currency_unit
5040
- currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
5041
- currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
5042
- }
5043
- channel_closing_transaction_transaction_hash: transaction_hash
5044
- channel_closing_transaction_fees: fees {
5045
- __typename
5046
- currency_amount_original_value: original_value
5047
- currency_amount_original_unit: original_unit
5048
- currency_amount_preferred_currency_unit: preferred_currency_unit
5049
- currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
5050
- currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
5051
- }
5052
- channel_closing_transaction_block_hash: block_hash
5053
- channel_closing_transaction_block_height: block_height
5054
- channel_closing_transaction_destination_addresses: destination_addresses
5055
- channel_closing_transaction_num_confirmations: num_confirmations
5056
- channel_closing_transaction_channel: channel {
5057
- id
5058
- }
5059
- }
5060
- ... on ChannelOpeningTransaction {
5224
+ currency_amount_original_value: original_value
5225
+ currency_amount_original_unit: original_unit
5226
+ currency_amount_preferred_currency_unit: preferred_currency_unit
5227
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
5228
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
5229
+ }
5230
+ channel_closing_transaction_transaction_hash: transaction_hash
5231
+ channel_closing_transaction_fees: fees {
5232
+ __typename
5233
+ currency_amount_original_value: original_value
5234
+ currency_amount_original_unit: original_unit
5235
+ currency_amount_preferred_currency_unit: preferred_currency_unit
5236
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
5237
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
5238
+ }
5239
+ channel_closing_transaction_block_hash: block_hash
5240
+ channel_closing_transaction_block_height: block_height
5241
+ channel_closing_transaction_destination_addresses: destination_addresses
5242
+ channel_closing_transaction_num_confirmations: num_confirmations
5243
+ channel_closing_transaction_channel: channel {
5244
+ id
5245
+ }
5246
+ }
5247
+ }
5248
+ }
5249
+ }
5250
+ }
5251
+ `,
5252
+ variables: { entity_id: this.id, first },
5253
+ constructObject: (json) => {
5254
+ const connection = json["entity"]["channel_closing_transactions"];
5255
+ return WithdrawalRequestToChannelClosingTransactionsConnectionFromJson(
5256
+ connection
5257
+ );
5258
+ }
5259
+ });
5260
+ }
5261
+ async getChannelOpeningTransactions(client, first = void 0) {
5262
+ return await client.executeRawQuery({
5263
+ queryPayload: `
5264
+ query FetchWithdrawalRequestToChannelOpeningTransactionsConnection($entity_id: ID!, $first: Int) {
5265
+ entity(id: $entity_id) {
5266
+ ... on WithdrawalRequest {
5267
+ channel_opening_transactions(, first: $first) {
5268
+ __typename
5269
+ withdrawal_request_to_channel_opening_transactions_connection_page_info: page_info {
5270
+ __typename
5271
+ page_info_has_next_page: has_next_page
5272
+ page_info_has_previous_page: has_previous_page
5273
+ page_info_start_cursor: start_cursor
5274
+ page_info_end_cursor: end_cursor
5275
+ }
5276
+ withdrawal_request_to_channel_opening_transactions_connection_count: count
5277
+ withdrawal_request_to_channel_opening_transactions_connection_entities: entities {
5278
+ __typename
5279
+ channel_opening_transaction_id: id
5280
+ channel_opening_transaction_created_at: created_at
5281
+ channel_opening_transaction_updated_at: updated_at
5282
+ channel_opening_transaction_status: status
5283
+ channel_opening_transaction_resolved_at: resolved_at
5284
+ channel_opening_transaction_amount: amount {
5285
+ __typename
5286
+ currency_amount_original_value: original_value
5287
+ currency_amount_original_unit: original_unit
5288
+ currency_amount_preferred_currency_unit: preferred_currency_unit
5289
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
5290
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
5291
+ }
5292
+ channel_opening_transaction_transaction_hash: transaction_hash
5293
+ channel_opening_transaction_fees: fees {
5294
+ __typename
5295
+ currency_amount_original_value: original_value
5296
+ currency_amount_original_unit: original_unit
5297
+ currency_amount_preferred_currency_unit: preferred_currency_unit
5298
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
5299
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
5300
+ }
5301
+ channel_opening_transaction_block_hash: block_hash
5302
+ channel_opening_transaction_block_height: block_height
5303
+ channel_opening_transaction_destination_addresses: destination_addresses
5304
+ channel_opening_transaction_num_confirmations: num_confirmations
5305
+ channel_opening_transaction_channel: channel {
5306
+ id
5307
+ }
5308
+ }
5309
+ }
5310
+ }
5311
+ }
5312
+ }
5313
+ `,
5314
+ variables: { entity_id: this.id, first },
5315
+ constructObject: (json) => {
5316
+ const connection = json["entity"]["channel_opening_transactions"];
5317
+ return WithdrawalRequestToChannelOpeningTransactionsConnectionFromJson(
5318
+ connection
5319
+ );
5320
+ }
5321
+ });
5322
+ }
5323
+ static getWithdrawalRequestQuery(id) {
5324
+ return {
5325
+ queryPayload: `
5326
+ query GetWithdrawalRequest($id: ID!) {
5327
+ entity(id: $id) {
5328
+ ... on WithdrawalRequest {
5329
+ ...WithdrawalRequestFragment
5330
+ }
5331
+ }
5332
+ }
5333
+
5334
+ ${FRAGMENT19}
5335
+ `,
5336
+ variables: { id },
5337
+ constructObject: (data) => WithdrawalRequestFromJson(data.entity)
5338
+ };
5339
+ }
5340
+ toJson() {
5341
+ return {
5342
+ __typename: "WithdrawalRequest",
5343
+ withdrawal_request_id: this.id,
5344
+ withdrawal_request_created_at: this.createdAt,
5345
+ withdrawal_request_updated_at: this.updatedAt,
5346
+ withdrawal_request_requested_amount: CurrencyAmountToJson(
5347
+ this.requestedAmount
5348
+ ),
5349
+ withdrawal_request_amount: CurrencyAmountToJson(this.amount),
5350
+ withdrawal_request_estimated_amount: this.estimatedAmount ? CurrencyAmountToJson(this.estimatedAmount) : void 0,
5351
+ withdrawal_request_amount_withdrawn: this.amountWithdrawn ? CurrencyAmountToJson(this.amountWithdrawn) : void 0,
5352
+ withdrawal_request_bitcoin_address: this.bitcoinAddress,
5353
+ withdrawal_request_withdrawal_mode: this.withdrawalMode,
5354
+ withdrawal_request_status: this.status,
5355
+ withdrawal_request_completed_at: this.completedAt,
5356
+ withdrawal_request_withdrawal: { id: this.withdrawalId }
5357
+ };
5358
+ }
5359
+ };
5360
+ var WithdrawalRequestFromJson = (obj) => {
5361
+ return new WithdrawalRequest(
5362
+ obj["withdrawal_request_id"],
5363
+ obj["withdrawal_request_created_at"],
5364
+ obj["withdrawal_request_updated_at"],
5365
+ CurrencyAmountFromJson(obj["withdrawal_request_requested_amount"]),
5366
+ CurrencyAmountFromJson(obj["withdrawal_request_amount"]),
5367
+ obj["withdrawal_request_bitcoin_address"],
5368
+ WithdrawalMode_default[obj["withdrawal_request_withdrawal_mode"]] ?? WithdrawalMode_default.FUTURE_VALUE,
5369
+ WithdrawalRequestStatus_default[obj["withdrawal_request_status"]] ?? WithdrawalRequestStatus_default.FUTURE_VALUE,
5370
+ "WithdrawalRequest",
5371
+ !!obj["withdrawal_request_estimated_amount"] ? CurrencyAmountFromJson(obj["withdrawal_request_estimated_amount"]) : void 0,
5372
+ !!obj["withdrawal_request_amount_withdrawn"] ? CurrencyAmountFromJson(obj["withdrawal_request_amount_withdrawn"]) : void 0,
5373
+ obj["withdrawal_request_completed_at"],
5374
+ obj["withdrawal_request_withdrawal"]?.id ?? void 0
5375
+ );
5376
+ };
5377
+ var FRAGMENT19 = `
5378
+ fragment WithdrawalRequestFragment on WithdrawalRequest {
5379
+ __typename
5380
+ withdrawal_request_id: id
5381
+ withdrawal_request_created_at: created_at
5382
+ withdrawal_request_updated_at: updated_at
5383
+ withdrawal_request_requested_amount: requested_amount {
5384
+ __typename
5385
+ currency_amount_original_value: original_value
5386
+ currency_amount_original_unit: original_unit
5387
+ currency_amount_preferred_currency_unit: preferred_currency_unit
5388
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
5389
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
5390
+ }
5391
+ withdrawal_request_amount: amount {
5392
+ __typename
5393
+ currency_amount_original_value: original_value
5394
+ currency_amount_original_unit: original_unit
5395
+ currency_amount_preferred_currency_unit: preferred_currency_unit
5396
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
5397
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
5398
+ }
5399
+ withdrawal_request_estimated_amount: estimated_amount {
5400
+ __typename
5401
+ currency_amount_original_value: original_value
5402
+ currency_amount_original_unit: original_unit
5403
+ currency_amount_preferred_currency_unit: preferred_currency_unit
5404
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
5405
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
5406
+ }
5407
+ withdrawal_request_amount_withdrawn: amount_withdrawn {
5408
+ __typename
5409
+ currency_amount_original_value: original_value
5410
+ currency_amount_original_unit: original_unit
5411
+ currency_amount_preferred_currency_unit: preferred_currency_unit
5412
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
5413
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
5414
+ }
5415
+ withdrawal_request_bitcoin_address: bitcoin_address
5416
+ withdrawal_request_withdrawal_mode: withdrawal_mode
5417
+ withdrawal_request_status: status
5418
+ withdrawal_request_completed_at: completed_at
5419
+ withdrawal_request_withdrawal: withdrawal {
5420
+ id
5421
+ }
5422
+ }`;
5423
+ var WithdrawalRequest_default = WithdrawalRequest;
5424
+
5425
+ // src/objects/WalletToWithdrawalRequestsConnection.ts
5426
+ var WalletToWithdrawalRequestsConnectionFromJson = (obj) => {
5427
+ return {
5428
+ count: obj["wallet_to_withdrawal_requests_connection_count"],
5429
+ pageInfo: PageInfoFromJson(
5430
+ obj["wallet_to_withdrawal_requests_connection_page_info"]
5431
+ ),
5432
+ entities: obj["wallet_to_withdrawal_requests_connection_entities"].map(
5433
+ (e) => WithdrawalRequestFromJson(e)
5434
+ ),
5435
+ typename: "WalletToWithdrawalRequestsConnection"
5436
+ };
5437
+ };
5438
+
5439
+ // src/objects/Wallet.ts
5440
+ var Wallet = class {
5441
+ constructor(id, createdAt, updatedAt, thirdPartyIdentifier, status, typename, lastLoginAt, balances, accountId) {
5442
+ this.id = id;
5443
+ this.createdAt = createdAt;
5444
+ this.updatedAt = updatedAt;
5445
+ this.thirdPartyIdentifier = thirdPartyIdentifier;
5446
+ this.status = status;
5447
+ this.typename = typename;
5448
+ this.lastLoginAt = lastLoginAt;
5449
+ this.balances = balances;
5450
+ this.accountId = accountId;
5451
+ autoBind10(this);
5452
+ }
5453
+ async getTransactions(client, first = void 0, after = void 0, createdAfterDate = void 0, createdBeforeDate = void 0, statuses = void 0, types = void 0) {
5454
+ return await client.executeRawQuery({
5455
+ queryPayload: `
5456
+ query FetchWalletToTransactionsConnection($entity_id: ID!, $first: Int, $after: ID, $created_after_date: DateTime, $created_before_date: DateTime, $statuses: [TransactionStatus!], $types: [TransactionType!]) {
5457
+ entity(id: $entity_id) {
5458
+ ... on Wallet {
5459
+ transactions(, first: $first, after: $after, created_after_date: $created_after_date, created_before_date: $created_before_date, statuses: $statuses, types: $types) {
5460
+ __typename
5461
+ wallet_to_transactions_connection_count: count
5462
+ wallet_to_transactions_connection_page_info: page_info {
5463
+ __typename
5464
+ page_info_has_next_page: has_next_page
5465
+ page_info_has_previous_page: has_previous_page
5466
+ page_info_start_cursor: start_cursor
5467
+ page_info_end_cursor: end_cursor
5468
+ }
5469
+ wallet_to_transactions_connection_entities: entities {
5470
+ __typename
5471
+ ... on ChannelClosingTransaction {
5472
+ __typename
5473
+ channel_closing_transaction_id: id
5474
+ channel_closing_transaction_created_at: created_at
5475
+ channel_closing_transaction_updated_at: updated_at
5476
+ channel_closing_transaction_status: status
5477
+ channel_closing_transaction_resolved_at: resolved_at
5478
+ channel_closing_transaction_amount: amount {
5479
+ __typename
5480
+ currency_amount_original_value: original_value
5481
+ currency_amount_original_unit: original_unit
5482
+ currency_amount_preferred_currency_unit: preferred_currency_unit
5483
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
5484
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
5485
+ }
5486
+ channel_closing_transaction_transaction_hash: transaction_hash
5487
+ channel_closing_transaction_fees: fees {
5488
+ __typename
5489
+ currency_amount_original_value: original_value
5490
+ currency_amount_original_unit: original_unit
5491
+ currency_amount_preferred_currency_unit: preferred_currency_unit
5492
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
5493
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
5494
+ }
5495
+ channel_closing_transaction_block_hash: block_hash
5496
+ channel_closing_transaction_block_height: block_height
5497
+ channel_closing_transaction_destination_addresses: destination_addresses
5498
+ channel_closing_transaction_num_confirmations: num_confirmations
5499
+ channel_closing_transaction_channel: channel {
5500
+ id
5501
+ }
5502
+ }
5503
+ ... on ChannelOpeningTransaction {
5061
5504
  __typename
5062
5505
  channel_opening_transaction_id: id
5063
5506
  channel_opening_transaction_created_at: created_at
@@ -5955,8 +6398,88 @@ query FetchWalletTotalAmountReceived($entity_id: ID!, $created_after_date: DateT
5955
6398
  created_before_date: createdBeforeDate
5956
6399
  },
5957
6400
  constructObject: (json) => {
5958
- const connection = json["entity"]["total_amount_received"];
5959
- return CurrencyAmountFromJson(connection);
6401
+ const connection = json["entity"]["total_amount_received"];
6402
+ return CurrencyAmountFromJson(connection);
6403
+ }
6404
+ });
6405
+ }
6406
+ async getWithdrawalRequests(client, first = void 0, after = void 0, statuses = void 0, createdAfterDate = void 0, createdBeforeDate = void 0) {
6407
+ return await client.executeRawQuery({
6408
+ queryPayload: `
6409
+ query FetchWalletToWithdrawalRequestsConnection($entity_id: ID!, $first: Int, $after: ID, $statuses: [WithdrawalRequestStatus!], $created_after_date: DateTime, $created_before_date: DateTime) {
6410
+ entity(id: $entity_id) {
6411
+ ... on Wallet {
6412
+ withdrawal_requests(, first: $first, after: $after, statuses: $statuses, created_after_date: $created_after_date, created_before_date: $created_before_date) {
6413
+ __typename
6414
+ wallet_to_withdrawal_requests_connection_count: count
6415
+ wallet_to_withdrawal_requests_connection_page_info: page_info {
6416
+ __typename
6417
+ page_info_has_next_page: has_next_page
6418
+ page_info_has_previous_page: has_previous_page
6419
+ page_info_start_cursor: start_cursor
6420
+ page_info_end_cursor: end_cursor
6421
+ }
6422
+ wallet_to_withdrawal_requests_connection_entities: entities {
6423
+ __typename
6424
+ withdrawal_request_id: id
6425
+ withdrawal_request_created_at: created_at
6426
+ withdrawal_request_updated_at: updated_at
6427
+ withdrawal_request_requested_amount: requested_amount {
6428
+ __typename
6429
+ currency_amount_original_value: original_value
6430
+ currency_amount_original_unit: original_unit
6431
+ currency_amount_preferred_currency_unit: preferred_currency_unit
6432
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
6433
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
6434
+ }
6435
+ withdrawal_request_amount: amount {
6436
+ __typename
6437
+ currency_amount_original_value: original_value
6438
+ currency_amount_original_unit: original_unit
6439
+ currency_amount_preferred_currency_unit: preferred_currency_unit
6440
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
6441
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
6442
+ }
6443
+ withdrawal_request_estimated_amount: estimated_amount {
6444
+ __typename
6445
+ currency_amount_original_value: original_value
6446
+ currency_amount_original_unit: original_unit
6447
+ currency_amount_preferred_currency_unit: preferred_currency_unit
6448
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
6449
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
6450
+ }
6451
+ withdrawal_request_amount_withdrawn: amount_withdrawn {
6452
+ __typename
6453
+ currency_amount_original_value: original_value
6454
+ currency_amount_original_unit: original_unit
6455
+ currency_amount_preferred_currency_unit: preferred_currency_unit
6456
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
6457
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
6458
+ }
6459
+ withdrawal_request_bitcoin_address: bitcoin_address
6460
+ withdrawal_request_withdrawal_mode: withdrawal_mode
6461
+ withdrawal_request_status: status
6462
+ withdrawal_request_completed_at: completed_at
6463
+ withdrawal_request_withdrawal: withdrawal {
6464
+ id
6465
+ }
6466
+ }
6467
+ }
6468
+ }
6469
+ }
6470
+ }
6471
+ `,
6472
+ variables: {
6473
+ entity_id: this.id,
6474
+ first,
6475
+ after,
6476
+ statuses,
6477
+ created_after_date: createdAfterDate,
6478
+ created_before_date: createdBeforeDate
6479
+ },
6480
+ constructObject: (json) => {
6481
+ const connection = json["entity"]["withdrawal_requests"];
6482
+ return WalletToWithdrawalRequestsConnectionFromJson(connection);
5960
6483
  }
5961
6484
  });
5962
6485
  }
@@ -6000,7 +6523,7 @@ query GetWallet($id: ID!) {
6000
6523
  }
6001
6524
  }
6002
6525
 
6003
- ${FRAGMENT17}
6526
+ ${FRAGMENT20}
6004
6527
  `,
6005
6528
  variables: { id },
6006
6529
  constructObject: (data) => WalletFromJson(data.entity)
@@ -6033,7 +6556,7 @@ var WalletFromJson = (obj) => {
6033
6556
  obj["wallet_account"]?.id ?? void 0
6034
6557
  );
6035
6558
  };
6036
- var FRAGMENT17 = `
6559
+ var FRAGMENT20 = `
6037
6560
  fragment WalletFragment on Wallet {
6038
6561
  __typename
6039
6562
  wallet_id: id
@@ -6087,6 +6610,20 @@ var AccountToWalletsConnectionFromJson = (obj) => {
6087
6610
  };
6088
6611
  };
6089
6612
 
6613
+ // src/objects/AccountToWithdrawalRequestsConnection.ts
6614
+ var AccountToWithdrawalRequestsConnectionFromJson = (obj) => {
6615
+ return {
6616
+ count: obj["account_to_withdrawal_requests_connection_count"],
6617
+ pageInfo: PageInfoFromJson(
6618
+ obj["account_to_withdrawal_requests_connection_page_info"]
6619
+ ),
6620
+ entities: obj["account_to_withdrawal_requests_connection_entities"].map(
6621
+ (e) => WithdrawalRequestFromJson(e)
6622
+ ),
6623
+ typename: "AccountToWithdrawalRequestsConnection"
6624
+ };
6625
+ };
6626
+
6090
6627
  // src/objects/Account.ts
6091
6628
  var Account = class {
6092
6629
  constructor(id, createdAt, updatedAt, typename, name) {
@@ -6095,7 +6632,7 @@ var Account = class {
6095
6632
  this.updatedAt = updatedAt;
6096
6633
  this.typename = typename;
6097
6634
  this.name = name;
6098
- autoBind10(this);
6635
+ autoBind11(this);
6099
6636
  }
6100
6637
  async getApiTokens(client, first = void 0, after = void 0) {
6101
6638
  return await client.executeRawQuery({
@@ -7660,6 +8197,87 @@ query FetchAccountToPaymentRequestsConnection($first: Int, $after: String, $afte
7660
8197
  }
7661
8198
  });
7662
8199
  }
8200
+ async getWithdrawalRequests(client, first = void 0, after = void 0, bitcoinNetworks = void 0, statuses = void 0, nodeIds = void 0, afterDate = void 0, beforeDate = void 0) {
8201
+ return await client.executeRawQuery({
8202
+ queryPayload: `
8203
+ query FetchAccountToWithdrawalRequestsConnection($first: Int, $after: String, $bitcoin_networks: [BitcoinNetwork!], $statuses: [WithdrawalRequestStatus!], $node_ids: [ID!], $after_date: DateTime, $before_date: DateTime) {
8204
+ current_account {
8205
+ ... on Account {
8206
+ withdrawal_requests(, first: $first, after: $after, bitcoin_networks: $bitcoin_networks, statuses: $statuses, node_ids: $node_ids, after_date: $after_date, before_date: $before_date) {
8207
+ __typename
8208
+ account_to_withdrawal_requests_connection_count: count
8209
+ account_to_withdrawal_requests_connection_page_info: page_info {
8210
+ __typename
8211
+ page_info_has_next_page: has_next_page
8212
+ page_info_has_previous_page: has_previous_page
8213
+ page_info_start_cursor: start_cursor
8214
+ page_info_end_cursor: end_cursor
8215
+ }
8216
+ account_to_withdrawal_requests_connection_entities: entities {
8217
+ __typename
8218
+ withdrawal_request_id: id
8219
+ withdrawal_request_created_at: created_at
8220
+ withdrawal_request_updated_at: updated_at
8221
+ withdrawal_request_requested_amount: requested_amount {
8222
+ __typename
8223
+ currency_amount_original_value: original_value
8224
+ currency_amount_original_unit: original_unit
8225
+ currency_amount_preferred_currency_unit: preferred_currency_unit
8226
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
8227
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
8228
+ }
8229
+ withdrawal_request_amount: amount {
8230
+ __typename
8231
+ currency_amount_original_value: original_value
8232
+ currency_amount_original_unit: original_unit
8233
+ currency_amount_preferred_currency_unit: preferred_currency_unit
8234
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
8235
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
8236
+ }
8237
+ withdrawal_request_estimated_amount: estimated_amount {
8238
+ __typename
8239
+ currency_amount_original_value: original_value
8240
+ currency_amount_original_unit: original_unit
8241
+ currency_amount_preferred_currency_unit: preferred_currency_unit
8242
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
8243
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
8244
+ }
8245
+ withdrawal_request_amount_withdrawn: amount_withdrawn {
8246
+ __typename
8247
+ currency_amount_original_value: original_value
8248
+ currency_amount_original_unit: original_unit
8249
+ currency_amount_preferred_currency_unit: preferred_currency_unit
8250
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
8251
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
8252
+ }
8253
+ withdrawal_request_bitcoin_address: bitcoin_address
8254
+ withdrawal_request_withdrawal_mode: withdrawal_mode
8255
+ withdrawal_request_status: status
8256
+ withdrawal_request_completed_at: completed_at
8257
+ withdrawal_request_withdrawal: withdrawal {
8258
+ id
8259
+ }
8260
+ }
8261
+ }
8262
+ }
8263
+ }
8264
+ }
8265
+ `,
8266
+ variables: {
8267
+ first,
8268
+ after,
8269
+ bitcoin_networks: bitcoinNetworks,
8270
+ statuses,
8271
+ node_ids: nodeIds,
8272
+ after_date: afterDate,
8273
+ before_date: beforeDate
8274
+ },
8275
+ constructObject: (json) => {
8276
+ const connection = json["current_account"]["withdrawal_requests"];
8277
+ return AccountToWithdrawalRequestsConnectionFromJson(connection);
8278
+ }
8279
+ });
8280
+ }
7663
8281
  async getWallets(client, first = void 0, after = void 0, thirdPartyIds = void 0) {
7664
8282
  return await client.executeRawQuery({
7665
8283
  queryPayload: `
@@ -7738,7 +8356,7 @@ query GetAccount {
7738
8356
  }
7739
8357
  }
7740
8358
 
7741
- ${FRAGMENT18}
8359
+ ${FRAGMENT21}
7742
8360
  `,
7743
8361
  variables: {},
7744
8362
  constructObject: (data) => AccountFromJson(data.current_account)
@@ -7763,7 +8381,7 @@ var AccountFromJson = (obj) => {
7763
8381
  obj["account_name"]
7764
8382
  );
7765
8383
  };
7766
- var FRAGMENT18 = `
8384
+ var FRAGMENT21 = `
7767
8385
  fragment AccountFragment on Account {
7768
8386
  __typename
7769
8387
  account_id: id
@@ -7773,146 +8391,6 @@ fragment AccountFragment on Account {
7773
8391
  }`;
7774
8392
  var Account_default = Account;
7775
8393
 
7776
- // src/objects/ChannelClosingTransaction.ts
7777
- var ChannelClosingTransactionFromJson = (obj) => {
7778
- return {
7779
- id: obj["channel_closing_transaction_id"],
7780
- createdAt: obj["channel_closing_transaction_created_at"],
7781
- updatedAt: obj["channel_closing_transaction_updated_at"],
7782
- status: TransactionStatus_default[obj["channel_closing_transaction_status"]] ?? TransactionStatus_default.FUTURE_VALUE,
7783
- amount: CurrencyAmountFromJson(obj["channel_closing_transaction_amount"]),
7784
- blockHeight: obj["channel_closing_transaction_block_height"],
7785
- destinationAddresses: obj["channel_closing_transaction_destination_addresses"],
7786
- typename: "ChannelClosingTransaction",
7787
- resolvedAt: obj["channel_closing_transaction_resolved_at"],
7788
- transactionHash: obj["channel_closing_transaction_transaction_hash"],
7789
- fees: !!obj["channel_closing_transaction_fees"] ? CurrencyAmountFromJson(obj["channel_closing_transaction_fees"]) : void 0,
7790
- blockHash: obj["channel_closing_transaction_block_hash"],
7791
- numConfirmations: obj["channel_closing_transaction_num_confirmations"],
7792
- channelId: obj["channel_closing_transaction_channel"]?.id ?? void 0
7793
- };
7794
- };
7795
- var FRAGMENT19 = `
7796
- fragment ChannelClosingTransactionFragment on ChannelClosingTransaction {
7797
- __typename
7798
- channel_closing_transaction_id: id
7799
- channel_closing_transaction_created_at: created_at
7800
- channel_closing_transaction_updated_at: updated_at
7801
- channel_closing_transaction_status: status
7802
- channel_closing_transaction_resolved_at: resolved_at
7803
- channel_closing_transaction_amount: amount {
7804
- __typename
7805
- currency_amount_original_value: original_value
7806
- currency_amount_original_unit: original_unit
7807
- currency_amount_preferred_currency_unit: preferred_currency_unit
7808
- currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
7809
- currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
7810
- }
7811
- channel_closing_transaction_transaction_hash: transaction_hash
7812
- channel_closing_transaction_fees: fees {
7813
- __typename
7814
- currency_amount_original_value: original_value
7815
- currency_amount_original_unit: original_unit
7816
- currency_amount_preferred_currency_unit: preferred_currency_unit
7817
- currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
7818
- currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
7819
- }
7820
- channel_closing_transaction_block_hash: block_hash
7821
- channel_closing_transaction_block_height: block_height
7822
- channel_closing_transaction_destination_addresses: destination_addresses
7823
- channel_closing_transaction_num_confirmations: num_confirmations
7824
- channel_closing_transaction_channel: channel {
7825
- id
7826
- }
7827
- }`;
7828
- var getChannelClosingTransactionQuery = (id) => {
7829
- return {
7830
- queryPayload: `
7831
- query GetChannelClosingTransaction($id: ID!) {
7832
- entity(id: $id) {
7833
- ... on ChannelClosingTransaction {
7834
- ...ChannelClosingTransactionFragment
7835
- }
7836
- }
7837
- }
7838
-
7839
- ${FRAGMENT19}
7840
- `,
7841
- variables: { id },
7842
- constructObject: (data) => ChannelClosingTransactionFromJson(data.entity)
7843
- };
7844
- };
7845
-
7846
- // src/objects/ChannelOpeningTransaction.ts
7847
- var ChannelOpeningTransactionFromJson = (obj) => {
7848
- return {
7849
- id: obj["channel_opening_transaction_id"],
7850
- createdAt: obj["channel_opening_transaction_created_at"],
7851
- updatedAt: obj["channel_opening_transaction_updated_at"],
7852
- status: TransactionStatus_default[obj["channel_opening_transaction_status"]] ?? TransactionStatus_default.FUTURE_VALUE,
7853
- amount: CurrencyAmountFromJson(obj["channel_opening_transaction_amount"]),
7854
- blockHeight: obj["channel_opening_transaction_block_height"],
7855
- destinationAddresses: obj["channel_opening_transaction_destination_addresses"],
7856
- typename: "ChannelOpeningTransaction",
7857
- resolvedAt: obj["channel_opening_transaction_resolved_at"],
7858
- transactionHash: obj["channel_opening_transaction_transaction_hash"],
7859
- fees: !!obj["channel_opening_transaction_fees"] ? CurrencyAmountFromJson(obj["channel_opening_transaction_fees"]) : void 0,
7860
- blockHash: obj["channel_opening_transaction_block_hash"],
7861
- numConfirmations: obj["channel_opening_transaction_num_confirmations"],
7862
- channelId: obj["channel_opening_transaction_channel"]?.id ?? void 0
7863
- };
7864
- };
7865
- var FRAGMENT20 = `
7866
- fragment ChannelOpeningTransactionFragment on ChannelOpeningTransaction {
7867
- __typename
7868
- channel_opening_transaction_id: id
7869
- channel_opening_transaction_created_at: created_at
7870
- channel_opening_transaction_updated_at: updated_at
7871
- channel_opening_transaction_status: status
7872
- channel_opening_transaction_resolved_at: resolved_at
7873
- channel_opening_transaction_amount: amount {
7874
- __typename
7875
- currency_amount_original_value: original_value
7876
- currency_amount_original_unit: original_unit
7877
- currency_amount_preferred_currency_unit: preferred_currency_unit
7878
- currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
7879
- currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
7880
- }
7881
- channel_opening_transaction_transaction_hash: transaction_hash
7882
- channel_opening_transaction_fees: fees {
7883
- __typename
7884
- currency_amount_original_value: original_value
7885
- currency_amount_original_unit: original_unit
7886
- currency_amount_preferred_currency_unit: preferred_currency_unit
7887
- currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
7888
- currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
7889
- }
7890
- channel_opening_transaction_block_hash: block_hash
7891
- channel_opening_transaction_block_height: block_height
7892
- channel_opening_transaction_destination_addresses: destination_addresses
7893
- channel_opening_transaction_num_confirmations: num_confirmations
7894
- channel_opening_transaction_channel: channel {
7895
- id
7896
- }
7897
- }`;
7898
- var getChannelOpeningTransactionQuery = (id) => {
7899
- return {
7900
- queryPayload: `
7901
- query GetChannelOpeningTransaction($id: ID!) {
7902
- entity(id: $id) {
7903
- ... on ChannelOpeningTransaction {
7904
- ...ChannelOpeningTransactionFragment
7905
- }
7906
- }
7907
- }
7908
-
7909
- ${FRAGMENT20}
7910
- `,
7911
- variables: { id },
7912
- constructObject: (data) => ChannelOpeningTransactionFromJson(data.entity)
7913
- };
7914
- };
7915
-
7916
8394
  // src/objects/RegionCode.ts
7917
8395
  var RegionCode = /* @__PURE__ */ ((RegionCode2) => {
7918
8396
  RegionCode2["FUTURE_VALUE"] = "FUTURE_VALUE";
@@ -8215,7 +8693,7 @@ var SignablePayloadFromJson = (obj) => {
8215
8693
  mulTweak: obj["signable_payload_mul_tweak"]
8216
8694
  };
8217
8695
  };
8218
- var FRAGMENT21 = `
8696
+ var FRAGMENT22 = `
8219
8697
  fragment SignablePayloadFragment on SignablePayload {
8220
8698
  __typename
8221
8699
  signable_payload_id: id
@@ -8241,7 +8719,7 @@ query GetSignablePayload($id: ID!) {
8241
8719
  }
8242
8720
  }
8243
8721
 
8244
- ${FRAGMENT21}
8722
+ ${FRAGMENT22}
8245
8723
  `,
8246
8724
  variables: { id },
8247
8725
  constructObject: (data) => SignablePayloadFromJson(data.entity)
@@ -8267,7 +8745,7 @@ var DepositFromJson = (obj) => {
8267
8745
  numConfirmations: obj["deposit_num_confirmations"]
8268
8746
  };
8269
8747
  };
8270
- var FRAGMENT22 = `
8748
+ var FRAGMENT23 = `
8271
8749
  fragment DepositFragment on Deposit {
8272
8750
  __typename
8273
8751
  deposit_id: id
@@ -8311,7 +8789,7 @@ query GetDeposit($id: ID!) {
8311
8789
  }
8312
8790
  }
8313
8791
 
8314
- ${FRAGMENT22}
8792
+ ${FRAGMENT23}
8315
8793
  `,
8316
8794
  variables: { id },
8317
8795
  constructObject: (data) => DepositFromJson(data.entity)
@@ -8325,7 +8803,7 @@ var FeeEstimateFromJson = (obj) => {
8325
8803
  feeMin: CurrencyAmountFromJson(obj["fee_estimate_fee_min"])
8326
8804
  };
8327
8805
  };
8328
- var FRAGMENT23 = `
8806
+ var FRAGMENT24 = `
8329
8807
  fragment FeeEstimateFragment on FeeEstimate {
8330
8808
  __typename
8331
8809
  fee_estimate_fee_fast: fee_fast {
@@ -8381,7 +8859,7 @@ var InvoiceFromJson = (obj) => {
8381
8859
  amountPaid: !!obj["invoice_amount_paid"] ? CurrencyAmountFromJson(obj["invoice_amount_paid"]) : void 0
8382
8860
  };
8383
8861
  };
8384
- var FRAGMENT24 = `
8862
+ var FRAGMENT25 = `
8385
8863
  fragment InvoiceFragment on Invoice {
8386
8864
  __typename
8387
8865
  invoice_id: id
@@ -8699,7 +9177,7 @@ query GetInvoice($id: ID!) {
8699
9177
  }
8700
9178
  }
8701
9179
 
8702
- ${FRAGMENT24}
9180
+ ${FRAGMENT25}
8703
9181
  `,
8704
9182
  variables: { id },
8705
9183
  constructObject: (data) => InvoiceFromJson(data.entity)
@@ -8707,7 +9185,7 @@ ${FRAGMENT24}
8707
9185
  };
8708
9186
 
8709
9187
  // src/objects/LightningFeeEstimateOutput.ts
8710
- var FRAGMENT25 = `
9188
+ var FRAGMENT26 = `
8711
9189
  fragment LightningFeeEstimateOutputFragment on LightningFeeEstimateOutput {
8712
9190
  __typename
8713
9191
  lightning_fee_estimate_output_fee_estimate: fee_estimate {
@@ -8786,7 +9264,7 @@ var LightningTransactionFromJson = (obj) => {
8786
9264
  `Couldn't find a concrete type for interface LightningTransaction corresponding to the typename=${obj["__typename"]}`
8787
9265
  );
8788
9266
  };
8789
- var FRAGMENT26 = `
9267
+ var FRAGMENT27 = `
8790
9268
  fragment LightningTransactionFragment on LightningTransaction {
8791
9269
  __typename
8792
9270
  ... on IncomingPayment {
@@ -9215,7 +9693,7 @@ query GetLightningTransaction($id: ID!) {
9215
9693
  }
9216
9694
  }
9217
9695
 
9218
- ${FRAGMENT26}
9696
+ ${FRAGMENT27}
9219
9697
  `,
9220
9698
  variables: { id },
9221
9699
  constructObject: (data) => LightningTransactionFromJson(data.entity)
@@ -9252,7 +9730,7 @@ var LightsparkNodeOwnerFromJson = (obj) => {
9252
9730
  `Couldn't find a concrete type for interface LightsparkNodeOwner corresponding to the typename=${obj["__typename"]}`
9253
9731
  );
9254
9732
  };
9255
- var FRAGMENT27 = `
9733
+ var FRAGMENT28 = `
9256
9734
  fragment LightsparkNodeOwnerFragment on LightsparkNodeOwner {
9257
9735
  __typename
9258
9736
  ... on Account {
@@ -9313,7 +9791,7 @@ query GetLightsparkNodeOwner($id: ID!) {
9313
9791
  }
9314
9792
  }
9315
9793
 
9316
- ${FRAGMENT27}
9794
+ ${FRAGMENT28}
9317
9795
  `,
9318
9796
  variables: { id },
9319
9797
  constructObject: (data) => LightsparkNodeOwnerFromJson(data.entity)
@@ -9400,7 +9878,7 @@ var OnChainTransactionFromJson = (obj) => {
9400
9878
  `Couldn't find a concrete type for interface OnChainTransaction corresponding to the typename=${obj["__typename"]}`
9401
9879
  );
9402
9880
  };
9403
- var FRAGMENT28 = `
9881
+ var FRAGMENT29 = `
9404
9882
  fragment OnChainTransactionFragment on OnChainTransaction {
9405
9883
  __typename
9406
9884
  ... on ChannelClosingTransaction {
@@ -9543,7 +10021,7 @@ query GetOnChainTransaction($id: ID!) {
9543
10021
  }
9544
10022
  }
9545
10023
 
9546
- ${FRAGMENT28}
10024
+ ${FRAGMENT29}
9547
10025
  `,
9548
10026
  variables: { id },
9549
10027
  constructObject: (data) => OnChainTransactionFromJson(data.entity)
@@ -9574,15 +10052,6 @@ var RemoteSigningSubEventType = /* @__PURE__ */ ((RemoteSigningSubEventType2) =>
9574
10052
  })(RemoteSigningSubEventType || {});
9575
10053
  var RemoteSigningSubEventType_default = RemoteSigningSubEventType;
9576
10054
 
9577
- // src/objects/WithdrawalMode.ts
9578
- var WithdrawalMode = /* @__PURE__ */ ((WithdrawalMode2) => {
9579
- WithdrawalMode2["FUTURE_VALUE"] = "FUTURE_VALUE";
9580
- WithdrawalMode2["WALLET_ONLY"] = "WALLET_ONLY";
9581
- WithdrawalMode2["WALLET_THEN_CHANNELS"] = "WALLET_THEN_CHANNELS";
9582
- return WithdrawalMode2;
9583
- })(WithdrawalMode || {});
9584
- var WithdrawalMode_default = WithdrawalMode;
9585
-
9586
10055
  // src/objects/RiskRating.ts
9587
10056
  var RiskRating = /* @__PURE__ */ ((RiskRating2) => {
9588
10057
  RiskRating2["FUTURE_VALUE"] = "FUTURE_VALUE";
@@ -9611,7 +10080,7 @@ var RoutingTransactionFromJson = (obj) => {
9611
10080
  failureReason: !!obj["routing_transaction_failure_reason"] ? RoutingTransactionFailureReason_default[obj["routing_transaction_failure_reason"]] ?? RoutingTransactionFailureReason_default.FUTURE_VALUE : null
9612
10081
  };
9613
10082
  };
9614
- var FRAGMENT29 = `
10083
+ var FRAGMENT30 = `
9615
10084
  fragment RoutingTransactionFragment on RoutingTransaction {
9616
10085
  __typename
9617
10086
  routing_transaction_id: id
@@ -9659,7 +10128,7 @@ query GetRoutingTransaction($id: ID!) {
9659
10128
  }
9660
10129
  }
9661
10130
 
9662
- ${FRAGMENT29}
10131
+ ${FRAGMENT30}
9663
10132
  `,
9664
10133
  variables: { id },
9665
10134
  constructObject: (data) => RoutingTransactionFromJson(data.entity)
@@ -9675,7 +10144,7 @@ var SignableFromJson = (obj) => {
9675
10144
  typename: "Signable"
9676
10145
  };
9677
10146
  };
9678
- var FRAGMENT30 = `
10147
+ var FRAGMENT31 = `
9679
10148
  fragment SignableFragment on Signable {
9680
10149
  __typename
9681
10150
  signable_id: id
@@ -9693,7 +10162,7 @@ query GetSignable($id: ID!) {
9693
10162
  }
9694
10163
  }
9695
10164
 
9696
- ${FRAGMENT30}
10165
+ ${FRAGMENT31}
9697
10166
  `,
9698
10167
  variables: { id },
9699
10168
  constructObject: (data) => SignableFromJson(data.entity)
@@ -9730,7 +10199,7 @@ var TransactionUpdateFromJson = (obj) => {
9730
10199
  transactionHash: obj["transaction_hash"]
9731
10200
  };
9732
10201
  };
9733
- var FRAGMENT31 = `
10202
+ var FRAGMENT32 = `
9734
10203
  fragment TransactionUpdateFragment on Transaction {
9735
10204
  __typename
9736
10205
  id
@@ -9764,7 +10233,7 @@ var UmaInvitationFromJson = (obj) => {
9764
10233
  incentivesIneligibilityReason: !!obj["uma_invitation_incentives_ineligibility_reason"] ? IncentivesIneligibilityReason_default[obj["uma_invitation_incentives_ineligibility_reason"]] ?? IncentivesIneligibilityReason_default.FUTURE_VALUE : null
9765
10234
  };
9766
10235
  };
9767
- var FRAGMENT32 = `
10236
+ var FRAGMENT33 = `
9768
10237
  fragment UmaInvitationFragment on UmaInvitation {
9769
10238
  __typename
9770
10239
  uma_invitation_id: id
@@ -9788,7 +10257,7 @@ query GetUmaInvitation($id: ID!) {
9788
10257
  }
9789
10258
  }
9790
10259
 
9791
- ${FRAGMENT32}
10260
+ ${FRAGMENT33}
9792
10261
  `,
9793
10262
  variables: { id },
9794
10263
  constructObject: (data) => UmaInvitationFromJson(data.entity)
@@ -9834,7 +10303,7 @@ var WithdrawalFromJson = (obj) => {
9834
10303
  numConfirmations: obj["withdrawal_num_confirmations"]
9835
10304
  };
9836
10305
  };
9837
- var FRAGMENT33 = `
10306
+ var FRAGMENT34 = `
9838
10307
  fragment WithdrawalFragment on Withdrawal {
9839
10308
  __typename
9840
10309
  withdrawal_id: id
@@ -9878,244 +10347,25 @@ query GetWithdrawal($id: ID!) {
9878
10347
  }
9879
10348
  }
9880
10349
 
9881
- ${FRAGMENT33}
10350
+ ${FRAGMENT34}
9882
10351
  `,
9883
10352
  variables: { id },
9884
10353
  constructObject: (data) => WithdrawalFromJson(data.entity)
9885
10354
  };
9886
10355
  };
9887
10356
 
9888
- // src/objects/WithdrawalRequest.ts
9889
- import autoBind11 from "auto-bind";
9890
-
9891
- // src/objects/WithdrawalRequestStatus.ts
9892
- var WithdrawalRequestStatus = /* @__PURE__ */ ((WithdrawalRequestStatus2) => {
9893
- WithdrawalRequestStatus2["FUTURE_VALUE"] = "FUTURE_VALUE";
9894
- WithdrawalRequestStatus2["CREATED"] = "CREATED";
9895
- WithdrawalRequestStatus2["FAILED"] = "FAILED";
9896
- WithdrawalRequestStatus2["IN_PROGRESS"] = "IN_PROGRESS";
9897
- WithdrawalRequestStatus2["SUCCESSFUL"] = "SUCCESSFUL";
9898
- return WithdrawalRequestStatus2;
9899
- })(WithdrawalRequestStatus || {});
9900
- var WithdrawalRequestStatus_default = WithdrawalRequestStatus;
9901
-
9902
- // src/objects/WithdrawalRequestToChannelClosingTransactionsConnection.ts
9903
- var WithdrawalRequestToChannelClosingTransactionsConnectionFromJson = (obj) => {
9904
- return {
9905
- pageInfo: PageInfoFromJson(
9906
- obj["withdrawal_request_to_channel_closing_transactions_connection_page_info"]
9907
- ),
9908
- count: obj["withdrawal_request_to_channel_closing_transactions_connection_count"],
9909
- entities: obj["withdrawal_request_to_channel_closing_transactions_connection_entities"].map((e) => ChannelClosingTransactionFromJson(e))
9910
- };
9911
- };
9912
-
9913
- // src/objects/WithdrawalRequestToChannelOpeningTransactionsConnection.ts
9914
- var WithdrawalRequestToChannelOpeningTransactionsConnectionFromJson = (obj) => {
10357
+ // src/objects/WithdrawalFeeEstimateOutput.ts
10358
+ var WithdrawalFeeEstimateOutputFromJson = (obj) => {
9915
10359
  return {
9916
- pageInfo: PageInfoFromJson(
9917
- obj["withdrawal_request_to_channel_opening_transactions_connection_page_info"]
9918
- ),
9919
- count: obj["withdrawal_request_to_channel_opening_transactions_connection_count"],
9920
- entities: obj["withdrawal_request_to_channel_opening_transactions_connection_entities"].map((e) => ChannelOpeningTransactionFromJson(e))
10360
+ feeEstimate: CurrencyAmountFromJson(
10361
+ obj["withdrawal_fee_estimate_output_fee_estimate"]
10362
+ )
9921
10363
  };
9922
10364
  };
9923
-
9924
- // src/objects/WithdrawalRequest.ts
9925
- var WithdrawalRequest = class {
9926
- constructor(id, createdAt, updatedAt, amount, bitcoinAddress, withdrawalMode, status, typename, estimatedAmount, completedAt, withdrawalId) {
9927
- this.id = id;
9928
- this.createdAt = createdAt;
9929
- this.updatedAt = updatedAt;
9930
- this.amount = amount;
9931
- this.bitcoinAddress = bitcoinAddress;
9932
- this.withdrawalMode = withdrawalMode;
9933
- this.status = status;
9934
- this.typename = typename;
9935
- this.estimatedAmount = estimatedAmount;
9936
- this.completedAt = completedAt;
9937
- this.withdrawalId = withdrawalId;
9938
- autoBind11(this);
9939
- }
9940
- async getChannelClosingTransactions(client, first = void 0) {
9941
- return await client.executeRawQuery({
9942
- queryPayload: `
9943
- query FetchWithdrawalRequestToChannelClosingTransactionsConnection($entity_id: ID!, $first: Int) {
9944
- entity(id: $entity_id) {
9945
- ... on WithdrawalRequest {
9946
- channel_closing_transactions(, first: $first) {
9947
- __typename
9948
- withdrawal_request_to_channel_closing_transactions_connection_page_info: page_info {
9949
- __typename
9950
- page_info_has_next_page: has_next_page
9951
- page_info_has_previous_page: has_previous_page
9952
- page_info_start_cursor: start_cursor
9953
- page_info_end_cursor: end_cursor
9954
- }
9955
- withdrawal_request_to_channel_closing_transactions_connection_count: count
9956
- withdrawal_request_to_channel_closing_transactions_connection_entities: entities {
9957
- __typename
9958
- channel_closing_transaction_id: id
9959
- channel_closing_transaction_created_at: created_at
9960
- channel_closing_transaction_updated_at: updated_at
9961
- channel_closing_transaction_status: status
9962
- channel_closing_transaction_resolved_at: resolved_at
9963
- channel_closing_transaction_amount: amount {
9964
- __typename
9965
- currency_amount_original_value: original_value
9966
- currency_amount_original_unit: original_unit
9967
- currency_amount_preferred_currency_unit: preferred_currency_unit
9968
- currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
9969
- currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
9970
- }
9971
- channel_closing_transaction_transaction_hash: transaction_hash
9972
- channel_closing_transaction_fees: fees {
9973
- __typename
9974
- currency_amount_original_value: original_value
9975
- currency_amount_original_unit: original_unit
9976
- currency_amount_preferred_currency_unit: preferred_currency_unit
9977
- currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
9978
- currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
9979
- }
9980
- channel_closing_transaction_block_hash: block_hash
9981
- channel_closing_transaction_block_height: block_height
9982
- channel_closing_transaction_destination_addresses: destination_addresses
9983
- channel_closing_transaction_num_confirmations: num_confirmations
9984
- channel_closing_transaction_channel: channel {
9985
- id
9986
- }
9987
- }
9988
- }
9989
- }
9990
- }
9991
- }
9992
- `,
9993
- variables: { entity_id: this.id, first },
9994
- constructObject: (json) => {
9995
- const connection = json["entity"]["channel_closing_transactions"];
9996
- return WithdrawalRequestToChannelClosingTransactionsConnectionFromJson(
9997
- connection
9998
- );
9999
- }
10000
- });
10001
- }
10002
- async getChannelOpeningTransactions(client, first = void 0) {
10003
- return await client.executeRawQuery({
10004
- queryPayload: `
10005
- query FetchWithdrawalRequestToChannelOpeningTransactionsConnection($entity_id: ID!, $first: Int) {
10006
- entity(id: $entity_id) {
10007
- ... on WithdrawalRequest {
10008
- channel_opening_transactions(, first: $first) {
10009
- __typename
10010
- withdrawal_request_to_channel_opening_transactions_connection_page_info: page_info {
10011
- __typename
10012
- page_info_has_next_page: has_next_page
10013
- page_info_has_previous_page: has_previous_page
10014
- page_info_start_cursor: start_cursor
10015
- page_info_end_cursor: end_cursor
10016
- }
10017
- withdrawal_request_to_channel_opening_transactions_connection_count: count
10018
- withdrawal_request_to_channel_opening_transactions_connection_entities: entities {
10019
- __typename
10020
- channel_opening_transaction_id: id
10021
- channel_opening_transaction_created_at: created_at
10022
- channel_opening_transaction_updated_at: updated_at
10023
- channel_opening_transaction_status: status
10024
- channel_opening_transaction_resolved_at: resolved_at
10025
- channel_opening_transaction_amount: amount {
10026
- __typename
10027
- currency_amount_original_value: original_value
10028
- currency_amount_original_unit: original_unit
10029
- currency_amount_preferred_currency_unit: preferred_currency_unit
10030
- currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
10031
- currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
10032
- }
10033
- channel_opening_transaction_transaction_hash: transaction_hash
10034
- channel_opening_transaction_fees: fees {
10035
- __typename
10036
- currency_amount_original_value: original_value
10037
- currency_amount_original_unit: original_unit
10038
- currency_amount_preferred_currency_unit: preferred_currency_unit
10039
- currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
10040
- currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
10041
- }
10042
- channel_opening_transaction_block_hash: block_hash
10043
- channel_opening_transaction_block_height: block_height
10044
- channel_opening_transaction_destination_addresses: destination_addresses
10045
- channel_opening_transaction_num_confirmations: num_confirmations
10046
- channel_opening_transaction_channel: channel {
10047
- id
10048
- }
10049
- }
10050
- }
10051
- }
10052
- }
10053
- }
10054
- `,
10055
- variables: { entity_id: this.id, first },
10056
- constructObject: (json) => {
10057
- const connection = json["entity"]["channel_opening_transactions"];
10058
- return WithdrawalRequestToChannelOpeningTransactionsConnectionFromJson(
10059
- connection
10060
- );
10061
- }
10062
- });
10063
- }
10064
- static getWithdrawalRequestQuery(id) {
10065
- return {
10066
- queryPayload: `
10067
- query GetWithdrawalRequest($id: ID!) {
10068
- entity(id: $id) {
10069
- ... on WithdrawalRequest {
10070
- ...WithdrawalRequestFragment
10071
- }
10072
- }
10073
- }
10074
-
10075
- ${FRAGMENT34}
10076
- `,
10077
- variables: { id },
10078
- constructObject: (data) => WithdrawalRequestFromJson(data.entity)
10079
- };
10080
- }
10081
- toJson() {
10082
- return {
10083
- __typename: "WithdrawalRequest",
10084
- withdrawal_request_id: this.id,
10085
- withdrawal_request_created_at: this.createdAt,
10086
- withdrawal_request_updated_at: this.updatedAt,
10087
- withdrawal_request_amount: CurrencyAmountToJson(this.amount),
10088
- withdrawal_request_estimated_amount: this.estimatedAmount ? CurrencyAmountToJson(this.estimatedAmount) : void 0,
10089
- withdrawal_request_bitcoin_address: this.bitcoinAddress,
10090
- withdrawal_request_withdrawal_mode: this.withdrawalMode,
10091
- withdrawal_request_status: this.status,
10092
- withdrawal_request_completed_at: this.completedAt,
10093
- withdrawal_request_withdrawal: { id: this.withdrawalId }
10094
- };
10095
- }
10096
- };
10097
- var WithdrawalRequestFromJson = (obj) => {
10098
- return new WithdrawalRequest(
10099
- obj["withdrawal_request_id"],
10100
- obj["withdrawal_request_created_at"],
10101
- obj["withdrawal_request_updated_at"],
10102
- CurrencyAmountFromJson(obj["withdrawal_request_amount"]),
10103
- obj["withdrawal_request_bitcoin_address"],
10104
- WithdrawalMode_default[obj["withdrawal_request_withdrawal_mode"]] ?? WithdrawalMode_default.FUTURE_VALUE,
10105
- WithdrawalRequestStatus_default[obj["withdrawal_request_status"]] ?? WithdrawalRequestStatus_default.FUTURE_VALUE,
10106
- "WithdrawalRequest",
10107
- !!obj["withdrawal_request_estimated_amount"] ? CurrencyAmountFromJson(obj["withdrawal_request_estimated_amount"]) : void 0,
10108
- obj["withdrawal_request_completed_at"],
10109
- obj["withdrawal_request_withdrawal"]?.id ?? void 0
10110
- );
10111
- };
10112
- var FRAGMENT34 = `
10113
- fragment WithdrawalRequestFragment on WithdrawalRequest {
10365
+ var FRAGMENT35 = `
10366
+ fragment WithdrawalFeeEstimateOutputFragment on WithdrawalFeeEstimateOutput {
10114
10367
  __typename
10115
- withdrawal_request_id: id
10116
- withdrawal_request_created_at: created_at
10117
- withdrawal_request_updated_at: updated_at
10118
- withdrawal_request_amount: amount {
10368
+ withdrawal_fee_estimate_output_fee_estimate: fee_estimate {
10119
10369
  __typename
10120
10370
  currency_amount_original_value: original_value
10121
10371
  currency_amount_original_unit: original_unit
@@ -10123,30 +10373,14 @@ fragment WithdrawalRequestFragment on WithdrawalRequest {
10123
10373
  currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
10124
10374
  currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
10125
10375
  }
10126
- withdrawal_request_estimated_amount: estimated_amount {
10127
- __typename
10128
- currency_amount_original_value: original_value
10129
- currency_amount_original_unit: original_unit
10130
- currency_amount_preferred_currency_unit: preferred_currency_unit
10131
- currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
10132
- currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
10133
- }
10134
- withdrawal_request_bitcoin_address: bitcoin_address
10135
- withdrawal_request_withdrawal_mode: withdrawal_mode
10136
- withdrawal_request_status: status
10137
- withdrawal_request_completed_at: completed_at
10138
- withdrawal_request_withdrawal: withdrawal {
10139
- id
10140
- }
10141
10376
  }`;
10142
- var WithdrawalRequest_default = WithdrawalRequest;
10143
10377
 
10144
10378
  export {
10145
10379
  CurrencyUnit_default,
10146
10380
  CurrencyAmountFromJson,
10147
10381
  FRAGMENT2 as FRAGMENT,
10148
10382
  FeeEstimateFromJson,
10149
- FRAGMENT23 as FRAGMENT2,
10383
+ FRAGMENT24 as FRAGMENT2,
10150
10384
  NodeAddressType_default,
10151
10385
  GraphNode_default,
10152
10386
  LightsparkNodeStatus_default,
@@ -10159,12 +10393,12 @@ export {
10159
10393
  FRAGMENT9 as FRAGMENT3,
10160
10394
  PaymentRequestStatus_default,
10161
10395
  InvoiceFromJson,
10162
- FRAGMENT24 as FRAGMENT4,
10396
+ FRAGMENT25 as FRAGMENT4,
10163
10397
  getInvoiceQuery,
10164
10398
  IncentivesIneligibilityReason_default,
10165
10399
  IncentivesStatus_default,
10166
10400
  UmaInvitationFromJson,
10167
- FRAGMENT32 as FRAGMENT5,
10401
+ FRAGMENT33 as FRAGMENT5,
10168
10402
  getUmaInvitationQuery,
10169
10403
  Permission_default,
10170
10404
  ApiTokenFromJson,
@@ -10176,7 +10410,7 @@ export {
10176
10410
  IncomingPaymentFromJson,
10177
10411
  FRAGMENT12 as FRAGMENT7,
10178
10412
  IncomingPayment_default,
10179
- FRAGMENT25 as FRAGMENT8,
10413
+ FRAGMENT26 as FRAGMENT8,
10180
10414
  HtlcAttemptFailureCode_default,
10181
10415
  OutgoingPaymentAttemptStatus_default,
10182
10416
  getHopQuery,
@@ -10193,14 +10427,16 @@ export {
10193
10427
  getChannelClosingTransactionQuery,
10194
10428
  getChannelOpeningTransactionQuery,
10195
10429
  WithdrawalRequestFromJson,
10196
- FRAGMENT34 as FRAGMENT11,
10430
+ FRAGMENT19 as FRAGMENT11,
10197
10431
  WithdrawalRequest_default,
10198
10432
  RoutingTransactionFailureReason_default,
10199
10433
  TransactionFromJson,
10200
10434
  FRAGMENT16 as FRAGMENT12,
10201
10435
  getTransactionQuery,
10202
10436
  TransactionUpdateFromJson,
10203
- FRAGMENT31 as FRAGMENT13,
10437
+ FRAGMENT32 as FRAGMENT13,
10438
+ WithdrawalFeeEstimateOutputFromJson,
10439
+ FRAGMENT35 as FRAGMENT14,
10204
10440
  AccountToChannelsConnection_default,
10205
10441
  getLightsparkNodeQuery,
10206
10442
  WalletStatus_default,