@lightsparkdev/lightspark-sdk 1.9.6 → 1.9.8
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 +12 -0
- package/dist/{chunk-INED3BP4.js → chunk-BPPGK6J6.js} +3 -3
- package/dist/{index-B_qpP_0o.d.cts → index-B2mWcZea.d.cts} +49 -41
- package/dist/{index-CZqitvax.d.ts → index-BAeaSQSH.d.ts} +49 -41
- package/dist/index.cjs +259 -237
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +27 -5
- package/dist/objects/index.cjs +2 -2
- 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 +1 -1
- package/src/client.ts +9 -2
- package/src/objects/ChannelStatus.ts +2 -2
- package/src/objects/CurrencyUnit.ts +3 -2
- package/src/objects/Entity.ts +1 -1
- package/src/objects/TransactionStatus.ts +3 -2
- package/src/objects/UmaCurrencyAmount.ts +7 -4
- package/src/objects/UmaInvitation.ts +1 -1
- package/src/objects/WalletStatus.ts +2 -2
- package/src/tests/integration/general-regtest.test.ts +1 -1
- package/src/webhooks.ts +20 -1
package/dist/index.cjs
CHANGED
|
@@ -175,12 +175,12 @@ var AccountTokenAuthProvider = class {
|
|
|
175
175
|
var AccountTokenAuthProvider_default = AccountTokenAuthProvider;
|
|
176
176
|
|
|
177
177
|
// src/client.ts
|
|
178
|
-
var
|
|
178
|
+
var import_core29 = require("@lightsparkdev/core");
|
|
179
179
|
|
|
180
180
|
// package.json
|
|
181
181
|
var package_default = {
|
|
182
182
|
name: "@lightsparkdev/lightspark-sdk",
|
|
183
|
-
version: "1.9.
|
|
183
|
+
version: "1.9.8",
|
|
184
184
|
description: "Lightspark JS SDK",
|
|
185
185
|
author: "Lightspark Inc.",
|
|
186
186
|
keywords: [
|
|
@@ -3123,7 +3123,7 @@ var CancelInvoice = `
|
|
|
3123
3123
|
`;
|
|
3124
3124
|
|
|
3125
3125
|
// src/objects/UmaInvitation.ts
|
|
3126
|
-
var
|
|
3126
|
+
var import_core11 = require("@lightsparkdev/core");
|
|
3127
3127
|
|
|
3128
3128
|
// src/objects/IncentivesIneligibilityReason.ts
|
|
3129
3129
|
var IncentivesIneligibilityReason = /* @__PURE__ */ ((IncentivesIneligibilityReason2) => {
|
|
@@ -3148,11 +3148,54 @@ var IncentivesStatus = /* @__PURE__ */ ((IncentivesStatus2) => {
|
|
|
3148
3148
|
})(IncentivesStatus || {});
|
|
3149
3149
|
var IncentivesStatus_default = IncentivesStatus;
|
|
3150
3150
|
|
|
3151
|
+
// src/objects/UmaCurrency.ts
|
|
3152
|
+
var import_core10 = require("@lightsparkdev/core");
|
|
3153
|
+
var UmaCurrencyFromJson = (obj) => {
|
|
3154
|
+
return {
|
|
3155
|
+
id: obj["uma_currency_id"],
|
|
3156
|
+
createdAt: obj["uma_currency_created_at"],
|
|
3157
|
+
updatedAt: obj["uma_currency_updated_at"],
|
|
3158
|
+
code: obj["uma_currency_code"],
|
|
3159
|
+
symbol: obj["uma_currency_symbol"],
|
|
3160
|
+
name: obj["uma_currency_name"],
|
|
3161
|
+
decimals: obj["uma_currency_decimals"],
|
|
3162
|
+
typename: "UmaCurrency"
|
|
3163
|
+
};
|
|
3164
|
+
};
|
|
3165
|
+
var FRAGMENT10 = `
|
|
3166
|
+
fragment UmaCurrencyFragment on UmaCurrency {
|
|
3167
|
+
__typename
|
|
3168
|
+
uma_currency_id: id
|
|
3169
|
+
uma_currency_created_at: created_at
|
|
3170
|
+
uma_currency_updated_at: updated_at
|
|
3171
|
+
uma_currency_code: code
|
|
3172
|
+
uma_currency_symbol: symbol
|
|
3173
|
+
uma_currency_name: name
|
|
3174
|
+
uma_currency_decimals: decimals
|
|
3175
|
+
}`;
|
|
3176
|
+
var getUmaCurrencyQuery = (id) => {
|
|
3177
|
+
return {
|
|
3178
|
+
queryPayload: `
|
|
3179
|
+
query GetUmaCurrency($id: ID!) {
|
|
3180
|
+
entity(id: $id) {
|
|
3181
|
+
... on UmaCurrency {
|
|
3182
|
+
...UmaCurrencyFragment
|
|
3183
|
+
}
|
|
3184
|
+
}
|
|
3185
|
+
}
|
|
3186
|
+
|
|
3187
|
+
${FRAGMENT10}
|
|
3188
|
+
`,
|
|
3189
|
+
variables: { id },
|
|
3190
|
+
constructObject: (data) => (0, import_core10.isObject)(data) && "entity" in data && (0, import_core10.isObject)(data.entity) ? UmaCurrencyFromJson(data.entity) : null
|
|
3191
|
+
};
|
|
3192
|
+
};
|
|
3193
|
+
|
|
3151
3194
|
// src/objects/UmaCurrencyAmount.ts
|
|
3152
3195
|
var UmaCurrencyAmountFromJson = (obj) => {
|
|
3153
3196
|
return {
|
|
3154
3197
|
value: obj["uma_currency_amount_value"],
|
|
3155
|
-
|
|
3198
|
+
currency: UmaCurrencyFromJson(obj["uma_currency_amount_currency"])
|
|
3156
3199
|
};
|
|
3157
3200
|
};
|
|
3158
3201
|
|
|
@@ -3187,7 +3230,7 @@ var UmaInvitationFromJson = (obj) => {
|
|
|
3187
3230
|
expiresAt: obj["uma_invitation_expires_at"]
|
|
3188
3231
|
};
|
|
3189
3232
|
};
|
|
3190
|
-
var
|
|
3233
|
+
var FRAGMENT11 = `
|
|
3191
3234
|
fragment UmaInvitationFragment on UmaInvitation {
|
|
3192
3235
|
__typename
|
|
3193
3236
|
uma_invitation_id: id
|
|
@@ -3205,7 +3248,7 @@ fragment UmaInvitationFragment on UmaInvitation {
|
|
|
3205
3248
|
__typename
|
|
3206
3249
|
uma_currency_amount_value: value
|
|
3207
3250
|
uma_currency_amount_currency: currency {
|
|
3208
|
-
|
|
3251
|
+
code
|
|
3209
3252
|
}
|
|
3210
3253
|
}
|
|
3211
3254
|
uma_invitation_cancelled_at: cancelled_at
|
|
@@ -3222,10 +3265,10 @@ query GetUmaInvitation($id: ID!) {
|
|
|
3222
3265
|
}
|
|
3223
3266
|
}
|
|
3224
3267
|
|
|
3225
|
-
${
|
|
3268
|
+
${FRAGMENT11}
|
|
3226
3269
|
`,
|
|
3227
3270
|
variables: { id },
|
|
3228
|
-
constructObject: (data) => (0,
|
|
3271
|
+
constructObject: (data) => (0, import_core11.isObject)(data) && "entity" in data && (0, import_core11.isObject)(data.entity) ? UmaInvitationFromJson(data.entity) : null
|
|
3229
3272
|
};
|
|
3230
3273
|
};
|
|
3231
3274
|
|
|
@@ -3243,7 +3286,7 @@ var CancelUmaInvitation = `
|
|
|
3243
3286
|
}
|
|
3244
3287
|
}
|
|
3245
3288
|
|
|
3246
|
-
${
|
|
3289
|
+
${FRAGMENT11}
|
|
3247
3290
|
`;
|
|
3248
3291
|
|
|
3249
3292
|
// src/graphql/ClaimUmaInvitation.ts
|
|
@@ -3262,7 +3305,7 @@ var ClaimUmaInvitation = `
|
|
|
3262
3305
|
}
|
|
3263
3306
|
}
|
|
3264
3307
|
|
|
3265
|
-
${
|
|
3308
|
+
${FRAGMENT11}
|
|
3266
3309
|
`;
|
|
3267
3310
|
|
|
3268
3311
|
// src/graphql/ClaimUmaInvitationWithIncentives.ts
|
|
@@ -3285,11 +3328,11 @@ var ClaimUmaInvitationWithIncentives = `
|
|
|
3285
3328
|
}
|
|
3286
3329
|
}
|
|
3287
3330
|
|
|
3288
|
-
${
|
|
3331
|
+
${FRAGMENT11}
|
|
3289
3332
|
`;
|
|
3290
3333
|
|
|
3291
3334
|
// src/objects/ApiToken.ts
|
|
3292
|
-
var
|
|
3335
|
+
var import_core12 = require("@lightsparkdev/core");
|
|
3293
3336
|
|
|
3294
3337
|
// src/objects/Permission.ts
|
|
3295
3338
|
var Permission = /* @__PURE__ */ ((Permission2) => {
|
|
@@ -3328,7 +3371,7 @@ var ApiTokenFromJson = (obj) => {
|
|
|
3328
3371
|
typename: "ApiToken"
|
|
3329
3372
|
};
|
|
3330
3373
|
};
|
|
3331
|
-
var
|
|
3374
|
+
var FRAGMENT12 = `
|
|
3332
3375
|
fragment ApiTokenFragment on ApiToken {
|
|
3333
3376
|
__typename
|
|
3334
3377
|
api_token_id: id
|
|
@@ -3350,10 +3393,10 @@ query GetApiToken($id: ID!) {
|
|
|
3350
3393
|
}
|
|
3351
3394
|
}
|
|
3352
3395
|
|
|
3353
|
-
${
|
|
3396
|
+
${FRAGMENT12}
|
|
3354
3397
|
`,
|
|
3355
3398
|
variables: { id },
|
|
3356
|
-
constructObject: (data) => (0,
|
|
3399
|
+
constructObject: (data) => (0, import_core12.isObject)(data) && "entity" in data && (0, import_core12.isObject)(data.entity) ? ApiTokenFromJson(data.entity) : null
|
|
3357
3400
|
};
|
|
3358
3401
|
};
|
|
3359
3402
|
|
|
@@ -3374,7 +3417,7 @@ var CreateApiToken = `
|
|
|
3374
3417
|
}
|
|
3375
3418
|
}
|
|
3376
3419
|
|
|
3377
|
-
${
|
|
3420
|
+
${FRAGMENT12}
|
|
3378
3421
|
`;
|
|
3379
3422
|
|
|
3380
3423
|
// src/graphql/CreateInvoice.ts
|
|
@@ -3466,10 +3509,10 @@ mutation CreateTestModeInvoice(
|
|
|
3466
3509
|
`;
|
|
3467
3510
|
|
|
3468
3511
|
// src/objects/IncomingPayment.ts
|
|
3469
|
-
var
|
|
3512
|
+
var import_core14 = require("@lightsparkdev/core");
|
|
3470
3513
|
|
|
3471
3514
|
// src/objects/IncomingPaymentAttempt.ts
|
|
3472
|
-
var
|
|
3515
|
+
var import_core13 = require("@lightsparkdev/core");
|
|
3473
3516
|
|
|
3474
3517
|
// src/objects/IncomingPaymentAttemptStatus.ts
|
|
3475
3518
|
var IncomingPaymentAttemptStatus = /* @__PURE__ */ ((IncomingPaymentAttemptStatus2) => {
|
|
@@ -3495,7 +3538,7 @@ var IncomingPaymentAttemptFromJson = (obj) => {
|
|
|
3495
3538
|
resolvedAt: obj["incoming_payment_attempt_resolved_at"]
|
|
3496
3539
|
};
|
|
3497
3540
|
};
|
|
3498
|
-
var
|
|
3541
|
+
var FRAGMENT13 = `
|
|
3499
3542
|
fragment IncomingPaymentAttemptFragment on IncomingPaymentAttempt {
|
|
3500
3543
|
__typename
|
|
3501
3544
|
incoming_payment_attempt_id: id
|
|
@@ -3526,10 +3569,10 @@ query GetIncomingPaymentAttempt($id: ID!) {
|
|
|
3526
3569
|
}
|
|
3527
3570
|
}
|
|
3528
3571
|
|
|
3529
|
-
${
|
|
3572
|
+
${FRAGMENT13}
|
|
3530
3573
|
`,
|
|
3531
3574
|
variables: { id },
|
|
3532
|
-
constructObject: (data) => (0,
|
|
3575
|
+
constructObject: (data) => (0, import_core13.isObject)(data) && "entity" in data && (0, import_core13.isObject)(data.entity) ? IncomingPaymentAttemptFromJson(data.entity) : null
|
|
3533
3576
|
};
|
|
3534
3577
|
};
|
|
3535
3578
|
|
|
@@ -3655,10 +3698,10 @@ query GetIncomingPayment($id: ID!) {
|
|
|
3655
3698
|
}
|
|
3656
3699
|
}
|
|
3657
3700
|
|
|
3658
|
-
${
|
|
3701
|
+
${FRAGMENT14}
|
|
3659
3702
|
`,
|
|
3660
3703
|
variables: { id },
|
|
3661
|
-
constructObject: (data) => (0,
|
|
3704
|
+
constructObject: (data) => (0, import_core14.isObject)(data) && "entity" in data && (0, import_core14.isObject)(data.entity) ? IncomingPaymentFromJson(data.entity) : null
|
|
3662
3705
|
};
|
|
3663
3706
|
}
|
|
3664
3707
|
toJson() {
|
|
@@ -3698,7 +3741,7 @@ var IncomingPaymentFromJson = (obj) => {
|
|
|
3698
3741
|
)
|
|
3699
3742
|
);
|
|
3700
3743
|
};
|
|
3701
|
-
var
|
|
3744
|
+
var FRAGMENT14 = `
|
|
3702
3745
|
fragment IncomingPaymentFragment on IncomingPayment {
|
|
3703
3746
|
__typename
|
|
3704
3747
|
incoming_payment_id: id
|
|
@@ -3756,7 +3799,7 @@ mutation CreateTestModePayment(
|
|
|
3756
3799
|
}
|
|
3757
3800
|
}
|
|
3758
3801
|
|
|
3759
|
-
${
|
|
3802
|
+
${FRAGMENT14}
|
|
3760
3803
|
`;
|
|
3761
3804
|
|
|
3762
3805
|
// src/graphql/CreateUmaInvitation.ts
|
|
@@ -3773,7 +3816,7 @@ var CreateUmaInvitation = `
|
|
|
3773
3816
|
}
|
|
3774
3817
|
}
|
|
3775
3818
|
|
|
3776
|
-
${
|
|
3819
|
+
${FRAGMENT11}
|
|
3777
3820
|
`;
|
|
3778
3821
|
|
|
3779
3822
|
// src/graphql/CreateUmaInvitationWithIncentives.ts
|
|
@@ -3794,7 +3837,7 @@ var CreateUmaInvitationWithIncentives = `
|
|
|
3794
3837
|
}
|
|
3795
3838
|
}
|
|
3796
3839
|
|
|
3797
|
-
${
|
|
3840
|
+
${FRAGMENT11}
|
|
3798
3841
|
`;
|
|
3799
3842
|
|
|
3800
3843
|
// src/graphql/CreateUmaInvitationWithPayment.ts
|
|
@@ -3817,7 +3860,7 @@ var CreateUmaInvitationWithPayment = `
|
|
|
3817
3860
|
}
|
|
3818
3861
|
}
|
|
3819
3862
|
|
|
3820
|
-
${
|
|
3863
|
+
${FRAGMENT11}
|
|
3821
3864
|
`;
|
|
3822
3865
|
|
|
3823
3866
|
// src/graphql/CreateUmaInvoice.ts
|
|
@@ -3881,7 +3924,7 @@ var FetchUmaInvitation = `
|
|
|
3881
3924
|
}
|
|
3882
3925
|
}
|
|
3883
3926
|
|
|
3884
|
-
${
|
|
3927
|
+
${FRAGMENT11}
|
|
3885
3928
|
`;
|
|
3886
3929
|
|
|
3887
3930
|
// src/graphql/FundNode.ts
|
|
@@ -3916,7 +3959,7 @@ query IncomingPaymentsForInvoice(
|
|
|
3916
3959
|
}
|
|
3917
3960
|
}
|
|
3918
3961
|
|
|
3919
|
-
${
|
|
3962
|
+
${FRAGMENT14}
|
|
3920
3963
|
`;
|
|
3921
3964
|
|
|
3922
3965
|
// src/graphql/InvoiceForPaymentHash.ts
|
|
@@ -3935,7 +3978,7 @@ query InvoiceForPaymentHash($payment_hash: Hash32!) {
|
|
|
3935
3978
|
`;
|
|
3936
3979
|
|
|
3937
3980
|
// src/objects/LightningFeeEstimateOutput.ts
|
|
3938
|
-
var
|
|
3981
|
+
var FRAGMENT15 = `
|
|
3939
3982
|
fragment LightningFeeEstimateOutputFragment on LightningFeeEstimateOutput {
|
|
3940
3983
|
__typename
|
|
3941
3984
|
lightning_fee_estimate_output_fee_estimate: fee_estimate {
|
|
@@ -3964,7 +4007,7 @@ var LightningFeeEstimateForInvoice = `
|
|
|
3964
4007
|
}
|
|
3965
4008
|
}
|
|
3966
4009
|
|
|
3967
|
-
${
|
|
4010
|
+
${FRAGMENT15}
|
|
3968
4011
|
`;
|
|
3969
4012
|
|
|
3970
4013
|
// src/graphql/LightningFeeEstimateForNode.ts
|
|
@@ -3983,7 +4026,7 @@ var LightningFeeEstimateForNode = `
|
|
|
3983
4026
|
}
|
|
3984
4027
|
}
|
|
3985
4028
|
|
|
3986
|
-
${
|
|
4029
|
+
${FRAGMENT15}
|
|
3987
4030
|
`;
|
|
3988
4031
|
|
|
3989
4032
|
// src/graphql/LookupUmaAddress.ts
|
|
@@ -4071,10 +4114,10 @@ var MultiNodeDashboard = `
|
|
|
4071
4114
|
`;
|
|
4072
4115
|
|
|
4073
4116
|
// src/objects/OutgoingPayment.ts
|
|
4074
|
-
var
|
|
4117
|
+
var import_core18 = require("@lightsparkdev/core");
|
|
4075
4118
|
|
|
4076
4119
|
// src/objects/OutgoingPaymentAttempt.ts
|
|
4077
|
-
var
|
|
4120
|
+
var import_core16 = require("@lightsparkdev/core");
|
|
4078
4121
|
|
|
4079
4122
|
// src/objects/HtlcAttemptFailureCode.ts
|
|
4080
4123
|
var HtlcAttemptFailureCode = /* @__PURE__ */ ((HtlcAttemptFailureCode2) => {
|
|
@@ -4122,7 +4165,7 @@ var OutgoingPaymentAttemptStatus = /* @__PURE__ */ ((OutgoingPaymentAttemptStatu
|
|
|
4122
4165
|
var OutgoingPaymentAttemptStatus_default = OutgoingPaymentAttemptStatus;
|
|
4123
4166
|
|
|
4124
4167
|
// src/objects/Hop.ts
|
|
4125
|
-
var
|
|
4168
|
+
var import_core15 = require("@lightsparkdev/core");
|
|
4126
4169
|
var HopFromJson = (obj) => {
|
|
4127
4170
|
return {
|
|
4128
4171
|
id: obj["hop_id"],
|
|
@@ -4137,7 +4180,7 @@ var HopFromJson = (obj) => {
|
|
|
4137
4180
|
expiryBlockHeight: obj["hop_expiry_block_height"]
|
|
4138
4181
|
};
|
|
4139
4182
|
};
|
|
4140
|
-
var
|
|
4183
|
+
var FRAGMENT16 = `
|
|
4141
4184
|
fragment HopFragment on Hop {
|
|
4142
4185
|
__typename
|
|
4143
4186
|
hop_id: id
|
|
@@ -4177,10 +4220,10 @@ query GetHop($id: ID!) {
|
|
|
4177
4220
|
}
|
|
4178
4221
|
}
|
|
4179
4222
|
|
|
4180
|
-
${
|
|
4223
|
+
${FRAGMENT16}
|
|
4181
4224
|
`,
|
|
4182
4225
|
variables: { id },
|
|
4183
|
-
constructObject: (data) => (0,
|
|
4226
|
+
constructObject: (data) => (0, import_core15.isObject)(data) && "entity" in data && (0, import_core15.isObject)(data.entity) ? HopFromJson(data.entity) : null
|
|
4184
4227
|
};
|
|
4185
4228
|
};
|
|
4186
4229
|
|
|
@@ -4283,10 +4326,10 @@ query GetOutgoingPaymentAttempt($id: ID!) {
|
|
|
4283
4326
|
}
|
|
4284
4327
|
}
|
|
4285
4328
|
|
|
4286
|
-
${
|
|
4329
|
+
${FRAGMENT17}
|
|
4287
4330
|
`,
|
|
4288
4331
|
variables: { id },
|
|
4289
|
-
constructObject: (data) => (0,
|
|
4332
|
+
constructObject: (data) => (0, import_core16.isObject)(data) && "entity" in data && (0, import_core16.isObject)(data.entity) ? OutgoingPaymentAttemptFromJson(data.entity) : null
|
|
4290
4333
|
};
|
|
4291
4334
|
}
|
|
4292
4335
|
toJson() {
|
|
@@ -4324,7 +4367,7 @@ var OutgoingPaymentAttemptFromJson = (obj) => {
|
|
|
4324
4367
|
obj["outgoing_payment_attempt_channel_snapshot"]?.id ?? void 0
|
|
4325
4368
|
);
|
|
4326
4369
|
};
|
|
4327
|
-
var
|
|
4370
|
+
var FRAGMENT17 = `
|
|
4328
4371
|
fragment OutgoingPaymentAttemptFragment on OutgoingPaymentAttempt {
|
|
4329
4372
|
__typename
|
|
4330
4373
|
outgoing_payment_attempt_id: id
|
|
@@ -4394,7 +4437,7 @@ var PaymentFailureReason = /* @__PURE__ */ ((PaymentFailureReason2) => {
|
|
|
4394
4437
|
var PaymentFailureReason_default = PaymentFailureReason;
|
|
4395
4438
|
|
|
4396
4439
|
// src/objects/PaymentRequestData.ts
|
|
4397
|
-
var
|
|
4440
|
+
var import_core17 = require("@lightsparkdev/core");
|
|
4398
4441
|
var PaymentRequestDataFromJson = (obj) => {
|
|
4399
4442
|
if (obj["__typename"] == "InvoiceData") {
|
|
4400
4443
|
return {
|
|
@@ -4409,7 +4452,7 @@ var PaymentRequestDataFromJson = (obj) => {
|
|
|
4409
4452
|
memo: obj["invoice_data_memo"]
|
|
4410
4453
|
};
|
|
4411
4454
|
}
|
|
4412
|
-
throw new
|
|
4455
|
+
throw new import_core17.LightsparkException(
|
|
4413
4456
|
"DeserializationError",
|
|
4414
4457
|
`Couldn't find a concrete type for interface PaymentRequestData corresponding to the typename=${obj["__typename"]}`
|
|
4415
4458
|
);
|
|
@@ -4429,7 +4472,7 @@ var PaymentRequestDataToJson = (obj) => {
|
|
|
4429
4472
|
invoice_data_destination: NodeToJson(invoiceData.destination)
|
|
4430
4473
|
};
|
|
4431
4474
|
}
|
|
4432
|
-
throw new
|
|
4475
|
+
throw new import_core17.LightsparkException(
|
|
4433
4476
|
"DeserializationError",
|
|
4434
4477
|
`Couldn't find a concrete type for interface PaymentRequestData corresponding to the typename=${obj.typename}`
|
|
4435
4478
|
);
|
|
@@ -4543,10 +4586,10 @@ query GetOutgoingPayment($id: ID!) {
|
|
|
4543
4586
|
}
|
|
4544
4587
|
}
|
|
4545
4588
|
|
|
4546
|
-
${
|
|
4589
|
+
${FRAGMENT18}
|
|
4547
4590
|
`,
|
|
4548
4591
|
variables: { id },
|
|
4549
|
-
constructObject: (data) => (0,
|
|
4592
|
+
constructObject: (data) => (0, import_core18.isObject)(data) && "entity" in data && (0, import_core18.isObject)(data.entity) ? OutgoingPaymentFromJson(data.entity) : null
|
|
4550
4593
|
};
|
|
4551
4594
|
}
|
|
4552
4595
|
toJson() {
|
|
@@ -4598,7 +4641,7 @@ var OutgoingPaymentFromJson = (obj) => {
|
|
|
4598
4641
|
obj["outgoing_payment_idempotency_key"]
|
|
4599
4642
|
);
|
|
4600
4643
|
};
|
|
4601
|
-
var
|
|
4644
|
+
var FRAGMENT18 = `
|
|
4602
4645
|
fragment OutgoingPaymentFragment on OutgoingPayment {
|
|
4603
4646
|
__typename
|
|
4604
4647
|
outgoing_payment_id: id
|
|
@@ -4963,7 +5006,7 @@ query OutgoingPaymentsForInvoice(
|
|
|
4963
5006
|
}
|
|
4964
5007
|
}
|
|
4965
5008
|
|
|
4966
|
-
${
|
|
5009
|
+
${FRAGMENT18}
|
|
4967
5010
|
`;
|
|
4968
5011
|
|
|
4969
5012
|
// src/graphql/OutgoingPaymentsForPaymentHash.ts
|
|
@@ -4982,7 +5025,7 @@ query OutgoingPaymentsForPaymentHash(
|
|
|
4982
5025
|
}
|
|
4983
5026
|
}
|
|
4984
5027
|
|
|
4985
|
-
${
|
|
5028
|
+
${FRAGMENT18}
|
|
4986
5029
|
`;
|
|
4987
5030
|
|
|
4988
5031
|
// src/graphql/PayInvoice.ts
|
|
@@ -5009,7 +5052,7 @@ var PayInvoice = `
|
|
|
5009
5052
|
}
|
|
5010
5053
|
}
|
|
5011
5054
|
|
|
5012
|
-
${
|
|
5055
|
+
${FRAGMENT18}
|
|
5013
5056
|
`;
|
|
5014
5057
|
|
|
5015
5058
|
// src/graphql/PayOffer.ts
|
|
@@ -5038,7 +5081,7 @@ var PayOffer = `
|
|
|
5038
5081
|
}
|
|
5039
5082
|
}
|
|
5040
5083
|
|
|
5041
|
-
${
|
|
5084
|
+
${FRAGMENT18}
|
|
5042
5085
|
`;
|
|
5043
5086
|
|
|
5044
5087
|
// src/graphql/PayUmaInvoice.ts
|
|
@@ -5067,11 +5110,11 @@ var PayUmaInvoice = `
|
|
|
5067
5110
|
}
|
|
5068
5111
|
}
|
|
5069
5112
|
|
|
5070
|
-
${
|
|
5113
|
+
${FRAGMENT18}
|
|
5071
5114
|
`;
|
|
5072
5115
|
|
|
5073
5116
|
// src/objects/PaymentRequest.ts
|
|
5074
|
-
var
|
|
5117
|
+
var import_core19 = require("@lightsparkdev/core");
|
|
5075
5118
|
var PaymentRequestFromJson = (obj) => {
|
|
5076
5119
|
if (obj["__typename"] == "Invoice") {
|
|
5077
5120
|
return {
|
|
@@ -5086,12 +5129,12 @@ var PaymentRequestFromJson = (obj) => {
|
|
|
5086
5129
|
isLnurl: obj["invoice_is_lnurl"]
|
|
5087
5130
|
};
|
|
5088
5131
|
}
|
|
5089
|
-
throw new
|
|
5132
|
+
throw new import_core19.LightsparkException(
|
|
5090
5133
|
"DeserializationError",
|
|
5091
5134
|
`Couldn't find a concrete type for interface PaymentRequest corresponding to the typename=${obj["__typename"]}`
|
|
5092
5135
|
);
|
|
5093
5136
|
};
|
|
5094
|
-
var
|
|
5137
|
+
var FRAGMENT19 = `
|
|
5095
5138
|
fragment PaymentRequestFragment on PaymentRequest {
|
|
5096
5139
|
__typename
|
|
5097
5140
|
... on Invoice {
|
|
@@ -5414,10 +5457,10 @@ query GetPaymentRequest($id: ID!) {
|
|
|
5414
5457
|
}
|
|
5415
5458
|
}
|
|
5416
5459
|
|
|
5417
|
-
${
|
|
5460
|
+
${FRAGMENT19}
|
|
5418
5461
|
`,
|
|
5419
5462
|
variables: { id },
|
|
5420
|
-
constructObject: (data) => (0,
|
|
5463
|
+
constructObject: (data) => (0, import_core19.isObject)(data) && "entity" in data && (0, import_core19.isObject)(data.entity) ? PaymentRequestFromJson(data.entity) : null
|
|
5421
5464
|
};
|
|
5422
5465
|
};
|
|
5423
5466
|
|
|
@@ -5449,7 +5492,7 @@ query PaymentRequestsForNode(
|
|
|
5449
5492
|
}
|
|
5450
5493
|
}
|
|
5451
5494
|
|
|
5452
|
-
${
|
|
5495
|
+
${FRAGMENT19}
|
|
5453
5496
|
`;
|
|
5454
5497
|
|
|
5455
5498
|
// src/graphql/RegisterPayment.ts
|
|
@@ -5474,7 +5517,7 @@ mutation RegisterPayment(
|
|
|
5474
5517
|
`;
|
|
5475
5518
|
|
|
5476
5519
|
// src/objects/WithdrawalRequest.ts
|
|
5477
|
-
var
|
|
5520
|
+
var import_core23 = require("@lightsparkdev/core");
|
|
5478
5521
|
|
|
5479
5522
|
// src/objects/RequestInitiator.ts
|
|
5480
5523
|
var RequestInitiator = /* @__PURE__ */ ((RequestInitiator2) => {
|
|
@@ -5508,7 +5551,7 @@ var WithdrawalRequestStatus = /* @__PURE__ */ ((WithdrawalRequestStatus2) => {
|
|
|
5508
5551
|
var WithdrawalRequestStatus_default = WithdrawalRequestStatus;
|
|
5509
5552
|
|
|
5510
5553
|
// src/objects/ChannelClosingTransaction.ts
|
|
5511
|
-
var
|
|
5554
|
+
var import_core20 = require("@lightsparkdev/core");
|
|
5512
5555
|
var ChannelClosingTransactionFromJson = (obj) => {
|
|
5513
5556
|
return {
|
|
5514
5557
|
id: obj["channel_closing_transaction_id"],
|
|
@@ -5527,7 +5570,7 @@ var ChannelClosingTransactionFromJson = (obj) => {
|
|
|
5527
5570
|
channelId: obj["channel_closing_transaction_channel"]?.id ?? void 0
|
|
5528
5571
|
};
|
|
5529
5572
|
};
|
|
5530
|
-
var
|
|
5573
|
+
var FRAGMENT20 = `
|
|
5531
5574
|
fragment ChannelClosingTransactionFragment on ChannelClosingTransaction {
|
|
5532
5575
|
__typename
|
|
5533
5576
|
channel_closing_transaction_id: id
|
|
@@ -5571,10 +5614,10 @@ query GetChannelClosingTransaction($id: ID!) {
|
|
|
5571
5614
|
}
|
|
5572
5615
|
}
|
|
5573
5616
|
|
|
5574
|
-
${
|
|
5617
|
+
${FRAGMENT20}
|
|
5575
5618
|
`,
|
|
5576
5619
|
variables: { id },
|
|
5577
|
-
constructObject: (data) => (0,
|
|
5620
|
+
constructObject: (data) => (0, import_core20.isObject)(data) && "entity" in data && (0, import_core20.isObject)(data.entity) ? ChannelClosingTransactionFromJson(data.entity) : null
|
|
5578
5621
|
};
|
|
5579
5622
|
};
|
|
5580
5623
|
|
|
@@ -5591,7 +5634,7 @@ var WithdrawalRequestToChannelClosingTransactionsConnectionFromJson = (obj) => {
|
|
|
5591
5634
|
};
|
|
5592
5635
|
|
|
5593
5636
|
// src/objects/ChannelOpeningTransaction.ts
|
|
5594
|
-
var
|
|
5637
|
+
var import_core21 = require("@lightsparkdev/core");
|
|
5595
5638
|
var ChannelOpeningTransactionFromJson = (obj) => {
|
|
5596
5639
|
return {
|
|
5597
5640
|
id: obj["channel_opening_transaction_id"],
|
|
@@ -5610,7 +5653,7 @@ var ChannelOpeningTransactionFromJson = (obj) => {
|
|
|
5610
5653
|
channelId: obj["channel_opening_transaction_channel"]?.id ?? void 0
|
|
5611
5654
|
};
|
|
5612
5655
|
};
|
|
5613
|
-
var
|
|
5656
|
+
var FRAGMENT21 = `
|
|
5614
5657
|
fragment ChannelOpeningTransactionFragment on ChannelOpeningTransaction {
|
|
5615
5658
|
__typename
|
|
5616
5659
|
channel_opening_transaction_id: id
|
|
@@ -5654,10 +5697,10 @@ query GetChannelOpeningTransaction($id: ID!) {
|
|
|
5654
5697
|
}
|
|
5655
5698
|
}
|
|
5656
5699
|
|
|
5657
|
-
${
|
|
5700
|
+
${FRAGMENT21}
|
|
5658
5701
|
`,
|
|
5659
5702
|
variables: { id },
|
|
5660
|
-
constructObject: (data) => (0,
|
|
5703
|
+
constructObject: (data) => (0, import_core21.isObject)(data) && "entity" in data && (0, import_core21.isObject)(data.entity) ? ChannelOpeningTransactionFromJson(data.entity) : null
|
|
5661
5704
|
};
|
|
5662
5705
|
};
|
|
5663
5706
|
|
|
@@ -5674,7 +5717,7 @@ var WithdrawalRequestToChannelOpeningTransactionsConnectionFromJson = (obj) => {
|
|
|
5674
5717
|
};
|
|
5675
5718
|
|
|
5676
5719
|
// src/objects/Withdrawal.ts
|
|
5677
|
-
var
|
|
5720
|
+
var import_core22 = require("@lightsparkdev/core");
|
|
5678
5721
|
var WithdrawalFromJson = (obj) => {
|
|
5679
5722
|
return {
|
|
5680
5723
|
id: obj["withdrawal_id"],
|
|
@@ -5693,7 +5736,7 @@ var WithdrawalFromJson = (obj) => {
|
|
|
5693
5736
|
numConfirmations: obj["withdrawal_num_confirmations"]
|
|
5694
5737
|
};
|
|
5695
5738
|
};
|
|
5696
|
-
var
|
|
5739
|
+
var FRAGMENT22 = `
|
|
5697
5740
|
fragment WithdrawalFragment on Withdrawal {
|
|
5698
5741
|
__typename
|
|
5699
5742
|
withdrawal_id: id
|
|
@@ -5737,10 +5780,10 @@ query GetWithdrawal($id: ID!) {
|
|
|
5737
5780
|
}
|
|
5738
5781
|
}
|
|
5739
5782
|
|
|
5740
|
-
${
|
|
5783
|
+
${FRAGMENT22}
|
|
5741
5784
|
`,
|
|
5742
5785
|
variables: { id },
|
|
5743
|
-
constructObject: (data) => (0,
|
|
5786
|
+
constructObject: (data) => (0, import_core22.isObject)(data) && "entity" in data && (0, import_core22.isObject)(data.entity) ? WithdrawalFromJson(data.entity) : null
|
|
5744
5787
|
};
|
|
5745
5788
|
};
|
|
5746
5789
|
|
|
@@ -5963,10 +6006,10 @@ query GetWithdrawalRequest($id: ID!) {
|
|
|
5963
6006
|
}
|
|
5964
6007
|
}
|
|
5965
6008
|
|
|
5966
|
-
${
|
|
6009
|
+
${FRAGMENT23}
|
|
5967
6010
|
`,
|
|
5968
6011
|
variables: { id },
|
|
5969
|
-
constructObject: (data) => (0,
|
|
6012
|
+
constructObject: (data) => (0, import_core23.isObject)(data) && "entity" in data && (0, import_core23.isObject)(data.entity) ? WithdrawalRequestFromJson(data.entity) : null
|
|
5970
6013
|
};
|
|
5971
6014
|
}
|
|
5972
6015
|
toJson() {
|
|
@@ -6012,7 +6055,7 @@ var WithdrawalRequestFromJson = (obj) => {
|
|
|
6012
6055
|
obj["withdrawal_request_idempotency_key"]
|
|
6013
6056
|
);
|
|
6014
6057
|
};
|
|
6015
|
-
var
|
|
6058
|
+
var FRAGMENT23 = `
|
|
6016
6059
|
fragment WithdrawalRequestFragment on WithdrawalRequest {
|
|
6017
6060
|
__typename
|
|
6018
6061
|
withdrawal_request_id: id
|
|
@@ -6090,7 +6133,7 @@ var RequestWithdrawal = `
|
|
|
6090
6133
|
}
|
|
6091
6134
|
}
|
|
6092
6135
|
|
|
6093
|
-
${
|
|
6136
|
+
${FRAGMENT23}
|
|
6094
6137
|
`;
|
|
6095
6138
|
|
|
6096
6139
|
// src/graphql/ScreenNode.ts
|
|
@@ -6132,11 +6175,11 @@ var SendPayment = `
|
|
|
6132
6175
|
}
|
|
6133
6176
|
}
|
|
6134
6177
|
|
|
6135
|
-
${
|
|
6178
|
+
${FRAGMENT18}
|
|
6136
6179
|
`;
|
|
6137
6180
|
|
|
6138
6181
|
// src/objects/Transaction.ts
|
|
6139
|
-
var
|
|
6182
|
+
var import_core24 = require("@lightsparkdev/core");
|
|
6140
6183
|
|
|
6141
6184
|
// src/objects/RoutingTransactionFailureReason.ts
|
|
6142
6185
|
var RoutingTransactionFailureReason = /* @__PURE__ */ ((RoutingTransactionFailureReason2) => {
|
|
@@ -6285,12 +6328,12 @@ var TransactionFromJson = (obj) => {
|
|
|
6285
6328
|
numConfirmations: obj["withdrawal_num_confirmations"]
|
|
6286
6329
|
};
|
|
6287
6330
|
}
|
|
6288
|
-
throw new
|
|
6331
|
+
throw new import_core24.LightsparkException(
|
|
6289
6332
|
"DeserializationError",
|
|
6290
6333
|
`Couldn't find a concrete type for interface Transaction corresponding to the typename=${obj["__typename"]}`
|
|
6291
6334
|
);
|
|
6292
6335
|
};
|
|
6293
|
-
var
|
|
6336
|
+
var FRAGMENT24 = `
|
|
6294
6337
|
fragment TransactionFragment on Transaction {
|
|
6295
6338
|
__typename
|
|
6296
6339
|
... on ChannelClosingTransaction {
|
|
@@ -6852,10 +6895,10 @@ query GetTransaction($id: ID!) {
|
|
|
6852
6895
|
}
|
|
6853
6896
|
}
|
|
6854
6897
|
|
|
6855
|
-
${
|
|
6898
|
+
${FRAGMENT24}
|
|
6856
6899
|
`,
|
|
6857
6900
|
variables: { id },
|
|
6858
|
-
constructObject: (data) => (0,
|
|
6901
|
+
constructObject: (data) => (0, import_core24.isObject)(data) && "entity" in data && (0, import_core24.isObject)(data.entity) ? TransactionFromJson(data.entity) : null
|
|
6859
6902
|
};
|
|
6860
6903
|
};
|
|
6861
6904
|
|
|
@@ -6967,7 +7010,7 @@ query SingleNodeDashboard(
|
|
|
6967
7010
|
}
|
|
6968
7011
|
}
|
|
6969
7012
|
|
|
6970
|
-
${
|
|
7013
|
+
${FRAGMENT24}
|
|
6971
7014
|
${FRAGMENT}
|
|
6972
7015
|
`;
|
|
6973
7016
|
|
|
@@ -6984,7 +7027,7 @@ var TransactionUpdateFromJson = (obj) => {
|
|
|
6984
7027
|
transactionHash: obj["transaction_hash"]
|
|
6985
7028
|
};
|
|
6986
7029
|
};
|
|
6987
|
-
var
|
|
7030
|
+
var FRAGMENT25 = `
|
|
6988
7031
|
fragment TransactionUpdateFragment on Transaction {
|
|
6989
7032
|
__typename
|
|
6990
7033
|
id
|
|
@@ -7014,7 +7057,7 @@ subscription TransactionSubscription(
|
|
|
7014
7057
|
}
|
|
7015
7058
|
}
|
|
7016
7059
|
|
|
7017
|
-
${
|
|
7060
|
+
${FRAGMENT25}
|
|
7018
7061
|
`;
|
|
7019
7062
|
|
|
7020
7063
|
// src/graphql/TransactionsForNode.ts
|
|
@@ -7052,7 +7095,7 @@ query TransactionsForNode(
|
|
|
7052
7095
|
}
|
|
7053
7096
|
}
|
|
7054
7097
|
|
|
7055
|
-
${
|
|
7098
|
+
${FRAGMENT24}
|
|
7056
7099
|
${FRAGMENT}
|
|
7057
7100
|
`;
|
|
7058
7101
|
|
|
@@ -7064,7 +7107,7 @@ var WithdrawalFeeEstimateOutputFromJson = (obj) => {
|
|
|
7064
7107
|
)
|
|
7065
7108
|
};
|
|
7066
7109
|
};
|
|
7067
|
-
var
|
|
7110
|
+
var FRAGMENT26 = `
|
|
7068
7111
|
fragment WithdrawalFeeEstimateOutputFragment on WithdrawalFeeEstimateOutput {
|
|
7069
7112
|
__typename
|
|
7070
7113
|
withdrawal_fee_estimate_output_fee_estimate: fee_estimate {
|
|
@@ -7093,15 +7136,15 @@ var WithdrawalFeeEstimate = `
|
|
|
7093
7136
|
}
|
|
7094
7137
|
}
|
|
7095
7138
|
|
|
7096
|
-
${
|
|
7139
|
+
${FRAGMENT26}
|
|
7097
7140
|
`;
|
|
7098
7141
|
|
|
7099
7142
|
// src/logger.ts
|
|
7100
|
-
var
|
|
7101
|
-
var logger = new
|
|
7143
|
+
var import_core25 = require("@lightsparkdev/core");
|
|
7144
|
+
var logger = new import_core25.Logger("@lightsparkdev/lightspark-sdk");
|
|
7102
7145
|
|
|
7103
7146
|
// src/objects/Account.ts
|
|
7104
|
-
var
|
|
7147
|
+
var import_core28 = require("@lightsparkdev/core");
|
|
7105
7148
|
|
|
7106
7149
|
// src/objects/AccountToApiTokensConnection.ts
|
|
7107
7150
|
var AccountToApiTokensConnectionFromJson = (obj) => {
|
|
@@ -7130,7 +7173,7 @@ var AccountToChannelsConnectionFromJson = (obj) => {
|
|
|
7130
7173
|
};
|
|
7131
7174
|
|
|
7132
7175
|
// src/objects/LightsparkNode.ts
|
|
7133
|
-
var
|
|
7176
|
+
var import_core26 = require("@lightsparkdev/core");
|
|
7134
7177
|
var LightsparkNodeFromJson = (obj) => {
|
|
7135
7178
|
if (obj["__typename"] == "LightsparkNodeWithOSK") {
|
|
7136
7179
|
return new LightsparkNodeWithOSK_default(
|
|
@@ -7201,12 +7244,12 @@ var LightsparkNodeFromJson = (obj) => {
|
|
|
7201
7244
|
!!obj["lightspark_node_with_remote_signing_balances"] ? BalancesFromJson(obj["lightspark_node_with_remote_signing_balances"]) : void 0
|
|
7202
7245
|
);
|
|
7203
7246
|
}
|
|
7204
|
-
throw new
|
|
7247
|
+
throw new import_core26.LightsparkException(
|
|
7205
7248
|
"DeserializationError",
|
|
7206
7249
|
`Couldn't find a concrete type for interface LightsparkNode corresponding to the typename=${obj["__typename"]}`
|
|
7207
7250
|
);
|
|
7208
7251
|
};
|
|
7209
|
-
var
|
|
7252
|
+
var FRAGMENT27 = `
|
|
7210
7253
|
fragment LightsparkNodeFragment on LightsparkNode {
|
|
7211
7254
|
__typename
|
|
7212
7255
|
... on LightsparkNodeWithOSK {
|
|
@@ -7480,10 +7523,10 @@ query GetLightsparkNode($id: ID!) {
|
|
|
7480
7523
|
}
|
|
7481
7524
|
}
|
|
7482
7525
|
|
|
7483
|
-
${
|
|
7526
|
+
${FRAGMENT27}
|
|
7484
7527
|
`,
|
|
7485
7528
|
variables: { id },
|
|
7486
|
-
constructObject: (data) => (0,
|
|
7529
|
+
constructObject: (data) => (0, import_core26.isObject)(data) && "entity" in data && (0, import_core26.isObject)(data.entity) ? LightsparkNodeFromJson(data.entity) : null
|
|
7487
7530
|
};
|
|
7488
7531
|
};
|
|
7489
7532
|
|
|
@@ -7537,7 +7580,7 @@ var AccountToTransactionsConnectionFromJson = (obj) => {
|
|
|
7537
7580
|
};
|
|
7538
7581
|
|
|
7539
7582
|
// src/objects/Wallet.ts
|
|
7540
|
-
var
|
|
7583
|
+
var import_core27 = require("@lightsparkdev/core");
|
|
7541
7584
|
|
|
7542
7585
|
// src/objects/WalletStatus.ts
|
|
7543
7586
|
var WalletStatus = /* @__PURE__ */ ((WalletStatus2) => {
|
|
@@ -8701,10 +8744,10 @@ query GetWallet($id: ID!) {
|
|
|
8701
8744
|
}
|
|
8702
8745
|
}
|
|
8703
8746
|
|
|
8704
|
-
${
|
|
8747
|
+
${FRAGMENT28}
|
|
8705
8748
|
`,
|
|
8706
8749
|
variables: { id },
|
|
8707
|
-
constructObject: (data) => (0,
|
|
8750
|
+
constructObject: (data) => (0, import_core27.isObject)(data) && "entity" in data && (0, import_core27.isObject)(data.entity) ? WalletFromJson(data.entity) : null
|
|
8708
8751
|
};
|
|
8709
8752
|
}
|
|
8710
8753
|
toJson() {
|
|
@@ -8734,7 +8777,7 @@ var WalletFromJson = (obj) => {
|
|
|
8734
8777
|
obj["wallet_account"]?.id ?? void 0
|
|
8735
8778
|
);
|
|
8736
8779
|
};
|
|
8737
|
-
var
|
|
8780
|
+
var FRAGMENT28 = `
|
|
8738
8781
|
fragment WalletFragment on Wallet {
|
|
8739
8782
|
__typename
|
|
8740
8783
|
wallet_id: id
|
|
@@ -10567,10 +10610,10 @@ query GetAccount {
|
|
|
10567
10610
|
}
|
|
10568
10611
|
}
|
|
10569
10612
|
|
|
10570
|
-
${
|
|
10613
|
+
${FRAGMENT29}
|
|
10571
10614
|
`,
|
|
10572
10615
|
variables: {},
|
|
10573
|
-
constructObject: (data) => (0,
|
|
10616
|
+
constructObject: (data) => (0, import_core28.isObject)(data) && "current_account" in data && (0, import_core28.isObject)(data.current_account) ? AccountFromJson(data.current_account) : null
|
|
10574
10617
|
};
|
|
10575
10618
|
}
|
|
10576
10619
|
toJson() {
|
|
@@ -10592,7 +10635,7 @@ var AccountFromJson = (obj) => {
|
|
|
10592
10635
|
obj["account_name"]
|
|
10593
10636
|
);
|
|
10594
10637
|
};
|
|
10595
|
-
var
|
|
10638
|
+
var FRAGMENT29 = `
|
|
10596
10639
|
fragment AccountFragment on Account {
|
|
10597
10640
|
__typename
|
|
10598
10641
|
account_id: id
|
|
@@ -10626,18 +10669,18 @@ var LightsparkClient = class {
|
|
|
10626
10669
|
* implementation from `@lightsparkdev/react-native`.
|
|
10627
10670
|
* @param signingKey Passing in a signing key enables you to overload the default signing behavior. You can implement your own SigningKey class to make requests to a secure environment to sign or load a locally persisted key. WARNING: Typically, you won't need to set this parameter unless you want to customize the OSK signing flow. Most users should just use `loadNodeSigningKey` instead of passing this parameter.
|
|
10628
10671
|
*/
|
|
10629
|
-
constructor(authProvider = new
|
|
10672
|
+
constructor(authProvider = new import_core29.StubAuthProvider(), serverUrl = "api.lightspark.com", cryptoImpl = import_core29.DefaultCrypto, signingKey, fetchImpl = fetch) {
|
|
10630
10673
|
this.authProvider = authProvider;
|
|
10631
10674
|
this.serverUrl = serverUrl;
|
|
10632
10675
|
this.cryptoImpl = cryptoImpl;
|
|
10633
10676
|
this.signingKey = signingKey;
|
|
10634
10677
|
this.fetchImpl = fetchImpl;
|
|
10635
|
-
this.nodeKeyCache = new
|
|
10678
|
+
this.nodeKeyCache = new import_core29.NodeKeyCache(this.cryptoImpl);
|
|
10636
10679
|
this.nodeKeyLoaderCache = new NodeKeyLoaderCache(
|
|
10637
10680
|
this.nodeKeyCache,
|
|
10638
10681
|
this.cryptoImpl
|
|
10639
10682
|
);
|
|
10640
|
-
this.requester = new
|
|
10683
|
+
this.requester = new import_core29.Requester(
|
|
10641
10684
|
this.nodeKeyCache,
|
|
10642
10685
|
this.LIGHTSPARK_SDK_ENDPOINT,
|
|
10643
10686
|
`js-lightspark-sdk/${sdkVersion}`,
|
|
@@ -10686,7 +10729,7 @@ var LightsparkClient = class {
|
|
|
10686
10729
|
* @param authProvider
|
|
10687
10730
|
*/
|
|
10688
10731
|
setAuthProvider(authProvider) {
|
|
10689
|
-
this.requester = new
|
|
10732
|
+
this.requester = new import_core29.Requester(
|
|
10690
10733
|
this.nodeKeyCache,
|
|
10691
10734
|
this.LIGHTSPARK_SDK_ENDPOINT,
|
|
10692
10735
|
`js-lightspark-sdk/${sdkVersion}`,
|
|
@@ -10793,10 +10836,10 @@ var LightsparkClient = class {
|
|
|
10793
10836
|
network: bitcoinNetwork
|
|
10794
10837
|
});
|
|
10795
10838
|
if (!response.current_account) {
|
|
10796
|
-
throw new
|
|
10839
|
+
throw new import_core29.LightsparkAuthException("No current account");
|
|
10797
10840
|
}
|
|
10798
10841
|
if (!response.current_account.dashboard_overview_nodes || response.current_account.dashboard_overview_nodes.entities.length === 0) {
|
|
10799
|
-
throw new
|
|
10842
|
+
throw new import_core29.LightsparkException(
|
|
10800
10843
|
"NO_NODES_FOUND",
|
|
10801
10844
|
`No nodes found for this dashboard request. This could mean one of a few things:
|
|
10802
10845
|
1. You are requesting MAINNET nodes, but you have no MAINNET nodes yet. In this case, request BitcoinNetwork.REGTEST instead.
|
|
@@ -10867,11 +10910,11 @@ var LightsparkClient = class {
|
|
|
10867
10910
|
}
|
|
10868
10911
|
);
|
|
10869
10912
|
if (!response.current_account) {
|
|
10870
|
-
throw new
|
|
10913
|
+
throw new import_core29.LightsparkAuthException("No current account");
|
|
10871
10914
|
}
|
|
10872
10915
|
const account = response.current_account;
|
|
10873
10916
|
if (!account.dashboard_overview_nodes || !account.dashboard_overview_nodes.entities || account.dashboard_overview_nodes.entities.length === 0) {
|
|
10874
|
-
throw new
|
|
10917
|
+
throw new import_core29.LightsparkException(
|
|
10875
10918
|
"InvalidOrMissingNode",
|
|
10876
10919
|
"No nodes found for node dashboard"
|
|
10877
10920
|
);
|
|
@@ -10985,7 +11028,7 @@ var LightsparkClient = class {
|
|
|
10985
11028
|
* @returns An Invoice object representing the generated invoice.
|
|
10986
11029
|
*/
|
|
10987
11030
|
async createLnurlInvoice(nodeId, amountMsats, metadata, expirySecs = void 0) {
|
|
10988
|
-
const metadataHash = await (0,
|
|
11031
|
+
const metadataHash = await (0, import_core29.createSha256Hash)(metadata, true);
|
|
10989
11032
|
const variables = {
|
|
10990
11033
|
node_id: nodeId,
|
|
10991
11034
|
amount_msats: amountMsats,
|
|
@@ -11024,11 +11067,11 @@ var LightsparkClient = class {
|
|
|
11024
11067
|
* @returns An Invoice object representing the generated invoice.
|
|
11025
11068
|
*/
|
|
11026
11069
|
async createUmaInvoice(nodeId, amountMsats, metadata, expirySecs = void 0, signingPrivateKey = void 0, receiverIdentifier = void 0) {
|
|
11027
|
-
const metadataHash = await (0,
|
|
11070
|
+
const metadataHash = await (0, import_core29.createSha256Hash)(metadata, true);
|
|
11028
11071
|
let receiverHash = void 0;
|
|
11029
11072
|
if (receiverIdentifier !== void 0) {
|
|
11030
11073
|
if (signingPrivateKey == void 0) {
|
|
11031
|
-
throw new
|
|
11074
|
+
throw new import_core29.LightsparkException(
|
|
11032
11075
|
"CreateUmaInvoiceError",
|
|
11033
11076
|
"Receiver identifier provided without signing private key"
|
|
11034
11077
|
);
|
|
@@ -11154,7 +11197,7 @@ var LightsparkClient = class {
|
|
|
11154
11197
|
* @param withdrawalMode The strategy that should be used to withdraw the funds from this node.
|
|
11155
11198
|
* @returns An estimated amount for the L1 withdrawal fees for the specified node, amount, and strategy.
|
|
11156
11199
|
*/
|
|
11157
|
-
async
|
|
11200
|
+
async getWithdrawalFeeEstimate(nodeId, amountSats, withdrawalMode) {
|
|
11158
11201
|
const response = await this.executeRawQuery({
|
|
11159
11202
|
queryPayload: WithdrawalFeeEstimate,
|
|
11160
11203
|
variables: {
|
|
@@ -11169,7 +11212,7 @@ var LightsparkClient = class {
|
|
|
11169
11212
|
}
|
|
11170
11213
|
});
|
|
11171
11214
|
if (!response) {
|
|
11172
|
-
throw new
|
|
11215
|
+
throw new import_core29.LightsparkException(
|
|
11173
11216
|
"WithdrawalFeeEstimateError",
|
|
11174
11217
|
"Null or invalid fee estimate response from server"
|
|
11175
11218
|
);
|
|
@@ -11186,7 +11229,7 @@ var LightsparkClient = class {
|
|
|
11186
11229
|
await this.nodeKeyCache.loadKey(
|
|
11187
11230
|
nodeId,
|
|
11188
11231
|
signingPrivateKeyOrAlias,
|
|
11189
|
-
|
|
11232
|
+
import_core29.SigningKeyType.RSASigningKey
|
|
11190
11233
|
);
|
|
11191
11234
|
}
|
|
11192
11235
|
/**
|
|
@@ -11210,7 +11253,7 @@ var LightsparkClient = class {
|
|
|
11210
11253
|
*/
|
|
11211
11254
|
async payInvoice(payerNodeId, encodedInvoice, maximumFeesMsats, timeoutSecs = 60, amountMsats = void 0) {
|
|
11212
11255
|
if (!this.nodeKeyCache.hasKey(payerNodeId)) {
|
|
11213
|
-
throw new
|
|
11256
|
+
throw new import_core29.LightsparkSigningException("Paying node is not unlocked");
|
|
11214
11257
|
}
|
|
11215
11258
|
const variables = {
|
|
11216
11259
|
node_id: payerNodeId,
|
|
@@ -11227,7 +11270,7 @@ var LightsparkClient = class {
|
|
|
11227
11270
|
payerNodeId
|
|
11228
11271
|
);
|
|
11229
11272
|
if (response.pay_invoice?.payment.outgoing_payment_failure_message) {
|
|
11230
|
-
throw new
|
|
11273
|
+
throw new import_core29.LightsparkException(
|
|
11231
11274
|
"PaymentError",
|
|
11232
11275
|
response.pay_invoice?.payment.outgoing_payment_failure_message.rich_text_text
|
|
11233
11276
|
);
|
|
@@ -11251,7 +11294,7 @@ var LightsparkClient = class {
|
|
|
11251
11294
|
*/
|
|
11252
11295
|
async payOffer(payerNodeId, encodedOffer, timeoutSecs, maximumFeeMsats, amountMsats, idempotencyKey) {
|
|
11253
11296
|
if (!this.nodeKeyCache.hasKey(payerNodeId)) {
|
|
11254
|
-
throw new
|
|
11297
|
+
throw new import_core29.LightsparkSigningException("Paying node is not unlocked");
|
|
11255
11298
|
}
|
|
11256
11299
|
const variables = {
|
|
11257
11300
|
node_id: payerNodeId,
|
|
@@ -11267,7 +11310,7 @@ var LightsparkClient = class {
|
|
|
11267
11310
|
payerNodeId
|
|
11268
11311
|
);
|
|
11269
11312
|
if (response.pay_offer?.payment.outgoing_payment_failure_message) {
|
|
11270
|
-
throw new
|
|
11313
|
+
throw new import_core29.LightsparkException(
|
|
11271
11314
|
"PaymentError",
|
|
11272
11315
|
response.pay_offer?.payment.outgoing_payment_failure_message.rich_text_text
|
|
11273
11316
|
);
|
|
@@ -11299,12 +11342,12 @@ var LightsparkClient = class {
|
|
|
11299
11342
|
*/
|
|
11300
11343
|
async payUmaInvoice(payerNodeId, encodedInvoice, maximumFeesMsats, timeoutSecs = 60, amountMsats = void 0, signingPrivateKey = void 0, senderIdentifier = void 0) {
|
|
11301
11344
|
if (!this.nodeKeyCache.hasKey(payerNodeId)) {
|
|
11302
|
-
throw new
|
|
11345
|
+
throw new import_core29.LightsparkSigningException("Paying node is not unlocked");
|
|
11303
11346
|
}
|
|
11304
11347
|
let senderHash = void 0;
|
|
11305
11348
|
if (senderIdentifier !== void 0) {
|
|
11306
11349
|
if (signingPrivateKey == void 0) {
|
|
11307
|
-
throw new
|
|
11350
|
+
throw new import_core29.LightsparkException(
|
|
11308
11351
|
"PayUmaInvoiceError",
|
|
11309
11352
|
"Sender identifier provided without signing private key"
|
|
11310
11353
|
);
|
|
@@ -11332,7 +11375,7 @@ var LightsparkClient = class {
|
|
|
11332
11375
|
payerNodeId
|
|
11333
11376
|
);
|
|
11334
11377
|
if (response.pay_uma_invoice?.payment.outgoing_payment_failure_message) {
|
|
11335
|
-
throw new
|
|
11378
|
+
throw new import_core29.LightsparkException(
|
|
11336
11379
|
"PaymentError",
|
|
11337
11380
|
response.pay_uma_invoice?.payment.outgoing_payment_failure_message.rich_text_text
|
|
11338
11381
|
);
|
|
@@ -11350,7 +11393,7 @@ var LightsparkClient = class {
|
|
|
11350
11393
|
const pollIntervalMs = 250;
|
|
11351
11394
|
const pollMaxTimeouts = pollTimeoutSecs * 1e3 / pollIntervalMs;
|
|
11352
11395
|
const pollIgnoreErrors = false;
|
|
11353
|
-
const transaction = await (0,
|
|
11396
|
+
const transaction = await (0, import_core29.pollUntil)(
|
|
11354
11397
|
() => {
|
|
11355
11398
|
return this.getTransaction(transactionId);
|
|
11356
11399
|
},
|
|
@@ -11370,7 +11413,7 @@ var LightsparkClient = class {
|
|
|
11370
11413
|
pollIntervalMs,
|
|
11371
11414
|
pollMaxTimeouts,
|
|
11372
11415
|
pollIgnoreErrors,
|
|
11373
|
-
() => new
|
|
11416
|
+
() => new import_core29.LightsparkException(
|
|
11374
11417
|
"Timeout",
|
|
11375
11418
|
"Timeout waiting for transaction to complete."
|
|
11376
11419
|
)
|
|
@@ -11394,7 +11437,7 @@ var LightsparkClient = class {
|
|
|
11394
11437
|
*/
|
|
11395
11438
|
async sendPayment(payerNodeId, destinationPublicKey, timeoutSecs = 60, amountMsats, maximumFeesMsats) {
|
|
11396
11439
|
if (!this.nodeKeyCache.hasKey(payerNodeId)) {
|
|
11397
|
-
throw new
|
|
11440
|
+
throw new import_core29.LightsparkSigningException("Paying node is not unlocked");
|
|
11398
11441
|
}
|
|
11399
11442
|
const response = await this.requester.makeRawRequest(
|
|
11400
11443
|
SendPayment,
|
|
@@ -11408,7 +11451,7 @@ var LightsparkClient = class {
|
|
|
11408
11451
|
payerNodeId
|
|
11409
11452
|
);
|
|
11410
11453
|
if (response.send_payment?.payment.outgoing_payment_failure_message) {
|
|
11411
|
-
throw new
|
|
11454
|
+
throw new import_core29.LightsparkException(
|
|
11412
11455
|
"PaymentError",
|
|
11413
11456
|
response.send_payment?.payment.outgoing_payment_failure_message.rich_text_text
|
|
11414
11457
|
);
|
|
@@ -11535,7 +11578,7 @@ var LightsparkClient = class {
|
|
|
11535
11578
|
constructObject: (responseJson) => {
|
|
11536
11579
|
const encodedPaymentRequest = responseJson.create_test_mode_invoice?.encoded_payment_request;
|
|
11537
11580
|
if (!encodedPaymentRequest) {
|
|
11538
|
-
throw new
|
|
11581
|
+
throw new import_core29.LightsparkException(
|
|
11539
11582
|
"CreateTestModeInvoiceError",
|
|
11540
11583
|
"Unable to create test mode invoice"
|
|
11541
11584
|
);
|
|
@@ -11586,7 +11629,7 @@ var LightsparkClient = class {
|
|
|
11586
11629
|
},
|
|
11587
11630
|
constructObject: (responseJson) => {
|
|
11588
11631
|
if (responseJson.screen_node?.rating === void 0) {
|
|
11589
|
-
throw new
|
|
11632
|
+
throw new import_core29.LightsparkException(
|
|
11590
11633
|
"ScreenNodeError",
|
|
11591
11634
|
"Unable to screen node"
|
|
11592
11635
|
);
|
|
@@ -11618,7 +11661,7 @@ var LightsparkClient = class {
|
|
|
11618
11661
|
},
|
|
11619
11662
|
constructObject: (responseJson) => {
|
|
11620
11663
|
if (!responseJson.register_payment?.payment?.id) {
|
|
11621
|
-
throw new
|
|
11664
|
+
throw new import_core29.LightsparkException(
|
|
11622
11665
|
"RegisterPaymentError",
|
|
11623
11666
|
"Unable to register payment"
|
|
11624
11667
|
);
|
|
@@ -11642,7 +11685,7 @@ var LightsparkClient = class {
|
|
|
11642
11685
|
},
|
|
11643
11686
|
constructObject: (responseJson) => {
|
|
11644
11687
|
if (!responseJson.create_uma_invitation?.invitation) {
|
|
11645
|
-
throw new
|
|
11688
|
+
throw new import_core29.LightsparkException(
|
|
11646
11689
|
"CreateUmaInvitationError",
|
|
11647
11690
|
"Unable to create UMA invitation"
|
|
11648
11691
|
);
|
|
@@ -11671,7 +11714,7 @@ var LightsparkClient = class {
|
|
|
11671
11714
|
},
|
|
11672
11715
|
constructObject: (responseJson) => {
|
|
11673
11716
|
if (!responseJson.create_uma_invitation_with_incentives?.invitation) {
|
|
11674
|
-
throw new
|
|
11717
|
+
throw new import_core29.LightsparkException(
|
|
11675
11718
|
"CreateUmaInvitationError",
|
|
11676
11719
|
"Unable to create UMA invitation"
|
|
11677
11720
|
);
|
|
@@ -11699,7 +11742,7 @@ var LightsparkClient = class {
|
|
|
11699
11742
|
},
|
|
11700
11743
|
constructObject: (responseJson) => {
|
|
11701
11744
|
if (!responseJson.claim_uma_invitation?.invitation) {
|
|
11702
|
-
throw new
|
|
11745
|
+
throw new import_core29.LightsparkException(
|
|
11703
11746
|
"ClaimUmaInvitationError",
|
|
11704
11747
|
"Unable to claim UMA invitation"
|
|
11705
11748
|
);
|
|
@@ -11731,7 +11774,7 @@ var LightsparkClient = class {
|
|
|
11731
11774
|
},
|
|
11732
11775
|
constructObject: (responseJson) => {
|
|
11733
11776
|
if (!responseJson.claim_uma_invitation_with_incentives?.invitation) {
|
|
11734
|
-
throw new
|
|
11777
|
+
throw new import_core29.LightsparkException(
|
|
11735
11778
|
"ClaimUmaInvitationError",
|
|
11736
11779
|
"Unable to claim UMA invitation"
|
|
11737
11780
|
);
|
|
@@ -11854,17 +11897,17 @@ var LightsparkClient = class {
|
|
|
11854
11897
|
async hashPhoneNumber(e164PhoneNumber) {
|
|
11855
11898
|
const e164PhoneRegex = /^\+[1-9]\d{1,14}$/;
|
|
11856
11899
|
if (!e164PhoneRegex.test(e164PhoneNumber)) {
|
|
11857
|
-
throw new
|
|
11900
|
+
throw new import_core29.LightsparkException(
|
|
11858
11901
|
"InvalidPhoneNumber",
|
|
11859
11902
|
"Invalid phone number. Phone number must be in E164 format."
|
|
11860
11903
|
);
|
|
11861
11904
|
}
|
|
11862
|
-
return await (0,
|
|
11905
|
+
return await (0, import_core29.createSha256Hash)(e164PhoneNumber, true);
|
|
11863
11906
|
}
|
|
11864
11907
|
async hashUmaIdentifier(identifier, signingPrivateKey) {
|
|
11865
11908
|
const now = this.getUtcDateTime();
|
|
11866
|
-
const input = identifier + `${now.getUTCMonth() + 1}-${now.getUTCFullYear()}` + (0,
|
|
11867
|
-
return await (0,
|
|
11909
|
+
const input = identifier + `${now.getUTCMonth() + 1}-${now.getUTCFullYear()}` + (0, import_core29.bytesToHex)(signingPrivateKey);
|
|
11910
|
+
return await (0, import_core29.createSha256Hash)(input, true);
|
|
11868
11911
|
}
|
|
11869
11912
|
getUtcDateTime() {
|
|
11870
11913
|
return /* @__PURE__ */ new Date();
|
|
@@ -11888,8 +11931,8 @@ var LightsparkClient = class {
|
|
|
11888
11931
|
* @param enabled Whether logging should be enabled.
|
|
11889
11932
|
* @param level The logging level to use.
|
|
11890
11933
|
* */
|
|
11891
|
-
setLoggingEnabled(enabled, level =
|
|
11892
|
-
|
|
11934
|
+
setLoggingEnabled(enabled, level = import_core29.LoggingLevel.Info) {
|
|
11935
|
+
import_core29.logger.setEnabled(enabled, level);
|
|
11893
11936
|
logger.setEnabled(enabled, level);
|
|
11894
11937
|
}
|
|
11895
11938
|
/**
|
|
@@ -11911,7 +11954,7 @@ var LightsparkClient = class {
|
|
|
11911
11954
|
},
|
|
11912
11955
|
constructObject: (responseJson) => {
|
|
11913
11956
|
if (!responseJson.create_uma_invitation_with_payment?.invitation) {
|
|
11914
|
-
throw new
|
|
11957
|
+
throw new import_core29.LightsparkException(
|
|
11915
11958
|
"CreateUmaInvitationWithPaymentError",
|
|
11916
11959
|
"Unable to create UMA invitation with payment"
|
|
11917
11960
|
);
|
|
@@ -11936,7 +11979,7 @@ var LightsparkClient = class {
|
|
|
11936
11979
|
},
|
|
11937
11980
|
constructObject: (responseJson) => {
|
|
11938
11981
|
if (!responseJson.cancel_uma_invitation?.invitation) {
|
|
11939
|
-
throw new
|
|
11982
|
+
throw new import_core29.LightsparkException(
|
|
11940
11983
|
"CancelUmaInvitationError",
|
|
11941
11984
|
"Unable to cancel UMA invitation"
|
|
11942
11985
|
);
|
|
@@ -11947,14 +11990,21 @@ var LightsparkClient = class {
|
|
|
11947
11990
|
}
|
|
11948
11991
|
});
|
|
11949
11992
|
}
|
|
11993
|
+
/**
|
|
11994
|
+
* Looks up a UMA address to check if it exists.
|
|
11995
|
+
*
|
|
11996
|
+
* @param umaAddress The UMA address to look up.
|
|
11997
|
+
* @returns True if the UMA address exists, false otherwise.
|
|
11998
|
+
*/
|
|
11950
11999
|
async lookupUmaAddress(umaAddress) {
|
|
11951
|
-
|
|
12000
|
+
const result = await this.executeRawQuery({
|
|
11952
12001
|
queryPayload: LookupUmaAddress,
|
|
11953
12002
|
variables: { uma_address: umaAddress },
|
|
11954
12003
|
constructObject: (responseJson) => {
|
|
11955
12004
|
return responseJson.lookup_uma_address;
|
|
11956
12005
|
}
|
|
11957
12006
|
});
|
|
12007
|
+
return result ?? false;
|
|
11958
12008
|
}
|
|
11959
12009
|
};
|
|
11960
12010
|
var client_default = LightsparkClient;
|
|
@@ -11984,7 +12034,7 @@ var getBitcoinNetworkOrThrow = (bitcoinNetwork) => {
|
|
|
11984
12034
|
};
|
|
11985
12035
|
|
|
11986
12036
|
// src/objects/AuditLogActor.ts
|
|
11987
|
-
var
|
|
12037
|
+
var import_core30 = require("@lightsparkdev/core");
|
|
11988
12038
|
var AuditLogActorFromJson = (obj) => {
|
|
11989
12039
|
if (obj["__typename"] == "ApiToken") {
|
|
11990
12040
|
return {
|
|
@@ -11998,12 +12048,12 @@ var AuditLogActorFromJson = (obj) => {
|
|
|
11998
12048
|
typename: "ApiToken"
|
|
11999
12049
|
};
|
|
12000
12050
|
}
|
|
12001
|
-
throw new
|
|
12051
|
+
throw new import_core30.LightsparkException(
|
|
12002
12052
|
"DeserializationError",
|
|
12003
12053
|
`Couldn't find a concrete type for interface AuditLogActor corresponding to the typename=${obj["__typename"]}`
|
|
12004
12054
|
);
|
|
12005
12055
|
};
|
|
12006
|
-
var
|
|
12056
|
+
var FRAGMENT30 = `
|
|
12007
12057
|
fragment AuditLogActorFragment on AuditLogActor {
|
|
12008
12058
|
__typename
|
|
12009
12059
|
... on ApiToken {
|
|
@@ -12028,15 +12078,15 @@ query GetAuditLogActor($id: ID!) {
|
|
|
12028
12078
|
}
|
|
12029
12079
|
}
|
|
12030
12080
|
|
|
12031
|
-
${
|
|
12081
|
+
${FRAGMENT30}
|
|
12032
12082
|
`,
|
|
12033
12083
|
variables: { id },
|
|
12034
|
-
constructObject: (data) => (0,
|
|
12084
|
+
constructObject: (data) => (0, import_core30.isObject)(data) && "entity" in data && (0, import_core30.isObject)(data.entity) ? AuditLogActorFromJson(data.entity) : null
|
|
12035
12085
|
};
|
|
12036
12086
|
};
|
|
12037
12087
|
|
|
12038
12088
|
// src/objects/ChannelSnapshot.ts
|
|
12039
|
-
var
|
|
12089
|
+
var import_core31 = require("@lightsparkdev/core");
|
|
12040
12090
|
var ChannelSnapshotFromJson = (obj) => {
|
|
12041
12091
|
return {
|
|
12042
12092
|
id: obj["channel_snapshot_id"],
|
|
@@ -12053,7 +12103,7 @@ var ChannelSnapshotFromJson = (obj) => {
|
|
|
12053
12103
|
localChannelReserve: !!obj["channel_snapshot_local_channel_reserve"] ? CurrencyAmountFromJson(obj["channel_snapshot_local_channel_reserve"]) : void 0
|
|
12054
12104
|
};
|
|
12055
12105
|
};
|
|
12056
|
-
var
|
|
12106
|
+
var FRAGMENT31 = `
|
|
12057
12107
|
fragment ChannelSnapshotFragment on ChannelSnapshot {
|
|
12058
12108
|
__typename
|
|
12059
12109
|
channel_snapshot_id: id
|
|
@@ -12116,10 +12166,10 @@ query GetChannelSnapshot($id: ID!) {
|
|
|
12116
12166
|
}
|
|
12117
12167
|
}
|
|
12118
12168
|
|
|
12119
|
-
${
|
|
12169
|
+
${FRAGMENT31}
|
|
12120
12170
|
`,
|
|
12121
12171
|
variables: { id },
|
|
12122
|
-
constructObject: (data) => (0,
|
|
12172
|
+
constructObject: (data) => (0, import_core31.isObject)(data) && "entity" in data && (0, import_core31.isObject)(data.entity) ? ChannelSnapshotFromJson(data.entity) : null
|
|
12123
12173
|
};
|
|
12124
12174
|
};
|
|
12125
12175
|
|
|
@@ -12389,10 +12439,10 @@ var ComplianceProvider = /* @__PURE__ */ ((ComplianceProvider2) => {
|
|
|
12389
12439
|
var ComplianceProvider_default = ComplianceProvider;
|
|
12390
12440
|
|
|
12391
12441
|
// src/objects/Connection.ts
|
|
12392
|
-
var
|
|
12442
|
+
var import_core32 = require("@lightsparkdev/core");
|
|
12393
12443
|
|
|
12394
12444
|
// src/objects/SignablePayload.ts
|
|
12395
|
-
var
|
|
12445
|
+
var import_core33 = require("@lightsparkdev/core");
|
|
12396
12446
|
|
|
12397
12447
|
// src/objects/SignablePayloadStatus.ts
|
|
12398
12448
|
var SignablePayloadStatus = /* @__PURE__ */ ((SignablePayloadStatus2) => {
|
|
@@ -12420,7 +12470,7 @@ var SignablePayloadFromJson = (obj) => {
|
|
|
12420
12470
|
mulTweak: obj["signable_payload_mul_tweak"]
|
|
12421
12471
|
};
|
|
12422
12472
|
};
|
|
12423
|
-
var
|
|
12473
|
+
var FRAGMENT32 = `
|
|
12424
12474
|
fragment SignablePayloadFragment on SignablePayload {
|
|
12425
12475
|
__typename
|
|
12426
12476
|
signable_payload_id: id
|
|
@@ -12446,15 +12496,15 @@ query GetSignablePayload($id: ID!) {
|
|
|
12446
12496
|
}
|
|
12447
12497
|
}
|
|
12448
12498
|
|
|
12449
|
-
${
|
|
12499
|
+
${FRAGMENT32}
|
|
12450
12500
|
`,
|
|
12451
12501
|
variables: { id },
|
|
12452
|
-
constructObject: (data) => (0,
|
|
12502
|
+
constructObject: (data) => (0, import_core33.isObject)(data) && "entity" in data && (0, import_core33.isObject)(data.entity) ? SignablePayloadFromJson(data.entity) : null
|
|
12453
12503
|
};
|
|
12454
12504
|
};
|
|
12455
12505
|
|
|
12456
12506
|
// src/objects/Deposit.ts
|
|
12457
|
-
var
|
|
12507
|
+
var import_core34 = require("@lightsparkdev/core");
|
|
12458
12508
|
var DepositFromJson = (obj) => {
|
|
12459
12509
|
return {
|
|
12460
12510
|
id: obj["deposit_id"],
|
|
@@ -12473,7 +12523,7 @@ var DepositFromJson = (obj) => {
|
|
|
12473
12523
|
numConfirmations: obj["deposit_num_confirmations"]
|
|
12474
12524
|
};
|
|
12475
12525
|
};
|
|
12476
|
-
var
|
|
12526
|
+
var FRAGMENT33 = `
|
|
12477
12527
|
fragment DepositFragment on Deposit {
|
|
12478
12528
|
__typename
|
|
12479
12529
|
deposit_id: id
|
|
@@ -12517,15 +12567,15 @@ query GetDeposit($id: ID!) {
|
|
|
12517
12567
|
}
|
|
12518
12568
|
}
|
|
12519
12569
|
|
|
12520
|
-
${
|
|
12570
|
+
${FRAGMENT33}
|
|
12521
12571
|
`,
|
|
12522
12572
|
variables: { id },
|
|
12523
|
-
constructObject: (data) => (0,
|
|
12573
|
+
constructObject: (data) => (0, import_core34.isObject)(data) && "entity" in data && (0, import_core34.isObject)(data.entity) ? DepositFromJson(data.entity) : null
|
|
12524
12574
|
};
|
|
12525
12575
|
};
|
|
12526
12576
|
|
|
12527
12577
|
// src/objects/LightningTransaction.ts
|
|
12528
|
-
var
|
|
12578
|
+
var import_core35 = require("@lightsparkdev/core");
|
|
12529
12579
|
var LightningTransactionFromJson = (obj) => {
|
|
12530
12580
|
if (obj["__typename"] == "IncomingPayment") {
|
|
12531
12581
|
return new IncomingPayment_default(
|
|
@@ -12590,12 +12640,12 @@ var LightningTransactionFromJson = (obj) => {
|
|
|
12590
12640
|
failureReason: !!obj["routing_transaction_failure_reason"] ? RoutingTransactionFailureReason_default[obj["routing_transaction_failure_reason"]] ?? RoutingTransactionFailureReason_default.FUTURE_VALUE : null
|
|
12591
12641
|
};
|
|
12592
12642
|
}
|
|
12593
|
-
throw new
|
|
12643
|
+
throw new import_core35.LightsparkException(
|
|
12594
12644
|
"DeserializationError",
|
|
12595
12645
|
`Couldn't find a concrete type for interface LightningTransaction corresponding to the typename=${obj["__typename"]}`
|
|
12596
12646
|
);
|
|
12597
12647
|
};
|
|
12598
|
-
var
|
|
12648
|
+
var FRAGMENT34 = `
|
|
12599
12649
|
fragment LightningTransactionFragment on LightningTransaction {
|
|
12600
12650
|
__typename
|
|
12601
12651
|
... on IncomingPayment {
|
|
@@ -13029,15 +13079,15 @@ query GetLightningTransaction($id: ID!) {
|
|
|
13029
13079
|
}
|
|
13030
13080
|
}
|
|
13031
13081
|
|
|
13032
|
-
${
|
|
13082
|
+
${FRAGMENT34}
|
|
13033
13083
|
`,
|
|
13034
13084
|
variables: { id },
|
|
13035
|
-
constructObject: (data) => (0,
|
|
13085
|
+
constructObject: (data) => (0, import_core35.isObject)(data) && "entity" in data && (0, import_core35.isObject)(data.entity) ? LightningTransactionFromJson(data.entity) : null
|
|
13036
13086
|
};
|
|
13037
13087
|
};
|
|
13038
13088
|
|
|
13039
13089
|
// src/objects/LightsparkNodeOwner.ts
|
|
13040
|
-
var
|
|
13090
|
+
var import_core36 = require("@lightsparkdev/core");
|
|
13041
13091
|
var LightsparkNodeOwnerFromJson = (obj) => {
|
|
13042
13092
|
if (obj["__typename"] == "Account") {
|
|
13043
13093
|
return new Account_default(
|
|
@@ -13061,12 +13111,12 @@ var LightsparkNodeOwnerFromJson = (obj) => {
|
|
|
13061
13111
|
obj["wallet_account"]?.id ?? void 0
|
|
13062
13112
|
);
|
|
13063
13113
|
}
|
|
13064
|
-
throw new
|
|
13114
|
+
throw new import_core36.LightsparkException(
|
|
13065
13115
|
"DeserializationError",
|
|
13066
13116
|
`Couldn't find a concrete type for interface LightsparkNodeOwner corresponding to the typename=${obj["__typename"]}`
|
|
13067
13117
|
);
|
|
13068
13118
|
};
|
|
13069
|
-
var
|
|
13119
|
+
var FRAGMENT35 = `
|
|
13070
13120
|
fragment LightsparkNodeOwnerFragment on LightsparkNodeOwner {
|
|
13071
13121
|
__typename
|
|
13072
13122
|
... on Account {
|
|
@@ -13127,15 +13177,15 @@ query GetLightsparkNodeOwner($id: ID!) {
|
|
|
13127
13177
|
}
|
|
13128
13178
|
}
|
|
13129
13179
|
|
|
13130
|
-
${
|
|
13180
|
+
${FRAGMENT35}
|
|
13131
13181
|
`,
|
|
13132
13182
|
variables: { id },
|
|
13133
|
-
constructObject: (data) => (0,
|
|
13183
|
+
constructObject: (data) => (0, import_core36.isObject)(data) && "entity" in data && (0, import_core36.isObject)(data.entity) ? LightsparkNodeOwnerFromJson(data.entity) : null
|
|
13134
13184
|
};
|
|
13135
13185
|
};
|
|
13136
13186
|
|
|
13137
13187
|
// src/objects/Offer.ts
|
|
13138
|
-
var
|
|
13188
|
+
var import_core37 = require("@lightsparkdev/core");
|
|
13139
13189
|
var OfferFromJson = (obj) => {
|
|
13140
13190
|
return {
|
|
13141
13191
|
id: obj["offer_id"],
|
|
@@ -13148,7 +13198,7 @@ var OfferFromJson = (obj) => {
|
|
|
13148
13198
|
description: obj["offer_description"]
|
|
13149
13199
|
};
|
|
13150
13200
|
};
|
|
13151
|
-
var
|
|
13201
|
+
var FRAGMENT36 = `
|
|
13152
13202
|
fragment OfferFragment on Offer {
|
|
13153
13203
|
__typename
|
|
13154
13204
|
offer_id: id
|
|
@@ -13179,15 +13229,15 @@ query GetOffer($id: ID!) {
|
|
|
13179
13229
|
}
|
|
13180
13230
|
}
|
|
13181
13231
|
|
|
13182
|
-
${
|
|
13232
|
+
${FRAGMENT36}
|
|
13183
13233
|
`,
|
|
13184
13234
|
variables: { id },
|
|
13185
|
-
constructObject: (data) => (0,
|
|
13235
|
+
constructObject: (data) => (0, import_core37.isObject)(data) && "entity" in data && (0, import_core37.isObject)(data.entity) ? OfferFromJson(data.entity) : null
|
|
13186
13236
|
};
|
|
13187
13237
|
};
|
|
13188
13238
|
|
|
13189
13239
|
// src/objects/OfferData.ts
|
|
13190
|
-
var
|
|
13240
|
+
var import_core38 = require("@lightsparkdev/core");
|
|
13191
13241
|
var OfferDataFromJson = (obj) => {
|
|
13192
13242
|
return {
|
|
13193
13243
|
id: obj["offer_data_id"],
|
|
@@ -13202,7 +13252,7 @@ var OfferDataFromJson = (obj) => {
|
|
|
13202
13252
|
expiresAt: obj["offer_data_expires_at"]
|
|
13203
13253
|
};
|
|
13204
13254
|
};
|
|
13205
|
-
var
|
|
13255
|
+
var FRAGMENT37 = `
|
|
13206
13256
|
fragment OfferDataFragment on OfferData {
|
|
13207
13257
|
__typename
|
|
13208
13258
|
offer_data_id: id
|
|
@@ -13231,10 +13281,10 @@ query GetOfferData($id: ID!) {
|
|
|
13231
13281
|
}
|
|
13232
13282
|
}
|
|
13233
13283
|
|
|
13234
|
-
${
|
|
13284
|
+
${FRAGMENT37}
|
|
13235
13285
|
`,
|
|
13236
13286
|
variables: { id },
|
|
13237
|
-
constructObject: (data) => (0,
|
|
13287
|
+
constructObject: (data) => (0, import_core38.isObject)(data) && "entity" in data && (0, import_core38.isObject)(data.entity) ? OfferDataFromJson(data.entity) : null
|
|
13238
13288
|
};
|
|
13239
13289
|
};
|
|
13240
13290
|
|
|
@@ -13250,7 +13300,7 @@ var OnChainFeeTarget = /* @__PURE__ */ ((OnChainFeeTarget2) => {
|
|
|
13250
13300
|
var OnChainFeeTarget_default = OnChainFeeTarget;
|
|
13251
13301
|
|
|
13252
13302
|
// src/objects/OnChainTransaction.ts
|
|
13253
|
-
var
|
|
13303
|
+
var import_core39 = require("@lightsparkdev/core");
|
|
13254
13304
|
var OnChainTransactionFromJson = (obj) => {
|
|
13255
13305
|
if (obj["__typename"] == "ChannelClosingTransaction") {
|
|
13256
13306
|
return {
|
|
@@ -13324,12 +13374,12 @@ var OnChainTransactionFromJson = (obj) => {
|
|
|
13324
13374
|
numConfirmations: obj["withdrawal_num_confirmations"]
|
|
13325
13375
|
};
|
|
13326
13376
|
}
|
|
13327
|
-
throw new
|
|
13377
|
+
throw new import_core39.LightsparkException(
|
|
13328
13378
|
"DeserializationError",
|
|
13329
13379
|
`Couldn't find a concrete type for interface OnChainTransaction corresponding to the typename=${obj["__typename"]}`
|
|
13330
13380
|
);
|
|
13331
13381
|
};
|
|
13332
|
-
var
|
|
13382
|
+
var FRAGMENT38 = `
|
|
13333
13383
|
fragment OnChainTransactionFragment on OnChainTransaction {
|
|
13334
13384
|
__typename
|
|
13335
13385
|
... on ChannelClosingTransaction {
|
|
@@ -13472,10 +13522,10 @@ query GetOnChainTransaction($id: ID!) {
|
|
|
13472
13522
|
}
|
|
13473
13523
|
}
|
|
13474
13524
|
|
|
13475
|
-
${
|
|
13525
|
+
${FRAGMENT38}
|
|
13476
13526
|
`,
|
|
13477
13527
|
variables: { id },
|
|
13478
|
-
constructObject: (data) => (0,
|
|
13528
|
+
constructObject: (data) => (0, import_core39.isObject)(data) && "entity" in data && (0, import_core39.isObject)(data.entity) ? OnChainTransactionFromJson(data.entity) : null
|
|
13479
13529
|
};
|
|
13480
13530
|
};
|
|
13481
13531
|
|
|
@@ -13515,7 +13565,7 @@ var RiskRating = /* @__PURE__ */ ((RiskRating2) => {
|
|
|
13515
13565
|
var RiskRating_default = RiskRating;
|
|
13516
13566
|
|
|
13517
13567
|
// src/objects/RoutingTransaction.ts
|
|
13518
|
-
var
|
|
13568
|
+
var import_core40 = require("@lightsparkdev/core");
|
|
13519
13569
|
var RoutingTransactionFromJson = (obj) => {
|
|
13520
13570
|
return {
|
|
13521
13571
|
id: obj["routing_transaction_id"],
|
|
@@ -13533,7 +13583,7 @@ var RoutingTransactionFromJson = (obj) => {
|
|
|
13533
13583
|
failureReason: !!obj["routing_transaction_failure_reason"] ? RoutingTransactionFailureReason_default[obj["routing_transaction_failure_reason"]] ?? RoutingTransactionFailureReason_default.FUTURE_VALUE : null
|
|
13534
13584
|
};
|
|
13535
13585
|
};
|
|
13536
|
-
var
|
|
13586
|
+
var FRAGMENT39 = `
|
|
13537
13587
|
fragment RoutingTransactionFragment on RoutingTransaction {
|
|
13538
13588
|
__typename
|
|
13539
13589
|
routing_transaction_id: id
|
|
@@ -13581,15 +13631,15 @@ query GetRoutingTransaction($id: ID!) {
|
|
|
13581
13631
|
}
|
|
13582
13632
|
}
|
|
13583
13633
|
|
|
13584
|
-
${
|
|
13634
|
+
${FRAGMENT39}
|
|
13585
13635
|
`,
|
|
13586
13636
|
variables: { id },
|
|
13587
|
-
constructObject: (data) => (0,
|
|
13637
|
+
constructObject: (data) => (0, import_core40.isObject)(data) && "entity" in data && (0, import_core40.isObject)(data.entity) ? RoutingTransactionFromJson(data.entity) : null
|
|
13588
13638
|
};
|
|
13589
13639
|
};
|
|
13590
13640
|
|
|
13591
13641
|
// src/objects/Signable.ts
|
|
13592
|
-
var
|
|
13642
|
+
var import_core41 = require("@lightsparkdev/core");
|
|
13593
13643
|
var SignableFromJson = (obj) => {
|
|
13594
13644
|
return {
|
|
13595
13645
|
id: obj["signable_id"],
|
|
@@ -13598,7 +13648,7 @@ var SignableFromJson = (obj) => {
|
|
|
13598
13648
|
typename: "Signable"
|
|
13599
13649
|
};
|
|
13600
13650
|
};
|
|
13601
|
-
var
|
|
13651
|
+
var FRAGMENT40 = `
|
|
13602
13652
|
fragment SignableFragment on Signable {
|
|
13603
13653
|
__typename
|
|
13604
13654
|
signable_id: id
|
|
@@ -13616,10 +13666,10 @@ query GetSignable($id: ID!) {
|
|
|
13616
13666
|
}
|
|
13617
13667
|
}
|
|
13618
13668
|
|
|
13619
|
-
${
|
|
13669
|
+
${FRAGMENT40}
|
|
13620
13670
|
`,
|
|
13621
13671
|
variables: { id },
|
|
13622
|
-
constructObject: (data) => (0,
|
|
13672
|
+
constructObject: (data) => (0, import_core41.isObject)(data) && "entity" in data && (0, import_core41.isObject)(data.entity) ? SignableFromJson(data.entity) : null
|
|
13623
13673
|
};
|
|
13624
13674
|
};
|
|
13625
13675
|
|
|
@@ -13640,49 +13690,6 @@ var TransactionType = /* @__PURE__ */ ((TransactionType2) => {
|
|
|
13640
13690
|
})(TransactionType || {});
|
|
13641
13691
|
var TransactionType_default = TransactionType;
|
|
13642
13692
|
|
|
13643
|
-
// src/objects/UmaCurrency.ts
|
|
13644
|
-
var import_core41 = require("@lightsparkdev/core");
|
|
13645
|
-
var UmaCurrencyFromJson = (obj) => {
|
|
13646
|
-
return {
|
|
13647
|
-
id: obj["uma_currency_id"],
|
|
13648
|
-
createdAt: obj["uma_currency_created_at"],
|
|
13649
|
-
updatedAt: obj["uma_currency_updated_at"],
|
|
13650
|
-
code: obj["uma_currency_code"],
|
|
13651
|
-
symbol: obj["uma_currency_symbol"],
|
|
13652
|
-
name: obj["uma_currency_name"],
|
|
13653
|
-
decimals: obj["uma_currency_decimals"],
|
|
13654
|
-
typename: "UmaCurrency"
|
|
13655
|
-
};
|
|
13656
|
-
};
|
|
13657
|
-
var FRAGMENT40 = `
|
|
13658
|
-
fragment UmaCurrencyFragment on UmaCurrency {
|
|
13659
|
-
__typename
|
|
13660
|
-
uma_currency_id: id
|
|
13661
|
-
uma_currency_created_at: created_at
|
|
13662
|
-
uma_currency_updated_at: updated_at
|
|
13663
|
-
uma_currency_code: code
|
|
13664
|
-
uma_currency_symbol: symbol
|
|
13665
|
-
uma_currency_name: name
|
|
13666
|
-
uma_currency_decimals: decimals
|
|
13667
|
-
}`;
|
|
13668
|
-
var getUmaCurrencyQuery = (id) => {
|
|
13669
|
-
return {
|
|
13670
|
-
queryPayload: `
|
|
13671
|
-
query GetUmaCurrency($id: ID!) {
|
|
13672
|
-
entity(id: $id) {
|
|
13673
|
-
... on UmaCurrency {
|
|
13674
|
-
...UmaCurrencyFragment
|
|
13675
|
-
}
|
|
13676
|
-
}
|
|
13677
|
-
}
|
|
13678
|
-
|
|
13679
|
-
${FRAGMENT40}
|
|
13680
|
-
`,
|
|
13681
|
-
variables: { id },
|
|
13682
|
-
constructObject: (data) => (0, import_core41.isObject)(data) && "entity" in data && (0, import_core41.isObject)(data.entity) ? UmaCurrencyFromJson(data.entity) : null
|
|
13683
|
-
};
|
|
13684
|
-
};
|
|
13685
|
-
|
|
13686
13693
|
// src/objects/WebhookEventType.ts
|
|
13687
13694
|
var WebhookEventType = /* @__PURE__ */ ((WebhookEventType2) => {
|
|
13688
13695
|
WebhookEventType2["FUTURE_VALUE"] = "FUTURE_VALUE";
|
|
@@ -13754,7 +13761,22 @@ var RemoteSigningWebhookHandler = class {
|
|
|
13754
13761
|
if (!response) {
|
|
13755
13762
|
return;
|
|
13756
13763
|
}
|
|
13757
|
-
|
|
13764
|
+
let jsonVariablesString;
|
|
13765
|
+
let variables;
|
|
13766
|
+
try {
|
|
13767
|
+
jsonVariablesString = JSON.parse(response.variables);
|
|
13768
|
+
} catch (e) {
|
|
13769
|
+
throw new import_core42.LightsparkSigningException(
|
|
13770
|
+
"Unable to get JSON variables string from response"
|
|
13771
|
+
);
|
|
13772
|
+
}
|
|
13773
|
+
try {
|
|
13774
|
+
variables = JSON.parse(jsonVariablesString);
|
|
13775
|
+
} catch (e) {
|
|
13776
|
+
throw new import_core42.LightsparkSigningException(
|
|
13777
|
+
"Unable to parse JSON variables from response"
|
|
13778
|
+
);
|
|
13779
|
+
}
|
|
13758
13780
|
return this.client.executeRawQuery({
|
|
13759
13781
|
queryPayload: response.query,
|
|
13760
13782
|
variables,
|