@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.
- package/CHANGELOG.md +30 -0
- package/README.md +1 -1
- package/dist/{chunk-NXUFC5J7.js → chunk-LZC5C5NI.js} +2908 -635
- package/dist/{index-3ffe9e7b.d.ts → index-09d4ac20.d.ts} +373 -62
- package/dist/index.cjs +3395 -842
- package/dist/index.d.ts +2 -2
- package/dist/index.js +390 -94
- package/dist/objects/index.cjs +2735 -553
- package/dist/objects/index.d.ts +1 -1
- package/dist/objects/index.js +17 -5
- package/package.json +12 -9
- package/src/NodeKeyLoaderCache.ts +87 -0
- package/src/SigningKeyLoader.ts +177 -0
- package/src/auth/AccountTokenAuthProvider.ts +4 -4
- package/src/client.ts +209 -118
- package/src/graphql/CreateInvoice.ts +3 -2
- package/src/graphql/CreateLnurlInvoice.ts +2 -0
- package/src/graphql/CreateUmaInvoice.ts +23 -0
- package/src/graphql/MultiNodeDashboard.ts +0 -3
- package/src/graphql/PayUmaInvoice.ts +29 -0
- package/src/graphql/RecoverNodeSigningKey.ts +1 -1
- package/src/graphql/SingleNodeDashboard.ts +0 -1
- package/src/lightspark_crypto/lightspark_crypto.d.ts +157 -0
- package/src/lightspark_crypto/lightspark_crypto.js +1010 -0
- package/src/lightspark_crypto/lightspark_crypto_bg.wasm +0 -0
- package/src/lightspark_crypto/lightspark_crypto_bg.wasm.d.ts +120 -0
- package/src/lightspark_crypto/package.json +11 -0
- package/src/objects/Account.ts +437 -120
- package/src/objects/AccountToApiTokensConnection.ts +3 -3
- package/src/objects/AccountToChannelsConnection.ts +4 -4
- package/src/objects/AccountToNodesConnection.ts +2 -15
- package/src/objects/AccountToPaymentRequestsConnection.ts +3 -3
- package/src/objects/AccountToTransactionsConnection.ts +6 -6
- package/src/objects/AccountToWalletsConnection.ts +2 -2
- package/src/objects/Balances.ts +2 -2
- package/src/objects/Channel.ts +4 -4
- package/src/objects/ChannelClosingTransaction.ts +2 -2
- package/src/objects/ChannelOpeningTransaction.ts +2 -2
- package/src/objects/ChannelToTransactionsConnection.ts +4 -4
- package/src/objects/{CryptoSanctionsScreeningProvider.ts → ComplianceProvider.ts} +3 -3
- package/src/objects/Connection.ts +25 -31
- package/src/objects/CreateApiTokenInput.ts +1 -1
- package/src/objects/CreateApiTokenOutput.ts +1 -1
- package/src/objects/CreateInvoiceInput.ts +0 -6
- package/src/objects/CreateLnurlInvoiceInput.ts +1 -7
- package/src/objects/CreateNodeWalletAddressInput.ts +1 -1
- package/src/objects/CreateNodeWalletAddressOutput.ts +1 -1
- package/src/objects/CreateTestModeInvoiceInput.ts +1 -1
- package/src/objects/CreateTestModeInvoiceOutput.ts +1 -1
- package/src/objects/CreateTestModePaymentInput.ts +1 -1
- package/src/objects/CreateTestModePaymentoutput.ts +14 -2
- package/src/objects/CreateUmaInvoiceInput.ts +24 -0
- package/src/objects/DeclineToSignMessagesInput.ts +16 -0
- package/src/objects/DeclineToSignMessagesOutput.ts +28 -0
- package/src/objects/DeleteApiTokenOutput.ts +1 -1
- package/src/objects/Entity.ts +401 -66
- package/src/objects/GraphNode.ts +3 -3
- package/src/objects/IdAndSignature.ts +16 -0
- package/src/objects/IncomingPayment.ts +21 -8
- package/src/objects/IncomingPaymentAttempt.ts +2 -2
- package/src/objects/IncomingPaymentToAttemptsConnection.ts +3 -3
- package/src/objects/Invoice.ts +118 -21
- package/src/objects/InvoiceData.ts +118 -21
- package/src/objects/LightningFeeEstimateForInvoiceInput.ts +1 -1
- package/src/objects/LightningFeeEstimateForNodeInput.ts +1 -1
- package/src/objects/LightningFeeEstimateOutput.ts +2 -2
- package/src/objects/LightningTransaction.ts +155 -31
- package/src/objects/LightsparkNode.ts +272 -112
- package/src/objects/LightsparkNodeOwner.ts +8 -4
- package/src/objects/LightsparkNodeToChannelsConnection.ts +3 -3
- package/src/objects/LightsparkNodeWithOSK.ts +389 -0
- package/src/objects/LightsparkNodeWithRemoteSigning.ts +384 -0
- package/src/objects/Node.ts +213 -60
- package/src/objects/NodeToAddressesConnection.ts +2 -2
- package/src/objects/OnChainTransaction.ts +2 -2
- package/src/objects/OutgoingPayment.ts +139 -24
- package/src/objects/OutgoingPaymentAttempt.ts +5 -5
- package/src/objects/OutgoingPaymentAttemptToHopsConnection.ts +3 -3
- package/src/objects/OutgoingPaymentToAttemptsConnection.ts +3 -3
- package/src/objects/OutgoingPaymentsForInvoiceQueryInput.ts +25 -0
- package/src/objects/OutgoingPaymentsForInvoiceQueryOutput.ts +28 -0
- package/src/objects/PayUmaInvoiceInput.ts +25 -0
- package/src/objects/{LightsparkNodePurpose.ts → PaymentDirection.ts} +5 -7
- package/src/objects/PaymentRequest.ts +119 -22
- package/src/objects/PaymentRequestData.ts +119 -22
- package/src/objects/PostTransactionData.ts +39 -0
- package/src/objects/RegisterPaymentInput.ts +31 -0
- package/src/objects/RegisterPaymentOutput.ts +23 -0
- package/src/objects/ReleaseChannelPerCommitmentSecretInput.ts +23 -0
- package/src/objects/ReleaseChannelPerCommitmentSecretOutput.ts +23 -0
- package/src/objects/ReleasePaymentPreimageInput.ts +20 -0
- package/src/objects/ReleasePaymentPreimageOutput.ts +23 -0
- package/src/objects/RemoteSigningSubEventType.ts +26 -0
- package/src/objects/RequestWithdrawalInput.ts +1 -1
- package/src/objects/RequestWithdrawalOutput.ts +1 -1
- package/src/objects/RoutingTransaction.ts +1 -1
- package/src/objects/ScreenNodeInput.ts +20 -0
- package/src/objects/ScreenNodeOutput.ts +22 -0
- package/src/objects/SetInvoicePaymentHashInput.ts +24 -0
- package/src/objects/SetInvoicePaymentHashOutput.ts +23 -0
- package/src/objects/SignInvoiceInput.ts +19 -0
- package/src/objects/SignInvoiceOutput.ts +21 -0
- package/src/objects/SignMessagesInput.ts +18 -0
- package/src/objects/SignMessagesOutput.ts +26 -0
- package/src/objects/Signable.ts +58 -0
- package/src/objects/SignablePayload.ts +93 -0
- package/src/objects/SignablePayloadStatus.ts +17 -0
- package/src/objects/SingleNodeDashboard.ts +0 -2
- package/src/objects/Transaction.ts +153 -29
- package/src/objects/TransactionFailures.ts +1 -1
- package/src/objects/UpdateChannelPerCommitmentPointInput.ts +25 -0
- package/src/objects/UpdateChannelPerCommitmentPointOutput.ts +23 -0
- package/src/objects/UpdateNodeSharedSecretInput.ts +18 -0
- package/src/objects/UpdateNodeSharedSecretOutput.ts +23 -0
- package/src/objects/Wallet.ts +271 -51
- package/src/objects/WalletToPaymentRequestsConnection.ts +3 -3
- package/src/objects/WalletToTransactionsConnection.ts +3 -3
- package/src/objects/WithdrawalRequest.ts +6 -6
- package/src/objects/WithdrawalRequestToChannelClosingTransactionsConnection.ts +2 -2
- package/src/objects/WithdrawalRequestToChannelOpeningTransactionsConnection.ts +2 -2
- package/src/objects/index.ts +37 -4
- package/src/{__tests__ → tests}/webhooks.test.ts +1 -1
- package/src/webhooks.ts +1 -1
- package/src/objects/ScreenBitcoinAddressesInput.ts +0 -23
- package/src/objects/ScreenBitcoinAddressesOutput.ts +0 -25
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
import { type Query } from "@lightsparkdev/core";
|
|
3
|
+
import { LightsparkException, type Query } from "@lightsparkdev/core";
|
|
4
4
|
import autoBind from "auto-bind";
|
|
5
5
|
import type LightsparkClient from "../client.js";
|
|
6
6
|
import BitcoinNetwork from "./BitcoinNetwork.js";
|
|
@@ -9,18 +9,18 @@ import { BlockchainBalanceFromJson } from "./BlockchainBalance.js";
|
|
|
9
9
|
import type ChannelStatus from "./ChannelStatus.js";
|
|
10
10
|
import type CurrencyAmount from "./CurrencyAmount.js";
|
|
11
11
|
import { CurrencyAmountFromJson } from "./CurrencyAmount.js";
|
|
12
|
-
import LightsparkNodePurpose from "./LightsparkNodePurpose.js";
|
|
13
12
|
import LightsparkNodeStatus from "./LightsparkNodeStatus.js";
|
|
14
13
|
import type LightsparkNodeToChannelsConnection from "./LightsparkNodeToChannelsConnection.js";
|
|
15
14
|
import { LightsparkNodeToChannelsConnectionFromJson } from "./LightsparkNodeToChannelsConnection.js";
|
|
15
|
+
import LightsparkNodeWithOSK from "./LightsparkNodeWithOSK.js";
|
|
16
|
+
import LightsparkNodeWithRemoteSigning from "./LightsparkNodeWithRemoteSigning.js";
|
|
16
17
|
import type Node from "./Node.js";
|
|
17
18
|
import type NodeAddressType from "./NodeAddressType.js";
|
|
18
19
|
import type NodeToAddressesConnection from "./NodeToAddressesConnection.js";
|
|
19
20
|
import { NodeToAddressesConnectionFromJson } from "./NodeToAddressesConnection.js";
|
|
20
|
-
import type Secret from "./Secret.js";
|
|
21
21
|
import { SecretFromJson } from "./Secret.js";
|
|
22
22
|
|
|
23
|
-
/** This is a node
|
|
23
|
+
/** This is an object representing a node managed by Lightspark and owned by the current connected account. This object contains information about the node’s configuration, state, and metadata. **/
|
|
24
24
|
class LightsparkNode implements Node {
|
|
25
25
|
constructor(
|
|
26
26
|
public readonly id: string,
|
|
@@ -28,21 +28,19 @@ class LightsparkNode implements Node {
|
|
|
28
28
|
public readonly updatedAt: string,
|
|
29
29
|
public readonly bitcoinNetwork: BitcoinNetwork,
|
|
30
30
|
public readonly displayName: string,
|
|
31
|
-
public readonly accountId: string,
|
|
32
31
|
public readonly ownerId: string,
|
|
32
|
+
public readonly umaPrescreeningUtxos: string[],
|
|
33
33
|
public readonly typename: string,
|
|
34
34
|
public readonly alias?: string,
|
|
35
35
|
public readonly color?: string,
|
|
36
36
|
public readonly conductivity?: number,
|
|
37
37
|
public readonly publicKey?: string,
|
|
38
|
-
public readonly
|
|
39
|
-
public readonly encryptedSigningPrivateKey?: Secret,
|
|
38
|
+
public readonly status?: LightsparkNodeStatus,
|
|
40
39
|
public readonly totalBalance?: CurrencyAmount,
|
|
41
40
|
public readonly totalLocalBalance?: CurrencyAmount,
|
|
42
41
|
public readonly localBalance?: CurrencyAmount,
|
|
43
|
-
public readonly purpose?: LightsparkNodePurpose,
|
|
44
42
|
public readonly remoteBalance?: CurrencyAmount,
|
|
45
|
-
public readonly
|
|
43
|
+
public readonly blockchainBalance?: BlockchainBalance,
|
|
46
44
|
) {
|
|
47
45
|
autoBind(this);
|
|
48
46
|
}
|
|
@@ -50,7 +48,7 @@ class LightsparkNode implements Node {
|
|
|
50
48
|
public async getAddresses(
|
|
51
49
|
client: LightsparkClient,
|
|
52
50
|
first: number | undefined = undefined,
|
|
53
|
-
types: NodeAddressType[] | undefined = undefined
|
|
51
|
+
types: NodeAddressType[] | undefined = undefined,
|
|
54
52
|
): Promise<NodeToAddressesConnection> {
|
|
55
53
|
return (await client.executeRawQuery({
|
|
56
54
|
queryPayload: `
|
|
@@ -82,7 +80,7 @@ query FetchNodeToAddressesConnection($entity_id: ID!, $first: Int, $types: [Node
|
|
|
82
80
|
client: LightsparkClient,
|
|
83
81
|
first: number | undefined = undefined,
|
|
84
82
|
statuses: ChannelStatus[] | undefined = undefined,
|
|
85
|
-
after: string | undefined = undefined
|
|
83
|
+
after: string | undefined = undefined,
|
|
86
84
|
): Promise<LightsparkNodeToChannelsConnection> {
|
|
87
85
|
return (await client.executeRawQuery({
|
|
88
86
|
queryPayload: `
|
|
@@ -231,70 +229,130 @@ ${FRAGMENT}
|
|
|
231
229
|
}
|
|
232
230
|
|
|
233
231
|
export const LightsparkNodeFromJson = (obj: any): LightsparkNode => {
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
BitcoinNetwork
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
232
|
+
if (obj["__typename"] == "LightsparkNodeWithOSK") {
|
|
233
|
+
return new LightsparkNodeWithOSK(
|
|
234
|
+
obj["lightspark_node_with_o_s_k_id"],
|
|
235
|
+
obj["lightspark_node_with_o_s_k_created_at"],
|
|
236
|
+
obj["lightspark_node_with_o_s_k_updated_at"],
|
|
237
|
+
BitcoinNetwork[obj["lightspark_node_with_o_s_k_bitcoin_network"]] ??
|
|
238
|
+
BitcoinNetwork.FUTURE_VALUE,
|
|
239
|
+
obj["lightspark_node_with_o_s_k_display_name"],
|
|
240
|
+
obj["lightspark_node_with_o_s_k_owner"].id,
|
|
241
|
+
obj["lightspark_node_with_o_s_k_uma_prescreening_utxos"],
|
|
242
|
+
"LightsparkNodeWithOSK",
|
|
243
|
+
obj["lightspark_node_with_o_s_k_alias"],
|
|
244
|
+
obj["lightspark_node_with_o_s_k_color"],
|
|
245
|
+
obj["lightspark_node_with_o_s_k_conductivity"],
|
|
246
|
+
obj["lightspark_node_with_o_s_k_public_key"],
|
|
247
|
+
!!obj["lightspark_node_with_o_s_k_status"]
|
|
248
|
+
? LightsparkNodeStatus[obj["lightspark_node_with_o_s_k_status"]] ??
|
|
249
|
+
LightsparkNodeStatus.FUTURE_VALUE
|
|
250
|
+
: null,
|
|
251
|
+
!!obj["lightspark_node_with_o_s_k_total_balance"]
|
|
252
|
+
? CurrencyAmountFromJson(
|
|
253
|
+
obj["lightspark_node_with_o_s_k_total_balance"],
|
|
254
|
+
)
|
|
255
|
+
: undefined,
|
|
256
|
+
!!obj["lightspark_node_with_o_s_k_total_local_balance"]
|
|
257
|
+
? CurrencyAmountFromJson(
|
|
258
|
+
obj["lightspark_node_with_o_s_k_total_local_balance"],
|
|
259
|
+
)
|
|
260
|
+
: undefined,
|
|
261
|
+
!!obj["lightspark_node_with_o_s_k_local_balance"]
|
|
262
|
+
? CurrencyAmountFromJson(
|
|
263
|
+
obj["lightspark_node_with_o_s_k_local_balance"],
|
|
264
|
+
)
|
|
265
|
+
: undefined,
|
|
266
|
+
!!obj["lightspark_node_with_o_s_k_remote_balance"]
|
|
267
|
+
? CurrencyAmountFromJson(
|
|
268
|
+
obj["lightspark_node_with_o_s_k_remote_balance"],
|
|
269
|
+
)
|
|
270
|
+
: undefined,
|
|
271
|
+
!!obj["lightspark_node_with_o_s_k_blockchain_balance"]
|
|
272
|
+
? BlockchainBalanceFromJson(
|
|
273
|
+
obj["lightspark_node_with_o_s_k_blockchain_balance"],
|
|
274
|
+
)
|
|
275
|
+
: undefined,
|
|
276
|
+
!!obj["lightspark_node_with_o_s_k_encrypted_signing_private_key"]
|
|
277
|
+
? SecretFromJson(
|
|
278
|
+
obj["lightspark_node_with_o_s_k_encrypted_signing_private_key"],
|
|
279
|
+
)
|
|
280
|
+
: undefined,
|
|
281
|
+
);
|
|
282
|
+
}
|
|
283
|
+
if (obj["__typename"] == "LightsparkNodeWithRemoteSigning") {
|
|
284
|
+
return new LightsparkNodeWithRemoteSigning(
|
|
285
|
+
obj["lightspark_node_with_remote_signing_id"],
|
|
286
|
+
obj["lightspark_node_with_remote_signing_created_at"],
|
|
287
|
+
obj["lightspark_node_with_remote_signing_updated_at"],
|
|
288
|
+
BitcoinNetwork[
|
|
289
|
+
obj["lightspark_node_with_remote_signing_bitcoin_network"]
|
|
290
|
+
] ?? BitcoinNetwork.FUTURE_VALUE,
|
|
291
|
+
obj["lightspark_node_with_remote_signing_display_name"],
|
|
292
|
+
obj["lightspark_node_with_remote_signing_owner"].id,
|
|
293
|
+
obj["lightspark_node_with_remote_signing_uma_prescreening_utxos"],
|
|
294
|
+
"LightsparkNodeWithRemoteSigning",
|
|
295
|
+
obj["lightspark_node_with_remote_signing_alias"],
|
|
296
|
+
obj["lightspark_node_with_remote_signing_color"],
|
|
297
|
+
obj["lightspark_node_with_remote_signing_conductivity"],
|
|
298
|
+
obj["lightspark_node_with_remote_signing_public_key"],
|
|
299
|
+
!!obj["lightspark_node_with_remote_signing_status"]
|
|
300
|
+
? LightsparkNodeStatus[
|
|
301
|
+
obj["lightspark_node_with_remote_signing_status"]
|
|
302
|
+
] ?? LightsparkNodeStatus.FUTURE_VALUE
|
|
303
|
+
: null,
|
|
304
|
+
!!obj["lightspark_node_with_remote_signing_total_balance"]
|
|
305
|
+
? CurrencyAmountFromJson(
|
|
306
|
+
obj["lightspark_node_with_remote_signing_total_balance"],
|
|
307
|
+
)
|
|
308
|
+
: undefined,
|
|
309
|
+
!!obj["lightspark_node_with_remote_signing_total_local_balance"]
|
|
310
|
+
? CurrencyAmountFromJson(
|
|
311
|
+
obj["lightspark_node_with_remote_signing_total_local_balance"],
|
|
312
|
+
)
|
|
313
|
+
: undefined,
|
|
314
|
+
!!obj["lightspark_node_with_remote_signing_local_balance"]
|
|
315
|
+
? CurrencyAmountFromJson(
|
|
316
|
+
obj["lightspark_node_with_remote_signing_local_balance"],
|
|
317
|
+
)
|
|
318
|
+
: undefined,
|
|
319
|
+
!!obj["lightspark_node_with_remote_signing_remote_balance"]
|
|
320
|
+
? CurrencyAmountFromJson(
|
|
321
|
+
obj["lightspark_node_with_remote_signing_remote_balance"],
|
|
322
|
+
)
|
|
323
|
+
: undefined,
|
|
324
|
+
!!obj["lightspark_node_with_remote_signing_blockchain_balance"]
|
|
325
|
+
? BlockchainBalanceFromJson(
|
|
326
|
+
obj["lightspark_node_with_remote_signing_blockchain_balance"],
|
|
327
|
+
)
|
|
328
|
+
: undefined,
|
|
329
|
+
);
|
|
330
|
+
}
|
|
331
|
+
throw new LightsparkException(
|
|
332
|
+
"DeserializationError",
|
|
333
|
+
`Couldn't find a concrete type for interface LightsparkNode corresponding to the typename=${obj["__typename"]}`,
|
|
274
334
|
);
|
|
275
335
|
};
|
|
276
336
|
|
|
277
337
|
export const FRAGMENT = `
|
|
278
338
|
fragment LightsparkNodeFragment on LightsparkNode {
|
|
279
339
|
__typename
|
|
280
|
-
|
|
281
|
-
lightspark_node_created_at: created_at
|
|
282
|
-
lightspark_node_updated_at: updated_at
|
|
283
|
-
lightspark_node_alias: alias
|
|
284
|
-
lightspark_node_bitcoin_network: bitcoin_network
|
|
285
|
-
lightspark_node_color: color
|
|
286
|
-
lightspark_node_conductivity: conductivity
|
|
287
|
-
lightspark_node_display_name: display_name
|
|
288
|
-
lightspark_node_public_key: public_key
|
|
289
|
-
lightspark_node_account: account {
|
|
290
|
-
id
|
|
291
|
-
}
|
|
292
|
-
lightspark_node_owner: owner {
|
|
293
|
-
id
|
|
294
|
-
}
|
|
295
|
-
lightspark_node_blockchain_balance: blockchain_balance {
|
|
340
|
+
... on LightsparkNodeWithOSK {
|
|
296
341
|
__typename
|
|
297
|
-
|
|
342
|
+
lightspark_node_with_o_s_k_id: id
|
|
343
|
+
lightspark_node_with_o_s_k_created_at: created_at
|
|
344
|
+
lightspark_node_with_o_s_k_updated_at: updated_at
|
|
345
|
+
lightspark_node_with_o_s_k_alias: alias
|
|
346
|
+
lightspark_node_with_o_s_k_bitcoin_network: bitcoin_network
|
|
347
|
+
lightspark_node_with_o_s_k_color: color
|
|
348
|
+
lightspark_node_with_o_s_k_conductivity: conductivity
|
|
349
|
+
lightspark_node_with_o_s_k_display_name: display_name
|
|
350
|
+
lightspark_node_with_o_s_k_public_key: public_key
|
|
351
|
+
lightspark_node_with_o_s_k_owner: owner {
|
|
352
|
+
id
|
|
353
|
+
}
|
|
354
|
+
lightspark_node_with_o_s_k_status: status
|
|
355
|
+
lightspark_node_with_o_s_k_total_balance: total_balance {
|
|
298
356
|
__typename
|
|
299
357
|
currency_amount_original_value: original_value
|
|
300
358
|
currency_amount_original_unit: original_unit
|
|
@@ -302,7 +360,7 @@ fragment LightsparkNodeFragment on LightsparkNode {
|
|
|
302
360
|
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
303
361
|
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
304
362
|
}
|
|
305
|
-
|
|
363
|
+
lightspark_node_with_o_s_k_total_local_balance: total_local_balance {
|
|
306
364
|
__typename
|
|
307
365
|
currency_amount_original_value: original_value
|
|
308
366
|
currency_amount_original_unit: original_unit
|
|
@@ -310,7 +368,7 @@ fragment LightsparkNodeFragment on LightsparkNode {
|
|
|
310
368
|
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
311
369
|
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
312
370
|
}
|
|
313
|
-
|
|
371
|
+
lightspark_node_with_o_s_k_local_balance: local_balance {
|
|
314
372
|
__typename
|
|
315
373
|
currency_amount_original_value: original_value
|
|
316
374
|
currency_amount_original_unit: original_unit
|
|
@@ -318,7 +376,7 @@ fragment LightsparkNodeFragment on LightsparkNode {
|
|
|
318
376
|
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
319
377
|
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
320
378
|
}
|
|
321
|
-
|
|
379
|
+
lightspark_node_with_o_s_k_remote_balance: remote_balance {
|
|
322
380
|
__typename
|
|
323
381
|
currency_amount_original_value: original_value
|
|
324
382
|
currency_amount_original_unit: original_unit
|
|
@@ -326,7 +384,80 @@ fragment LightsparkNodeFragment on LightsparkNode {
|
|
|
326
384
|
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
327
385
|
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
328
386
|
}
|
|
329
|
-
|
|
387
|
+
lightspark_node_with_o_s_k_blockchain_balance: blockchain_balance {
|
|
388
|
+
__typename
|
|
389
|
+
blockchain_balance_total_balance: total_balance {
|
|
390
|
+
__typename
|
|
391
|
+
currency_amount_original_value: original_value
|
|
392
|
+
currency_amount_original_unit: original_unit
|
|
393
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
394
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
395
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
396
|
+
}
|
|
397
|
+
blockchain_balance_confirmed_balance: confirmed_balance {
|
|
398
|
+
__typename
|
|
399
|
+
currency_amount_original_value: original_value
|
|
400
|
+
currency_amount_original_unit: original_unit
|
|
401
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
402
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
403
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
404
|
+
}
|
|
405
|
+
blockchain_balance_unconfirmed_balance: unconfirmed_balance {
|
|
406
|
+
__typename
|
|
407
|
+
currency_amount_original_value: original_value
|
|
408
|
+
currency_amount_original_unit: original_unit
|
|
409
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
410
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
411
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
412
|
+
}
|
|
413
|
+
blockchain_balance_locked_balance: locked_balance {
|
|
414
|
+
__typename
|
|
415
|
+
currency_amount_original_value: original_value
|
|
416
|
+
currency_amount_original_unit: original_unit
|
|
417
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
418
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
419
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
420
|
+
}
|
|
421
|
+
blockchain_balance_required_reserve: required_reserve {
|
|
422
|
+
__typename
|
|
423
|
+
currency_amount_original_value: original_value
|
|
424
|
+
currency_amount_original_unit: original_unit
|
|
425
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
426
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
427
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
428
|
+
}
|
|
429
|
+
blockchain_balance_available_balance: available_balance {
|
|
430
|
+
__typename
|
|
431
|
+
currency_amount_original_value: original_value
|
|
432
|
+
currency_amount_original_unit: original_unit
|
|
433
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
434
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
435
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
lightspark_node_with_o_s_k_uma_prescreening_utxos: uma_prescreening_utxos
|
|
439
|
+
lightspark_node_with_o_s_k_encrypted_signing_private_key: encrypted_signing_private_key {
|
|
440
|
+
__typename
|
|
441
|
+
secret_encrypted_value: encrypted_value
|
|
442
|
+
secret_cipher: cipher
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
... on LightsparkNodeWithRemoteSigning {
|
|
446
|
+
__typename
|
|
447
|
+
lightspark_node_with_remote_signing_id: id
|
|
448
|
+
lightspark_node_with_remote_signing_created_at: created_at
|
|
449
|
+
lightspark_node_with_remote_signing_updated_at: updated_at
|
|
450
|
+
lightspark_node_with_remote_signing_alias: alias
|
|
451
|
+
lightspark_node_with_remote_signing_bitcoin_network: bitcoin_network
|
|
452
|
+
lightspark_node_with_remote_signing_color: color
|
|
453
|
+
lightspark_node_with_remote_signing_conductivity: conductivity
|
|
454
|
+
lightspark_node_with_remote_signing_display_name: display_name
|
|
455
|
+
lightspark_node_with_remote_signing_public_key: public_key
|
|
456
|
+
lightspark_node_with_remote_signing_owner: owner {
|
|
457
|
+
id
|
|
458
|
+
}
|
|
459
|
+
lightspark_node_with_remote_signing_status: status
|
|
460
|
+
lightspark_node_with_remote_signing_total_balance: total_balance {
|
|
330
461
|
__typename
|
|
331
462
|
currency_amount_original_value: original_value
|
|
332
463
|
currency_amount_original_unit: original_unit
|
|
@@ -334,7 +465,7 @@ fragment LightsparkNodeFragment on LightsparkNode {
|
|
|
334
465
|
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
335
466
|
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
336
467
|
}
|
|
337
|
-
|
|
468
|
+
lightspark_node_with_remote_signing_total_local_balance: total_local_balance {
|
|
338
469
|
__typename
|
|
339
470
|
currency_amount_original_value: original_value
|
|
340
471
|
currency_amount_original_unit: original_unit
|
|
@@ -342,46 +473,75 @@ fragment LightsparkNodeFragment on LightsparkNode {
|
|
|
342
473
|
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
343
474
|
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
344
475
|
}
|
|
476
|
+
lightspark_node_with_remote_signing_local_balance: local_balance {
|
|
477
|
+
__typename
|
|
478
|
+
currency_amount_original_value: original_value
|
|
479
|
+
currency_amount_original_unit: original_unit
|
|
480
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
481
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
482
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
483
|
+
}
|
|
484
|
+
lightspark_node_with_remote_signing_remote_balance: remote_balance {
|
|
485
|
+
__typename
|
|
486
|
+
currency_amount_original_value: original_value
|
|
487
|
+
currency_amount_original_unit: original_unit
|
|
488
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
489
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
490
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
491
|
+
}
|
|
492
|
+
lightspark_node_with_remote_signing_blockchain_balance: blockchain_balance {
|
|
493
|
+
__typename
|
|
494
|
+
blockchain_balance_total_balance: total_balance {
|
|
495
|
+
__typename
|
|
496
|
+
currency_amount_original_value: original_value
|
|
497
|
+
currency_amount_original_unit: original_unit
|
|
498
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
499
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
500
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
501
|
+
}
|
|
502
|
+
blockchain_balance_confirmed_balance: confirmed_balance {
|
|
503
|
+
__typename
|
|
504
|
+
currency_amount_original_value: original_value
|
|
505
|
+
currency_amount_original_unit: original_unit
|
|
506
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
507
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
508
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
509
|
+
}
|
|
510
|
+
blockchain_balance_unconfirmed_balance: unconfirmed_balance {
|
|
511
|
+
__typename
|
|
512
|
+
currency_amount_original_value: original_value
|
|
513
|
+
currency_amount_original_unit: original_unit
|
|
514
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
515
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
516
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
517
|
+
}
|
|
518
|
+
blockchain_balance_locked_balance: locked_balance {
|
|
519
|
+
__typename
|
|
520
|
+
currency_amount_original_value: original_value
|
|
521
|
+
currency_amount_original_unit: original_unit
|
|
522
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
523
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
524
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
525
|
+
}
|
|
526
|
+
blockchain_balance_required_reserve: required_reserve {
|
|
527
|
+
__typename
|
|
528
|
+
currency_amount_original_value: original_value
|
|
529
|
+
currency_amount_original_unit: original_unit
|
|
530
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
531
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
532
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
533
|
+
}
|
|
534
|
+
blockchain_balance_available_balance: available_balance {
|
|
535
|
+
__typename
|
|
536
|
+
currency_amount_original_value: original_value
|
|
537
|
+
currency_amount_original_unit: original_unit
|
|
538
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
539
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
540
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
lightspark_node_with_remote_signing_uma_prescreening_utxos: uma_prescreening_utxos
|
|
345
544
|
}
|
|
346
|
-
lightspark_node_encrypted_signing_private_key: encrypted_signing_private_key {
|
|
347
|
-
__typename
|
|
348
|
-
secret_encrypted_value: encrypted_value
|
|
349
|
-
secret_cipher: cipher
|
|
350
|
-
}
|
|
351
|
-
lightspark_node_total_balance: total_balance {
|
|
352
|
-
__typename
|
|
353
|
-
currency_amount_original_value: original_value
|
|
354
|
-
currency_amount_original_unit: original_unit
|
|
355
|
-
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
356
|
-
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
357
|
-
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
358
|
-
}
|
|
359
|
-
lightspark_node_total_local_balance: total_local_balance {
|
|
360
|
-
__typename
|
|
361
|
-
currency_amount_original_value: original_value
|
|
362
|
-
currency_amount_original_unit: original_unit
|
|
363
|
-
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
364
|
-
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
365
|
-
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
366
|
-
}
|
|
367
|
-
lightspark_node_local_balance: local_balance {
|
|
368
|
-
__typename
|
|
369
|
-
currency_amount_original_value: original_value
|
|
370
|
-
currency_amount_original_unit: original_unit
|
|
371
|
-
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
372
|
-
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
373
|
-
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
374
|
-
}
|
|
375
|
-
lightspark_node_purpose: purpose
|
|
376
|
-
lightspark_node_remote_balance: remote_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
|
-
lightspark_node_status: status
|
|
385
545
|
}`;
|
|
386
546
|
|
|
387
547
|
export default LightsparkNode;
|
|
@@ -32,7 +32,7 @@ export const LightsparkNodeOwnerFromJson = (obj: any): LightsparkNodeOwner => {
|
|
|
32
32
|
obj["account_created_at"],
|
|
33
33
|
obj["account_updated_at"],
|
|
34
34
|
"Account",
|
|
35
|
-
obj["account_name"]
|
|
35
|
+
obj["account_name"],
|
|
36
36
|
);
|
|
37
37
|
}
|
|
38
38
|
if (obj["__typename"] == "Wallet") {
|
|
@@ -46,12 +46,13 @@ export const LightsparkNodeOwnerFromJson = (obj: any): LightsparkNodeOwner => {
|
|
|
46
46
|
obj["wallet_last_login_at"],
|
|
47
47
|
!!obj["wallet_balances"]
|
|
48
48
|
? BalancesFromJson(obj["wallet_balances"])
|
|
49
|
-
: undefined
|
|
49
|
+
: undefined,
|
|
50
|
+
obj["wallet_account"]?.id ?? undefined,
|
|
50
51
|
);
|
|
51
52
|
}
|
|
52
53
|
throw new LightsparkException(
|
|
53
54
|
"DeserializationError",
|
|
54
|
-
`Couldn't find a concrete type for interface LightsparkNodeOwner corresponding to the typename=${obj["__typename"]}
|
|
55
|
+
`Couldn't find a concrete type for interface LightsparkNodeOwner corresponding to the typename=${obj["__typename"]}`,
|
|
55
56
|
);
|
|
56
57
|
};
|
|
57
58
|
|
|
@@ -99,12 +100,15 @@ fragment LightsparkNodeOwnerFragment on LightsparkNodeOwner {
|
|
|
99
100
|
}
|
|
100
101
|
}
|
|
101
102
|
wallet_third_party_identifier: third_party_identifier
|
|
103
|
+
wallet_account: account {
|
|
104
|
+
id
|
|
105
|
+
}
|
|
102
106
|
wallet_status: status
|
|
103
107
|
}
|
|
104
108
|
}`;
|
|
105
109
|
|
|
106
110
|
export const getLightsparkNodeOwnerQuery = (
|
|
107
|
-
id: string
|
|
111
|
+
id: string,
|
|
108
112
|
): Query<LightsparkNodeOwner> => {
|
|
109
113
|
return {
|
|
110
114
|
queryPayload: `
|
|
@@ -24,15 +24,15 @@ type LightsparkNodeToChannelsConnection = Connection & {
|
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
export const LightsparkNodeToChannelsConnectionFromJson = (
|
|
27
|
-
obj: any
|
|
27
|
+
obj: any,
|
|
28
28
|
): LightsparkNodeToChannelsConnection => {
|
|
29
29
|
return {
|
|
30
30
|
count: obj["lightspark_node_to_channels_connection_count"],
|
|
31
31
|
pageInfo: PageInfoFromJson(
|
|
32
|
-
obj["lightspark_node_to_channels_connection_page_info"]
|
|
32
|
+
obj["lightspark_node_to_channels_connection_page_info"],
|
|
33
33
|
),
|
|
34
34
|
entities: obj["lightspark_node_to_channels_connection_entities"].map((e) =>
|
|
35
|
-
ChannelFromJson(e)
|
|
35
|
+
ChannelFromJson(e),
|
|
36
36
|
),
|
|
37
37
|
typename: "LightsparkNodeToChannelsConnection",
|
|
38
38
|
} as LightsparkNodeToChannelsConnection;
|