@lightsparkdev/lightspark-sdk 1.9.14 → 1.9.16
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 +17 -0
- package/dist/{chunk-K62FULET.js → chunk-TWQHQTN7.js} +50 -34
- package/dist/{index-DfbWBZ5s.d.cts → index-C753xMTP.d.cts} +13 -5
- package/dist/{index-J9dgrFWx.d.ts → index-COyfARTo.d.ts} +13 -5
- package/dist/index.cjs +128 -73
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +68 -25
- package/dist/objects/index.d.cts +1 -1
- package/dist/objects/index.d.ts +1 -1
- package/dist/objects/index.js +1 -1
- package/package.json +3 -3
- package/src/client.ts +36 -6
- package/src/graphql/FailHtlcs.ts +19 -0
- package/src/graphql/RequestWithdrawal.ts +2 -0
package/dist/index.cjs
CHANGED
|
@@ -180,7 +180,7 @@ var import_core29 = require("@lightsparkdev/core");
|
|
|
180
180
|
// package.json
|
|
181
181
|
var package_default = {
|
|
182
182
|
name: "@lightsparkdev/lightspark-sdk",
|
|
183
|
-
version: "1.9.
|
|
183
|
+
version: "1.9.16",
|
|
184
184
|
description: "Lightspark JS SDK",
|
|
185
185
|
author: "Lightspark Inc.",
|
|
186
186
|
keywords: [
|
|
@@ -250,8 +250,8 @@ var package_default = {
|
|
|
250
250
|
},
|
|
251
251
|
license: "Apache-2.0",
|
|
252
252
|
dependencies: {
|
|
253
|
-
"@lightsparkdev/core": "1.4.
|
|
254
|
-
"@lightsparkdev/crypto-wasm": "0.1.
|
|
253
|
+
"@lightsparkdev/core": "1.4.9",
|
|
254
|
+
"@lightsparkdev/crypto-wasm": "0.1.23",
|
|
255
255
|
dayjs: "^1.11.7",
|
|
256
256
|
dotenv: "^16.3.1",
|
|
257
257
|
graphql: "^16.6.0",
|
|
@@ -3936,6 +3936,37 @@ var DeleteApiToken = `
|
|
|
3936
3936
|
}
|
|
3937
3937
|
`;
|
|
3938
3938
|
|
|
3939
|
+
// src/objects/FailHtlcsOutput.ts
|
|
3940
|
+
var FailHtlcsOutputFromJson = (obj) => {
|
|
3941
|
+
return {
|
|
3942
|
+
invoiceId: obj["fail_htlcs_output_invoice"].id
|
|
3943
|
+
};
|
|
3944
|
+
};
|
|
3945
|
+
var FRAGMENT15 = `
|
|
3946
|
+
fragment FailHtlcsOutputFragment on FailHtlcsOutput {
|
|
3947
|
+
__typename
|
|
3948
|
+
fail_htlcs_output_invoice: invoice {
|
|
3949
|
+
id
|
|
3950
|
+
}
|
|
3951
|
+
}`;
|
|
3952
|
+
|
|
3953
|
+
// src/graphql/FailHtlcs.ts
|
|
3954
|
+
var FailHtlcs = `
|
|
3955
|
+
mutation FailHtlcs(
|
|
3956
|
+
$invoice_id: ID!,
|
|
3957
|
+
$cancel_invoice: Boolean!
|
|
3958
|
+
) {
|
|
3959
|
+
fail_htlcs(input: {
|
|
3960
|
+
invoice_id: $invoice_id,
|
|
3961
|
+
cancel_invoice: $cancel_invoice
|
|
3962
|
+
}) {
|
|
3963
|
+
...FailHtlcsOutputFragment
|
|
3964
|
+
}
|
|
3965
|
+
}
|
|
3966
|
+
|
|
3967
|
+
${FRAGMENT15}
|
|
3968
|
+
`;
|
|
3969
|
+
|
|
3939
3970
|
// src/graphql/FetchUmaInvitation.ts
|
|
3940
3971
|
var FetchUmaInvitation = `
|
|
3941
3972
|
query FetchUmaInvitation(
|
|
@@ -4000,7 +4031,7 @@ query InvoiceForPaymentHash($payment_hash: Hash32!) {
|
|
|
4000
4031
|
`;
|
|
4001
4032
|
|
|
4002
4033
|
// src/objects/LightningFeeEstimateOutput.ts
|
|
4003
|
-
var
|
|
4034
|
+
var FRAGMENT16 = `
|
|
4004
4035
|
fragment LightningFeeEstimateOutputFragment on LightningFeeEstimateOutput {
|
|
4005
4036
|
__typename
|
|
4006
4037
|
lightning_fee_estimate_output_fee_estimate: fee_estimate {
|
|
@@ -4029,7 +4060,7 @@ var LightningFeeEstimateForInvoice = `
|
|
|
4029
4060
|
}
|
|
4030
4061
|
}
|
|
4031
4062
|
|
|
4032
|
-
${
|
|
4063
|
+
${FRAGMENT16}
|
|
4033
4064
|
`;
|
|
4034
4065
|
|
|
4035
4066
|
// src/graphql/LightningFeeEstimateForNode.ts
|
|
@@ -4048,7 +4079,7 @@ var LightningFeeEstimateForNode = `
|
|
|
4048
4079
|
}
|
|
4049
4080
|
}
|
|
4050
4081
|
|
|
4051
|
-
${
|
|
4082
|
+
${FRAGMENT16}
|
|
4052
4083
|
`;
|
|
4053
4084
|
|
|
4054
4085
|
// src/graphql/LookupUmaAddress.ts
|
|
@@ -4202,7 +4233,7 @@ var HopFromJson = (obj) => {
|
|
|
4202
4233
|
expiryBlockHeight: obj["hop_expiry_block_height"]
|
|
4203
4234
|
};
|
|
4204
4235
|
};
|
|
4205
|
-
var
|
|
4236
|
+
var FRAGMENT17 = `
|
|
4206
4237
|
fragment HopFragment on Hop {
|
|
4207
4238
|
__typename
|
|
4208
4239
|
hop_id: id
|
|
@@ -4242,7 +4273,7 @@ query GetHop($id: ID!) {
|
|
|
4242
4273
|
}
|
|
4243
4274
|
}
|
|
4244
4275
|
|
|
4245
|
-
${
|
|
4276
|
+
${FRAGMENT17}
|
|
4246
4277
|
`,
|
|
4247
4278
|
variables: { id },
|
|
4248
4279
|
constructObject: (data) => (0, import_core15.isObject)(data) && "entity" in data && (0, import_core15.isObject)(data.entity) ? HopFromJson(data.entity) : null
|
|
@@ -4348,7 +4379,7 @@ query GetOutgoingPaymentAttempt($id: ID!) {
|
|
|
4348
4379
|
}
|
|
4349
4380
|
}
|
|
4350
4381
|
|
|
4351
|
-
${
|
|
4382
|
+
${FRAGMENT18}
|
|
4352
4383
|
`,
|
|
4353
4384
|
variables: { id },
|
|
4354
4385
|
constructObject: (data) => (0, import_core16.isObject)(data) && "entity" in data && (0, import_core16.isObject)(data.entity) ? OutgoingPaymentAttemptFromJson(data.entity) : null
|
|
@@ -4389,7 +4420,7 @@ var OutgoingPaymentAttemptFromJson = (obj) => {
|
|
|
4389
4420
|
obj["outgoing_payment_attempt_channel_snapshot"]?.id ?? void 0
|
|
4390
4421
|
);
|
|
4391
4422
|
};
|
|
4392
|
-
var
|
|
4423
|
+
var FRAGMENT18 = `
|
|
4393
4424
|
fragment OutgoingPaymentAttemptFragment on OutgoingPaymentAttempt {
|
|
4394
4425
|
__typename
|
|
4395
4426
|
outgoing_payment_attempt_id: id
|
|
@@ -4608,7 +4639,7 @@ query GetOutgoingPayment($id: ID!) {
|
|
|
4608
4639
|
}
|
|
4609
4640
|
}
|
|
4610
4641
|
|
|
4611
|
-
${
|
|
4642
|
+
${FRAGMENT19}
|
|
4612
4643
|
`,
|
|
4613
4644
|
variables: { id },
|
|
4614
4645
|
constructObject: (data) => (0, import_core18.isObject)(data) && "entity" in data && (0, import_core18.isObject)(data.entity) ? OutgoingPaymentFromJson(data.entity) : null
|
|
@@ -4663,7 +4694,7 @@ var OutgoingPaymentFromJson = (obj) => {
|
|
|
4663
4694
|
obj["outgoing_payment_idempotency_key"]
|
|
4664
4695
|
);
|
|
4665
4696
|
};
|
|
4666
|
-
var
|
|
4697
|
+
var FRAGMENT19 = `
|
|
4667
4698
|
fragment OutgoingPaymentFragment on OutgoingPayment {
|
|
4668
4699
|
__typename
|
|
4669
4700
|
outgoing_payment_id: id
|
|
@@ -5028,7 +5059,7 @@ query OutgoingPaymentsForInvoice(
|
|
|
5028
5059
|
}
|
|
5029
5060
|
}
|
|
5030
5061
|
|
|
5031
|
-
${
|
|
5062
|
+
${FRAGMENT19}
|
|
5032
5063
|
`;
|
|
5033
5064
|
|
|
5034
5065
|
// src/graphql/OutgoingPaymentsForPaymentHash.ts
|
|
@@ -5047,7 +5078,7 @@ query OutgoingPaymentsForPaymentHash(
|
|
|
5047
5078
|
}
|
|
5048
5079
|
}
|
|
5049
5080
|
|
|
5050
|
-
${
|
|
5081
|
+
${FRAGMENT19}
|
|
5051
5082
|
`;
|
|
5052
5083
|
|
|
5053
5084
|
// src/graphql/PayInvoice.ts
|
|
@@ -5076,7 +5107,7 @@ var PayInvoice = `
|
|
|
5076
5107
|
}
|
|
5077
5108
|
}
|
|
5078
5109
|
|
|
5079
|
-
${
|
|
5110
|
+
${FRAGMENT19}
|
|
5080
5111
|
`;
|
|
5081
5112
|
|
|
5082
5113
|
// src/graphql/PayOffer.ts
|
|
@@ -5105,7 +5136,7 @@ var PayOffer = `
|
|
|
5105
5136
|
}
|
|
5106
5137
|
}
|
|
5107
5138
|
|
|
5108
|
-
${
|
|
5139
|
+
${FRAGMENT19}
|
|
5109
5140
|
`;
|
|
5110
5141
|
|
|
5111
5142
|
// src/graphql/PayUmaInvoice.ts
|
|
@@ -5134,7 +5165,7 @@ var PayUmaInvoice = `
|
|
|
5134
5165
|
}
|
|
5135
5166
|
}
|
|
5136
5167
|
|
|
5137
|
-
${
|
|
5168
|
+
${FRAGMENT19}
|
|
5138
5169
|
`;
|
|
5139
5170
|
|
|
5140
5171
|
// src/objects/PaymentRequest.ts
|
|
@@ -5158,7 +5189,7 @@ var PaymentRequestFromJson = (obj) => {
|
|
|
5158
5189
|
`Couldn't find a concrete type for interface PaymentRequest corresponding to the typename=${obj["__typename"]}`
|
|
5159
5190
|
);
|
|
5160
5191
|
};
|
|
5161
|
-
var
|
|
5192
|
+
var FRAGMENT20 = `
|
|
5162
5193
|
fragment PaymentRequestFragment on PaymentRequest {
|
|
5163
5194
|
__typename
|
|
5164
5195
|
... on Invoice {
|
|
@@ -5481,7 +5512,7 @@ query GetPaymentRequest($id: ID!) {
|
|
|
5481
5512
|
}
|
|
5482
5513
|
}
|
|
5483
5514
|
|
|
5484
|
-
${
|
|
5515
|
+
${FRAGMENT20}
|
|
5485
5516
|
`,
|
|
5486
5517
|
variables: { id },
|
|
5487
5518
|
constructObject: (data) => (0, import_core19.isObject)(data) && "entity" in data && (0, import_core19.isObject)(data.entity) ? PaymentRequestFromJson(data.entity) : null
|
|
@@ -5516,7 +5547,7 @@ query PaymentRequestsForNode(
|
|
|
5516
5547
|
}
|
|
5517
5548
|
}
|
|
5518
5549
|
|
|
5519
|
-
${
|
|
5550
|
+
${FRAGMENT20}
|
|
5520
5551
|
`;
|
|
5521
5552
|
|
|
5522
5553
|
// src/graphql/RegisterPayment.ts
|
|
@@ -5594,7 +5625,7 @@ var ChannelClosingTransactionFromJson = (obj) => {
|
|
|
5594
5625
|
channelId: obj["channel_closing_transaction_channel"]?.id ?? void 0
|
|
5595
5626
|
};
|
|
5596
5627
|
};
|
|
5597
|
-
var
|
|
5628
|
+
var FRAGMENT21 = `
|
|
5598
5629
|
fragment ChannelClosingTransactionFragment on ChannelClosingTransaction {
|
|
5599
5630
|
__typename
|
|
5600
5631
|
channel_closing_transaction_id: id
|
|
@@ -5638,7 +5669,7 @@ query GetChannelClosingTransaction($id: ID!) {
|
|
|
5638
5669
|
}
|
|
5639
5670
|
}
|
|
5640
5671
|
|
|
5641
|
-
${
|
|
5672
|
+
${FRAGMENT21}
|
|
5642
5673
|
`,
|
|
5643
5674
|
variables: { id },
|
|
5644
5675
|
constructObject: (data) => (0, import_core20.isObject)(data) && "entity" in data && (0, import_core20.isObject)(data.entity) ? ChannelClosingTransactionFromJson(data.entity) : null
|
|
@@ -5677,7 +5708,7 @@ var ChannelOpeningTransactionFromJson = (obj) => {
|
|
|
5677
5708
|
channelId: obj["channel_opening_transaction_channel"]?.id ?? void 0
|
|
5678
5709
|
};
|
|
5679
5710
|
};
|
|
5680
|
-
var
|
|
5711
|
+
var FRAGMENT22 = `
|
|
5681
5712
|
fragment ChannelOpeningTransactionFragment on ChannelOpeningTransaction {
|
|
5682
5713
|
__typename
|
|
5683
5714
|
channel_opening_transaction_id: id
|
|
@@ -5721,7 +5752,7 @@ query GetChannelOpeningTransaction($id: ID!) {
|
|
|
5721
5752
|
}
|
|
5722
5753
|
}
|
|
5723
5754
|
|
|
5724
|
-
${
|
|
5755
|
+
${FRAGMENT22}
|
|
5725
5756
|
`,
|
|
5726
5757
|
variables: { id },
|
|
5727
5758
|
constructObject: (data) => (0, import_core21.isObject)(data) && "entity" in data && (0, import_core21.isObject)(data.entity) ? ChannelOpeningTransactionFromJson(data.entity) : null
|
|
@@ -5760,7 +5791,7 @@ var WithdrawalFromJson = (obj) => {
|
|
|
5760
5791
|
numConfirmations: obj["withdrawal_num_confirmations"]
|
|
5761
5792
|
};
|
|
5762
5793
|
};
|
|
5763
|
-
var
|
|
5794
|
+
var FRAGMENT23 = `
|
|
5764
5795
|
fragment WithdrawalFragment on Withdrawal {
|
|
5765
5796
|
__typename
|
|
5766
5797
|
withdrawal_id: id
|
|
@@ -5804,7 +5835,7 @@ query GetWithdrawal($id: ID!) {
|
|
|
5804
5835
|
}
|
|
5805
5836
|
}
|
|
5806
5837
|
|
|
5807
|
-
${
|
|
5838
|
+
${FRAGMENT23}
|
|
5808
5839
|
`,
|
|
5809
5840
|
variables: { id },
|
|
5810
5841
|
constructObject: (data) => (0, import_core22.isObject)(data) && "entity" in data && (0, import_core22.isObject)(data.entity) ? WithdrawalFromJson(data.entity) : null
|
|
@@ -6030,7 +6061,7 @@ query GetWithdrawalRequest($id: ID!) {
|
|
|
6030
6061
|
}
|
|
6031
6062
|
}
|
|
6032
6063
|
|
|
6033
|
-
${
|
|
6064
|
+
${FRAGMENT24}
|
|
6034
6065
|
`,
|
|
6035
6066
|
variables: { id },
|
|
6036
6067
|
constructObject: (data) => (0, import_core23.isObject)(data) && "entity" in data && (0, import_core23.isObject)(data.entity) ? WithdrawalRequestFromJson(data.entity) : null
|
|
@@ -6079,7 +6110,7 @@ var WithdrawalRequestFromJson = (obj) => {
|
|
|
6079
6110
|
obj["withdrawal_request_idempotency_key"]
|
|
6080
6111
|
);
|
|
6081
6112
|
};
|
|
6082
|
-
var
|
|
6113
|
+
var FRAGMENT24 = `
|
|
6083
6114
|
fragment WithdrawalRequestFragment on WithdrawalRequest {
|
|
6084
6115
|
__typename
|
|
6085
6116
|
withdrawal_request_id: id
|
|
@@ -6144,12 +6175,14 @@ var RequestWithdrawal = `
|
|
|
6144
6175
|
$bitcoin_address: String!
|
|
6145
6176
|
$amount_sats: Long!
|
|
6146
6177
|
$withdrawal_mode: WithdrawalMode!
|
|
6178
|
+
$idempotency_key: String
|
|
6147
6179
|
) {
|
|
6148
6180
|
request_withdrawal(input: {
|
|
6149
6181
|
node_id: $node_id
|
|
6150
6182
|
bitcoin_address: $bitcoin_address
|
|
6151
6183
|
amount_sats: $amount_sats
|
|
6152
6184
|
withdrawal_mode: $withdrawal_mode
|
|
6185
|
+
idempotency_key: $idempotency_key
|
|
6153
6186
|
}) {
|
|
6154
6187
|
request {
|
|
6155
6188
|
...WithdrawalRequestFragment
|
|
@@ -6157,7 +6190,7 @@ var RequestWithdrawal = `
|
|
|
6157
6190
|
}
|
|
6158
6191
|
}
|
|
6159
6192
|
|
|
6160
|
-
${
|
|
6193
|
+
${FRAGMENT24}
|
|
6161
6194
|
`;
|
|
6162
6195
|
|
|
6163
6196
|
// src/graphql/ScreenNode.ts
|
|
@@ -6199,7 +6232,7 @@ var SendPayment = `
|
|
|
6199
6232
|
}
|
|
6200
6233
|
}
|
|
6201
6234
|
|
|
6202
|
-
${
|
|
6235
|
+
${FRAGMENT19}
|
|
6203
6236
|
`;
|
|
6204
6237
|
|
|
6205
6238
|
// src/objects/Transaction.ts
|
|
@@ -6357,7 +6390,7 @@ var TransactionFromJson = (obj) => {
|
|
|
6357
6390
|
`Couldn't find a concrete type for interface Transaction corresponding to the typename=${obj["__typename"]}`
|
|
6358
6391
|
);
|
|
6359
6392
|
};
|
|
6360
|
-
var
|
|
6393
|
+
var FRAGMENT25 = `
|
|
6361
6394
|
fragment TransactionFragment on Transaction {
|
|
6362
6395
|
__typename
|
|
6363
6396
|
... on ChannelClosingTransaction {
|
|
@@ -6919,7 +6952,7 @@ query GetTransaction($id: ID!) {
|
|
|
6919
6952
|
}
|
|
6920
6953
|
}
|
|
6921
6954
|
|
|
6922
|
-
${
|
|
6955
|
+
${FRAGMENT25}
|
|
6923
6956
|
`,
|
|
6924
6957
|
variables: { id },
|
|
6925
6958
|
constructObject: (data) => (0, import_core24.isObject)(data) && "entity" in data && (0, import_core24.isObject)(data.entity) ? TransactionFromJson(data.entity) : null
|
|
@@ -7034,7 +7067,7 @@ query SingleNodeDashboard(
|
|
|
7034
7067
|
}
|
|
7035
7068
|
}
|
|
7036
7069
|
|
|
7037
|
-
${
|
|
7070
|
+
${FRAGMENT25}
|
|
7038
7071
|
${FRAGMENT}
|
|
7039
7072
|
`;
|
|
7040
7073
|
|
|
@@ -7051,7 +7084,7 @@ var TransactionUpdateFromJson = (obj) => {
|
|
|
7051
7084
|
transactionHash: obj["transaction_hash"]
|
|
7052
7085
|
};
|
|
7053
7086
|
};
|
|
7054
|
-
var
|
|
7087
|
+
var FRAGMENT26 = `
|
|
7055
7088
|
fragment TransactionUpdateFragment on Transaction {
|
|
7056
7089
|
__typename
|
|
7057
7090
|
id
|
|
@@ -7081,7 +7114,7 @@ subscription TransactionSubscription(
|
|
|
7081
7114
|
}
|
|
7082
7115
|
}
|
|
7083
7116
|
|
|
7084
|
-
${
|
|
7117
|
+
${FRAGMENT26}
|
|
7085
7118
|
`;
|
|
7086
7119
|
|
|
7087
7120
|
// src/graphql/TransactionsForNode.ts
|
|
@@ -7119,7 +7152,7 @@ query TransactionsForNode(
|
|
|
7119
7152
|
}
|
|
7120
7153
|
}
|
|
7121
7154
|
|
|
7122
|
-
${
|
|
7155
|
+
${FRAGMENT25}
|
|
7123
7156
|
${FRAGMENT}
|
|
7124
7157
|
`;
|
|
7125
7158
|
|
|
@@ -7131,7 +7164,7 @@ var WithdrawalFeeEstimateOutputFromJson = (obj) => {
|
|
|
7131
7164
|
)
|
|
7132
7165
|
};
|
|
7133
7166
|
};
|
|
7134
|
-
var
|
|
7167
|
+
var FRAGMENT27 = `
|
|
7135
7168
|
fragment WithdrawalFeeEstimateOutputFragment on WithdrawalFeeEstimateOutput {
|
|
7136
7169
|
__typename
|
|
7137
7170
|
withdrawal_fee_estimate_output_fee_estimate: fee_estimate {
|
|
@@ -7160,7 +7193,7 @@ var WithdrawalFeeEstimate = `
|
|
|
7160
7193
|
}
|
|
7161
7194
|
}
|
|
7162
7195
|
|
|
7163
|
-
${
|
|
7196
|
+
${FRAGMENT27}
|
|
7164
7197
|
`;
|
|
7165
7198
|
|
|
7166
7199
|
// src/logger.ts
|
|
@@ -7273,7 +7306,7 @@ var LightsparkNodeFromJson = (obj) => {
|
|
|
7273
7306
|
`Couldn't find a concrete type for interface LightsparkNode corresponding to the typename=${obj["__typename"]}`
|
|
7274
7307
|
);
|
|
7275
7308
|
};
|
|
7276
|
-
var
|
|
7309
|
+
var FRAGMENT28 = `
|
|
7277
7310
|
fragment LightsparkNodeFragment on LightsparkNode {
|
|
7278
7311
|
__typename
|
|
7279
7312
|
... on LightsparkNodeWithOSK {
|
|
@@ -7547,7 +7580,7 @@ query GetLightsparkNode($id: ID!) {
|
|
|
7547
7580
|
}
|
|
7548
7581
|
}
|
|
7549
7582
|
|
|
7550
|
-
${
|
|
7583
|
+
${FRAGMENT28}
|
|
7551
7584
|
`,
|
|
7552
7585
|
variables: { id },
|
|
7553
7586
|
constructObject: (data) => (0, import_core26.isObject)(data) && "entity" in data && (0, import_core26.isObject)(data.entity) ? LightsparkNodeFromJson(data.entity) : null
|
|
@@ -8768,7 +8801,7 @@ query GetWallet($id: ID!) {
|
|
|
8768
8801
|
}
|
|
8769
8802
|
}
|
|
8770
8803
|
|
|
8771
|
-
${
|
|
8804
|
+
${FRAGMENT29}
|
|
8772
8805
|
`,
|
|
8773
8806
|
variables: { id },
|
|
8774
8807
|
constructObject: (data) => (0, import_core27.isObject)(data) && "entity" in data && (0, import_core27.isObject)(data.entity) ? WalletFromJson(data.entity) : null
|
|
@@ -8801,7 +8834,7 @@ var WalletFromJson = (obj) => {
|
|
|
8801
8834
|
obj["wallet_account"]?.id ?? void 0
|
|
8802
8835
|
);
|
|
8803
8836
|
};
|
|
8804
|
-
var
|
|
8837
|
+
var FRAGMENT29 = `
|
|
8805
8838
|
fragment WalletFragment on Wallet {
|
|
8806
8839
|
__typename
|
|
8807
8840
|
wallet_id: id
|
|
@@ -10634,7 +10667,7 @@ query GetAccount {
|
|
|
10634
10667
|
}
|
|
10635
10668
|
}
|
|
10636
10669
|
|
|
10637
|
-
${
|
|
10670
|
+
${FRAGMENT30}
|
|
10638
10671
|
`,
|
|
10639
10672
|
variables: {},
|
|
10640
10673
|
constructObject: (data) => (0, import_core28.isObject)(data) && "current_account" in data && (0, import_core28.isObject)(data.current_account) ? AccountFromJson(data.current_account) : null
|
|
@@ -10659,7 +10692,7 @@ var AccountFromJson = (obj) => {
|
|
|
10659
10692
|
obj["account_name"]
|
|
10660
10693
|
);
|
|
10661
10694
|
};
|
|
10662
|
-
var
|
|
10695
|
+
var FRAGMENT30 = `
|
|
10663
10696
|
fragment AccountFragment on Account {
|
|
10664
10697
|
__typename
|
|
10665
10698
|
account_id: id
|
|
@@ -11182,6 +11215,24 @@ var LightsparkClient = class {
|
|
|
11182
11215
|
}
|
|
11183
11216
|
return InvoiceFromJson(invoiceJson);
|
|
11184
11217
|
}
|
|
11218
|
+
/**
|
|
11219
|
+
* Fails all pending HTLCs (Hash Time Locked Contracts) for a given invoice.
|
|
11220
|
+
*
|
|
11221
|
+
* @param invoiceId The ID of the invoice for which to fail HTLCs.
|
|
11222
|
+
* @param cancelInvoice Whether to also cancel the invoice after failing the HTLCs.
|
|
11223
|
+
* @returns The output containing the invoice ID, or undefined if the operation failed.
|
|
11224
|
+
*/
|
|
11225
|
+
async failHtlcs(invoiceId, cancelInvoice) {
|
|
11226
|
+
const response = await this.requester.makeRawRequest(FailHtlcs, {
|
|
11227
|
+
invoice_id: invoiceId,
|
|
11228
|
+
cancel_invoice: cancelInvoice
|
|
11229
|
+
});
|
|
11230
|
+
const output = response.fail_htlcs;
|
|
11231
|
+
if (!output) {
|
|
11232
|
+
return void 0;
|
|
11233
|
+
}
|
|
11234
|
+
return FailHtlcsOutputFromJson(output);
|
|
11235
|
+
}
|
|
11185
11236
|
/**
|
|
11186
11237
|
* Decodes an encoded lightning invoice string.
|
|
11187
11238
|
*
|
|
@@ -11557,15 +11608,19 @@ var LightsparkClient = class {
|
|
|
11557
11608
|
* @param bitcoinAddress The Bitcoin address to withdraw funds to.
|
|
11558
11609
|
* @param mode The mode to use for the withdrawal. See `WithdrawalMode` for more information.
|
|
11559
11610
|
*/
|
|
11560
|
-
async requestWithdrawal(nodeId, amountSats, bitcoinAddress, mode) {
|
|
11611
|
+
async requestWithdrawal(nodeId, amountSats, bitcoinAddress, mode, idempotencyKey = void 0) {
|
|
11612
|
+
const variables = {
|
|
11613
|
+
node_id: nodeId,
|
|
11614
|
+
amount_sats: amountSats,
|
|
11615
|
+
bitcoin_address: bitcoinAddress,
|
|
11616
|
+
withdrawal_mode: mode
|
|
11617
|
+
};
|
|
11618
|
+
if (idempotencyKey !== void 0) {
|
|
11619
|
+
variables.idempotency_key = idempotencyKey;
|
|
11620
|
+
}
|
|
11561
11621
|
const response = await this.requester.makeRawRequest(
|
|
11562
11622
|
RequestWithdrawal,
|
|
11563
|
-
|
|
11564
|
-
node_id: nodeId,
|
|
11565
|
-
amount_sats: amountSats,
|
|
11566
|
-
bitcoin_address: bitcoinAddress,
|
|
11567
|
-
withdrawal_mode: mode
|
|
11568
|
-
},
|
|
11623
|
+
variables,
|
|
11569
11624
|
nodeId
|
|
11570
11625
|
);
|
|
11571
11626
|
return WithdrawalRequestFromJson(response.request_withdrawal.request);
|
|
@@ -12122,7 +12177,7 @@ var AuditLogActorFromJson = (obj) => {
|
|
|
12122
12177
|
`Couldn't find a concrete type for interface AuditLogActor corresponding to the typename=${obj["__typename"]}`
|
|
12123
12178
|
);
|
|
12124
12179
|
};
|
|
12125
|
-
var
|
|
12180
|
+
var FRAGMENT31 = `
|
|
12126
12181
|
fragment AuditLogActorFragment on AuditLogActor {
|
|
12127
12182
|
__typename
|
|
12128
12183
|
... on ApiToken {
|
|
@@ -12147,7 +12202,7 @@ query GetAuditLogActor($id: ID!) {
|
|
|
12147
12202
|
}
|
|
12148
12203
|
}
|
|
12149
12204
|
|
|
12150
|
-
${
|
|
12205
|
+
${FRAGMENT31}
|
|
12151
12206
|
`,
|
|
12152
12207
|
variables: { id },
|
|
12153
12208
|
constructObject: (data) => (0, import_core30.isObject)(data) && "entity" in data && (0, import_core30.isObject)(data.entity) ? AuditLogActorFromJson(data.entity) : null
|
|
@@ -12172,7 +12227,7 @@ var ChannelSnapshotFromJson = (obj) => {
|
|
|
12172
12227
|
localChannelReserve: !!obj["channel_snapshot_local_channel_reserve"] ? CurrencyAmountFromJson(obj["channel_snapshot_local_channel_reserve"]) : void 0
|
|
12173
12228
|
};
|
|
12174
12229
|
};
|
|
12175
|
-
var
|
|
12230
|
+
var FRAGMENT32 = `
|
|
12176
12231
|
fragment ChannelSnapshotFragment on ChannelSnapshot {
|
|
12177
12232
|
__typename
|
|
12178
12233
|
channel_snapshot_id: id
|
|
@@ -12235,7 +12290,7 @@ query GetChannelSnapshot($id: ID!) {
|
|
|
12235
12290
|
}
|
|
12236
12291
|
}
|
|
12237
12292
|
|
|
12238
|
-
${
|
|
12293
|
+
${FRAGMENT32}
|
|
12239
12294
|
`,
|
|
12240
12295
|
variables: { id },
|
|
12241
12296
|
constructObject: (data) => (0, import_core31.isObject)(data) && "entity" in data && (0, import_core31.isObject)(data.entity) ? ChannelSnapshotFromJson(data.entity) : null
|
|
@@ -12539,7 +12594,7 @@ var SignablePayloadFromJson = (obj) => {
|
|
|
12539
12594
|
mulTweak: obj["signable_payload_mul_tweak"]
|
|
12540
12595
|
};
|
|
12541
12596
|
};
|
|
12542
|
-
var
|
|
12597
|
+
var FRAGMENT33 = `
|
|
12543
12598
|
fragment SignablePayloadFragment on SignablePayload {
|
|
12544
12599
|
__typename
|
|
12545
12600
|
signable_payload_id: id
|
|
@@ -12565,7 +12620,7 @@ query GetSignablePayload($id: ID!) {
|
|
|
12565
12620
|
}
|
|
12566
12621
|
}
|
|
12567
12622
|
|
|
12568
|
-
${
|
|
12623
|
+
${FRAGMENT33}
|
|
12569
12624
|
`,
|
|
12570
12625
|
variables: { id },
|
|
12571
12626
|
constructObject: (data) => (0, import_core33.isObject)(data) && "entity" in data && (0, import_core33.isObject)(data.entity) ? SignablePayloadFromJson(data.entity) : null
|
|
@@ -12592,7 +12647,7 @@ var DepositFromJson = (obj) => {
|
|
|
12592
12647
|
numConfirmations: obj["deposit_num_confirmations"]
|
|
12593
12648
|
};
|
|
12594
12649
|
};
|
|
12595
|
-
var
|
|
12650
|
+
var FRAGMENT34 = `
|
|
12596
12651
|
fragment DepositFragment on Deposit {
|
|
12597
12652
|
__typename
|
|
12598
12653
|
deposit_id: id
|
|
@@ -12636,7 +12691,7 @@ query GetDeposit($id: ID!) {
|
|
|
12636
12691
|
}
|
|
12637
12692
|
}
|
|
12638
12693
|
|
|
12639
|
-
${
|
|
12694
|
+
${FRAGMENT34}
|
|
12640
12695
|
`,
|
|
12641
12696
|
variables: { id },
|
|
12642
12697
|
constructObject: (data) => (0, import_core34.isObject)(data) && "entity" in data && (0, import_core34.isObject)(data.entity) ? DepositFromJson(data.entity) : null
|
|
@@ -12714,7 +12769,7 @@ var LightningTransactionFromJson = (obj) => {
|
|
|
12714
12769
|
`Couldn't find a concrete type for interface LightningTransaction corresponding to the typename=${obj["__typename"]}`
|
|
12715
12770
|
);
|
|
12716
12771
|
};
|
|
12717
|
-
var
|
|
12772
|
+
var FRAGMENT35 = `
|
|
12718
12773
|
fragment LightningTransactionFragment on LightningTransaction {
|
|
12719
12774
|
__typename
|
|
12720
12775
|
... on IncomingPayment {
|
|
@@ -13148,7 +13203,7 @@ query GetLightningTransaction($id: ID!) {
|
|
|
13148
13203
|
}
|
|
13149
13204
|
}
|
|
13150
13205
|
|
|
13151
|
-
${
|
|
13206
|
+
${FRAGMENT35}
|
|
13152
13207
|
`,
|
|
13153
13208
|
variables: { id },
|
|
13154
13209
|
constructObject: (data) => (0, import_core35.isObject)(data) && "entity" in data && (0, import_core35.isObject)(data.entity) ? LightningTransactionFromJson(data.entity) : null
|
|
@@ -13185,7 +13240,7 @@ var LightsparkNodeOwnerFromJson = (obj) => {
|
|
|
13185
13240
|
`Couldn't find a concrete type for interface LightsparkNodeOwner corresponding to the typename=${obj["__typename"]}`
|
|
13186
13241
|
);
|
|
13187
13242
|
};
|
|
13188
|
-
var
|
|
13243
|
+
var FRAGMENT36 = `
|
|
13189
13244
|
fragment LightsparkNodeOwnerFragment on LightsparkNodeOwner {
|
|
13190
13245
|
__typename
|
|
13191
13246
|
... on Account {
|
|
@@ -13246,7 +13301,7 @@ query GetLightsparkNodeOwner($id: ID!) {
|
|
|
13246
13301
|
}
|
|
13247
13302
|
}
|
|
13248
13303
|
|
|
13249
|
-
${
|
|
13304
|
+
${FRAGMENT36}
|
|
13250
13305
|
`,
|
|
13251
13306
|
variables: { id },
|
|
13252
13307
|
constructObject: (data) => (0, import_core36.isObject)(data) && "entity" in data && (0, import_core36.isObject)(data.entity) ? LightsparkNodeOwnerFromJson(data.entity) : null
|
|
@@ -13267,7 +13322,7 @@ var OfferFromJson = (obj) => {
|
|
|
13267
13322
|
description: obj["offer_description"]
|
|
13268
13323
|
};
|
|
13269
13324
|
};
|
|
13270
|
-
var
|
|
13325
|
+
var FRAGMENT37 = `
|
|
13271
13326
|
fragment OfferFragment on Offer {
|
|
13272
13327
|
__typename
|
|
13273
13328
|
offer_id: id
|
|
@@ -13298,7 +13353,7 @@ query GetOffer($id: ID!) {
|
|
|
13298
13353
|
}
|
|
13299
13354
|
}
|
|
13300
13355
|
|
|
13301
|
-
${
|
|
13356
|
+
${FRAGMENT37}
|
|
13302
13357
|
`,
|
|
13303
13358
|
variables: { id },
|
|
13304
13359
|
constructObject: (data) => (0, import_core37.isObject)(data) && "entity" in data && (0, import_core37.isObject)(data.entity) ? OfferFromJson(data.entity) : null
|
|
@@ -13321,7 +13376,7 @@ var OfferDataFromJson = (obj) => {
|
|
|
13321
13376
|
expiresAt: obj["offer_data_expires_at"]
|
|
13322
13377
|
};
|
|
13323
13378
|
};
|
|
13324
|
-
var
|
|
13379
|
+
var FRAGMENT38 = `
|
|
13325
13380
|
fragment OfferDataFragment on OfferData {
|
|
13326
13381
|
__typename
|
|
13327
13382
|
offer_data_id: id
|
|
@@ -13350,7 +13405,7 @@ query GetOfferData($id: ID!) {
|
|
|
13350
13405
|
}
|
|
13351
13406
|
}
|
|
13352
13407
|
|
|
13353
|
-
${
|
|
13408
|
+
${FRAGMENT38}
|
|
13354
13409
|
`,
|
|
13355
13410
|
variables: { id },
|
|
13356
13411
|
constructObject: (data) => (0, import_core38.isObject)(data) && "entity" in data && (0, import_core38.isObject)(data.entity) ? OfferDataFromJson(data.entity) : null
|
|
@@ -13448,7 +13503,7 @@ var OnChainTransactionFromJson = (obj) => {
|
|
|
13448
13503
|
`Couldn't find a concrete type for interface OnChainTransaction corresponding to the typename=${obj["__typename"]}`
|
|
13449
13504
|
);
|
|
13450
13505
|
};
|
|
13451
|
-
var
|
|
13506
|
+
var FRAGMENT39 = `
|
|
13452
13507
|
fragment OnChainTransactionFragment on OnChainTransaction {
|
|
13453
13508
|
__typename
|
|
13454
13509
|
... on ChannelClosingTransaction {
|
|
@@ -13591,7 +13646,7 @@ query GetOnChainTransaction($id: ID!) {
|
|
|
13591
13646
|
}
|
|
13592
13647
|
}
|
|
13593
13648
|
|
|
13594
|
-
${
|
|
13649
|
+
${FRAGMENT39}
|
|
13595
13650
|
`,
|
|
13596
13651
|
variables: { id },
|
|
13597
13652
|
constructObject: (data) => (0, import_core39.isObject)(data) && "entity" in data && (0, import_core39.isObject)(data.entity) ? OnChainTransactionFromJson(data.entity) : null
|
|
@@ -13642,7 +13697,7 @@ var RoutingTransactionFromJson = (obj) => {
|
|
|
13642
13697
|
failureReason: !!obj["routing_transaction_failure_reason"] ? RoutingTransactionFailureReason_default[obj["routing_transaction_failure_reason"]] ?? RoutingTransactionFailureReason_default.FUTURE_VALUE : null
|
|
13643
13698
|
};
|
|
13644
13699
|
};
|
|
13645
|
-
var
|
|
13700
|
+
var FRAGMENT40 = `
|
|
13646
13701
|
fragment RoutingTransactionFragment on RoutingTransaction {
|
|
13647
13702
|
__typename
|
|
13648
13703
|
routing_transaction_id: id
|
|
@@ -13690,7 +13745,7 @@ query GetRoutingTransaction($id: ID!) {
|
|
|
13690
13745
|
}
|
|
13691
13746
|
}
|
|
13692
13747
|
|
|
13693
|
-
${
|
|
13748
|
+
${FRAGMENT40}
|
|
13694
13749
|
`,
|
|
13695
13750
|
variables: { id },
|
|
13696
13751
|
constructObject: (data) => (0, import_core40.isObject)(data) && "entity" in data && (0, import_core40.isObject)(data.entity) ? RoutingTransactionFromJson(data.entity) : null
|
|
@@ -13707,7 +13762,7 @@ var SignableFromJson = (obj) => {
|
|
|
13707
13762
|
typename: "Signable"
|
|
13708
13763
|
};
|
|
13709
13764
|
};
|
|
13710
|
-
var
|
|
13765
|
+
var FRAGMENT41 = `
|
|
13711
13766
|
fragment SignableFragment on Signable {
|
|
13712
13767
|
__typename
|
|
13713
13768
|
signable_id: id
|
|
@@ -13725,7 +13780,7 @@ query GetSignable($id: ID!) {
|
|
|
13725
13780
|
}
|
|
13726
13781
|
}
|
|
13727
13782
|
|
|
13728
|
-
${
|
|
13783
|
+
${FRAGMENT41}
|
|
13729
13784
|
`,
|
|
13730
13785
|
variables: { id },
|
|
13731
13786
|
constructObject: (data) => (0, import_core41.isObject)(data) && "entity" in data && (0, import_core41.isObject)(data.entity) ? SignableFromJson(data.entity) : null
|