@lightsparkdev/lightspark-sdk 0.4.9 → 0.4.11
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 +14 -0
- package/dist/{chunk-YTXDF6SQ.js → chunk-NXUFC5J7.js} +950 -246
- package/dist/{index-adeff42d.d.ts → index-3ffe9e7b.d.ts} +194 -56
- package/dist/index.cjs +963 -254
- package/dist/index.d.ts +2 -2
- package/dist/index.js +16 -9
- package/dist/objects/index.cjs +952 -246
- package/dist/objects/index.d.ts +1 -1
- package/dist/objects/index.js +5 -1
- package/package.json +4 -4
- package/src/__tests__/webhooks.test.ts +1 -1
- package/src/auth/AccountTokenAuthProvider.ts +4 -4
- package/src/client.ts +62 -63
- package/src/objects/Account.ts +46 -40
- package/src/objects/AccountToApiTokensConnection.ts +14 -9
- package/src/objects/AccountToChannelsConnection.ts +4 -4
- package/src/objects/AccountToNodesConnection.ts +13 -8
- package/src/objects/AccountToPaymentRequestsConnection.ts +22 -17
- package/src/objects/AccountToTransactionsConnection.ts +24 -19
- package/src/objects/AccountToWalletsConnection.ts +13 -8
- package/src/objects/ApiToken.ts +2 -1
- package/src/objects/Balances.ts +3 -2
- package/src/objects/BitcoinNetwork.ts +2 -1
- package/src/objects/BlockchainBalance.ts +1 -1
- package/src/objects/Channel.ts +6 -6
- package/src/objects/ChannelClosingTransaction.ts +4 -4
- package/src/objects/ChannelFees.ts +1 -0
- package/src/objects/ChannelOpeningTransaction.ts +4 -4
- package/src/objects/ChannelStatus.ts +1 -0
- package/src/objects/ChannelToTransactionsConnection.ts +4 -4
- package/src/objects/Connection.ts +387 -0
- package/src/objects/CreateApiTokenInput.ts +1 -1
- package/src/objects/CreateApiTokenOutput.ts +1 -1
- package/src/objects/CreateInvoiceInput.ts +12 -0
- package/src/objects/CreateLnurlInvoiceInput.ts +11 -1
- 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 +2 -1
- package/src/objects/CryptoSanctionsScreeningProvider.ts +14 -0
- package/src/objects/CurrencyAmount.ts +1 -1
- package/src/objects/CurrencyUnit.ts +1 -0
- package/src/objects/DeleteApiTokenOutput.ts +1 -1
- package/src/objects/Deposit.ts +2 -2
- package/src/objects/Entity.ts +1 -1
- package/src/objects/FeeEstimate.ts +1 -0
- package/src/objects/GraphNode.ts +5 -5
- package/src/objects/Hop.ts +2 -2
- package/src/objects/HtlcAttemptFailureCode.ts +1 -0
- package/src/objects/IncomingPayment.ts +21 -8
- package/src/objects/IncomingPaymentAttempt.ts +4 -4
- package/src/objects/IncomingPaymentAttemptStatus.ts +1 -1
- package/src/objects/IncomingPaymentToAttemptsConnection.ts +23 -3
- package/src/objects/Invoice.ts +2 -2
- package/src/objects/InvoiceData.ts +1 -1
- package/src/objects/InvoiceType.ts +1 -0
- 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 +8 -8
- package/src/objects/LightsparkNode.ts +15 -9
- package/src/objects/LightsparkNodeOwner.ts +6 -6
- package/src/objects/LightsparkNodePurpose.ts +1 -0
- package/src/objects/LightsparkNodeToChannelsConnection.ts +14 -9
- package/src/objects/Node.ts +7 -8
- package/src/objects/NodeAddress.ts +1 -1
- package/src/objects/NodeAddressType.ts +1 -1
- package/src/objects/NodeToAddressesConnection.ts +2 -2
- package/src/objects/OnChainTransaction.ts +4 -5
- package/src/objects/OutgoingPayment.ts +16 -8
- package/src/objects/OutgoingPaymentAttempt.ts +18 -10
- package/src/objects/OutgoingPaymentAttemptStatus.ts +1 -1
- package/src/objects/OutgoingPaymentAttemptToHopsConnection.ts +23 -3
- package/src/objects/OutgoingPaymentToAttemptsConnection.ts +23 -3
- package/src/objects/PageInfo.ts +1 -0
- package/src/objects/PaymentFailureReason.ts +1 -0
- package/src/objects/PaymentRequest.ts +3 -3
- package/src/objects/PaymentRequestData.ts +2 -2
- package/src/objects/PaymentRequestStatus.ts +1 -0
- package/src/objects/Permission.ts +1 -0
- package/src/objects/RequestWithdrawalInput.ts +1 -1
- package/src/objects/RequestWithdrawalOutput.ts +1 -1
- package/src/objects/RiskRating.ts +18 -0
- package/src/objects/RoutingTransaction.ts +3 -3
- package/src/objects/RoutingTransactionFailureReason.ts +1 -0
- package/src/objects/ScreenBitcoinAddressesInput.ts +23 -0
- package/src/objects/ScreenBitcoinAddressesOutput.ts +25 -0
- package/src/objects/Transaction.ts +6 -6
- package/src/objects/TransactionFailures.ts +2 -1
- package/src/objects/TransactionStatus.ts +1 -0
- package/src/objects/TransactionType.ts +1 -0
- package/src/objects/Wallet.ts +636 -11
- package/src/objects/WalletStatus.ts +1 -0
- package/src/objects/WalletToPaymentRequestsConnection.ts +57 -0
- package/src/objects/WalletToTransactionsConnection.ts +57 -0
- package/src/objects/WebhookEventType.ts +3 -0
- package/src/objects/Withdrawal.ts +2 -2
- package/src/objects/WithdrawalMode.ts +1 -0
- package/src/objects/WithdrawalRequest.ts +8 -7
- package/src/objects/WithdrawalRequestStatus.ts +1 -0
- package/src/objects/WithdrawalRequestToChannelClosingTransactionsConnection.ts +2 -2
- package/src/objects/WithdrawalRequestToChannelOpeningTransactionsConnection.ts +2 -2
- package/src/objects/index.ts +7 -0
- package/src/webhooks.ts +1 -1
- package/src/objects/.eslintrc.cjs +0 -5
package/src/objects/Account.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
import type
|
|
3
|
+
import { type Query } from "@lightsparkdev/core";
|
|
4
4
|
import autoBind from "auto-bind";
|
|
5
5
|
import type LightsparkClient from "../client.js";
|
|
6
6
|
import type AccountToApiTokensConnection from "./AccountToApiTokensConnection.js";
|
|
@@ -25,28 +25,31 @@ import type TransactionFailures from "./TransactionFailures.js";
|
|
|
25
25
|
import type TransactionStatus from "./TransactionStatus.js";
|
|
26
26
|
import type TransactionType from "./TransactionType.js";
|
|
27
27
|
|
|
28
|
+
/** This is an object representing the connected Lightspark account. You can retrieve this object to see your account information and objects tied to your account. **/
|
|
28
29
|
class Account implements LightsparkNodeOwner {
|
|
29
30
|
constructor(
|
|
30
31
|
public readonly id: string,
|
|
31
32
|
public readonly createdAt: string,
|
|
32
33
|
public readonly updatedAt: string,
|
|
33
34
|
public readonly typename: string,
|
|
34
|
-
public readonly name?: string
|
|
35
|
+
public readonly name?: string,
|
|
35
36
|
) {
|
|
36
37
|
autoBind(this);
|
|
37
38
|
}
|
|
38
39
|
|
|
39
40
|
public async getApiTokens(
|
|
40
41
|
client: LightsparkClient,
|
|
41
|
-
first: number | undefined = undefined
|
|
42
|
+
first: number | undefined = undefined,
|
|
43
|
+
after: string | undefined = undefined,
|
|
42
44
|
): Promise<AccountToApiTokensConnection> {
|
|
43
45
|
return (await client.executeRawQuery({
|
|
44
46
|
queryPayload: `
|
|
45
|
-
query FetchAccountToApiTokensConnection($first: Int) {
|
|
47
|
+
query FetchAccountToApiTokensConnection($first: Int, $after: String) {
|
|
46
48
|
current_account {
|
|
47
49
|
... on Account {
|
|
48
|
-
api_tokens(, first: $first) {
|
|
50
|
+
api_tokens(, first: $first, after: $after) {
|
|
49
51
|
__typename
|
|
52
|
+
account_to_api_tokens_connection_count: count
|
|
50
53
|
account_to_api_tokens_connection_page_info: page_info {
|
|
51
54
|
__typename
|
|
52
55
|
page_info_has_next_page: has_next_page
|
|
@@ -54,7 +57,6 @@ query FetchAccountToApiTokensConnection($first: Int) {
|
|
|
54
57
|
page_info_start_cursor: start_cursor
|
|
55
58
|
page_info_end_cursor: end_cursor
|
|
56
59
|
}
|
|
57
|
-
account_to_api_tokens_connection_count: count
|
|
58
60
|
account_to_api_tokens_connection_entities: entities {
|
|
59
61
|
__typename
|
|
60
62
|
api_token_id: id
|
|
@@ -69,7 +71,7 @@ query FetchAccountToApiTokensConnection($first: Int) {
|
|
|
69
71
|
}
|
|
70
72
|
}
|
|
71
73
|
`,
|
|
72
|
-
variables: { first: first },
|
|
74
|
+
variables: { first: first, after: after },
|
|
73
75
|
constructObject: (json) => {
|
|
74
76
|
const connection = json["current_account"]["api_tokens"];
|
|
75
77
|
return AccountToApiTokensConnectionFromJson(connection);
|
|
@@ -80,7 +82,7 @@ query FetchAccountToApiTokensConnection($first: Int) {
|
|
|
80
82
|
public async getBlockchainBalance(
|
|
81
83
|
client: LightsparkClient,
|
|
82
84
|
bitcoinNetworks: BitcoinNetwork[] | undefined = undefined,
|
|
83
|
-
nodeIds: string[] | undefined = undefined
|
|
85
|
+
nodeIds: string[] | undefined = undefined,
|
|
84
86
|
): Promise<BlockchainBalance | null> {
|
|
85
87
|
return await client.executeRawQuery({
|
|
86
88
|
queryPayload: `
|
|
@@ -153,7 +155,7 @@ query FetchAccountBlockchainBalance($bitcoin_networks: [BitcoinNetwork!], $node_
|
|
|
153
155
|
public async getConductivity(
|
|
154
156
|
client: LightsparkClient,
|
|
155
157
|
bitcoinNetworks: BitcoinNetwork[] | undefined = undefined,
|
|
156
|
-
nodeIds: string[] | undefined = undefined
|
|
158
|
+
nodeIds: string[] | undefined = undefined,
|
|
157
159
|
): Promise<number> {
|
|
158
160
|
return await client.executeRawQuery({
|
|
159
161
|
queryPayload: `
|
|
@@ -176,7 +178,7 @@ query FetchAccountConductivity($bitcoin_networks: [BitcoinNetwork!], $node_ids:
|
|
|
176
178
|
public async getLocalBalance(
|
|
177
179
|
client: LightsparkClient,
|
|
178
180
|
bitcoinNetworks: BitcoinNetwork[] | undefined = undefined,
|
|
179
|
-
nodeIds: string[] | undefined = undefined
|
|
181
|
+
nodeIds: string[] | undefined = undefined,
|
|
180
182
|
): Promise<CurrencyAmount | null> {
|
|
181
183
|
return await client.executeRawQuery({
|
|
182
184
|
queryPayload: `
|
|
@@ -207,15 +209,17 @@ query FetchAccountLocalBalance($bitcoin_networks: [BitcoinNetwork!], $node_ids:
|
|
|
207
209
|
client: LightsparkClient,
|
|
208
210
|
first: number | undefined = undefined,
|
|
209
211
|
bitcoinNetworks: BitcoinNetwork[] | undefined = undefined,
|
|
210
|
-
nodeIds: string[] | undefined = undefined
|
|
212
|
+
nodeIds: string[] | undefined = undefined,
|
|
213
|
+
after: string | undefined = undefined,
|
|
211
214
|
): Promise<AccountToNodesConnection> {
|
|
212
215
|
return (await client.executeRawQuery({
|
|
213
216
|
queryPayload: `
|
|
214
|
-
query FetchAccountToNodesConnection($first: Int, $bitcoin_networks: [BitcoinNetwork!], $node_ids: [ID!]) {
|
|
217
|
+
query FetchAccountToNodesConnection($first: Int, $bitcoin_networks: [BitcoinNetwork!], $node_ids: [ID!], $after: String) {
|
|
215
218
|
current_account {
|
|
216
219
|
... on Account {
|
|
217
|
-
nodes(, first: $first, bitcoin_networks: $bitcoin_networks, node_ids: $node_ids) {
|
|
220
|
+
nodes(, first: $first, bitcoin_networks: $bitcoin_networks, node_ids: $node_ids, after: $after) {
|
|
218
221
|
__typename
|
|
222
|
+
account_to_nodes_connection_count: count
|
|
219
223
|
account_to_nodes_connection_page_info: page_info {
|
|
220
224
|
__typename
|
|
221
225
|
page_info_has_next_page: has_next_page
|
|
@@ -223,7 +227,6 @@ query FetchAccountToNodesConnection($first: Int, $bitcoin_networks: [BitcoinNetw
|
|
|
223
227
|
page_info_start_cursor: start_cursor
|
|
224
228
|
page_info_end_cursor: end_cursor
|
|
225
229
|
}
|
|
226
|
-
account_to_nodes_connection_count: count
|
|
227
230
|
account_to_nodes_connection_purpose: purpose
|
|
228
231
|
account_to_nodes_connection_entities: entities {
|
|
229
232
|
__typename
|
|
@@ -342,6 +345,7 @@ query FetchAccountToNodesConnection($first: Int, $bitcoin_networks: [BitcoinNetw
|
|
|
342
345
|
first: first,
|
|
343
346
|
bitcoin_networks: bitcoinNetworks,
|
|
344
347
|
node_ids: nodeIds,
|
|
348
|
+
after: after,
|
|
345
349
|
},
|
|
346
350
|
constructObject: (json) => {
|
|
347
351
|
const connection = json["current_account"]["nodes"];
|
|
@@ -353,7 +357,7 @@ query FetchAccountToNodesConnection($first: Int, $bitcoin_networks: [BitcoinNetw
|
|
|
353
357
|
public async getRemoteBalance(
|
|
354
358
|
client: LightsparkClient,
|
|
355
359
|
bitcoinNetworks: BitcoinNetwork[] | undefined = undefined,
|
|
356
|
-
nodeIds: string[] | undefined = undefined
|
|
360
|
+
nodeIds: string[] | undefined = undefined,
|
|
357
361
|
): Promise<CurrencyAmount | null> {
|
|
358
362
|
return await client.executeRawQuery({
|
|
359
363
|
queryPayload: `
|
|
@@ -385,7 +389,7 @@ query FetchAccountRemoteBalance($bitcoin_networks: [BitcoinNetwork!], $node_ids:
|
|
|
385
389
|
afterDate: string | undefined = undefined,
|
|
386
390
|
beforeDate: string | undefined = undefined,
|
|
387
391
|
bitcoinNetworks: BitcoinNetwork[] | undefined = undefined,
|
|
388
|
-
nodeIds: string[] | undefined = undefined
|
|
392
|
+
nodeIds: string[] | undefined = undefined,
|
|
389
393
|
): Promise<number> {
|
|
390
394
|
return await client.executeRawQuery({
|
|
391
395
|
queryPayload: `
|
|
@@ -416,7 +420,7 @@ query FetchAccountUptimePercentage($after_date: DateTime, $before_date: DateTime
|
|
|
416
420
|
lightningNodeId: string | undefined = undefined,
|
|
417
421
|
afterDate: string | undefined = undefined,
|
|
418
422
|
beforeDate: string | undefined = undefined,
|
|
419
|
-
first: number | undefined = undefined
|
|
423
|
+
first: number | undefined = undefined,
|
|
420
424
|
): Promise<AccountToChannelsConnection> {
|
|
421
425
|
return (await client.executeRawQuery({
|
|
422
426
|
queryPayload: `
|
|
@@ -549,7 +553,7 @@ query FetchAccountToChannelsConnection($bitcoin_network: BitcoinNetwork!, $light
|
|
|
549
553
|
bitcoinNetwork: BitcoinNetwork | undefined = undefined,
|
|
550
554
|
lightningNodeId: string | undefined = undefined,
|
|
551
555
|
statuses: TransactionStatus[] | undefined = undefined,
|
|
552
|
-
excludeFailures: TransactionFailures | undefined = undefined
|
|
556
|
+
excludeFailures: TransactionFailures | undefined = undefined,
|
|
553
557
|
): Promise<AccountToTransactionsConnection> {
|
|
554
558
|
return (await client.executeRawQuery({
|
|
555
559
|
queryPayload: `
|
|
@@ -558,6 +562,14 @@ query FetchAccountToTransactionsConnection($first: Int, $after: String, $types:
|
|
|
558
562
|
... on Account {
|
|
559
563
|
transactions(, first: $first, after: $after, types: $types, after_date: $after_date, before_date: $before_date, bitcoin_network: $bitcoin_network, lightning_node_id: $lightning_node_id, statuses: $statuses, exclude_failures: $exclude_failures) {
|
|
560
564
|
__typename
|
|
565
|
+
account_to_transactions_connection_count: count
|
|
566
|
+
account_to_transactions_connection_page_info: page_info {
|
|
567
|
+
__typename
|
|
568
|
+
page_info_has_next_page: has_next_page
|
|
569
|
+
page_info_has_previous_page: has_previous_page
|
|
570
|
+
page_info_start_cursor: start_cursor
|
|
571
|
+
page_info_end_cursor: end_cursor
|
|
572
|
+
}
|
|
561
573
|
account_to_transactions_connection_profit_loss: profit_loss {
|
|
562
574
|
__typename
|
|
563
575
|
currency_amount_original_value: original_value
|
|
@@ -574,7 +586,6 @@ query FetchAccountToTransactionsConnection($first: Int, $after: String, $types:
|
|
|
574
586
|
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
575
587
|
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
576
588
|
}
|
|
577
|
-
account_to_transactions_connection_count: count
|
|
578
589
|
account_to_transactions_connection_total_amount_transacted: total_amount_transacted {
|
|
579
590
|
__typename
|
|
580
591
|
currency_amount_original_value: original_value
|
|
@@ -955,13 +966,6 @@ query FetchAccountToTransactionsConnection($first: Int, $after: String, $types:
|
|
|
955
966
|
}
|
|
956
967
|
}
|
|
957
968
|
}
|
|
958
|
-
account_to_transactions_connection_page_info: page_info {
|
|
959
|
-
__typename
|
|
960
|
-
page_info_has_next_page: has_next_page
|
|
961
|
-
page_info_has_previous_page: has_previous_page
|
|
962
|
-
page_info_start_cursor: start_cursor
|
|
963
|
-
page_info_end_cursor: end_cursor
|
|
964
|
-
}
|
|
965
969
|
}
|
|
966
970
|
}
|
|
967
971
|
}
|
|
@@ -992,7 +996,7 @@ query FetchAccountToTransactionsConnection($first: Int, $after: String, $types:
|
|
|
992
996
|
afterDate: string | undefined = undefined,
|
|
993
997
|
beforeDate: string | undefined = undefined,
|
|
994
998
|
bitcoinNetwork: BitcoinNetwork | undefined = undefined,
|
|
995
|
-
lightningNodeId: string | undefined = undefined
|
|
999
|
+
lightningNodeId: string | undefined = undefined,
|
|
996
1000
|
): Promise<AccountToPaymentRequestsConnection> {
|
|
997
1001
|
return (await client.executeRawQuery({
|
|
998
1002
|
queryPayload: `
|
|
@@ -1002,6 +1006,13 @@ query FetchAccountToPaymentRequestsConnection($first: Int, $after: String, $afte
|
|
|
1002
1006
|
payment_requests(, first: $first, after: $after, after_date: $after_date, before_date: $before_date, bitcoin_network: $bitcoin_network, lightning_node_id: $lightning_node_id) {
|
|
1003
1007
|
__typename
|
|
1004
1008
|
account_to_payment_requests_connection_count: count
|
|
1009
|
+
account_to_payment_requests_connection_page_info: page_info {
|
|
1010
|
+
__typename
|
|
1011
|
+
page_info_has_next_page: has_next_page
|
|
1012
|
+
page_info_has_previous_page: has_previous_page
|
|
1013
|
+
page_info_start_cursor: start_cursor
|
|
1014
|
+
page_info_end_cursor: end_cursor
|
|
1015
|
+
}
|
|
1005
1016
|
account_to_payment_requests_connection_entities: entities {
|
|
1006
1017
|
__typename
|
|
1007
1018
|
... on Invoice {
|
|
@@ -1160,13 +1171,6 @@ query FetchAccountToPaymentRequestsConnection($first: Int, $after: String, $afte
|
|
|
1160
1171
|
}
|
|
1161
1172
|
}
|
|
1162
1173
|
}
|
|
1163
|
-
account_to_payment_requests_connection_page_info: page_info {
|
|
1164
|
-
__typename
|
|
1165
|
-
page_info_has_next_page: has_next_page
|
|
1166
|
-
page_info_has_previous_page: has_previous_page
|
|
1167
|
-
page_info_start_cursor: start_cursor
|
|
1168
|
-
page_info_end_cursor: end_cursor
|
|
1169
|
-
}
|
|
1170
1174
|
}
|
|
1171
1175
|
}
|
|
1172
1176
|
}
|
|
@@ -1189,15 +1193,18 @@ query FetchAccountToPaymentRequestsConnection($first: Int, $after: String, $afte
|
|
|
1189
1193
|
|
|
1190
1194
|
public async getWallets(
|
|
1191
1195
|
client: LightsparkClient,
|
|
1192
|
-
first: number | undefined = undefined
|
|
1196
|
+
first: number | undefined = undefined,
|
|
1197
|
+
after: string | undefined = undefined,
|
|
1198
|
+
thirdPartyIds: string[] | undefined = undefined,
|
|
1193
1199
|
): Promise<AccountToWalletsConnection> {
|
|
1194
1200
|
return (await client.executeRawQuery({
|
|
1195
1201
|
queryPayload: `
|
|
1196
|
-
query FetchAccountToWalletsConnection($first: Int) {
|
|
1202
|
+
query FetchAccountToWalletsConnection($first: Int, $after: String, $third_party_ids: [String!]) {
|
|
1197
1203
|
current_account {
|
|
1198
1204
|
... on Account {
|
|
1199
|
-
wallets(, first: $first) {
|
|
1205
|
+
wallets(, first: $first, after: $after, third_party_ids: $third_party_ids) {
|
|
1200
1206
|
__typename
|
|
1207
|
+
account_to_wallets_connection_count: count
|
|
1201
1208
|
account_to_wallets_connection_page_info: page_info {
|
|
1202
1209
|
__typename
|
|
1203
1210
|
page_info_has_next_page: has_next_page
|
|
@@ -1205,7 +1212,6 @@ query FetchAccountToWalletsConnection($first: Int) {
|
|
|
1205
1212
|
page_info_start_cursor: start_cursor
|
|
1206
1213
|
page_info_end_cursor: end_cursor
|
|
1207
1214
|
}
|
|
1208
|
-
account_to_wallets_connection_count: count
|
|
1209
1215
|
account_to_wallets_connection_entities: entities {
|
|
1210
1216
|
__typename
|
|
1211
1217
|
wallet_id: id
|
|
@@ -1247,7 +1253,7 @@ query FetchAccountToWalletsConnection($first: Int) {
|
|
|
1247
1253
|
}
|
|
1248
1254
|
}
|
|
1249
1255
|
`,
|
|
1250
|
-
variables: { first: first },
|
|
1256
|
+
variables: { first: first, after: after, third_party_ids: thirdPartyIds },
|
|
1251
1257
|
constructObject: (json) => {
|
|
1252
1258
|
const connection = json["current_account"]["wallets"];
|
|
1253
1259
|
return AccountToWalletsConnectionFromJson(connection);
|
|
@@ -1280,7 +1286,7 @@ export const AccountFromJson = (obj: any): Account => {
|
|
|
1280
1286
|
obj["account_created_at"],
|
|
1281
1287
|
obj["account_updated_at"],
|
|
1282
1288
|
"Account",
|
|
1283
|
-
obj["account_name"]
|
|
1289
|
+
obj["account_name"],
|
|
1284
1290
|
);
|
|
1285
1291
|
};
|
|
1286
1292
|
|
|
@@ -2,40 +2,46 @@
|
|
|
2
2
|
|
|
3
3
|
import type ApiToken from "./ApiToken.js";
|
|
4
4
|
import { ApiTokenFromJson } from "./ApiToken.js";
|
|
5
|
+
import type Connection from "./Connection.js";
|
|
5
6
|
import type PageInfo from "./PageInfo.js";
|
|
6
7
|
import { PageInfoFromJson } from "./PageInfo.js";
|
|
7
8
|
|
|
8
|
-
type AccountToApiTokensConnection = {
|
|
9
|
-
/** An object that holds pagination information about the objects in this connection. **/
|
|
10
|
-
pageInfo: PageInfo;
|
|
11
|
-
|
|
9
|
+
type AccountToApiTokensConnection = Connection & {
|
|
12
10
|
/**
|
|
13
11
|
* The total count of objects in this connection, using the current filters. It is different from the
|
|
14
12
|
* number of objects returned in the current page (in the `entities` field).
|
|
15
13
|
**/
|
|
16
14
|
count: number;
|
|
17
15
|
|
|
16
|
+
/** An object that holds pagination information about the objects in this connection. **/
|
|
17
|
+
pageInfo: PageInfo;
|
|
18
|
+
|
|
18
19
|
/** The API tokens for the current page of this connection. **/
|
|
19
20
|
entities: ApiToken[];
|
|
21
|
+
|
|
22
|
+
/** The typename of the object **/
|
|
23
|
+
typename: string;
|
|
20
24
|
};
|
|
21
25
|
|
|
22
26
|
export const AccountToApiTokensConnectionFromJson = (
|
|
23
|
-
obj: any
|
|
27
|
+
obj: any,
|
|
24
28
|
): AccountToApiTokensConnection => {
|
|
25
29
|
return {
|
|
30
|
+
count: obj["account_to_api_tokens_connection_count"],
|
|
26
31
|
pageInfo: PageInfoFromJson(
|
|
27
|
-
obj["account_to_api_tokens_connection_page_info"]
|
|
32
|
+
obj["account_to_api_tokens_connection_page_info"],
|
|
28
33
|
),
|
|
29
|
-
count: obj["account_to_api_tokens_connection_count"],
|
|
30
34
|
entities: obj["account_to_api_tokens_connection_entities"].map((e) =>
|
|
31
|
-
ApiTokenFromJson(e)
|
|
35
|
+
ApiTokenFromJson(e),
|
|
32
36
|
),
|
|
37
|
+
typename: "AccountToApiTokensConnection",
|
|
33
38
|
} as AccountToApiTokensConnection;
|
|
34
39
|
};
|
|
35
40
|
|
|
36
41
|
export const FRAGMENT = `
|
|
37
42
|
fragment AccountToApiTokensConnectionFragment on AccountToApiTokensConnection {
|
|
38
43
|
__typename
|
|
44
|
+
account_to_api_tokens_connection_count: count
|
|
39
45
|
account_to_api_tokens_connection_page_info: page_info {
|
|
40
46
|
__typename
|
|
41
47
|
page_info_has_next_page: has_next_page
|
|
@@ -43,7 +49,6 @@ fragment AccountToApiTokensConnectionFragment on AccountToApiTokensConnection {
|
|
|
43
49
|
page_info_start_cursor: start_cursor
|
|
44
50
|
page_info_end_cursor: end_cursor
|
|
45
51
|
}
|
|
46
|
-
account_to_api_tokens_connection_count: count
|
|
47
52
|
account_to_api_tokens_connection_entities: entities {
|
|
48
53
|
id
|
|
49
54
|
}
|
|
@@ -7,20 +7,20 @@ import { ChannelFromJson } from "./Channel.js";
|
|
|
7
7
|
class AccountToChannelsConnection {
|
|
8
8
|
constructor(
|
|
9
9
|
public readonly count: number,
|
|
10
|
-
public readonly entities: Channel[]
|
|
10
|
+
public readonly entities: Channel[],
|
|
11
11
|
) {
|
|
12
12
|
autoBind(this);
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
export const AccountToChannelsConnectionFromJson = (
|
|
17
|
-
obj: any
|
|
17
|
+
obj: any,
|
|
18
18
|
): AccountToChannelsConnection => {
|
|
19
19
|
return new AccountToChannelsConnection(
|
|
20
20
|
obj["account_to_channels_connection_count"],
|
|
21
21
|
obj["account_to_channels_connection_entities"].map((e) =>
|
|
22
|
-
ChannelFromJson(e)
|
|
23
|
-
)
|
|
22
|
+
ChannelFromJson(e),
|
|
23
|
+
),
|
|
24
24
|
);
|
|
25
25
|
};
|
|
26
26
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
+
import type Connection from "./Connection.js";
|
|
3
4
|
import type LightsparkNode from "./LightsparkNode.js";
|
|
4
5
|
import { LightsparkNodeFromJson } from "./LightsparkNode.js";
|
|
5
6
|
import LightsparkNodePurpose from "./LightsparkNodePurpose.js";
|
|
@@ -7,19 +8,22 @@ import type PageInfo from "./PageInfo.js";
|
|
|
7
8
|
import { PageInfoFromJson } from "./PageInfo.js";
|
|
8
9
|
|
|
9
10
|
/** A connection between an account and the nodes it manages. **/
|
|
10
|
-
type AccountToNodesConnection = {
|
|
11
|
-
/** An object that holds pagination information about the objects in this connection. **/
|
|
12
|
-
pageInfo: PageInfo;
|
|
13
|
-
|
|
11
|
+
type AccountToNodesConnection = Connection & {
|
|
14
12
|
/**
|
|
15
13
|
* The total count of objects in this connection, using the current filters. It is different from the
|
|
16
14
|
* number of objects returned in the current page (in the `entities` field).
|
|
17
15
|
**/
|
|
18
16
|
count: number;
|
|
19
17
|
|
|
18
|
+
/** An object that holds pagination information about the objects in this connection. **/
|
|
19
|
+
pageInfo: PageInfo;
|
|
20
|
+
|
|
20
21
|
/** The nodes for the current page of this connection. **/
|
|
21
22
|
entities: LightsparkNode[];
|
|
22
23
|
|
|
24
|
+
/** The typename of the object **/
|
|
25
|
+
typename: string;
|
|
26
|
+
|
|
23
27
|
/**
|
|
24
28
|
* The main purpose for the selected set of nodes. It is automatically determined from the nodes that
|
|
25
29
|
* are selected in this connection and is used for optimization purposes, as well as to determine the
|
|
@@ -29,14 +33,15 @@ type AccountToNodesConnection = {
|
|
|
29
33
|
};
|
|
30
34
|
|
|
31
35
|
export const AccountToNodesConnectionFromJson = (
|
|
32
|
-
obj: any
|
|
36
|
+
obj: any,
|
|
33
37
|
): AccountToNodesConnection => {
|
|
34
38
|
return {
|
|
35
|
-
pageInfo: PageInfoFromJson(obj["account_to_nodes_connection_page_info"]),
|
|
36
39
|
count: obj["account_to_nodes_connection_count"],
|
|
40
|
+
pageInfo: PageInfoFromJson(obj["account_to_nodes_connection_page_info"]),
|
|
37
41
|
entities: obj["account_to_nodes_connection_entities"].map((e) =>
|
|
38
|
-
LightsparkNodeFromJson(e)
|
|
42
|
+
LightsparkNodeFromJson(e),
|
|
39
43
|
),
|
|
44
|
+
typename: "AccountToNodesConnection",
|
|
40
45
|
purpose: !!obj["account_to_nodes_connection_purpose"]
|
|
41
46
|
? LightsparkNodePurpose[obj["account_to_nodes_connection_purpose"]] ??
|
|
42
47
|
LightsparkNodePurpose.FUTURE_VALUE
|
|
@@ -47,6 +52,7 @@ export const AccountToNodesConnectionFromJson = (
|
|
|
47
52
|
export const FRAGMENT = `
|
|
48
53
|
fragment AccountToNodesConnectionFragment on AccountToNodesConnection {
|
|
49
54
|
__typename
|
|
55
|
+
account_to_nodes_connection_count: count
|
|
50
56
|
account_to_nodes_connection_page_info: page_info {
|
|
51
57
|
__typename
|
|
52
58
|
page_info_has_next_page: has_next_page
|
|
@@ -54,7 +60,6 @@ fragment AccountToNodesConnectionFragment on AccountToNodesConnection {
|
|
|
54
60
|
page_info_start_cursor: start_cursor
|
|
55
61
|
page_info_end_cursor: end_cursor
|
|
56
62
|
}
|
|
57
|
-
account_to_nodes_connection_count: count
|
|
58
63
|
account_to_nodes_connection_purpose: purpose
|
|
59
64
|
account_to_nodes_connection_entities: entities {
|
|
60
65
|
id
|
|
@@ -1,35 +1,40 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
+
import type Connection from "./Connection.js";
|
|
3
4
|
import type PageInfo from "./PageInfo.js";
|
|
4
5
|
import { PageInfoFromJson } from "./PageInfo.js";
|
|
5
6
|
import type PaymentRequest from "./PaymentRequest.js";
|
|
6
7
|
import { PaymentRequestFromJson } from "./PaymentRequest.js";
|
|
7
8
|
|
|
8
|
-
type AccountToPaymentRequestsConnection = {
|
|
9
|
-
/** The payment requests for the current page of this connection. **/
|
|
10
|
-
entities: PaymentRequest[];
|
|
11
|
-
|
|
12
|
-
/** An object that holds pagination information about the objects in this connection. **/
|
|
13
|
-
pageInfo: PageInfo;
|
|
14
|
-
|
|
9
|
+
type AccountToPaymentRequestsConnection = Connection & {
|
|
15
10
|
/**
|
|
16
11
|
* The total count of objects in this connection, using the current filters. It is different from the
|
|
17
12
|
* number of objects returned in the current page (in the `entities` field).
|
|
18
13
|
**/
|
|
19
|
-
count
|
|
14
|
+
count: number;
|
|
15
|
+
|
|
16
|
+
/** An object that holds pagination information about the objects in this connection. **/
|
|
17
|
+
pageInfo: PageInfo;
|
|
18
|
+
|
|
19
|
+
/** The payment requests for the current page of this connection. **/
|
|
20
|
+
entities: PaymentRequest[];
|
|
21
|
+
|
|
22
|
+
/** The typename of the object **/
|
|
23
|
+
typename: string;
|
|
20
24
|
};
|
|
21
25
|
|
|
22
26
|
export const AccountToPaymentRequestsConnectionFromJson = (
|
|
23
|
-
obj: any
|
|
27
|
+
obj: any,
|
|
24
28
|
): AccountToPaymentRequestsConnection => {
|
|
25
29
|
return {
|
|
26
|
-
|
|
27
|
-
PaymentRequestFromJson(e)
|
|
28
|
-
),
|
|
30
|
+
count: obj["account_to_payment_requests_connection_count"],
|
|
29
31
|
pageInfo: PageInfoFromJson(
|
|
30
|
-
obj["account_to_payment_requests_connection_page_info"]
|
|
32
|
+
obj["account_to_payment_requests_connection_page_info"],
|
|
31
33
|
),
|
|
32
|
-
|
|
34
|
+
entities: obj["account_to_payment_requests_connection_entities"].map((e) =>
|
|
35
|
+
PaymentRequestFromJson(e),
|
|
36
|
+
),
|
|
37
|
+
typename: "AccountToPaymentRequestsConnection",
|
|
33
38
|
} as AccountToPaymentRequestsConnection;
|
|
34
39
|
};
|
|
35
40
|
|
|
@@ -37,9 +42,6 @@ export const FRAGMENT = `
|
|
|
37
42
|
fragment AccountToPaymentRequestsConnectionFragment on AccountToPaymentRequestsConnection {
|
|
38
43
|
__typename
|
|
39
44
|
account_to_payment_requests_connection_count: count
|
|
40
|
-
account_to_payment_requests_connection_entities: entities {
|
|
41
|
-
id
|
|
42
|
-
}
|
|
43
45
|
account_to_payment_requests_connection_page_info: page_info {
|
|
44
46
|
__typename
|
|
45
47
|
page_info_has_next_page: has_next_page
|
|
@@ -47,6 +49,9 @@ fragment AccountToPaymentRequestsConnectionFragment on AccountToPaymentRequestsC
|
|
|
47
49
|
page_info_start_cursor: start_cursor
|
|
48
50
|
page_info_end_cursor: end_cursor
|
|
49
51
|
}
|
|
52
|
+
account_to_payment_requests_connection_entities: entities {
|
|
53
|
+
id
|
|
54
|
+
}
|
|
50
55
|
}`;
|
|
51
56
|
|
|
52
57
|
export default AccountToPaymentRequestsConnection;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
+
import type Connection from "./Connection.js";
|
|
3
4
|
import type CurrencyAmount from "./CurrencyAmount.js";
|
|
4
5
|
import { CurrencyAmountFromJson } from "./CurrencyAmount.js";
|
|
5
6
|
import type PageInfo from "./PageInfo.js";
|
|
@@ -7,18 +8,21 @@ import { PageInfoFromJson } from "./PageInfo.js";
|
|
|
7
8
|
import type Transaction from "./Transaction.js";
|
|
8
9
|
import { TransactionFromJson } from "./Transaction.js";
|
|
9
10
|
|
|
10
|
-
type AccountToTransactionsConnection = {
|
|
11
|
+
type AccountToTransactionsConnection = Connection & {
|
|
11
12
|
/**
|
|
12
13
|
* The total count of objects in this connection, using the current filters. It is different from the
|
|
13
14
|
* number of objects returned in the current page (in the `entities` field).
|
|
14
15
|
**/
|
|
15
16
|
count: number;
|
|
16
17
|
|
|
18
|
+
/** An object that holds pagination information about the objects in this connection. **/
|
|
19
|
+
pageInfo: PageInfo;
|
|
20
|
+
|
|
17
21
|
/** The transactions for the current page of this connection. **/
|
|
18
22
|
entities: Transaction[];
|
|
19
23
|
|
|
20
|
-
/**
|
|
21
|
-
|
|
24
|
+
/** The typename of the object **/
|
|
25
|
+
typename: string;
|
|
22
26
|
|
|
23
27
|
/**
|
|
24
28
|
* Profit (or loss) generated by the transactions in this connection, with the set of filters and
|
|
@@ -40,33 +44,34 @@ type AccountToTransactionsConnection = {
|
|
|
40
44
|
};
|
|
41
45
|
|
|
42
46
|
export const AccountToTransactionsConnectionFromJson = (
|
|
43
|
-
obj: any
|
|
47
|
+
obj: any,
|
|
44
48
|
): AccountToTransactionsConnection => {
|
|
45
49
|
return {
|
|
46
50
|
count: obj["account_to_transactions_connection_count"],
|
|
47
|
-
entities: obj["account_to_transactions_connection_entities"].map((e) =>
|
|
48
|
-
TransactionFromJson(e)
|
|
49
|
-
),
|
|
50
51
|
pageInfo: PageInfoFromJson(
|
|
51
|
-
obj["account_to_transactions_connection_page_info"]
|
|
52
|
+
obj["account_to_transactions_connection_page_info"],
|
|
52
53
|
),
|
|
54
|
+
entities: obj["account_to_transactions_connection_entities"].map((e) =>
|
|
55
|
+
TransactionFromJson(e),
|
|
56
|
+
),
|
|
57
|
+
typename: "AccountToTransactionsConnection",
|
|
53
58
|
profitLoss: !!obj["account_to_transactions_connection_profit_loss"]
|
|
54
59
|
? CurrencyAmountFromJson(
|
|
55
|
-
obj["account_to_transactions_connection_profit_loss"]
|
|
60
|
+
obj["account_to_transactions_connection_profit_loss"],
|
|
56
61
|
)
|
|
57
62
|
: undefined,
|
|
58
63
|
averageFeeEarned: !!obj[
|
|
59
64
|
"account_to_transactions_connection_average_fee_earned"
|
|
60
65
|
]
|
|
61
66
|
? CurrencyAmountFromJson(
|
|
62
|
-
obj["account_to_transactions_connection_average_fee_earned"]
|
|
67
|
+
obj["account_to_transactions_connection_average_fee_earned"],
|
|
63
68
|
)
|
|
64
69
|
: undefined,
|
|
65
70
|
totalAmountTransacted: !!obj[
|
|
66
71
|
"account_to_transactions_connection_total_amount_transacted"
|
|
67
72
|
]
|
|
68
73
|
? CurrencyAmountFromJson(
|
|
69
|
-
obj["account_to_transactions_connection_total_amount_transacted"]
|
|
74
|
+
obj["account_to_transactions_connection_total_amount_transacted"],
|
|
70
75
|
)
|
|
71
76
|
: undefined,
|
|
72
77
|
} as AccountToTransactionsConnection;
|
|
@@ -75,6 +80,14 @@ export const AccountToTransactionsConnectionFromJson = (
|
|
|
75
80
|
export const FRAGMENT = `
|
|
76
81
|
fragment AccountToTransactionsConnectionFragment on AccountToTransactionsConnection {
|
|
77
82
|
__typename
|
|
83
|
+
account_to_transactions_connection_count: count
|
|
84
|
+
account_to_transactions_connection_page_info: page_info {
|
|
85
|
+
__typename
|
|
86
|
+
page_info_has_next_page: has_next_page
|
|
87
|
+
page_info_has_previous_page: has_previous_page
|
|
88
|
+
page_info_start_cursor: start_cursor
|
|
89
|
+
page_info_end_cursor: end_cursor
|
|
90
|
+
}
|
|
78
91
|
account_to_transactions_connection_profit_loss: profit_loss {
|
|
79
92
|
__typename
|
|
80
93
|
currency_amount_original_value: original_value
|
|
@@ -91,7 +104,6 @@ fragment AccountToTransactionsConnectionFragment on AccountToTransactionsConnect
|
|
|
91
104
|
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
92
105
|
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
93
106
|
}
|
|
94
|
-
account_to_transactions_connection_count: count
|
|
95
107
|
account_to_transactions_connection_total_amount_transacted: total_amount_transacted {
|
|
96
108
|
__typename
|
|
97
109
|
currency_amount_original_value: original_value
|
|
@@ -103,13 +115,6 @@ fragment AccountToTransactionsConnectionFragment on AccountToTransactionsConnect
|
|
|
103
115
|
account_to_transactions_connection_entities: entities {
|
|
104
116
|
id
|
|
105
117
|
}
|
|
106
|
-
account_to_transactions_connection_page_info: page_info {
|
|
107
|
-
__typename
|
|
108
|
-
page_info_has_next_page: has_next_page
|
|
109
|
-
page_info_has_previous_page: has_previous_page
|
|
110
|
-
page_info_start_cursor: start_cursor
|
|
111
|
-
page_info_end_cursor: end_cursor
|
|
112
|
-
}
|
|
113
118
|
}`;
|
|
114
119
|
|
|
115
120
|
export default AccountToTransactionsConnection;
|
|
@@ -1,39 +1,45 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
+
import type Connection from "./Connection.js";
|
|
3
4
|
import type PageInfo from "./PageInfo.js";
|
|
4
5
|
import { PageInfoFromJson } from "./PageInfo.js";
|
|
5
6
|
import type Wallet from "./Wallet.js";
|
|
6
7
|
import { WalletFromJson } from "./Wallet.js";
|
|
7
8
|
|
|
8
|
-
type AccountToWalletsConnection = {
|
|
9
|
-
/** An object that holds pagination information about the objects in this connection. **/
|
|
10
|
-
pageInfo: PageInfo;
|
|
11
|
-
|
|
9
|
+
type AccountToWalletsConnection = Connection & {
|
|
12
10
|
/**
|
|
13
11
|
* The total count of objects in this connection, using the current filters. It is different from the
|
|
14
12
|
* number of objects returned in the current page (in the `entities` field).
|
|
15
13
|
**/
|
|
16
14
|
count: number;
|
|
17
15
|
|
|
16
|
+
/** An object that holds pagination information about the objects in this connection. **/
|
|
17
|
+
pageInfo: PageInfo;
|
|
18
|
+
|
|
18
19
|
/** The wallets for the current page of this connection. **/
|
|
19
20
|
entities: Wallet[];
|
|
21
|
+
|
|
22
|
+
/** The typename of the object **/
|
|
23
|
+
typename: string;
|
|
20
24
|
};
|
|
21
25
|
|
|
22
26
|
export const AccountToWalletsConnectionFromJson = (
|
|
23
|
-
obj: any
|
|
27
|
+
obj: any,
|
|
24
28
|
): AccountToWalletsConnection => {
|
|
25
29
|
return {
|
|
26
|
-
pageInfo: PageInfoFromJson(obj["account_to_wallets_connection_page_info"]),
|
|
27
30
|
count: obj["account_to_wallets_connection_count"],
|
|
31
|
+
pageInfo: PageInfoFromJson(obj["account_to_wallets_connection_page_info"]),
|
|
28
32
|
entities: obj["account_to_wallets_connection_entities"].map((e) =>
|
|
29
|
-
WalletFromJson(e)
|
|
33
|
+
WalletFromJson(e),
|
|
30
34
|
),
|
|
35
|
+
typename: "AccountToWalletsConnection",
|
|
31
36
|
} as AccountToWalletsConnection;
|
|
32
37
|
};
|
|
33
38
|
|
|
34
39
|
export const FRAGMENT = `
|
|
35
40
|
fragment AccountToWalletsConnectionFragment on AccountToWalletsConnection {
|
|
36
41
|
__typename
|
|
42
|
+
account_to_wallets_connection_count: count
|
|
37
43
|
account_to_wallets_connection_page_info: page_info {
|
|
38
44
|
__typename
|
|
39
45
|
page_info_has_next_page: has_next_page
|
|
@@ -41,7 +47,6 @@ fragment AccountToWalletsConnectionFragment on AccountToWalletsConnection {
|
|
|
41
47
|
page_info_start_cursor: start_cursor
|
|
42
48
|
page_info_end_cursor: end_cursor
|
|
43
49
|
}
|
|
44
|
-
account_to_wallets_connection_count: count
|
|
45
50
|
account_to_wallets_connection_entities: entities {
|
|
46
51
|
id
|
|
47
52
|
}
|