@lightsparkdev/lightspark-sdk 1.5.13 → 1.6.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 +15 -0
- package/dist/{chunk-FGFVWCTL.js → chunk-UHTZSOPX.js} +272 -144
- package/dist/{index-2b493387.d.ts → index-145ff316.d.ts} +232 -87
- package/dist/index.cjs +351 -142
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +85 -3
- package/dist/objects/index.cjs +262 -133
- package/dist/objects/index.d.cts +1 -1
- package/dist/objects/index.d.ts +1 -1
- package/dist/objects/index.js +3 -1
- package/package.json +2 -2
- package/src/client.ts +62 -0
- package/src/graphql/InvoiceForPaymentHash.ts +17 -0
- package/src/graphql/OutgoingPaymentsForPaymentHash.ts +21 -0
- package/src/objects/Account.ts +14 -2
- package/src/objects/ChannelClosingTransaction.ts +1 -4
- package/src/objects/ChannelOpeningTransaction.ts +1 -4
- package/src/objects/Connection.ts +116 -0
- package/src/objects/Deposit.ts +1 -4
- package/src/objects/Entity.ts +10 -0
- package/src/objects/FailHtlcsInput.ts +27 -0
- package/src/objects/FailHtlcsOutput.ts +26 -0
- package/src/objects/InvoiceForPaymentHashInput.ts +23 -0
- package/src/objects/InvoiceForPaymentHashOutput.ts +30 -0
- package/src/objects/LightningTransaction.ts +3 -0
- package/src/objects/LightsparkNode.ts +3 -1
- package/src/objects/LightsparkNodeWithOSK.ts +8 -4
- package/src/objects/LightsparkNodeWithRemoteSigning.ts +8 -4
- package/src/objects/OnChainFeeTarget.ts +19 -0
- package/src/objects/OnChainTransaction.ts +1 -4
- package/src/objects/OutgoingPayment.ts +5 -0
- package/src/objects/OutgoingPaymentForIdempotencyKeyInput.ts +24 -0
- package/src/objects/OutgoingPaymentForIdempotencyKeyOutput.ts +33 -0
- package/src/objects/OutgoingPaymentsForInvoiceQueryOutput.ts +1 -0
- package/src/objects/OutgoingPaymentsForPaymentHashQueryInput.ts +34 -0
- package/src/objects/OutgoingPaymentsForPaymentHashQueryOutput.ts +37 -0
- package/src/objects/PayInvoiceInput.ts +8 -0
- package/src/objects/PayUmaInvoiceInput.ts +4 -0
- package/src/objects/PaymentFailureReason.ts +2 -0
- package/src/objects/RemoteSigningSubEventType.ts +2 -0
- package/src/objects/RequestWithdrawalInput.ts +29 -0
- package/src/objects/SendPaymentInput.ts +8 -0
- package/src/objects/Transaction.ts +3 -0
- package/src/objects/TransactionStatus.ts +1 -1
- package/src/objects/Wallet.ts +10 -0
- package/src/objects/Withdrawal.ts +1 -4
- package/src/objects/WithdrawalRequest.ts +107 -11
- package/src/objects/WithdrawalRequestStatus.ts +2 -0
- package/src/objects/WithdrawalRequestToChannelClosingTransactionsConnection.ts +15 -10
- package/src/objects/WithdrawalRequestToChannelOpeningTransactionsConnection.ts +15 -10
- package/src/objects/WithdrawalRequestToWithdrawalsConnection.ts +47 -0
- package/src/objects/index.ts +10 -0
- package/src/webhooks.ts +3 -0
|
@@ -15,6 +15,8 @@ import type WithdrawalRequestToChannelClosingTransactionsConnection from "./With
|
|
|
15
15
|
import { WithdrawalRequestToChannelClosingTransactionsConnectionFromJson } from "./WithdrawalRequestToChannelClosingTransactionsConnection.js";
|
|
16
16
|
import type WithdrawalRequestToChannelOpeningTransactionsConnection from "./WithdrawalRequestToChannelOpeningTransactionsConnection.js";
|
|
17
17
|
import { WithdrawalRequestToChannelOpeningTransactionsConnectionFromJson } from "./WithdrawalRequestToChannelOpeningTransactionsConnection.js";
|
|
18
|
+
import type WithdrawalRequestToWithdrawalsConnection from "./WithdrawalRequestToWithdrawalsConnection.js";
|
|
19
|
+
import { WithdrawalRequestToWithdrawalsConnectionFromJson } from "./WithdrawalRequestToWithdrawalsConnection.js";
|
|
18
20
|
|
|
19
21
|
/**
|
|
20
22
|
* This object represents a request made for an L1 withdrawal from your Lightspark Node to any
|
|
@@ -45,7 +47,11 @@ class WithdrawalRequest implements Entity {
|
|
|
45
47
|
public readonly amount: CurrencyAmount,
|
|
46
48
|
/** The bitcoin address where the funds should be sent. **/
|
|
47
49
|
public readonly bitcoinAddress: string,
|
|
48
|
-
/**
|
|
50
|
+
/**
|
|
51
|
+
* The strategy that should be used to withdraw the funds from the account.
|
|
52
|
+
*
|
|
53
|
+
* @deprecated It is always withdrawing from channels now.
|
|
54
|
+
**/
|
|
49
55
|
public readonly withdrawalMode: WithdrawalMode,
|
|
50
56
|
/** The current status of this withdrawal request. **/
|
|
51
57
|
public readonly status: WithdrawalRequestStatus,
|
|
@@ -56,12 +62,26 @@ class WithdrawalRequest implements Entity {
|
|
|
56
62
|
* amount for the withdrawal.
|
|
57
63
|
**/
|
|
58
64
|
public readonly estimatedAmount?: CurrencyAmount | undefined,
|
|
59
|
-
/**
|
|
65
|
+
/**
|
|
66
|
+
* The actual amount that is withdrawn to the bitcoin address. It will be set once the request
|
|
67
|
+
* is completed.
|
|
68
|
+
**/
|
|
60
69
|
public readonly amountWithdrawn?: CurrencyAmount | undefined,
|
|
70
|
+
/**
|
|
71
|
+
* The total fees the node paid for the withdrawal. It will be set once the request is
|
|
72
|
+
* completed. *
|
|
73
|
+
*/
|
|
74
|
+
public readonly totalFees?: CurrencyAmount | undefined,
|
|
61
75
|
/** The time at which this request was completed. **/
|
|
62
76
|
public readonly completedAt?: string | undefined,
|
|
63
|
-
/**
|
|
77
|
+
/**
|
|
78
|
+
* The withdrawal transaction that has been generated by this request.
|
|
79
|
+
*
|
|
80
|
+
* @deprecated Use `withdrawals` instead.
|
|
81
|
+
**/
|
|
64
82
|
public readonly withdrawalId?: string | undefined,
|
|
83
|
+
/** The idempotency key of the withdrawal request. **/
|
|
84
|
+
public readonly idempotencyKey?: string | undefined,
|
|
65
85
|
) {
|
|
66
86
|
autoBind(this);
|
|
67
87
|
}
|
|
@@ -69,14 +89,16 @@ class WithdrawalRequest implements Entity {
|
|
|
69
89
|
public async getChannelClosingTransactions(
|
|
70
90
|
client: LightsparkClient,
|
|
71
91
|
first: number | undefined = undefined,
|
|
92
|
+
after: string | undefined = undefined,
|
|
72
93
|
): Promise<WithdrawalRequestToChannelClosingTransactionsConnection> {
|
|
73
94
|
return (await client.executeRawQuery({
|
|
74
95
|
queryPayload: `
|
|
75
|
-
query FetchWithdrawalRequestToChannelClosingTransactionsConnection($entity_id: ID!, $first: Int) {
|
|
96
|
+
query FetchWithdrawalRequestToChannelClosingTransactionsConnection($entity_id: ID!, $first: Int, $after: String) {
|
|
76
97
|
entity(id: $entity_id) {
|
|
77
98
|
... on WithdrawalRequest {
|
|
78
|
-
channel_closing_transactions(, first: $first) {
|
|
99
|
+
channel_closing_transactions(, first: $first, after: $after) {
|
|
79
100
|
__typename
|
|
101
|
+
withdrawal_request_to_channel_closing_transactions_connection_count: count
|
|
80
102
|
withdrawal_request_to_channel_closing_transactions_connection_page_info: page_info {
|
|
81
103
|
__typename
|
|
82
104
|
page_info_has_next_page: has_next_page
|
|
@@ -84,7 +106,6 @@ query FetchWithdrawalRequestToChannelClosingTransactionsConnection($entity_id: I
|
|
|
84
106
|
page_info_start_cursor: start_cursor
|
|
85
107
|
page_info_end_cursor: end_cursor
|
|
86
108
|
}
|
|
87
|
-
withdrawal_request_to_channel_closing_transactions_connection_count: count
|
|
88
109
|
withdrawal_request_to_channel_closing_transactions_connection_entities: entities {
|
|
89
110
|
__typename
|
|
90
111
|
channel_closing_transaction_id: id
|
|
@@ -122,7 +143,7 @@ query FetchWithdrawalRequestToChannelClosingTransactionsConnection($entity_id: I
|
|
|
122
143
|
}
|
|
123
144
|
}
|
|
124
145
|
`,
|
|
125
|
-
variables: { entity_id: this.id, first: first },
|
|
146
|
+
variables: { entity_id: this.id, first: first, after: after },
|
|
126
147
|
constructObject: (json) => {
|
|
127
148
|
const connection = json["entity"]["channel_closing_transactions"];
|
|
128
149
|
return WithdrawalRequestToChannelClosingTransactionsConnectionFromJson(
|
|
@@ -135,14 +156,16 @@ query FetchWithdrawalRequestToChannelClosingTransactionsConnection($entity_id: I
|
|
|
135
156
|
public async getChannelOpeningTransactions(
|
|
136
157
|
client: LightsparkClient,
|
|
137
158
|
first: number | undefined = undefined,
|
|
159
|
+
after: string | undefined = undefined,
|
|
138
160
|
): Promise<WithdrawalRequestToChannelOpeningTransactionsConnection> {
|
|
139
161
|
return (await client.executeRawQuery({
|
|
140
162
|
queryPayload: `
|
|
141
|
-
query FetchWithdrawalRequestToChannelOpeningTransactionsConnection($entity_id: ID!, $first: Int) {
|
|
163
|
+
query FetchWithdrawalRequestToChannelOpeningTransactionsConnection($entity_id: ID!, $first: Int, $after: String) {
|
|
142
164
|
entity(id: $entity_id) {
|
|
143
165
|
... on WithdrawalRequest {
|
|
144
|
-
channel_opening_transactions(, first: $first) {
|
|
166
|
+
channel_opening_transactions(, first: $first, after: $after) {
|
|
145
167
|
__typename
|
|
168
|
+
withdrawal_request_to_channel_opening_transactions_connection_count: count
|
|
146
169
|
withdrawal_request_to_channel_opening_transactions_connection_page_info: page_info {
|
|
147
170
|
__typename
|
|
148
171
|
page_info_has_next_page: has_next_page
|
|
@@ -150,7 +173,6 @@ query FetchWithdrawalRequestToChannelOpeningTransactionsConnection($entity_id: I
|
|
|
150
173
|
page_info_start_cursor: start_cursor
|
|
151
174
|
page_info_end_cursor: end_cursor
|
|
152
175
|
}
|
|
153
|
-
withdrawal_request_to_channel_opening_transactions_connection_count: count
|
|
154
176
|
withdrawal_request_to_channel_opening_transactions_connection_entities: entities {
|
|
155
177
|
__typename
|
|
156
178
|
channel_opening_transaction_id: id
|
|
@@ -188,7 +210,7 @@ query FetchWithdrawalRequestToChannelOpeningTransactionsConnection($entity_id: I
|
|
|
188
210
|
}
|
|
189
211
|
}
|
|
190
212
|
`,
|
|
191
|
-
variables: { entity_id: this.id, first: first },
|
|
213
|
+
variables: { entity_id: this.id, first: first, after: after },
|
|
192
214
|
constructObject: (json) => {
|
|
193
215
|
const connection = json["entity"]["channel_opening_transactions"];
|
|
194
216
|
return WithdrawalRequestToChannelOpeningTransactionsConnectionFromJson(
|
|
@@ -198,6 +220,63 @@ query FetchWithdrawalRequestToChannelOpeningTransactionsConnection($entity_id: I
|
|
|
198
220
|
}))!;
|
|
199
221
|
}
|
|
200
222
|
|
|
223
|
+
public async getWithdrawals(
|
|
224
|
+
client: LightsparkClient,
|
|
225
|
+
first: number | undefined = undefined,
|
|
226
|
+
): Promise<WithdrawalRequestToWithdrawalsConnection> {
|
|
227
|
+
return (await client.executeRawQuery({
|
|
228
|
+
queryPayload: `
|
|
229
|
+
query FetchWithdrawalRequestToWithdrawalsConnection($entity_id: ID!, $first: Int) {
|
|
230
|
+
entity(id: $entity_id) {
|
|
231
|
+
... on WithdrawalRequest {
|
|
232
|
+
withdrawals(, first: $first) {
|
|
233
|
+
__typename
|
|
234
|
+
withdrawal_request_to_withdrawals_connection_count: count
|
|
235
|
+
withdrawal_request_to_withdrawals_connection_entities: entities {
|
|
236
|
+
__typename
|
|
237
|
+
withdrawal_id: id
|
|
238
|
+
withdrawal_created_at: created_at
|
|
239
|
+
withdrawal_updated_at: updated_at
|
|
240
|
+
withdrawal_status: status
|
|
241
|
+
withdrawal_resolved_at: resolved_at
|
|
242
|
+
withdrawal_amount: amount {
|
|
243
|
+
__typename
|
|
244
|
+
currency_amount_original_value: original_value
|
|
245
|
+
currency_amount_original_unit: original_unit
|
|
246
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
247
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
248
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
249
|
+
}
|
|
250
|
+
withdrawal_transaction_hash: transaction_hash
|
|
251
|
+
withdrawal_fees: fees {
|
|
252
|
+
__typename
|
|
253
|
+
currency_amount_original_value: original_value
|
|
254
|
+
currency_amount_original_unit: original_unit
|
|
255
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
256
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
257
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
258
|
+
}
|
|
259
|
+
withdrawal_block_hash: block_hash
|
|
260
|
+
withdrawal_block_height: block_height
|
|
261
|
+
withdrawal_destination_addresses: destination_addresses
|
|
262
|
+
withdrawal_num_confirmations: num_confirmations
|
|
263
|
+
withdrawal_origin: origin {
|
|
264
|
+
id
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
`,
|
|
272
|
+
variables: { entity_id: this.id, first: first },
|
|
273
|
+
constructObject: (json) => {
|
|
274
|
+
const connection = json["entity"]["withdrawals"];
|
|
275
|
+
return WithdrawalRequestToWithdrawalsConnectionFromJson(connection);
|
|
276
|
+
},
|
|
277
|
+
}))!;
|
|
278
|
+
}
|
|
279
|
+
|
|
201
280
|
static getWithdrawalRequestQuery(id: string): Query<WithdrawalRequest> {
|
|
202
281
|
return {
|
|
203
282
|
queryPayload: `
|
|
@@ -232,11 +311,15 @@ ${FRAGMENT}
|
|
|
232
311
|
withdrawal_request_amount_withdrawn: this.amountWithdrawn
|
|
233
312
|
? CurrencyAmountToJson(this.amountWithdrawn)
|
|
234
313
|
: undefined,
|
|
314
|
+
withdrawal_request_total_fees: this.totalFees
|
|
315
|
+
? CurrencyAmountToJson(this.totalFees)
|
|
316
|
+
: undefined,
|
|
235
317
|
withdrawal_request_bitcoin_address: this.bitcoinAddress,
|
|
236
318
|
withdrawal_request_withdrawal_mode: this.withdrawalMode,
|
|
237
319
|
withdrawal_request_status: this.status,
|
|
238
320
|
withdrawal_request_completed_at: this.completedAt,
|
|
239
321
|
withdrawal_request_withdrawal: { id: this.withdrawalId } ?? undefined,
|
|
322
|
+
withdrawal_request_idempotency_key: this.idempotencyKey,
|
|
240
323
|
};
|
|
241
324
|
}
|
|
242
325
|
}
|
|
@@ -260,8 +343,12 @@ export const WithdrawalRequestFromJson = (obj: any): WithdrawalRequest => {
|
|
|
260
343
|
!!obj["withdrawal_request_amount_withdrawn"]
|
|
261
344
|
? CurrencyAmountFromJson(obj["withdrawal_request_amount_withdrawn"])
|
|
262
345
|
: undefined,
|
|
346
|
+
!!obj["withdrawal_request_total_fees"]
|
|
347
|
+
? CurrencyAmountFromJson(obj["withdrawal_request_total_fees"])
|
|
348
|
+
: undefined,
|
|
263
349
|
obj["withdrawal_request_completed_at"],
|
|
264
350
|
obj["withdrawal_request_withdrawal"]?.id ?? undefined,
|
|
351
|
+
obj["withdrawal_request_idempotency_key"],
|
|
265
352
|
);
|
|
266
353
|
};
|
|
267
354
|
|
|
@@ -303,6 +390,14 @@ fragment WithdrawalRequestFragment on WithdrawalRequest {
|
|
|
303
390
|
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
304
391
|
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
305
392
|
}
|
|
393
|
+
withdrawal_request_total_fees: total_fees {
|
|
394
|
+
__typename
|
|
395
|
+
currency_amount_original_value: original_value
|
|
396
|
+
currency_amount_original_unit: original_unit
|
|
397
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
398
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
399
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
400
|
+
}
|
|
306
401
|
withdrawal_request_bitcoin_address: bitcoin_address
|
|
307
402
|
withdrawal_request_withdrawal_mode: withdrawal_mode
|
|
308
403
|
withdrawal_request_status: status
|
|
@@ -310,6 +405,7 @@ fragment WithdrawalRequestFragment on WithdrawalRequest {
|
|
|
310
405
|
withdrawal_request_withdrawal: withdrawal {
|
|
311
406
|
id
|
|
312
407
|
}
|
|
408
|
+
withdrawal_request_idempotency_key: idempotency_key
|
|
313
409
|
}`;
|
|
314
410
|
|
|
315
411
|
export default WithdrawalRequest;
|
|
@@ -9,45 +9,50 @@ import type PageInfo from "./PageInfo.js";
|
|
|
9
9
|
import { PageInfoFromJson, PageInfoToJson } from "./PageInfo.js";
|
|
10
10
|
|
|
11
11
|
interface WithdrawalRequestToChannelClosingTransactionsConnection {
|
|
12
|
-
/** An object that holds pagination information about the objects in this connection. **/
|
|
13
|
-
pageInfo: PageInfo;
|
|
14
|
-
|
|
15
12
|
/**
|
|
16
13
|
* The total count of objects in this connection, using the current filters. It is different
|
|
17
14
|
* from the number of objects returned in the current page (in the `entities` field).
|
|
18
15
|
**/
|
|
19
16
|
count: number;
|
|
20
17
|
|
|
18
|
+
/** An object that holds pagination information about the objects in this connection. **/
|
|
19
|
+
pageInfo: PageInfo;
|
|
20
|
+
|
|
21
21
|
/** The channel closing transactions for the current page of this connection. **/
|
|
22
22
|
entities: ChannelClosingTransaction[];
|
|
23
|
+
|
|
24
|
+
/** The typename of the object **/
|
|
25
|
+
typename: string;
|
|
23
26
|
}
|
|
24
27
|
|
|
25
28
|
export const WithdrawalRequestToChannelClosingTransactionsConnectionFromJson = (
|
|
26
29
|
obj: any,
|
|
27
30
|
): WithdrawalRequestToChannelClosingTransactionsConnection => {
|
|
28
31
|
return {
|
|
32
|
+
count:
|
|
33
|
+
obj[
|
|
34
|
+
"withdrawal_request_to_channel_closing_transactions_connection_count"
|
|
35
|
+
],
|
|
29
36
|
pageInfo: PageInfoFromJson(
|
|
30
37
|
obj[
|
|
31
38
|
"withdrawal_request_to_channel_closing_transactions_connection_page_info"
|
|
32
39
|
],
|
|
33
40
|
),
|
|
34
|
-
count:
|
|
35
|
-
obj[
|
|
36
|
-
"withdrawal_request_to_channel_closing_transactions_connection_count"
|
|
37
|
-
],
|
|
38
41
|
entities: obj[
|
|
39
42
|
"withdrawal_request_to_channel_closing_transactions_connection_entities"
|
|
40
43
|
].map((e) => ChannelClosingTransactionFromJson(e)),
|
|
44
|
+
typename: "WithdrawalRequestToChannelClosingTransactionsConnection",
|
|
41
45
|
} as WithdrawalRequestToChannelClosingTransactionsConnection;
|
|
42
46
|
};
|
|
43
47
|
export const WithdrawalRequestToChannelClosingTransactionsConnectionToJson = (
|
|
44
48
|
obj: WithdrawalRequestToChannelClosingTransactionsConnection,
|
|
45
49
|
): any => {
|
|
46
50
|
return {
|
|
47
|
-
|
|
48
|
-
PageInfoToJson(obj.pageInfo),
|
|
51
|
+
__typename: "WithdrawalRequestToChannelClosingTransactionsConnection",
|
|
49
52
|
withdrawal_request_to_channel_closing_transactions_connection_count:
|
|
50
53
|
obj.count,
|
|
54
|
+
withdrawal_request_to_channel_closing_transactions_connection_page_info:
|
|
55
|
+
PageInfoToJson(obj.pageInfo),
|
|
51
56
|
withdrawal_request_to_channel_closing_transactions_connection_entities:
|
|
52
57
|
obj.entities.map((e) => ChannelClosingTransactionToJson(e)),
|
|
53
58
|
};
|
|
@@ -56,6 +61,7 @@ export const WithdrawalRequestToChannelClosingTransactionsConnectionToJson = (
|
|
|
56
61
|
export const FRAGMENT = `
|
|
57
62
|
fragment WithdrawalRequestToChannelClosingTransactionsConnectionFragment on WithdrawalRequestToChannelClosingTransactionsConnection {
|
|
58
63
|
__typename
|
|
64
|
+
withdrawal_request_to_channel_closing_transactions_connection_count: count
|
|
59
65
|
withdrawal_request_to_channel_closing_transactions_connection_page_info: page_info {
|
|
60
66
|
__typename
|
|
61
67
|
page_info_has_next_page: has_next_page
|
|
@@ -63,7 +69,6 @@ fragment WithdrawalRequestToChannelClosingTransactionsConnectionFragment on With
|
|
|
63
69
|
page_info_start_cursor: start_cursor
|
|
64
70
|
page_info_end_cursor: end_cursor
|
|
65
71
|
}
|
|
66
|
-
withdrawal_request_to_channel_closing_transactions_connection_count: count
|
|
67
72
|
withdrawal_request_to_channel_closing_transactions_connection_entities: entities {
|
|
68
73
|
id
|
|
69
74
|
}
|
|
@@ -9,45 +9,50 @@ import type PageInfo from "./PageInfo.js";
|
|
|
9
9
|
import { PageInfoFromJson, PageInfoToJson } from "./PageInfo.js";
|
|
10
10
|
|
|
11
11
|
interface WithdrawalRequestToChannelOpeningTransactionsConnection {
|
|
12
|
-
/** An object that holds pagination information about the objects in this connection. **/
|
|
13
|
-
pageInfo: PageInfo;
|
|
14
|
-
|
|
15
12
|
/**
|
|
16
13
|
* The total count of objects in this connection, using the current filters. It is different
|
|
17
14
|
* from the number of objects returned in the current page (in the `entities` field).
|
|
18
15
|
**/
|
|
19
16
|
count: number;
|
|
20
17
|
|
|
18
|
+
/** An object that holds pagination information about the objects in this connection. **/
|
|
19
|
+
pageInfo: PageInfo;
|
|
20
|
+
|
|
21
21
|
/** The channel opening transactions for the current page of this connection. **/
|
|
22
22
|
entities: ChannelOpeningTransaction[];
|
|
23
|
+
|
|
24
|
+
/** The typename of the object **/
|
|
25
|
+
typename: string;
|
|
23
26
|
}
|
|
24
27
|
|
|
25
28
|
export const WithdrawalRequestToChannelOpeningTransactionsConnectionFromJson = (
|
|
26
29
|
obj: any,
|
|
27
30
|
): WithdrawalRequestToChannelOpeningTransactionsConnection => {
|
|
28
31
|
return {
|
|
32
|
+
count:
|
|
33
|
+
obj[
|
|
34
|
+
"withdrawal_request_to_channel_opening_transactions_connection_count"
|
|
35
|
+
],
|
|
29
36
|
pageInfo: PageInfoFromJson(
|
|
30
37
|
obj[
|
|
31
38
|
"withdrawal_request_to_channel_opening_transactions_connection_page_info"
|
|
32
39
|
],
|
|
33
40
|
),
|
|
34
|
-
count:
|
|
35
|
-
obj[
|
|
36
|
-
"withdrawal_request_to_channel_opening_transactions_connection_count"
|
|
37
|
-
],
|
|
38
41
|
entities: obj[
|
|
39
42
|
"withdrawal_request_to_channel_opening_transactions_connection_entities"
|
|
40
43
|
].map((e) => ChannelOpeningTransactionFromJson(e)),
|
|
44
|
+
typename: "WithdrawalRequestToChannelOpeningTransactionsConnection",
|
|
41
45
|
} as WithdrawalRequestToChannelOpeningTransactionsConnection;
|
|
42
46
|
};
|
|
43
47
|
export const WithdrawalRequestToChannelOpeningTransactionsConnectionToJson = (
|
|
44
48
|
obj: WithdrawalRequestToChannelOpeningTransactionsConnection,
|
|
45
49
|
): any => {
|
|
46
50
|
return {
|
|
47
|
-
|
|
48
|
-
PageInfoToJson(obj.pageInfo),
|
|
51
|
+
__typename: "WithdrawalRequestToChannelOpeningTransactionsConnection",
|
|
49
52
|
withdrawal_request_to_channel_opening_transactions_connection_count:
|
|
50
53
|
obj.count,
|
|
54
|
+
withdrawal_request_to_channel_opening_transactions_connection_page_info:
|
|
55
|
+
PageInfoToJson(obj.pageInfo),
|
|
51
56
|
withdrawal_request_to_channel_opening_transactions_connection_entities:
|
|
52
57
|
obj.entities.map((e) => ChannelOpeningTransactionToJson(e)),
|
|
53
58
|
};
|
|
@@ -56,6 +61,7 @@ export const WithdrawalRequestToChannelOpeningTransactionsConnectionToJson = (
|
|
|
56
61
|
export const FRAGMENT = `
|
|
57
62
|
fragment WithdrawalRequestToChannelOpeningTransactionsConnectionFragment on WithdrawalRequestToChannelOpeningTransactionsConnection {
|
|
58
63
|
__typename
|
|
64
|
+
withdrawal_request_to_channel_opening_transactions_connection_count: count
|
|
59
65
|
withdrawal_request_to_channel_opening_transactions_connection_page_info: page_info {
|
|
60
66
|
__typename
|
|
61
67
|
page_info_has_next_page: has_next_page
|
|
@@ -63,7 +69,6 @@ fragment WithdrawalRequestToChannelOpeningTransactionsConnectionFragment on With
|
|
|
63
69
|
page_info_start_cursor: start_cursor
|
|
64
70
|
page_info_end_cursor: end_cursor
|
|
65
71
|
}
|
|
66
|
-
withdrawal_request_to_channel_opening_transactions_connection_count: count
|
|
67
72
|
withdrawal_request_to_channel_opening_transactions_connection_entities: entities {
|
|
68
73
|
id
|
|
69
74
|
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
|
+
|
|
3
|
+
import type Withdrawal from "./Withdrawal.js";
|
|
4
|
+
import { WithdrawalFromJson, WithdrawalToJson } from "./Withdrawal.js";
|
|
5
|
+
|
|
6
|
+
interface WithdrawalRequestToWithdrawalsConnection {
|
|
7
|
+
/**
|
|
8
|
+
* The total count of objects in this connection, using the current filters. It is different
|
|
9
|
+
* from the number of objects returned in the current page (in the `entities` field).
|
|
10
|
+
**/
|
|
11
|
+
count: number;
|
|
12
|
+
|
|
13
|
+
/** The withdrawals for the current page of this connection. **/
|
|
14
|
+
entities: Withdrawal[];
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const WithdrawalRequestToWithdrawalsConnectionFromJson = (
|
|
18
|
+
obj: any,
|
|
19
|
+
): WithdrawalRequestToWithdrawalsConnection => {
|
|
20
|
+
return {
|
|
21
|
+
count: obj["withdrawal_request_to_withdrawals_connection_count"],
|
|
22
|
+
entities: obj["withdrawal_request_to_withdrawals_connection_entities"].map(
|
|
23
|
+
(e) => WithdrawalFromJson(e),
|
|
24
|
+
),
|
|
25
|
+
} as WithdrawalRequestToWithdrawalsConnection;
|
|
26
|
+
};
|
|
27
|
+
export const WithdrawalRequestToWithdrawalsConnectionToJson = (
|
|
28
|
+
obj: WithdrawalRequestToWithdrawalsConnection,
|
|
29
|
+
): any => {
|
|
30
|
+
return {
|
|
31
|
+
withdrawal_request_to_withdrawals_connection_count: obj.count,
|
|
32
|
+
withdrawal_request_to_withdrawals_connection_entities: obj.entities.map(
|
|
33
|
+
(e) => WithdrawalToJson(e),
|
|
34
|
+
),
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export const FRAGMENT = `
|
|
39
|
+
fragment WithdrawalRequestToWithdrawalsConnectionFragment on WithdrawalRequestToWithdrawalsConnection {
|
|
40
|
+
__typename
|
|
41
|
+
withdrawal_request_to_withdrawals_connection_count: count
|
|
42
|
+
withdrawal_request_to_withdrawals_connection_entities: entities {
|
|
43
|
+
id
|
|
44
|
+
}
|
|
45
|
+
}`;
|
|
46
|
+
|
|
47
|
+
export default WithdrawalRequestToWithdrawalsConnection;
|
package/src/objects/index.ts
CHANGED
|
@@ -63,6 +63,8 @@ export { default as DeleteApiTokenInput } from "./DeleteApiTokenInput.js";
|
|
|
63
63
|
export { default as DeleteApiTokenOutput } from "./DeleteApiTokenOutput.js";
|
|
64
64
|
export { default as Deposit, getDepositQuery } from "./Deposit.js";
|
|
65
65
|
export { default as Entity } from "./Entity.js";
|
|
66
|
+
export { default as FailHtlcsInput } from "./FailHtlcsInput.js";
|
|
67
|
+
export { default as FailHtlcsOutput } from "./FailHtlcsOutput.js";
|
|
66
68
|
export { default as FeeEstimate } from "./FeeEstimate.js";
|
|
67
69
|
export { default as FundNodeInput } from "./FundNodeInput.js";
|
|
68
70
|
export { default as FundNodeOutput } from "./FundNodeOutput.js";
|
|
@@ -83,6 +85,8 @@ export { default as IncomingPaymentsForInvoiceQueryInput } from "./IncomingPayme
|
|
|
83
85
|
export { default as IncomingPaymentsForInvoiceQueryOutput } from "./IncomingPaymentsForInvoiceQueryOutput.js";
|
|
84
86
|
export { default as Invoice, getInvoiceQuery } from "./Invoice.js";
|
|
85
87
|
export { default as InvoiceData } from "./InvoiceData.js";
|
|
88
|
+
export { default as InvoiceForPaymentHashInput } from "./InvoiceForPaymentHashInput.js";
|
|
89
|
+
export { default as InvoiceForPaymentHashOutput } from "./InvoiceForPaymentHashOutput.js";
|
|
86
90
|
export { default as InvoiceType } from "./InvoiceType.js";
|
|
87
91
|
export { default as LightningFeeEstimateForInvoiceInput } from "./LightningFeeEstimateForInvoiceInput.js";
|
|
88
92
|
export { default as LightningFeeEstimateForNodeInput } from "./LightningFeeEstimateForNodeInput.js";
|
|
@@ -110,6 +114,7 @@ export { default as Node, getNodeQuery } from "./Node.js";
|
|
|
110
114
|
export { default as NodeAddress } from "./NodeAddress.js";
|
|
111
115
|
export { default as NodeAddressType } from "./NodeAddressType.js";
|
|
112
116
|
export { default as NodeToAddressesConnection } from "./NodeToAddressesConnection.js";
|
|
117
|
+
export { default as OnChainFeeTarget } from "./OnChainFeeTarget.js";
|
|
113
118
|
export {
|
|
114
119
|
default as OnChainTransaction,
|
|
115
120
|
getOnChainTransactionQuery,
|
|
@@ -118,9 +123,13 @@ export { default as OutgoingPayment } from "./OutgoingPayment.js";
|
|
|
118
123
|
export { default as OutgoingPaymentAttempt } from "./OutgoingPaymentAttempt.js";
|
|
119
124
|
export { default as OutgoingPaymentAttemptStatus } from "./OutgoingPaymentAttemptStatus.js";
|
|
120
125
|
export { default as OutgoingPaymentAttemptToHopsConnection } from "./OutgoingPaymentAttemptToHopsConnection.js";
|
|
126
|
+
export { default as OutgoingPaymentForIdempotencyKeyInput } from "./OutgoingPaymentForIdempotencyKeyInput.js";
|
|
127
|
+
export { default as OutgoingPaymentForIdempotencyKeyOutput } from "./OutgoingPaymentForIdempotencyKeyOutput.js";
|
|
121
128
|
export { default as OutgoingPaymentToAttemptsConnection } from "./OutgoingPaymentToAttemptsConnection.js";
|
|
122
129
|
export { default as OutgoingPaymentsForInvoiceQueryInput } from "./OutgoingPaymentsForInvoiceQueryInput.js";
|
|
123
130
|
export { default as OutgoingPaymentsForInvoiceQueryOutput } from "./OutgoingPaymentsForInvoiceQueryOutput.js";
|
|
131
|
+
export { default as OutgoingPaymentsForPaymentHashQueryInput } from "./OutgoingPaymentsForPaymentHashQueryInput.js";
|
|
132
|
+
export { default as OutgoingPaymentsForPaymentHashQueryOutput } from "./OutgoingPaymentsForPaymentHashQueryOutput.js";
|
|
124
133
|
export { default as PageInfo } from "./PageInfo.js";
|
|
125
134
|
export { default as PayInvoiceInput } from "./PayInvoiceInput.js";
|
|
126
135
|
export { default as PayInvoiceOutput } from "./PayInvoiceOutput.js";
|
|
@@ -197,3 +206,4 @@ export { default as WithdrawalRequest } from "./WithdrawalRequest.js";
|
|
|
197
206
|
export { default as WithdrawalRequestStatus } from "./WithdrawalRequestStatus.js";
|
|
198
207
|
export { default as WithdrawalRequestToChannelClosingTransactionsConnection } from "./WithdrawalRequestToChannelClosingTransactionsConnection.js";
|
|
199
208
|
export { default as WithdrawalRequestToChannelOpeningTransactionsConnection } from "./WithdrawalRequestToChannelOpeningTransactionsConnection.js";
|
|
209
|
+
export { default as WithdrawalRequestToWithdrawalsConnection } from "./WithdrawalRequestToWithdrawalsConnection.js";
|
package/src/webhooks.ts
CHANGED