@lightsparkdev/lightspark-sdk 0.4.10 → 1.0.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 (125) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/README.md +1 -1
  3. package/dist/{chunk-NXUFC5J7.js → chunk-LZC5C5NI.js} +2908 -635
  4. package/dist/{index-3ffe9e7b.d.ts → index-09d4ac20.d.ts} +373 -62
  5. package/dist/index.cjs +3395 -842
  6. package/dist/index.d.ts +2 -2
  7. package/dist/index.js +390 -94
  8. package/dist/objects/index.cjs +2735 -553
  9. package/dist/objects/index.d.ts +1 -1
  10. package/dist/objects/index.js +17 -5
  11. package/package.json +12 -9
  12. package/src/NodeKeyLoaderCache.ts +87 -0
  13. package/src/SigningKeyLoader.ts +177 -0
  14. package/src/auth/AccountTokenAuthProvider.ts +4 -4
  15. package/src/client.ts +209 -118
  16. package/src/graphql/CreateInvoice.ts +3 -2
  17. package/src/graphql/CreateLnurlInvoice.ts +2 -0
  18. package/src/graphql/CreateUmaInvoice.ts +23 -0
  19. package/src/graphql/MultiNodeDashboard.ts +0 -3
  20. package/src/graphql/PayUmaInvoice.ts +29 -0
  21. package/src/graphql/RecoverNodeSigningKey.ts +1 -1
  22. package/src/graphql/SingleNodeDashboard.ts +0 -1
  23. package/src/lightspark_crypto/lightspark_crypto.d.ts +157 -0
  24. package/src/lightspark_crypto/lightspark_crypto.js +1010 -0
  25. package/src/lightspark_crypto/lightspark_crypto_bg.wasm +0 -0
  26. package/src/lightspark_crypto/lightspark_crypto_bg.wasm.d.ts +120 -0
  27. package/src/lightspark_crypto/package.json +11 -0
  28. package/src/objects/Account.ts +437 -120
  29. package/src/objects/AccountToApiTokensConnection.ts +3 -3
  30. package/src/objects/AccountToChannelsConnection.ts +4 -4
  31. package/src/objects/AccountToNodesConnection.ts +2 -15
  32. package/src/objects/AccountToPaymentRequestsConnection.ts +3 -3
  33. package/src/objects/AccountToTransactionsConnection.ts +6 -6
  34. package/src/objects/AccountToWalletsConnection.ts +2 -2
  35. package/src/objects/Balances.ts +2 -2
  36. package/src/objects/Channel.ts +4 -4
  37. package/src/objects/ChannelClosingTransaction.ts +2 -2
  38. package/src/objects/ChannelOpeningTransaction.ts +2 -2
  39. package/src/objects/ChannelToTransactionsConnection.ts +4 -4
  40. package/src/objects/{CryptoSanctionsScreeningProvider.ts → ComplianceProvider.ts} +3 -3
  41. package/src/objects/Connection.ts +25 -31
  42. package/src/objects/CreateApiTokenInput.ts +1 -1
  43. package/src/objects/CreateApiTokenOutput.ts +1 -1
  44. package/src/objects/CreateInvoiceInput.ts +0 -6
  45. package/src/objects/CreateLnurlInvoiceInput.ts +1 -7
  46. package/src/objects/CreateNodeWalletAddressInput.ts +1 -1
  47. package/src/objects/CreateNodeWalletAddressOutput.ts +1 -1
  48. package/src/objects/CreateTestModeInvoiceInput.ts +1 -1
  49. package/src/objects/CreateTestModeInvoiceOutput.ts +1 -1
  50. package/src/objects/CreateTestModePaymentInput.ts +1 -1
  51. package/src/objects/CreateTestModePaymentoutput.ts +14 -2
  52. package/src/objects/CreateUmaInvoiceInput.ts +24 -0
  53. package/src/objects/DeclineToSignMessagesInput.ts +16 -0
  54. package/src/objects/DeclineToSignMessagesOutput.ts +28 -0
  55. package/src/objects/DeleteApiTokenOutput.ts +1 -1
  56. package/src/objects/Entity.ts +401 -66
  57. package/src/objects/GraphNode.ts +3 -3
  58. package/src/objects/IdAndSignature.ts +16 -0
  59. package/src/objects/IncomingPayment.ts +21 -8
  60. package/src/objects/IncomingPaymentAttempt.ts +2 -2
  61. package/src/objects/IncomingPaymentToAttemptsConnection.ts +3 -3
  62. package/src/objects/Invoice.ts +118 -21
  63. package/src/objects/InvoiceData.ts +118 -21
  64. package/src/objects/LightningFeeEstimateForInvoiceInput.ts +1 -1
  65. package/src/objects/LightningFeeEstimateForNodeInput.ts +1 -1
  66. package/src/objects/LightningFeeEstimateOutput.ts +2 -2
  67. package/src/objects/LightningTransaction.ts +155 -31
  68. package/src/objects/LightsparkNode.ts +272 -112
  69. package/src/objects/LightsparkNodeOwner.ts +8 -4
  70. package/src/objects/LightsparkNodeToChannelsConnection.ts +3 -3
  71. package/src/objects/LightsparkNodeWithOSK.ts +389 -0
  72. package/src/objects/LightsparkNodeWithRemoteSigning.ts +384 -0
  73. package/src/objects/Node.ts +213 -60
  74. package/src/objects/NodeToAddressesConnection.ts +2 -2
  75. package/src/objects/OnChainTransaction.ts +2 -2
  76. package/src/objects/OutgoingPayment.ts +139 -24
  77. package/src/objects/OutgoingPaymentAttempt.ts +5 -5
  78. package/src/objects/OutgoingPaymentAttemptToHopsConnection.ts +3 -3
  79. package/src/objects/OutgoingPaymentToAttemptsConnection.ts +3 -3
  80. package/src/objects/OutgoingPaymentsForInvoiceQueryInput.ts +25 -0
  81. package/src/objects/OutgoingPaymentsForInvoiceQueryOutput.ts +28 -0
  82. package/src/objects/PayUmaInvoiceInput.ts +25 -0
  83. package/src/objects/{LightsparkNodePurpose.ts → PaymentDirection.ts} +5 -7
  84. package/src/objects/PaymentRequest.ts +119 -22
  85. package/src/objects/PaymentRequestData.ts +119 -22
  86. package/src/objects/PostTransactionData.ts +39 -0
  87. package/src/objects/RegisterPaymentInput.ts +31 -0
  88. package/src/objects/RegisterPaymentOutput.ts +23 -0
  89. package/src/objects/ReleaseChannelPerCommitmentSecretInput.ts +23 -0
  90. package/src/objects/ReleaseChannelPerCommitmentSecretOutput.ts +23 -0
  91. package/src/objects/ReleasePaymentPreimageInput.ts +20 -0
  92. package/src/objects/ReleasePaymentPreimageOutput.ts +23 -0
  93. package/src/objects/RemoteSigningSubEventType.ts +26 -0
  94. package/src/objects/RequestWithdrawalInput.ts +1 -1
  95. package/src/objects/RequestWithdrawalOutput.ts +1 -1
  96. package/src/objects/RoutingTransaction.ts +1 -1
  97. package/src/objects/ScreenNodeInput.ts +20 -0
  98. package/src/objects/ScreenNodeOutput.ts +22 -0
  99. package/src/objects/SetInvoicePaymentHashInput.ts +24 -0
  100. package/src/objects/SetInvoicePaymentHashOutput.ts +23 -0
  101. package/src/objects/SignInvoiceInput.ts +19 -0
  102. package/src/objects/SignInvoiceOutput.ts +21 -0
  103. package/src/objects/SignMessagesInput.ts +18 -0
  104. package/src/objects/SignMessagesOutput.ts +26 -0
  105. package/src/objects/Signable.ts +58 -0
  106. package/src/objects/SignablePayload.ts +93 -0
  107. package/src/objects/SignablePayloadStatus.ts +17 -0
  108. package/src/objects/SingleNodeDashboard.ts +0 -2
  109. package/src/objects/Transaction.ts +153 -29
  110. package/src/objects/TransactionFailures.ts +1 -1
  111. package/src/objects/UpdateChannelPerCommitmentPointInput.ts +25 -0
  112. package/src/objects/UpdateChannelPerCommitmentPointOutput.ts +23 -0
  113. package/src/objects/UpdateNodeSharedSecretInput.ts +18 -0
  114. package/src/objects/UpdateNodeSharedSecretOutput.ts +23 -0
  115. package/src/objects/Wallet.ts +271 -51
  116. package/src/objects/WalletToPaymentRequestsConnection.ts +3 -3
  117. package/src/objects/WalletToTransactionsConnection.ts +3 -3
  118. package/src/objects/WithdrawalRequest.ts +6 -6
  119. package/src/objects/WithdrawalRequestToChannelClosingTransactionsConnection.ts +2 -2
  120. package/src/objects/WithdrawalRequestToChannelOpeningTransactionsConnection.ts +2 -2
  121. package/src/objects/index.ts +37 -4
  122. package/src/{__tests__ → tests}/webhooks.test.ts +1 -1
  123. package/src/webhooks.ts +1 -1
  124. package/src/objects/ScreenBitcoinAddressesInput.ts +0 -23
  125. package/src/objects/ScreenBitcoinAddressesOutput.ts +0 -25
@@ -8,9 +8,9 @@ import { BlockchainBalanceFromJson } from "./BlockchainBalance.js";
8
8
  import { CurrencyAmountFromJson } from "./CurrencyAmount.js";
9
9
  import type Entity from "./Entity.js";
10
10
  import GraphNode from "./GraphNode.js";
11
- import LightsparkNode from "./LightsparkNode.js";
12
- import LightsparkNodePurpose from "./LightsparkNodePurpose.js";
13
11
  import LightsparkNodeStatus from "./LightsparkNodeStatus.js";
12
+ import LightsparkNodeWithOSK from "./LightsparkNodeWithOSK.js";
13
+ import LightsparkNodeWithRemoteSigning from "./LightsparkNodeWithRemoteSigning.js";
14
14
  import type NodeAddressType from "./NodeAddressType.js";
15
15
  import type NodeToAddressesConnection from "./NodeToAddressesConnection.js";
16
16
  import { NodeToAddressesConnectionFromJson } from "./NodeToAddressesConnection.js";
@@ -28,7 +28,7 @@ class Node implements Entity {
28
28
  public readonly alias?: string,
29
29
  public readonly color?: string,
30
30
  public readonly conductivity?: number,
31
- public readonly publicKey?: string
31
+ public readonly publicKey?: string,
32
32
  ) {
33
33
  autoBind(this);
34
34
  }
@@ -36,7 +36,7 @@ class Node implements Entity {
36
36
  public async getAddresses(
37
37
  client: LightsparkClient,
38
38
  first: number | undefined = undefined,
39
- types: NodeAddressType[] | undefined = undefined
39
+ types: NodeAddressType[] | undefined = undefined,
40
40
  ): Promise<NodeToAddressesConnection> {
41
41
  return (await client.executeRawQuery({
42
42
  queryPayload: `
@@ -96,55 +96,111 @@ export const NodeFromJson = (obj: any): Node => {
96
96
  obj["graph_node_alias"],
97
97
  obj["graph_node_color"],
98
98
  obj["graph_node_conductivity"],
99
- obj["graph_node_public_key"]
99
+ obj["graph_node_public_key"],
100
100
  );
101
101
  }
102
- if (obj["__typename"] == "LightsparkNode") {
103
- return new LightsparkNode(
104
- obj["lightspark_node_id"],
105
- obj["lightspark_node_created_at"],
106
- obj["lightspark_node_updated_at"],
107
- BitcoinNetwork[obj["lightspark_node_bitcoin_network"]] ??
102
+ if (obj["__typename"] == "LightsparkNodeWithOSK") {
103
+ return new LightsparkNodeWithOSK(
104
+ obj["lightspark_node_with_o_s_k_id"],
105
+ obj["lightspark_node_with_o_s_k_created_at"],
106
+ obj["lightspark_node_with_o_s_k_updated_at"],
107
+ BitcoinNetwork[obj["lightspark_node_with_o_s_k_bitcoin_network"]] ??
108
108
  BitcoinNetwork.FUTURE_VALUE,
109
- obj["lightspark_node_display_name"],
110
- obj["lightspark_node_account"].id,
111
- obj["lightspark_node_owner"].id,
112
- "LightsparkNode",
113
- obj["lightspark_node_alias"],
114
- obj["lightspark_node_color"],
115
- obj["lightspark_node_conductivity"],
116
- obj["lightspark_node_public_key"],
117
- !!obj["lightspark_node_blockchain_balance"]
118
- ? BlockchainBalanceFromJson(obj["lightspark_node_blockchain_balance"])
109
+ obj["lightspark_node_with_o_s_k_display_name"],
110
+ obj["lightspark_node_with_o_s_k_owner"].id,
111
+ obj["lightspark_node_with_o_s_k_uma_prescreening_utxos"],
112
+ "LightsparkNodeWithOSK",
113
+ obj["lightspark_node_with_o_s_k_alias"],
114
+ obj["lightspark_node_with_o_s_k_color"],
115
+ obj["lightspark_node_with_o_s_k_conductivity"],
116
+ obj["lightspark_node_with_o_s_k_public_key"],
117
+ !!obj["lightspark_node_with_o_s_k_status"]
118
+ ? LightsparkNodeStatus[obj["lightspark_node_with_o_s_k_status"]] ??
119
+ LightsparkNodeStatus.FUTURE_VALUE
120
+ : null,
121
+ !!obj["lightspark_node_with_o_s_k_total_balance"]
122
+ ? CurrencyAmountFromJson(
123
+ obj["lightspark_node_with_o_s_k_total_balance"],
124
+ )
125
+ : undefined,
126
+ !!obj["lightspark_node_with_o_s_k_total_local_balance"]
127
+ ? CurrencyAmountFromJson(
128
+ obj["lightspark_node_with_o_s_k_total_local_balance"],
129
+ )
119
130
  : undefined,
120
- !!obj["lightspark_node_encrypted_signing_private_key"]
121
- ? SecretFromJson(obj["lightspark_node_encrypted_signing_private_key"])
131
+ !!obj["lightspark_node_with_o_s_k_local_balance"]
132
+ ? CurrencyAmountFromJson(
133
+ obj["lightspark_node_with_o_s_k_local_balance"],
134
+ )
122
135
  : undefined,
123
- !!obj["lightspark_node_total_balance"]
124
- ? CurrencyAmountFromJson(obj["lightspark_node_total_balance"])
136
+ !!obj["lightspark_node_with_o_s_k_remote_balance"]
137
+ ? CurrencyAmountFromJson(
138
+ obj["lightspark_node_with_o_s_k_remote_balance"],
139
+ )
125
140
  : undefined,
126
- !!obj["lightspark_node_total_local_balance"]
127
- ? CurrencyAmountFromJson(obj["lightspark_node_total_local_balance"])
141
+ !!obj["lightspark_node_with_o_s_k_blockchain_balance"]
142
+ ? BlockchainBalanceFromJson(
143
+ obj["lightspark_node_with_o_s_k_blockchain_balance"],
144
+ )
128
145
  : undefined,
129
- !!obj["lightspark_node_local_balance"]
130
- ? CurrencyAmountFromJson(obj["lightspark_node_local_balance"])
146
+ !!obj["lightspark_node_with_o_s_k_encrypted_signing_private_key"]
147
+ ? SecretFromJson(
148
+ obj["lightspark_node_with_o_s_k_encrypted_signing_private_key"],
149
+ )
131
150
  : undefined,
132
- !!obj["lightspark_node_purpose"]
133
- ? LightsparkNodePurpose[obj["lightspark_node_purpose"]] ??
134
- LightsparkNodePurpose.FUTURE_VALUE
151
+ );
152
+ }
153
+ if (obj["__typename"] == "LightsparkNodeWithRemoteSigning") {
154
+ return new LightsparkNodeWithRemoteSigning(
155
+ obj["lightspark_node_with_remote_signing_id"],
156
+ obj["lightspark_node_with_remote_signing_created_at"],
157
+ obj["lightspark_node_with_remote_signing_updated_at"],
158
+ BitcoinNetwork[
159
+ obj["lightspark_node_with_remote_signing_bitcoin_network"]
160
+ ] ?? BitcoinNetwork.FUTURE_VALUE,
161
+ obj["lightspark_node_with_remote_signing_display_name"],
162
+ obj["lightspark_node_with_remote_signing_owner"].id,
163
+ obj["lightspark_node_with_remote_signing_uma_prescreening_utxos"],
164
+ "LightsparkNodeWithRemoteSigning",
165
+ obj["lightspark_node_with_remote_signing_alias"],
166
+ obj["lightspark_node_with_remote_signing_color"],
167
+ obj["lightspark_node_with_remote_signing_conductivity"],
168
+ obj["lightspark_node_with_remote_signing_public_key"],
169
+ !!obj["lightspark_node_with_remote_signing_status"]
170
+ ? LightsparkNodeStatus[
171
+ obj["lightspark_node_with_remote_signing_status"]
172
+ ] ?? LightsparkNodeStatus.FUTURE_VALUE
135
173
  : null,
136
- !!obj["lightspark_node_remote_balance"]
137
- ? CurrencyAmountFromJson(obj["lightspark_node_remote_balance"])
174
+ !!obj["lightspark_node_with_remote_signing_total_balance"]
175
+ ? CurrencyAmountFromJson(
176
+ obj["lightspark_node_with_remote_signing_total_balance"],
177
+ )
178
+ : undefined,
179
+ !!obj["lightspark_node_with_remote_signing_total_local_balance"]
180
+ ? CurrencyAmountFromJson(
181
+ obj["lightspark_node_with_remote_signing_total_local_balance"],
182
+ )
183
+ : undefined,
184
+ !!obj["lightspark_node_with_remote_signing_local_balance"]
185
+ ? CurrencyAmountFromJson(
186
+ obj["lightspark_node_with_remote_signing_local_balance"],
187
+ )
188
+ : undefined,
189
+ !!obj["lightspark_node_with_remote_signing_remote_balance"]
190
+ ? CurrencyAmountFromJson(
191
+ obj["lightspark_node_with_remote_signing_remote_balance"],
192
+ )
193
+ : undefined,
194
+ !!obj["lightspark_node_with_remote_signing_blockchain_balance"]
195
+ ? BlockchainBalanceFromJson(
196
+ obj["lightspark_node_with_remote_signing_blockchain_balance"],
197
+ )
138
198
  : undefined,
139
- !!obj["lightspark_node_status"]
140
- ? LightsparkNodeStatus[obj["lightspark_node_status"]] ??
141
- LightsparkNodeStatus.FUTURE_VALUE
142
- : null
143
199
  );
144
200
  }
145
201
  throw new LightsparkException(
146
202
  "DeserializationError",
147
- `Couldn't find a concrete type for interface Node corresponding to the typename=${obj["__typename"]}`
203
+ `Couldn't find a concrete type for interface Node corresponding to the typename=${obj["__typename"]}`,
148
204
  );
149
205
  };
150
206
 
@@ -163,24 +219,54 @@ fragment NodeFragment on Node {
163
219
  graph_node_display_name: display_name
164
220
  graph_node_public_key: public_key
165
221
  }
166
- ... on LightsparkNode {
222
+ ... on LightsparkNodeWithOSK {
167
223
  __typename
168
- lightspark_node_id: id
169
- lightspark_node_created_at: created_at
170
- lightspark_node_updated_at: updated_at
171
- lightspark_node_alias: alias
172
- lightspark_node_bitcoin_network: bitcoin_network
173
- lightspark_node_color: color
174
- lightspark_node_conductivity: conductivity
175
- lightspark_node_display_name: display_name
176
- lightspark_node_public_key: public_key
177
- lightspark_node_account: account {
224
+ lightspark_node_with_o_s_k_id: id
225
+ lightspark_node_with_o_s_k_created_at: created_at
226
+ lightspark_node_with_o_s_k_updated_at: updated_at
227
+ lightspark_node_with_o_s_k_alias: alias
228
+ lightspark_node_with_o_s_k_bitcoin_network: bitcoin_network
229
+ lightspark_node_with_o_s_k_color: color
230
+ lightspark_node_with_o_s_k_conductivity: conductivity
231
+ lightspark_node_with_o_s_k_display_name: display_name
232
+ lightspark_node_with_o_s_k_public_key: public_key
233
+ lightspark_node_with_o_s_k_owner: owner {
178
234
  id
179
235
  }
180
- lightspark_node_owner: owner {
181
- id
236
+ lightspark_node_with_o_s_k_status: status
237
+ lightspark_node_with_o_s_k_total_balance: total_balance {
238
+ __typename
239
+ currency_amount_original_value: original_value
240
+ currency_amount_original_unit: original_unit
241
+ currency_amount_preferred_currency_unit: preferred_currency_unit
242
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
243
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
244
+ }
245
+ lightspark_node_with_o_s_k_total_local_balance: total_local_balance {
246
+ __typename
247
+ currency_amount_original_value: original_value
248
+ currency_amount_original_unit: original_unit
249
+ currency_amount_preferred_currency_unit: preferred_currency_unit
250
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
251
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
252
+ }
253
+ lightspark_node_with_o_s_k_local_balance: local_balance {
254
+ __typename
255
+ currency_amount_original_value: original_value
256
+ currency_amount_original_unit: original_unit
257
+ currency_amount_preferred_currency_unit: preferred_currency_unit
258
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
259
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
182
260
  }
183
- lightspark_node_blockchain_balance: blockchain_balance {
261
+ lightspark_node_with_o_s_k_remote_balance: remote_balance {
262
+ __typename
263
+ currency_amount_original_value: original_value
264
+ currency_amount_original_unit: original_unit
265
+ currency_amount_preferred_currency_unit: preferred_currency_unit
266
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
267
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
268
+ }
269
+ lightspark_node_with_o_s_k_blockchain_balance: blockchain_balance {
184
270
  __typename
185
271
  blockchain_balance_total_balance: total_balance {
186
272
  __typename
@@ -231,12 +317,29 @@ fragment NodeFragment on Node {
231
317
  currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
232
318
  }
233
319
  }
234
- lightspark_node_encrypted_signing_private_key: encrypted_signing_private_key {
320
+ lightspark_node_with_o_s_k_uma_prescreening_utxos: uma_prescreening_utxos
321
+ lightspark_node_with_o_s_k_encrypted_signing_private_key: encrypted_signing_private_key {
235
322
  __typename
236
323
  secret_encrypted_value: encrypted_value
237
324
  secret_cipher: cipher
238
325
  }
239
- lightspark_node_total_balance: total_balance {
326
+ }
327
+ ... on LightsparkNodeWithRemoteSigning {
328
+ __typename
329
+ lightspark_node_with_remote_signing_id: id
330
+ lightspark_node_with_remote_signing_created_at: created_at
331
+ lightspark_node_with_remote_signing_updated_at: updated_at
332
+ lightspark_node_with_remote_signing_alias: alias
333
+ lightspark_node_with_remote_signing_bitcoin_network: bitcoin_network
334
+ lightspark_node_with_remote_signing_color: color
335
+ lightspark_node_with_remote_signing_conductivity: conductivity
336
+ lightspark_node_with_remote_signing_display_name: display_name
337
+ lightspark_node_with_remote_signing_public_key: public_key
338
+ lightspark_node_with_remote_signing_owner: owner {
339
+ id
340
+ }
341
+ lightspark_node_with_remote_signing_status: status
342
+ lightspark_node_with_remote_signing_total_balance: total_balance {
240
343
  __typename
241
344
  currency_amount_original_value: original_value
242
345
  currency_amount_original_unit: original_unit
@@ -244,7 +347,7 @@ fragment NodeFragment on Node {
244
347
  currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
245
348
  currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
246
349
  }
247
- lightspark_node_total_local_balance: total_local_balance {
350
+ lightspark_node_with_remote_signing_total_local_balance: total_local_balance {
248
351
  __typename
249
352
  currency_amount_original_value: original_value
250
353
  currency_amount_original_unit: original_unit
@@ -252,7 +355,7 @@ fragment NodeFragment on Node {
252
355
  currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
253
356
  currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
254
357
  }
255
- lightspark_node_local_balance: local_balance {
358
+ lightspark_node_with_remote_signing_local_balance: local_balance {
256
359
  __typename
257
360
  currency_amount_original_value: original_value
258
361
  currency_amount_original_unit: original_unit
@@ -260,8 +363,7 @@ fragment NodeFragment on Node {
260
363
  currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
261
364
  currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
262
365
  }
263
- lightspark_node_purpose: purpose
264
- lightspark_node_remote_balance: remote_balance {
366
+ lightspark_node_with_remote_signing_remote_balance: remote_balance {
265
367
  __typename
266
368
  currency_amount_original_value: original_value
267
369
  currency_amount_original_unit: original_unit
@@ -269,7 +371,58 @@ fragment NodeFragment on Node {
269
371
  currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
270
372
  currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
271
373
  }
272
- lightspark_node_status: status
374
+ lightspark_node_with_remote_signing_blockchain_balance: blockchain_balance {
375
+ __typename
376
+ blockchain_balance_total_balance: total_balance {
377
+ __typename
378
+ currency_amount_original_value: original_value
379
+ currency_amount_original_unit: original_unit
380
+ currency_amount_preferred_currency_unit: preferred_currency_unit
381
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
382
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
383
+ }
384
+ blockchain_balance_confirmed_balance: confirmed_balance {
385
+ __typename
386
+ currency_amount_original_value: original_value
387
+ currency_amount_original_unit: original_unit
388
+ currency_amount_preferred_currency_unit: preferred_currency_unit
389
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
390
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
391
+ }
392
+ blockchain_balance_unconfirmed_balance: unconfirmed_balance {
393
+ __typename
394
+ currency_amount_original_value: original_value
395
+ currency_amount_original_unit: original_unit
396
+ currency_amount_preferred_currency_unit: preferred_currency_unit
397
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
398
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
399
+ }
400
+ blockchain_balance_locked_balance: locked_balance {
401
+ __typename
402
+ currency_amount_original_value: original_value
403
+ currency_amount_original_unit: original_unit
404
+ currency_amount_preferred_currency_unit: preferred_currency_unit
405
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
406
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
407
+ }
408
+ blockchain_balance_required_reserve: required_reserve {
409
+ __typename
410
+ currency_amount_original_value: original_value
411
+ currency_amount_original_unit: original_unit
412
+ currency_amount_preferred_currency_unit: preferred_currency_unit
413
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
414
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
415
+ }
416
+ blockchain_balance_available_balance: available_balance {
417
+ __typename
418
+ currency_amount_original_value: original_value
419
+ currency_amount_original_unit: original_unit
420
+ currency_amount_preferred_currency_unit: preferred_currency_unit
421
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
422
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
423
+ }
424
+ }
425
+ lightspark_node_with_remote_signing_uma_prescreening_utxos: uma_prescreening_utxos
273
426
  }
274
427
  }`;
275
428
 
@@ -16,12 +16,12 @@ type NodeToAddressesConnection = {
16
16
  };
17
17
 
18
18
  export const NodeToAddressesConnectionFromJson = (
19
- obj: any
19
+ obj: any,
20
20
  ): NodeToAddressesConnection => {
21
21
  return {
22
22
  count: obj["node_to_addresses_connection_count"],
23
23
  entities: obj["node_to_addresses_connection_entities"].map((e) =>
24
- NodeAddressFromJson(e)
24
+ NodeAddressFromJson(e),
25
25
  ),
26
26
  } as NodeToAddressesConnection;
27
27
  };
@@ -159,7 +159,7 @@ export const OnChainTransactionFromJson = (obj: any): OnChainTransaction => {
159
159
  }
160
160
  throw new LightsparkException(
161
161
  "DeserializationError",
162
- `Couldn't find a concrete type for interface OnChainTransaction corresponding to the typename=${obj["__typename"]}`
162
+ `Couldn't find a concrete type for interface OnChainTransaction corresponding to the typename=${obj["__typename"]}`,
163
163
  );
164
164
  };
165
165
 
@@ -297,7 +297,7 @@ fragment OnChainTransactionFragment on OnChainTransaction {
297
297
  }`;
298
298
 
299
299
  export const getOnChainTransactionQuery = (
300
- id: string
300
+ id: string,
301
301
  ): Query<OnChainTransaction> => {
302
302
  return {
303
303
  queryPayload: `
@@ -11,6 +11,8 @@ import { OutgoingPaymentToAttemptsConnectionFromJson } from "./OutgoingPaymentTo
11
11
  import PaymentFailureReason from "./PaymentFailureReason.js";
12
12
  import type PaymentRequestData from "./PaymentRequestData.js";
13
13
  import { PaymentRequestDataFromJson } from "./PaymentRequestData.js";
14
+ import type PostTransactionData from "./PostTransactionData.js";
15
+ import { PostTransactionDataFromJson } from "./PostTransactionData.js";
14
16
  import type RichText from "./RichText.js";
15
17
  import { RichTextFromJson } from "./RichText.js";
16
18
  import TransactionStatus from "./TransactionStatus.js";
@@ -31,7 +33,8 @@ class OutgoingPayment implements LightningTransaction {
31
33
  public readonly fees?: CurrencyAmount,
32
34
  public readonly paymentRequestData?: PaymentRequestData,
33
35
  public readonly failureReason?: PaymentFailureReason,
34
- public readonly failureMessage?: RichText
36
+ public readonly failureMessage?: RichText,
37
+ public readonly umaPostTransactionData?: PostTransactionData[],
35
38
  ) {
36
39
  autoBind(this);
37
40
  }
@@ -39,7 +42,7 @@ class OutgoingPayment implements LightningTransaction {
39
42
  public async getAttempts(
40
43
  client: LightsparkClient,
41
44
  first: number | undefined = undefined,
42
- after: string | undefined = undefined
45
+ after: string | undefined = undefined,
43
46
  ): Promise<OutgoingPaymentToAttemptsConnection> {
44
47
  return (await client.executeRawQuery({
45
48
  queryPayload: `
@@ -142,7 +145,10 @@ export const OutgoingPaymentFromJson = (obj: any): OutgoingPayment => {
142
145
  : null,
143
146
  !!obj["outgoing_payment_failure_message"]
144
147
  ? RichTextFromJson(obj["outgoing_payment_failure_message"])
145
- : undefined
148
+ : undefined,
149
+ obj["outgoing_payment_uma_post_transaction_data"]?.map((e) =>
150
+ PostTransactionDataFromJson(e),
151
+ ),
146
152
  );
147
153
  };
148
154
 
@@ -209,24 +215,54 @@ fragment OutgoingPaymentFragment on OutgoingPayment {
209
215
  graph_node_display_name: display_name
210
216
  graph_node_public_key: public_key
211
217
  }
212
- ... on LightsparkNode {
218
+ ... on LightsparkNodeWithOSK {
213
219
  __typename
214
- lightspark_node_id: id
215
- lightspark_node_created_at: created_at
216
- lightspark_node_updated_at: updated_at
217
- lightspark_node_alias: alias
218
- lightspark_node_bitcoin_network: bitcoin_network
219
- lightspark_node_color: color
220
- lightspark_node_conductivity: conductivity
221
- lightspark_node_display_name: display_name
222
- lightspark_node_public_key: public_key
223
- lightspark_node_account: account {
220
+ lightspark_node_with_o_s_k_id: id
221
+ lightspark_node_with_o_s_k_created_at: created_at
222
+ lightspark_node_with_o_s_k_updated_at: updated_at
223
+ lightspark_node_with_o_s_k_alias: alias
224
+ lightspark_node_with_o_s_k_bitcoin_network: bitcoin_network
225
+ lightspark_node_with_o_s_k_color: color
226
+ lightspark_node_with_o_s_k_conductivity: conductivity
227
+ lightspark_node_with_o_s_k_display_name: display_name
228
+ lightspark_node_with_o_s_k_public_key: public_key
229
+ lightspark_node_with_o_s_k_owner: owner {
224
230
  id
225
231
  }
226
- lightspark_node_owner: owner {
227
- id
232
+ lightspark_node_with_o_s_k_status: status
233
+ lightspark_node_with_o_s_k_total_balance: total_balance {
234
+ __typename
235
+ currency_amount_original_value: original_value
236
+ currency_amount_original_unit: original_unit
237
+ currency_amount_preferred_currency_unit: preferred_currency_unit
238
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
239
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
240
+ }
241
+ lightspark_node_with_o_s_k_total_local_balance: total_local_balance {
242
+ __typename
243
+ currency_amount_original_value: original_value
244
+ currency_amount_original_unit: original_unit
245
+ currency_amount_preferred_currency_unit: preferred_currency_unit
246
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
247
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
248
+ }
249
+ lightspark_node_with_o_s_k_local_balance: local_balance {
250
+ __typename
251
+ currency_amount_original_value: original_value
252
+ currency_amount_original_unit: original_unit
253
+ currency_amount_preferred_currency_unit: preferred_currency_unit
254
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
255
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
228
256
  }
229
- lightspark_node_blockchain_balance: blockchain_balance {
257
+ lightspark_node_with_o_s_k_remote_balance: remote_balance {
258
+ __typename
259
+ currency_amount_original_value: original_value
260
+ currency_amount_original_unit: original_unit
261
+ currency_amount_preferred_currency_unit: preferred_currency_unit
262
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
263
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
264
+ }
265
+ lightspark_node_with_o_s_k_blockchain_balance: blockchain_balance {
230
266
  __typename
231
267
  blockchain_balance_total_balance: total_balance {
232
268
  __typename
@@ -277,12 +313,29 @@ fragment OutgoingPaymentFragment on OutgoingPayment {
277
313
  currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
278
314
  }
279
315
  }
280
- lightspark_node_encrypted_signing_private_key: encrypted_signing_private_key {
316
+ lightspark_node_with_o_s_k_uma_prescreening_utxos: uma_prescreening_utxos
317
+ lightspark_node_with_o_s_k_encrypted_signing_private_key: encrypted_signing_private_key {
281
318
  __typename
282
319
  secret_encrypted_value: encrypted_value
283
320
  secret_cipher: cipher
284
321
  }
285
- lightspark_node_total_balance: total_balance {
322
+ }
323
+ ... on LightsparkNodeWithRemoteSigning {
324
+ __typename
325
+ lightspark_node_with_remote_signing_id: id
326
+ lightspark_node_with_remote_signing_created_at: created_at
327
+ lightspark_node_with_remote_signing_updated_at: updated_at
328
+ lightspark_node_with_remote_signing_alias: alias
329
+ lightspark_node_with_remote_signing_bitcoin_network: bitcoin_network
330
+ lightspark_node_with_remote_signing_color: color
331
+ lightspark_node_with_remote_signing_conductivity: conductivity
332
+ lightspark_node_with_remote_signing_display_name: display_name
333
+ lightspark_node_with_remote_signing_public_key: public_key
334
+ lightspark_node_with_remote_signing_owner: owner {
335
+ id
336
+ }
337
+ lightspark_node_with_remote_signing_status: status
338
+ lightspark_node_with_remote_signing_total_balance: total_balance {
286
339
  __typename
287
340
  currency_amount_original_value: original_value
288
341
  currency_amount_original_unit: original_unit
@@ -290,7 +343,7 @@ fragment OutgoingPaymentFragment on OutgoingPayment {
290
343
  currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
291
344
  currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
292
345
  }
293
- lightspark_node_total_local_balance: total_local_balance {
346
+ lightspark_node_with_remote_signing_total_local_balance: total_local_balance {
294
347
  __typename
295
348
  currency_amount_original_value: original_value
296
349
  currency_amount_original_unit: original_unit
@@ -298,7 +351,7 @@ fragment OutgoingPaymentFragment on OutgoingPayment {
298
351
  currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
299
352
  currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
300
353
  }
301
- lightspark_node_local_balance: local_balance {
354
+ lightspark_node_with_remote_signing_local_balance: local_balance {
302
355
  __typename
303
356
  currency_amount_original_value: original_value
304
357
  currency_amount_original_unit: original_unit
@@ -306,8 +359,7 @@ fragment OutgoingPaymentFragment on OutgoingPayment {
306
359
  currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
307
360
  currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
308
361
  }
309
- lightspark_node_purpose: purpose
310
- lightspark_node_remote_balance: remote_balance {
362
+ lightspark_node_with_remote_signing_remote_balance: remote_balance {
311
363
  __typename
312
364
  currency_amount_original_value: original_value
313
365
  currency_amount_original_unit: original_unit
@@ -315,7 +367,58 @@ fragment OutgoingPaymentFragment on OutgoingPayment {
315
367
  currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
316
368
  currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
317
369
  }
318
- lightspark_node_status: status
370
+ lightspark_node_with_remote_signing_blockchain_balance: blockchain_balance {
371
+ __typename
372
+ blockchain_balance_total_balance: total_balance {
373
+ __typename
374
+ currency_amount_original_value: original_value
375
+ currency_amount_original_unit: original_unit
376
+ currency_amount_preferred_currency_unit: preferred_currency_unit
377
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
378
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
379
+ }
380
+ blockchain_balance_confirmed_balance: confirmed_balance {
381
+ __typename
382
+ currency_amount_original_value: original_value
383
+ currency_amount_original_unit: original_unit
384
+ currency_amount_preferred_currency_unit: preferred_currency_unit
385
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
386
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
387
+ }
388
+ blockchain_balance_unconfirmed_balance: unconfirmed_balance {
389
+ __typename
390
+ currency_amount_original_value: original_value
391
+ currency_amount_original_unit: original_unit
392
+ currency_amount_preferred_currency_unit: preferred_currency_unit
393
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
394
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
395
+ }
396
+ blockchain_balance_locked_balance: locked_balance {
397
+ __typename
398
+ currency_amount_original_value: original_value
399
+ currency_amount_original_unit: original_unit
400
+ currency_amount_preferred_currency_unit: preferred_currency_unit
401
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
402
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
403
+ }
404
+ blockchain_balance_required_reserve: required_reserve {
405
+ __typename
406
+ currency_amount_original_value: original_value
407
+ currency_amount_original_unit: original_unit
408
+ currency_amount_preferred_currency_unit: preferred_currency_unit
409
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
410
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
411
+ }
412
+ blockchain_balance_available_balance: available_balance {
413
+ __typename
414
+ currency_amount_original_value: original_value
415
+ currency_amount_original_unit: original_unit
416
+ currency_amount_preferred_currency_unit: preferred_currency_unit
417
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
418
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
419
+ }
420
+ }
421
+ lightspark_node_with_remote_signing_uma_prescreening_utxos: uma_prescreening_utxos
319
422
  }
320
423
  }
321
424
  }
@@ -325,6 +428,18 @@ fragment OutgoingPaymentFragment on OutgoingPayment {
325
428
  __typename
326
429
  rich_text_text: text
327
430
  }
431
+ outgoing_payment_uma_post_transaction_data: uma_post_transaction_data {
432
+ __typename
433
+ post_transaction_data_utxo: utxo
434
+ post_transaction_data_amount: amount {
435
+ __typename
436
+ currency_amount_original_value: original_value
437
+ currency_amount_original_unit: original_unit
438
+ currency_amount_preferred_currency_unit: preferred_currency_unit
439
+ currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
440
+ currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
441
+ }
442
+ }
328
443
  }`;
329
444
 
330
445
  export default OutgoingPayment;