@lightsparkdev/lightspark-sdk 0.2.7 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/dist/{Withdrawal-82dbbfd6.d.ts → Withdrawal-e4b8b697.d.ts} +31 -6
- package/dist/{chunk-2T6E6TXJ.js → chunk-7GDCZ2RB.js} +9 -9
- package/dist/index.cjs +871 -768
- package/dist/index.d.ts +1 -1
- package/dist/index.js +118 -15
- package/dist/objects/index.d.ts +1 -1
- package/dist/objects/index.js +1 -1
- package/package.json +2 -2
- package/src/client.ts +90 -8
- package/src/graphql/CreateTestModeInvoice.ts +19 -0
- package/src/graphql/CreateTestModePayment.ts +23 -0
package/dist/index.cjs
CHANGED
|
@@ -35,7 +35,7 @@ var require_package = __commonJS({
|
|
|
35
35
|
"package.json"(exports, module2) {
|
|
36
36
|
module2.exports = {
|
|
37
37
|
name: "@lightsparkdev/lightspark-sdk",
|
|
38
|
-
version: "0.
|
|
38
|
+
version: "0.3.0",
|
|
39
39
|
description: "Lightspark JS SDK",
|
|
40
40
|
author: "Lightspark Inc.",
|
|
41
41
|
keywords: [
|
|
@@ -103,7 +103,7 @@ var require_package = __commonJS({
|
|
|
103
103
|
},
|
|
104
104
|
license: "Apache-2.0",
|
|
105
105
|
dependencies: {
|
|
106
|
-
"@lightsparkdev/core": "0.
|
|
106
|
+
"@lightsparkdev/core": "0.3.0",
|
|
107
107
|
"auto-bind": "^5.0.1",
|
|
108
108
|
crypto: "^1.0.1",
|
|
109
109
|
"crypto-browserify": "^3.12.0",
|
|
@@ -211,9 +211,8 @@ var AccountTokenAuthProvider = class {
|
|
|
211
211
|
var AccountTokenAuthProvider_default = AccountTokenAuthProvider;
|
|
212
212
|
|
|
213
213
|
// src/client.ts
|
|
214
|
-
var import_core6 = require("@lightsparkdev/core");
|
|
215
214
|
var import_auto_bind13 = __toESM(require("auto-bind"), 1);
|
|
216
|
-
var
|
|
215
|
+
var import_core6 = require("@lightsparkdev/core");
|
|
217
216
|
|
|
218
217
|
// src/objects/CurrencyUnit.ts
|
|
219
218
|
var CurrencyUnit = /* @__PURE__ */ ((CurrencyUnit2) => {
|
|
@@ -400,142 +399,442 @@ var CreateNodeWalletAddress = `
|
|
|
400
399
|
}
|
|
401
400
|
`;
|
|
402
401
|
|
|
403
|
-
// src/
|
|
404
|
-
var
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
402
|
+
// src/graphql/CreateTestModeInvoice.ts
|
|
403
|
+
var CreateTestModeInvoice = `
|
|
404
|
+
mutation CreateTestModeInvoice(
|
|
405
|
+
$local_node_id: ID!
|
|
406
|
+
$amount_msats: Long!
|
|
407
|
+
$memo: String
|
|
408
|
+
$invoice_type: InvoiceType
|
|
409
|
+
) {
|
|
410
|
+
create_test_mode_invoice(input: {
|
|
411
|
+
local_node_id: $local_node_id
|
|
412
|
+
amount_msats: $amount_msats
|
|
413
|
+
memo: $memo
|
|
414
|
+
invoice_type: $invoice_type
|
|
415
|
+
}) {
|
|
416
|
+
encoded_payment_request
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
`;
|
|
417
420
|
|
|
418
|
-
// src/objects/
|
|
419
|
-
var
|
|
420
|
-
return {
|
|
421
|
-
totalBalance: !!obj["blockchain_balance_total_balance"] ? CurrencyAmountFromJson(obj["blockchain_balance_total_balance"]) : void 0,
|
|
422
|
-
confirmedBalance: !!obj["blockchain_balance_confirmed_balance"] ? CurrencyAmountFromJson(obj["blockchain_balance_confirmed_balance"]) : void 0,
|
|
423
|
-
unconfirmedBalance: !!obj["blockchain_balance_unconfirmed_balance"] ? CurrencyAmountFromJson(obj["blockchain_balance_unconfirmed_balance"]) : void 0,
|
|
424
|
-
lockedBalance: !!obj["blockchain_balance_locked_balance"] ? CurrencyAmountFromJson(obj["blockchain_balance_locked_balance"]) : void 0,
|
|
425
|
-
requiredReserve: !!obj["blockchain_balance_required_reserve"] ? CurrencyAmountFromJson(obj["blockchain_balance_required_reserve"]) : void 0,
|
|
426
|
-
availableBalance: !!obj["blockchain_balance_available_balance"] ? CurrencyAmountFromJson(obj["blockchain_balance_available_balance"]) : void 0
|
|
427
|
-
};
|
|
428
|
-
};
|
|
421
|
+
// src/objects/OutgoingPayment.ts
|
|
422
|
+
var import_auto_bind7 = __toESM(require("auto-bind"), 1);
|
|
429
423
|
|
|
430
|
-
// src/objects/
|
|
424
|
+
// src/objects/OutgoingPaymentAttempt.ts
|
|
431
425
|
var import_auto_bind2 = __toESM(require("auto-bind"), 1);
|
|
432
426
|
|
|
433
|
-
// src/objects/
|
|
434
|
-
var
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
427
|
+
// src/objects/HtlcAttemptFailureCode.ts
|
|
428
|
+
var HtlcAttemptFailureCode = /* @__PURE__ */ ((HtlcAttemptFailureCode2) => {
|
|
429
|
+
HtlcAttemptFailureCode2["FUTURE_VALUE"] = "FUTURE_VALUE";
|
|
430
|
+
HtlcAttemptFailureCode2["INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS"] = "INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS";
|
|
431
|
+
HtlcAttemptFailureCode2["INCORRECT_PAYMENT_AMOUNT"] = "INCORRECT_PAYMENT_AMOUNT";
|
|
432
|
+
HtlcAttemptFailureCode2["FINAL_INCORRECT_CLTV_EXPIRY"] = "FINAL_INCORRECT_CLTV_EXPIRY";
|
|
433
|
+
HtlcAttemptFailureCode2["FINAL_INCORRECT_HTLC_AMOUNT"] = "FINAL_INCORRECT_HTLC_AMOUNT";
|
|
434
|
+
HtlcAttemptFailureCode2["FINAL_EXPIRY_TOO_SOON"] = "FINAL_EXPIRY_TOO_SOON";
|
|
435
|
+
HtlcAttemptFailureCode2["INVALID_REALM"] = "INVALID_REALM";
|
|
436
|
+
HtlcAttemptFailureCode2["EXPIRY_TOO_SOON"] = "EXPIRY_TOO_SOON";
|
|
437
|
+
HtlcAttemptFailureCode2["INVALID_ONION_VERSION"] = "INVALID_ONION_VERSION";
|
|
438
|
+
HtlcAttemptFailureCode2["INVALID_ONION_HMAC"] = "INVALID_ONION_HMAC";
|
|
439
|
+
HtlcAttemptFailureCode2["INVALID_ONION_KEY"] = "INVALID_ONION_KEY";
|
|
440
|
+
HtlcAttemptFailureCode2["AMOUNT_BELOW_MINIMUM"] = "AMOUNT_BELOW_MINIMUM";
|
|
441
|
+
HtlcAttemptFailureCode2["FEE_INSUFFICIENT"] = "FEE_INSUFFICIENT";
|
|
442
|
+
HtlcAttemptFailureCode2["INCORRECT_CLTV_EXPIRY"] = "INCORRECT_CLTV_EXPIRY";
|
|
443
|
+
HtlcAttemptFailureCode2["CHANNEL_DISABLED"] = "CHANNEL_DISABLED";
|
|
444
|
+
HtlcAttemptFailureCode2["TEMPORARY_CHANNEL_FAILURE"] = "TEMPORARY_CHANNEL_FAILURE";
|
|
445
|
+
HtlcAttemptFailureCode2["REQUIRED_NODE_FEATURE_MISSING"] = "REQUIRED_NODE_FEATURE_MISSING";
|
|
446
|
+
HtlcAttemptFailureCode2["REQUIRED_CHANNEL_FEATURE_MISSING"] = "REQUIRED_CHANNEL_FEATURE_MISSING";
|
|
447
|
+
HtlcAttemptFailureCode2["UNKNOWN_NEXT_PEER"] = "UNKNOWN_NEXT_PEER";
|
|
448
|
+
HtlcAttemptFailureCode2["TEMPORARY_NODE_FAILURE"] = "TEMPORARY_NODE_FAILURE";
|
|
449
|
+
HtlcAttemptFailureCode2["PERMANENT_NODE_FAILURE"] = "PERMANENT_NODE_FAILURE";
|
|
450
|
+
HtlcAttemptFailureCode2["PERMANENT_CHANNEL_FAILURE"] = "PERMANENT_CHANNEL_FAILURE";
|
|
451
|
+
HtlcAttemptFailureCode2["EXPIRY_TOO_FAR"] = "EXPIRY_TOO_FAR";
|
|
452
|
+
HtlcAttemptFailureCode2["MPP_TIMEOUT"] = "MPP_TIMEOUT";
|
|
453
|
+
HtlcAttemptFailureCode2["INVALID_ONION_PAYLOAD"] = "INVALID_ONION_PAYLOAD";
|
|
454
|
+
HtlcAttemptFailureCode2["INTERNAL_FAILURE"] = "INTERNAL_FAILURE";
|
|
455
|
+
HtlcAttemptFailureCode2["UNKNOWN_FAILURE"] = "UNKNOWN_FAILURE";
|
|
456
|
+
HtlcAttemptFailureCode2["UNREADABLE_FAILURE"] = "UNREADABLE_FAILURE";
|
|
457
|
+
return HtlcAttemptFailureCode2;
|
|
458
|
+
})(HtlcAttemptFailureCode || {});
|
|
459
|
+
var HtlcAttemptFailureCode_default = HtlcAttemptFailureCode;
|
|
442
460
|
|
|
443
|
-
// src/objects/
|
|
444
|
-
var
|
|
461
|
+
// src/objects/OutgoingPaymentAttemptStatus.ts
|
|
462
|
+
var OutgoingPaymentAttemptStatus = /* @__PURE__ */ ((OutgoingPaymentAttemptStatus2) => {
|
|
463
|
+
OutgoingPaymentAttemptStatus2["FUTURE_VALUE"] = "FUTURE_VALUE";
|
|
464
|
+
OutgoingPaymentAttemptStatus2["IN_FLIGHT"] = "IN_FLIGHT";
|
|
465
|
+
OutgoingPaymentAttemptStatus2["SUCCEEDED"] = "SUCCEEDED";
|
|
466
|
+
OutgoingPaymentAttemptStatus2["FAILED"] = "FAILED";
|
|
467
|
+
return OutgoingPaymentAttemptStatus2;
|
|
468
|
+
})(OutgoingPaymentAttemptStatus || {});
|
|
469
|
+
var OutgoingPaymentAttemptStatus_default = OutgoingPaymentAttemptStatus;
|
|
470
|
+
|
|
471
|
+
// src/objects/Hop.ts
|
|
472
|
+
var HopFromJson = (obj) => {
|
|
445
473
|
return {
|
|
446
|
-
|
|
447
|
-
|
|
474
|
+
id: obj["hop_id"],
|
|
475
|
+
createdAt: obj["hop_created_at"],
|
|
476
|
+
updatedAt: obj["hop_updated_at"],
|
|
477
|
+
index: obj["hop_index"],
|
|
478
|
+
typename: "Hop",
|
|
479
|
+
destinationId: obj["hop_destination"]?.id ?? void 0,
|
|
480
|
+
publicKey: obj["hop_public_key"],
|
|
481
|
+
amountToForward: !!obj["hop_amount_to_forward"] ? CurrencyAmountFromJson(obj["hop_amount_to_forward"]) : void 0,
|
|
482
|
+
fee: !!obj["hop_fee"] ? CurrencyAmountFromJson(obj["hop_fee"]) : void 0,
|
|
483
|
+
expiryBlockHeight: obj["hop_expiry_block_height"]
|
|
484
|
+
};
|
|
485
|
+
};
|
|
486
|
+
var FRAGMENT4 = `
|
|
487
|
+
fragment HopFragment on Hop {
|
|
488
|
+
__typename
|
|
489
|
+
hop_id: id
|
|
490
|
+
hop_created_at: created_at
|
|
491
|
+
hop_updated_at: updated_at
|
|
492
|
+
hop_destination: destination {
|
|
493
|
+
id
|
|
494
|
+
}
|
|
495
|
+
hop_index: index
|
|
496
|
+
hop_public_key: public_key
|
|
497
|
+
hop_amount_to_forward: amount_to_forward {
|
|
498
|
+
__typename
|
|
499
|
+
currency_amount_original_value: original_value
|
|
500
|
+
currency_amount_original_unit: original_unit
|
|
501
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
502
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
503
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
504
|
+
}
|
|
505
|
+
hop_fee: fee {
|
|
506
|
+
__typename
|
|
507
|
+
currency_amount_original_value: original_value
|
|
508
|
+
currency_amount_original_unit: original_unit
|
|
509
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
510
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
511
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
512
|
+
}
|
|
513
|
+
hop_expiry_block_height: expiry_block_height
|
|
514
|
+
}`;
|
|
515
|
+
var getHopQuery = (id) => {
|
|
516
|
+
return {
|
|
517
|
+
queryPayload: `
|
|
518
|
+
query GetHop($id: ID!) {
|
|
519
|
+
entity(id: $id) {
|
|
520
|
+
... on Hop {
|
|
521
|
+
...HopFragment
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
${FRAGMENT4}
|
|
527
|
+
`,
|
|
528
|
+
variables: { id },
|
|
529
|
+
constructObject: (data) => HopFromJson(data.entity)
|
|
448
530
|
};
|
|
449
531
|
};
|
|
450
532
|
|
|
451
|
-
// src/objects/
|
|
452
|
-
var
|
|
533
|
+
// src/objects/OutgoingPaymentAttemptToHopsConnection.ts
|
|
534
|
+
var OutgoingPaymentAttemptToHopsConnectionFromJson = (obj) => {
|
|
453
535
|
return {
|
|
454
|
-
count: obj["
|
|
455
|
-
entities: obj["
|
|
456
|
-
(e) =>
|
|
536
|
+
count: obj["outgoing_payment_attempt_to_hops_connection_count"],
|
|
537
|
+
entities: obj["outgoing_payment_attempt_to_hops_connection_entities"].map(
|
|
538
|
+
(e) => HopFromJson(e)
|
|
457
539
|
)
|
|
458
540
|
};
|
|
459
541
|
};
|
|
460
542
|
|
|
461
|
-
// src/objects/
|
|
462
|
-
var
|
|
463
|
-
constructor(id, createdAt, updatedAt,
|
|
543
|
+
// src/objects/OutgoingPaymentAttempt.ts
|
|
544
|
+
var OutgoingPaymentAttempt = class {
|
|
545
|
+
constructor(id, createdAt, updatedAt, status, outgoingPaymentId, typename, failureCode, failureSourceIndex, resolvedAt, amount, fees) {
|
|
464
546
|
this.id = id;
|
|
465
547
|
this.createdAt = createdAt;
|
|
466
548
|
this.updatedAt = updatedAt;
|
|
467
|
-
this.
|
|
468
|
-
this.
|
|
549
|
+
this.status = status;
|
|
550
|
+
this.outgoingPaymentId = outgoingPaymentId;
|
|
469
551
|
this.typename = typename;
|
|
470
|
-
this.
|
|
471
|
-
this.
|
|
472
|
-
this.
|
|
473
|
-
this.
|
|
552
|
+
this.failureCode = failureCode;
|
|
553
|
+
this.failureSourceIndex = failureSourceIndex;
|
|
554
|
+
this.resolvedAt = resolvedAt;
|
|
555
|
+
this.amount = amount;
|
|
556
|
+
this.fees = fees;
|
|
474
557
|
(0, import_auto_bind2.default)(this);
|
|
475
558
|
}
|
|
476
|
-
async
|
|
559
|
+
async getHops(client, first = void 0) {
|
|
477
560
|
return await client.executeRawQuery({
|
|
478
561
|
queryPayload: `
|
|
479
|
-
query
|
|
562
|
+
query FetchOutgoingPaymentAttemptToHopsConnection($entity_id: ID!, $first: Int) {
|
|
480
563
|
entity(id: $entity_id) {
|
|
481
|
-
... on
|
|
482
|
-
|
|
564
|
+
... on OutgoingPaymentAttempt {
|
|
565
|
+
hops(, first: $first) {
|
|
483
566
|
__typename
|
|
484
|
-
|
|
485
|
-
|
|
567
|
+
outgoing_payment_attempt_to_hops_connection_count: count
|
|
568
|
+
outgoing_payment_attempt_to_hops_connection_entities: entities {
|
|
486
569
|
__typename
|
|
487
|
-
|
|
488
|
-
|
|
570
|
+
hop_id: id
|
|
571
|
+
hop_created_at: created_at
|
|
572
|
+
hop_updated_at: updated_at
|
|
573
|
+
hop_destination: destination {
|
|
574
|
+
id
|
|
575
|
+
}
|
|
576
|
+
hop_index: index
|
|
577
|
+
hop_public_key: public_key
|
|
578
|
+
hop_amount_to_forward: amount_to_forward {
|
|
579
|
+
__typename
|
|
580
|
+
currency_amount_original_value: original_value
|
|
581
|
+
currency_amount_original_unit: original_unit
|
|
582
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
583
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
584
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
585
|
+
}
|
|
586
|
+
hop_fee: fee {
|
|
587
|
+
__typename
|
|
588
|
+
currency_amount_original_value: original_value
|
|
589
|
+
currency_amount_original_unit: original_unit
|
|
590
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
591
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
592
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
593
|
+
}
|
|
594
|
+
hop_expiry_block_height: expiry_block_height
|
|
489
595
|
}
|
|
490
596
|
}
|
|
491
597
|
}
|
|
492
598
|
}
|
|
493
599
|
}
|
|
494
600
|
`,
|
|
495
|
-
variables: { entity_id: this.id, first
|
|
601
|
+
variables: { entity_id: this.id, first },
|
|
496
602
|
constructObject: (json) => {
|
|
497
|
-
const connection = json["entity"]["
|
|
498
|
-
return
|
|
603
|
+
const connection = json["entity"]["hops"];
|
|
604
|
+
return OutgoingPaymentAttemptToHopsConnectionFromJson(connection);
|
|
499
605
|
}
|
|
500
606
|
});
|
|
501
607
|
}
|
|
502
|
-
static
|
|
608
|
+
static getOutgoingPaymentAttemptQuery(id) {
|
|
503
609
|
return {
|
|
504
610
|
queryPayload: `
|
|
505
|
-
query
|
|
611
|
+
query GetOutgoingPaymentAttempt($id: ID!) {
|
|
506
612
|
entity(id: $id) {
|
|
507
|
-
... on
|
|
508
|
-
...
|
|
613
|
+
... on OutgoingPaymentAttempt {
|
|
614
|
+
...OutgoingPaymentAttemptFragment
|
|
509
615
|
}
|
|
510
616
|
}
|
|
511
617
|
}
|
|
512
618
|
|
|
513
|
-
${
|
|
619
|
+
${FRAGMENT5}
|
|
514
620
|
`,
|
|
515
621
|
variables: { id },
|
|
516
|
-
constructObject: (data) =>
|
|
622
|
+
constructObject: (data) => OutgoingPaymentAttemptFromJson(data.entity)
|
|
517
623
|
};
|
|
518
624
|
}
|
|
519
625
|
};
|
|
520
|
-
var
|
|
521
|
-
return new
|
|
522
|
-
obj["
|
|
523
|
-
obj["
|
|
524
|
-
obj["
|
|
525
|
-
|
|
526
|
-
obj["
|
|
527
|
-
"
|
|
528
|
-
obj["
|
|
529
|
-
obj["
|
|
530
|
-
obj["
|
|
531
|
-
obj["
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
626
|
+
var OutgoingPaymentAttemptFromJson = (obj) => {
|
|
627
|
+
return new OutgoingPaymentAttempt(
|
|
628
|
+
obj["outgoing_payment_attempt_id"],
|
|
629
|
+
obj["outgoing_payment_attempt_created_at"],
|
|
630
|
+
obj["outgoing_payment_attempt_updated_at"],
|
|
631
|
+
OutgoingPaymentAttemptStatus_default[obj["outgoing_payment_attempt_status"]] ?? OutgoingPaymentAttemptStatus_default.FUTURE_VALUE,
|
|
632
|
+
obj["outgoing_payment_attempt_outgoing_payment"].id,
|
|
633
|
+
"OutgoingPaymentAttempt",
|
|
634
|
+
!!obj["outgoing_payment_attempt_failure_code"] ? HtlcAttemptFailureCode_default[obj["outgoing_payment_attempt_failure_code"]] ?? HtlcAttemptFailureCode_default.FUTURE_VALUE : null,
|
|
635
|
+
obj["outgoing_payment_attempt_failure_source_index"],
|
|
636
|
+
obj["outgoing_payment_attempt_resolved_at"],
|
|
637
|
+
!!obj["outgoing_payment_attempt_amount"] ? CurrencyAmountFromJson(obj["outgoing_payment_attempt_amount"]) : void 0,
|
|
638
|
+
!!obj["outgoing_payment_attempt_fees"] ? CurrencyAmountFromJson(obj["outgoing_payment_attempt_fees"]) : void 0
|
|
639
|
+
);
|
|
640
|
+
};
|
|
641
|
+
var FRAGMENT5 = `
|
|
642
|
+
fragment OutgoingPaymentAttemptFragment on OutgoingPaymentAttempt {
|
|
643
|
+
__typename
|
|
644
|
+
outgoing_payment_attempt_id: id
|
|
645
|
+
outgoing_payment_attempt_created_at: created_at
|
|
646
|
+
outgoing_payment_attempt_updated_at: updated_at
|
|
647
|
+
outgoing_payment_attempt_status: status
|
|
648
|
+
outgoing_payment_attempt_failure_code: failure_code
|
|
649
|
+
outgoing_payment_attempt_failure_source_index: failure_source_index
|
|
650
|
+
outgoing_payment_attempt_resolved_at: resolved_at
|
|
651
|
+
outgoing_payment_attempt_amount: amount {
|
|
652
|
+
__typename
|
|
653
|
+
currency_amount_original_value: original_value
|
|
654
|
+
currency_amount_original_unit: original_unit
|
|
655
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
656
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
657
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
658
|
+
}
|
|
659
|
+
outgoing_payment_attempt_fees: fees {
|
|
660
|
+
__typename
|
|
661
|
+
currency_amount_original_value: original_value
|
|
662
|
+
currency_amount_original_unit: original_unit
|
|
663
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
664
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
665
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
666
|
+
}
|
|
667
|
+
outgoing_payment_attempt_outgoing_payment: outgoing_payment {
|
|
668
|
+
id
|
|
669
|
+
}
|
|
670
|
+
}`;
|
|
671
|
+
var OutgoingPaymentAttempt_default = OutgoingPaymentAttempt;
|
|
672
|
+
|
|
673
|
+
// src/objects/OutgoingPaymentToAttemptsConnection.ts
|
|
674
|
+
var OutgoingPaymentToAttemptsConnectionFromJson = (obj) => {
|
|
675
|
+
return {
|
|
676
|
+
count: obj["outgoing_payment_to_attempts_connection_count"],
|
|
677
|
+
entities: obj["outgoing_payment_to_attempts_connection_entities"].map(
|
|
678
|
+
(e) => OutgoingPaymentAttemptFromJson(e)
|
|
679
|
+
)
|
|
680
|
+
};
|
|
681
|
+
};
|
|
682
|
+
|
|
683
|
+
// src/objects/PaymentFailureReason.ts
|
|
684
|
+
var PaymentFailureReason = /* @__PURE__ */ ((PaymentFailureReason2) => {
|
|
685
|
+
PaymentFailureReason2["FUTURE_VALUE"] = "FUTURE_VALUE";
|
|
686
|
+
PaymentFailureReason2["NONE"] = "NONE";
|
|
687
|
+
PaymentFailureReason2["TIMEOUT"] = "TIMEOUT";
|
|
688
|
+
PaymentFailureReason2["NO_ROUTE"] = "NO_ROUTE";
|
|
689
|
+
PaymentFailureReason2["ERROR"] = "ERROR";
|
|
690
|
+
PaymentFailureReason2["INCORRECT_PAYMENT_DETAILS"] = "INCORRECT_PAYMENT_DETAILS";
|
|
691
|
+
PaymentFailureReason2["INSUFFICIENT_BALANCE"] = "INSUFFICIENT_BALANCE";
|
|
692
|
+
PaymentFailureReason2["INVOICE_ALREADY_PAID"] = "INVOICE_ALREADY_PAID";
|
|
693
|
+
PaymentFailureReason2["SELF_PAYMENT"] = "SELF_PAYMENT";
|
|
694
|
+
PaymentFailureReason2["INVOICE_EXPIRED"] = "INVOICE_EXPIRED";
|
|
695
|
+
return PaymentFailureReason2;
|
|
696
|
+
})(PaymentFailureReason || {});
|
|
697
|
+
var PaymentFailureReason_default = PaymentFailureReason;
|
|
698
|
+
|
|
699
|
+
// src/objects/PaymentRequestData.ts
|
|
700
|
+
var import_core3 = require("@lightsparkdev/core");
|
|
701
|
+
|
|
702
|
+
// src/objects/BitcoinNetwork.ts
|
|
703
|
+
var BitcoinNetwork = /* @__PURE__ */ ((BitcoinNetwork2) => {
|
|
704
|
+
BitcoinNetwork2["FUTURE_VALUE"] = "FUTURE_VALUE";
|
|
705
|
+
BitcoinNetwork2["MAINNET"] = "MAINNET";
|
|
706
|
+
BitcoinNetwork2["REGTEST"] = "REGTEST";
|
|
707
|
+
BitcoinNetwork2["SIGNET"] = "SIGNET";
|
|
708
|
+
BitcoinNetwork2["TESTNET"] = "TESTNET";
|
|
709
|
+
return BitcoinNetwork2;
|
|
710
|
+
})(BitcoinNetwork || {});
|
|
711
|
+
var BitcoinNetwork_default = BitcoinNetwork;
|
|
712
|
+
|
|
713
|
+
// src/objects/Node.ts
|
|
714
|
+
var import_core2 = require("@lightsparkdev/core");
|
|
715
|
+
var import_auto_bind6 = __toESM(require("auto-bind"), 1);
|
|
716
|
+
|
|
717
|
+
// src/objects/BlockchainBalance.ts
|
|
718
|
+
var BlockchainBalanceFromJson = (obj) => {
|
|
719
|
+
return {
|
|
720
|
+
totalBalance: !!obj["blockchain_balance_total_balance"] ? CurrencyAmountFromJson(obj["blockchain_balance_total_balance"]) : void 0,
|
|
721
|
+
confirmedBalance: !!obj["blockchain_balance_confirmed_balance"] ? CurrencyAmountFromJson(obj["blockchain_balance_confirmed_balance"]) : void 0,
|
|
722
|
+
unconfirmedBalance: !!obj["blockchain_balance_unconfirmed_balance"] ? CurrencyAmountFromJson(obj["blockchain_balance_unconfirmed_balance"]) : void 0,
|
|
723
|
+
lockedBalance: !!obj["blockchain_balance_locked_balance"] ? CurrencyAmountFromJson(obj["blockchain_balance_locked_balance"]) : void 0,
|
|
724
|
+
requiredReserve: !!obj["blockchain_balance_required_reserve"] ? CurrencyAmountFromJson(obj["blockchain_balance_required_reserve"]) : void 0,
|
|
725
|
+
availableBalance: !!obj["blockchain_balance_available_balance"] ? CurrencyAmountFromJson(obj["blockchain_balance_available_balance"]) : void 0
|
|
726
|
+
};
|
|
727
|
+
};
|
|
728
|
+
|
|
729
|
+
// src/objects/GraphNode.ts
|
|
730
|
+
var import_auto_bind3 = __toESM(require("auto-bind"), 1);
|
|
731
|
+
|
|
732
|
+
// src/objects/NodeAddressType.ts
|
|
733
|
+
var NodeAddressType = /* @__PURE__ */ ((NodeAddressType2) => {
|
|
734
|
+
NodeAddressType2["FUTURE_VALUE"] = "FUTURE_VALUE";
|
|
735
|
+
NodeAddressType2["IPV4"] = "IPV4";
|
|
736
|
+
NodeAddressType2["IPV6"] = "IPV6";
|
|
737
|
+
NodeAddressType2["TOR"] = "TOR";
|
|
738
|
+
return NodeAddressType2;
|
|
739
|
+
})(NodeAddressType || {});
|
|
740
|
+
var NodeAddressType_default = NodeAddressType;
|
|
741
|
+
|
|
742
|
+
// src/objects/NodeAddress.ts
|
|
743
|
+
var NodeAddressFromJson = (obj) => {
|
|
744
|
+
return {
|
|
745
|
+
address: obj["node_address_address"],
|
|
746
|
+
type: NodeAddressType_default[obj["node_address_type"]] ?? NodeAddressType_default.FUTURE_VALUE
|
|
747
|
+
};
|
|
748
|
+
};
|
|
749
|
+
|
|
750
|
+
// src/objects/NodeToAddressesConnection.ts
|
|
751
|
+
var NodeToAddressesConnectionFromJson = (obj) => {
|
|
752
|
+
return {
|
|
753
|
+
count: obj["node_to_addresses_connection_count"],
|
|
754
|
+
entities: obj["node_to_addresses_connection_entities"].map(
|
|
755
|
+
(e) => NodeAddressFromJson(e)
|
|
756
|
+
)
|
|
757
|
+
};
|
|
758
|
+
};
|
|
759
|
+
|
|
760
|
+
// src/objects/GraphNode.ts
|
|
761
|
+
var GraphNode = class {
|
|
762
|
+
constructor(id, createdAt, updatedAt, bitcoinNetwork, displayName, typename, alias, color, conductivity, publicKey) {
|
|
763
|
+
this.id = id;
|
|
764
|
+
this.createdAt = createdAt;
|
|
765
|
+
this.updatedAt = updatedAt;
|
|
766
|
+
this.bitcoinNetwork = bitcoinNetwork;
|
|
767
|
+
this.displayName = displayName;
|
|
768
|
+
this.typename = typename;
|
|
769
|
+
this.alias = alias;
|
|
770
|
+
this.color = color;
|
|
771
|
+
this.conductivity = conductivity;
|
|
772
|
+
this.publicKey = publicKey;
|
|
773
|
+
(0, import_auto_bind3.default)(this);
|
|
774
|
+
}
|
|
775
|
+
async getAddresses(client, first = void 0, types = void 0) {
|
|
776
|
+
return await client.executeRawQuery({
|
|
777
|
+
queryPayload: `
|
|
778
|
+
query FetchNodeToAddressesConnection($entity_id: ID!, $first: Int, $types: [NodeAddressType!]) {
|
|
779
|
+
entity(id: $entity_id) {
|
|
780
|
+
... on GraphNode {
|
|
781
|
+
addresses(, first: $first, types: $types) {
|
|
782
|
+
__typename
|
|
783
|
+
node_to_addresses_connection_count: count
|
|
784
|
+
node_to_addresses_connection_entities: entities {
|
|
785
|
+
__typename
|
|
786
|
+
node_address_address: address
|
|
787
|
+
node_address_type: type
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
}
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
|
+
`,
|
|
794
|
+
variables: { entity_id: this.id, first, types },
|
|
795
|
+
constructObject: (json) => {
|
|
796
|
+
const connection = json["entity"]["addresses"];
|
|
797
|
+
return NodeToAddressesConnectionFromJson(connection);
|
|
798
|
+
}
|
|
799
|
+
});
|
|
800
|
+
}
|
|
801
|
+
static getGraphNodeQuery(id) {
|
|
802
|
+
return {
|
|
803
|
+
queryPayload: `
|
|
804
|
+
query GetGraphNode($id: ID!) {
|
|
805
|
+
entity(id: $id) {
|
|
806
|
+
... on GraphNode {
|
|
807
|
+
...GraphNodeFragment
|
|
808
|
+
}
|
|
809
|
+
}
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
${FRAGMENT6}
|
|
813
|
+
`,
|
|
814
|
+
variables: { id },
|
|
815
|
+
constructObject: (data) => GraphNodeFromJson(data.entity)
|
|
816
|
+
};
|
|
817
|
+
}
|
|
818
|
+
};
|
|
819
|
+
var GraphNodeFromJson = (obj) => {
|
|
820
|
+
return new GraphNode(
|
|
821
|
+
obj["graph_node_id"],
|
|
822
|
+
obj["graph_node_created_at"],
|
|
823
|
+
obj["graph_node_updated_at"],
|
|
824
|
+
BitcoinNetwork_default[obj["graph_node_bitcoin_network"]] ?? BitcoinNetwork_default.FUTURE_VALUE,
|
|
825
|
+
obj["graph_node_display_name"],
|
|
826
|
+
"GraphNode",
|
|
827
|
+
obj["graph_node_alias"],
|
|
828
|
+
obj["graph_node_color"],
|
|
829
|
+
obj["graph_node_conductivity"],
|
|
830
|
+
obj["graph_node_public_key"]
|
|
831
|
+
);
|
|
832
|
+
};
|
|
833
|
+
var FRAGMENT6 = `
|
|
834
|
+
fragment GraphNodeFragment on GraphNode {
|
|
835
|
+
__typename
|
|
836
|
+
graph_node_id: id
|
|
837
|
+
graph_node_created_at: created_at
|
|
539
838
|
graph_node_updated_at: updated_at
|
|
540
839
|
graph_node_alias: alias
|
|
541
840
|
graph_node_bitcoin_network: bitcoin_network
|
|
@@ -547,7 +846,7 @@ fragment GraphNodeFragment on GraphNode {
|
|
|
547
846
|
var GraphNode_default = GraphNode;
|
|
548
847
|
|
|
549
848
|
// src/objects/LightsparkNode.ts
|
|
550
|
-
var
|
|
849
|
+
var import_auto_bind5 = __toESM(require("auto-bind"), 1);
|
|
551
850
|
|
|
552
851
|
// src/objects/LightsparkNodePurpose.ts
|
|
553
852
|
var LightsparkNodePurpose = /* @__PURE__ */ ((LightsparkNodePurpose2) => {
|
|
@@ -577,7 +876,7 @@ var LightsparkNodeStatus = /* @__PURE__ */ ((LightsparkNodeStatus2) => {
|
|
|
577
876
|
var LightsparkNodeStatus_default = LightsparkNodeStatus;
|
|
578
877
|
|
|
579
878
|
// src/objects/Channel.ts
|
|
580
|
-
var
|
|
879
|
+
var import_auto_bind4 = __toESM(require("auto-bind"), 1);
|
|
581
880
|
|
|
582
881
|
// src/objects/ChannelFees.ts
|
|
583
882
|
var ChannelFeesFromJson = (obj) => {
|
|
@@ -639,7 +938,7 @@ var Channel = class {
|
|
|
639
938
|
this.fees = fees;
|
|
640
939
|
this.remoteNodeId = remoteNodeId;
|
|
641
940
|
this.shortChannelId = shortChannelId;
|
|
642
|
-
(0,
|
|
941
|
+
(0, import_auto_bind4.default)(this);
|
|
643
942
|
}
|
|
644
943
|
async getUptimePercentage(client, afterDate = void 0, beforeDate = void 0) {
|
|
645
944
|
return await client.executeRawQuery({
|
|
@@ -724,7 +1023,7 @@ query GetChannel($id: ID!) {
|
|
|
724
1023
|
}
|
|
725
1024
|
}
|
|
726
1025
|
|
|
727
|
-
${
|
|
1026
|
+
${FRAGMENT7}
|
|
728
1027
|
`,
|
|
729
1028
|
variables: { id },
|
|
730
1029
|
constructObject: (data) => ChannelFromJson(data.entity)
|
|
@@ -754,7 +1053,7 @@ var ChannelFromJson = (obj) => {
|
|
|
754
1053
|
obj["channel_short_channel_id"]
|
|
755
1054
|
);
|
|
756
1055
|
};
|
|
757
|
-
var
|
|
1056
|
+
var FRAGMENT7 = `
|
|
758
1057
|
fragment ChannelFragment on Channel {
|
|
759
1058
|
__typename
|
|
760
1059
|
channel_id: id
|
|
@@ -904,7 +1203,7 @@ var LightsparkNode = class {
|
|
|
904
1203
|
this.purpose = purpose;
|
|
905
1204
|
this.remoteBalance = remoteBalance;
|
|
906
1205
|
this.status = status;
|
|
907
|
-
(0,
|
|
1206
|
+
(0, import_auto_bind5.default)(this);
|
|
908
1207
|
}
|
|
909
1208
|
async getAddresses(client, first = void 0, types = void 0) {
|
|
910
1209
|
return await client.executeRawQuery({
|
|
@@ -1065,7 +1364,7 @@ query GetLightsparkNode($id: ID!) {
|
|
|
1065
1364
|
}
|
|
1066
1365
|
}
|
|
1067
1366
|
|
|
1068
|
-
${
|
|
1367
|
+
${FRAGMENT8}
|
|
1069
1368
|
`,
|
|
1070
1369
|
variables: { id },
|
|
1071
1370
|
constructObject: (data) => LightsparkNodeFromJson(data.entity)
|
|
@@ -1095,7 +1394,7 @@ var LightsparkNodeFromJson = (obj) => {
|
|
|
1095
1394
|
!!obj["lightspark_node_status"] ? LightsparkNodeStatus_default[obj["lightspark_node_status"]] ?? LightsparkNodeStatus_default.FUTURE_VALUE : null
|
|
1096
1395
|
);
|
|
1097
1396
|
};
|
|
1098
|
-
var
|
|
1397
|
+
var FRAGMENT8 = `
|
|
1099
1398
|
fragment LightsparkNodeFragment on LightsparkNode {
|
|
1100
1399
|
__typename
|
|
1101
1400
|
lightspark_node_id: id
|
|
@@ -1216,7 +1515,7 @@ var Node = class {
|
|
|
1216
1515
|
this.color = color;
|
|
1217
1516
|
this.conductivity = conductivity;
|
|
1218
1517
|
this.publicKey = publicKey;
|
|
1219
|
-
(0,
|
|
1518
|
+
(0, import_auto_bind6.default)(this);
|
|
1220
1519
|
}
|
|
1221
1520
|
async getAddresses(client, first = void 0, types = void 0) {
|
|
1222
1521
|
return await client.executeRawQuery({
|
|
@@ -1255,7 +1554,7 @@ query GetNode($id: ID!) {
|
|
|
1255
1554
|
}
|
|
1256
1555
|
}
|
|
1257
1556
|
|
|
1258
|
-
${
|
|
1557
|
+
${FRAGMENT9}
|
|
1259
1558
|
`,
|
|
1260
1559
|
variables: { id },
|
|
1261
1560
|
constructObject: (data) => NodeFromJson(data.entity)
|
|
@@ -1305,7 +1604,7 @@ var NodeFromJson = (obj) => {
|
|
|
1305
1604
|
`Couldn't find a concrete type for interface Node corresponding to the typename=${obj["__typename"]}`
|
|
1306
1605
|
);
|
|
1307
1606
|
};
|
|
1308
|
-
var
|
|
1607
|
+
var FRAGMENT9 = `
|
|
1309
1608
|
fragment NodeFragment on Node {
|
|
1310
1609
|
__typename
|
|
1311
1610
|
... on GraphNode {
|
|
@@ -1400,638 +1699,35 @@ fragment NodeFragment on Node {
|
|
|
1400
1699
|
}
|
|
1401
1700
|
lightspark_node_total_local_balance: total_local_balance {
|
|
1402
1701
|
__typename
|
|
1403
|
-
currency_amount_original_value: original_value
|
|
1404
|
-
currency_amount_original_unit: original_unit
|
|
1405
|
-
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
1406
|
-
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
1407
|
-
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
1408
|
-
}
|
|
1409
|
-
lightspark_node_local_balance: local_balance {
|
|
1410
|
-
__typename
|
|
1411
|
-
currency_amount_original_value: original_value
|
|
1412
|
-
currency_amount_original_unit: original_unit
|
|
1413
|
-
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
1414
|
-
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
1415
|
-
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
1416
|
-
}
|
|
1417
|
-
lightspark_node_purpose: purpose
|
|
1418
|
-
lightspark_node_remote_balance: remote_balance {
|
|
1419
|
-
__typename
|
|
1420
|
-
currency_amount_original_value: original_value
|
|
1421
|
-
currency_amount_original_unit: original_unit
|
|
1422
|
-
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
1423
|
-
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
1424
|
-
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
1425
|
-
}
|
|
1426
|
-
lightspark_node_status: status
|
|
1427
|
-
}
|
|
1428
|
-
}`;
|
|
1429
|
-
var Node_default = Node;
|
|
1430
|
-
|
|
1431
|
-
// src/objects/InvoiceData.ts
|
|
1432
|
-
var InvoiceDataFromJson = (obj) => {
|
|
1433
|
-
return {
|
|
1434
|
-
encodedPaymentRequest: obj["invoice_data_encoded_payment_request"],
|
|
1435
|
-
bitcoinNetwork: BitcoinNetwork_default[obj["invoice_data_bitcoin_network"]] ?? BitcoinNetwork_default.FUTURE_VALUE,
|
|
1436
|
-
paymentHash: obj["invoice_data_payment_hash"],
|
|
1437
|
-
amount: CurrencyAmountFromJson(obj["invoice_data_amount"]),
|
|
1438
|
-
createdAt: obj["invoice_data_created_at"],
|
|
1439
|
-
expiresAt: obj["invoice_data_expires_at"],
|
|
1440
|
-
destination: NodeFromJson(obj["invoice_data_destination"]),
|
|
1441
|
-
typename: "InvoiceData",
|
|
1442
|
-
memo: obj["invoice_data_memo"]
|
|
1443
|
-
};
|
|
1444
|
-
};
|
|
1445
|
-
var FRAGMENT8 = `
|
|
1446
|
-
fragment InvoiceDataFragment on InvoiceData {
|
|
1447
|
-
__typename
|
|
1448
|
-
invoice_data_encoded_payment_request: encoded_payment_request
|
|
1449
|
-
invoice_data_bitcoin_network: bitcoin_network
|
|
1450
|
-
invoice_data_payment_hash: payment_hash
|
|
1451
|
-
invoice_data_amount: amount {
|
|
1452
|
-
__typename
|
|
1453
|
-
currency_amount_original_value: original_value
|
|
1454
|
-
currency_amount_original_unit: original_unit
|
|
1455
|
-
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
1456
|
-
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
1457
|
-
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
1458
|
-
}
|
|
1459
|
-
invoice_data_created_at: created_at
|
|
1460
|
-
invoice_data_expires_at: expires_at
|
|
1461
|
-
invoice_data_memo: memo
|
|
1462
|
-
invoice_data_destination: destination {
|
|
1463
|
-
__typename
|
|
1464
|
-
... on GraphNode {
|
|
1465
|
-
__typename
|
|
1466
|
-
graph_node_id: id
|
|
1467
|
-
graph_node_created_at: created_at
|
|
1468
|
-
graph_node_updated_at: updated_at
|
|
1469
|
-
graph_node_alias: alias
|
|
1470
|
-
graph_node_bitcoin_network: bitcoin_network
|
|
1471
|
-
graph_node_color: color
|
|
1472
|
-
graph_node_conductivity: conductivity
|
|
1473
|
-
graph_node_display_name: display_name
|
|
1474
|
-
graph_node_public_key: public_key
|
|
1475
|
-
}
|
|
1476
|
-
... on LightsparkNode {
|
|
1477
|
-
__typename
|
|
1478
|
-
lightspark_node_id: id
|
|
1479
|
-
lightspark_node_created_at: created_at
|
|
1480
|
-
lightspark_node_updated_at: updated_at
|
|
1481
|
-
lightspark_node_alias: alias
|
|
1482
|
-
lightspark_node_bitcoin_network: bitcoin_network
|
|
1483
|
-
lightspark_node_color: color
|
|
1484
|
-
lightspark_node_conductivity: conductivity
|
|
1485
|
-
lightspark_node_display_name: display_name
|
|
1486
|
-
lightspark_node_public_key: public_key
|
|
1487
|
-
lightspark_node_account: account {
|
|
1488
|
-
id
|
|
1489
|
-
}
|
|
1490
|
-
lightspark_node_blockchain_balance: blockchain_balance {
|
|
1491
|
-
__typename
|
|
1492
|
-
blockchain_balance_total_balance: total_balance {
|
|
1493
|
-
__typename
|
|
1494
|
-
currency_amount_original_value: original_value
|
|
1495
|
-
currency_amount_original_unit: original_unit
|
|
1496
|
-
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
1497
|
-
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
1498
|
-
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
1499
|
-
}
|
|
1500
|
-
blockchain_balance_confirmed_balance: confirmed_balance {
|
|
1501
|
-
__typename
|
|
1502
|
-
currency_amount_original_value: original_value
|
|
1503
|
-
currency_amount_original_unit: original_unit
|
|
1504
|
-
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
1505
|
-
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
1506
|
-
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
1507
|
-
}
|
|
1508
|
-
blockchain_balance_unconfirmed_balance: unconfirmed_balance {
|
|
1509
|
-
__typename
|
|
1510
|
-
currency_amount_original_value: original_value
|
|
1511
|
-
currency_amount_original_unit: original_unit
|
|
1512
|
-
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
1513
|
-
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
1514
|
-
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
1515
|
-
}
|
|
1516
|
-
blockchain_balance_locked_balance: locked_balance {
|
|
1517
|
-
__typename
|
|
1518
|
-
currency_amount_original_value: original_value
|
|
1519
|
-
currency_amount_original_unit: original_unit
|
|
1520
|
-
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
1521
|
-
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
1522
|
-
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
1523
|
-
}
|
|
1524
|
-
blockchain_balance_required_reserve: required_reserve {
|
|
1525
|
-
__typename
|
|
1526
|
-
currency_amount_original_value: original_value
|
|
1527
|
-
currency_amount_original_unit: original_unit
|
|
1528
|
-
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
1529
|
-
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
1530
|
-
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
1531
|
-
}
|
|
1532
|
-
blockchain_balance_available_balance: available_balance {
|
|
1533
|
-
__typename
|
|
1534
|
-
currency_amount_original_value: original_value
|
|
1535
|
-
currency_amount_original_unit: original_unit
|
|
1536
|
-
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
1537
|
-
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
1538
|
-
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
1539
|
-
}
|
|
1540
|
-
}
|
|
1541
|
-
lightspark_node_encrypted_signing_private_key: encrypted_signing_private_key {
|
|
1542
|
-
__typename
|
|
1543
|
-
secret_encrypted_value: encrypted_value
|
|
1544
|
-
secret_cipher: cipher
|
|
1545
|
-
}
|
|
1546
|
-
lightspark_node_total_balance: total_balance {
|
|
1547
|
-
__typename
|
|
1548
|
-
currency_amount_original_value: original_value
|
|
1549
|
-
currency_amount_original_unit: original_unit
|
|
1550
|
-
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
1551
|
-
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
1552
|
-
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
1553
|
-
}
|
|
1554
|
-
lightspark_node_total_local_balance: total_local_balance {
|
|
1555
|
-
__typename
|
|
1556
|
-
currency_amount_original_value: original_value
|
|
1557
|
-
currency_amount_original_unit: original_unit
|
|
1558
|
-
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
1559
|
-
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
1560
|
-
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
1561
|
-
}
|
|
1562
|
-
lightspark_node_local_balance: local_balance {
|
|
1563
|
-
__typename
|
|
1564
|
-
currency_amount_original_value: original_value
|
|
1565
|
-
currency_amount_original_unit: original_unit
|
|
1566
|
-
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
1567
|
-
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
1568
|
-
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
1569
|
-
}
|
|
1570
|
-
lightspark_node_purpose: purpose
|
|
1571
|
-
lightspark_node_remote_balance: remote_balance {
|
|
1572
|
-
__typename
|
|
1573
|
-
currency_amount_original_value: original_value
|
|
1574
|
-
currency_amount_original_unit: original_unit
|
|
1575
|
-
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
1576
|
-
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
1577
|
-
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
1578
|
-
}
|
|
1579
|
-
lightspark_node_status: status
|
|
1580
|
-
}
|
|
1581
|
-
}
|
|
1582
|
-
}`;
|
|
1583
|
-
|
|
1584
|
-
// src/graphql/DecodeInvoice.ts
|
|
1585
|
-
var DecodeInvoice = `
|
|
1586
|
-
query DecodeInvoice($encoded_payment_request: String!) {
|
|
1587
|
-
decoded_payment_request(encoded_payment_request: $encoded_payment_request) {
|
|
1588
|
-
__typename
|
|
1589
|
-
... on InvoiceData {
|
|
1590
|
-
...InvoiceDataFragment
|
|
1591
|
-
}
|
|
1592
|
-
}
|
|
1593
|
-
}
|
|
1594
|
-
|
|
1595
|
-
${FRAGMENT8}
|
|
1596
|
-
`;
|
|
1597
|
-
|
|
1598
|
-
// src/graphql/DeleteApiToken.ts
|
|
1599
|
-
var DeleteApiToken = `
|
|
1600
|
-
mutation DeleteApiToken(
|
|
1601
|
-
$api_token_id: ID!
|
|
1602
|
-
) {
|
|
1603
|
-
delete_api_token(input: {
|
|
1604
|
-
api_token_id: $api_token_id
|
|
1605
|
-
}) {
|
|
1606
|
-
__typename
|
|
1607
|
-
}
|
|
1608
|
-
}
|
|
1609
|
-
`;
|
|
1610
|
-
|
|
1611
|
-
// src/graphql/FundNode.ts
|
|
1612
|
-
var FundNode = `
|
|
1613
|
-
mutation FundNode(
|
|
1614
|
-
$node_id: ID!,
|
|
1615
|
-
$amountSats: Long
|
|
1616
|
-
) {
|
|
1617
|
-
fund_node(input: { node_id: $node_id, amount_sats: $amountMsats }) {
|
|
1618
|
-
amount {
|
|
1619
|
-
...CurrencyAmountFragment
|
|
1620
|
-
}
|
|
1621
|
-
}
|
|
1622
|
-
}
|
|
1623
|
-
|
|
1624
|
-
${FRAGMENT}
|
|
1625
|
-
`;
|
|
1626
|
-
|
|
1627
|
-
// src/objects/LightningFeeEstimateOutput.ts
|
|
1628
|
-
var FRAGMENT9 = `
|
|
1629
|
-
fragment LightningFeeEstimateOutputFragment on LightningFeeEstimateOutput {
|
|
1630
|
-
__typename
|
|
1631
|
-
lightning_fee_estimate_output_fee_estimate: fee_estimate {
|
|
1632
|
-
__typename
|
|
1633
|
-
currency_amount_original_value: original_value
|
|
1634
|
-
currency_amount_original_unit: original_unit
|
|
1635
|
-
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
1636
|
-
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
1637
|
-
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
1638
|
-
}
|
|
1639
|
-
}`;
|
|
1640
|
-
|
|
1641
|
-
// src/graphql/LightningFeeEstimateForInvoice.ts
|
|
1642
|
-
var LightningFeeEstimateForInvoice = `
|
|
1643
|
-
query LightningFeeEstimateForInvoice(
|
|
1644
|
-
$node_id: ID!
|
|
1645
|
-
$encoded_payment_request: String!
|
|
1646
|
-
$amount_msats: Long
|
|
1647
|
-
) {
|
|
1648
|
-
lightning_fee_estimate_for_invoice(input: {
|
|
1649
|
-
node_id: $node_id,
|
|
1650
|
-
encoded_payment_request: $encoded_payment_request,
|
|
1651
|
-
amount_msats: $amount_msats
|
|
1652
|
-
}) {
|
|
1653
|
-
...LightningFeeEstimateOutputFragment
|
|
1654
|
-
}
|
|
1655
|
-
}
|
|
1656
|
-
|
|
1657
|
-
${FRAGMENT9}
|
|
1658
|
-
`;
|
|
1659
|
-
|
|
1660
|
-
// src/graphql/LightningFeeEstimateForNode.ts
|
|
1661
|
-
var LightningFeeEstimateForNode = `
|
|
1662
|
-
query LightningFeeEstimateForNode(
|
|
1663
|
-
$node_id: ID!
|
|
1664
|
-
$destination_node_public_key: String!
|
|
1665
|
-
$amount_msats: Long!
|
|
1666
|
-
) {
|
|
1667
|
-
lightning_fee_estimate_for_node(input: {
|
|
1668
|
-
node_id: $node_id,
|
|
1669
|
-
destination_node_public_key: $destination_node_public_key,
|
|
1670
|
-
amount_msats: $amount_msats
|
|
1671
|
-
}) {
|
|
1672
|
-
...LightningFeeEstimateOutputFragment
|
|
1673
|
-
}
|
|
1674
|
-
}
|
|
1675
|
-
|
|
1676
|
-
${FRAGMENT9}
|
|
1677
|
-
`;
|
|
1678
|
-
|
|
1679
|
-
// src/graphql/MultiNodeDashboard.ts
|
|
1680
|
-
var MultiNodeDashboard = `
|
|
1681
|
-
query MultiNodeDashboard(
|
|
1682
|
-
$network: BitcoinNetwork!,
|
|
1683
|
-
$nodeIds: [ID!]
|
|
1684
|
-
) {
|
|
1685
|
-
current_account {
|
|
1686
|
-
id
|
|
1687
|
-
name
|
|
1688
|
-
dashboard_overview_nodes: nodes(
|
|
1689
|
-
bitcoin_networks: [$network]
|
|
1690
|
-
node_ids: $nodeIds
|
|
1691
|
-
) {
|
|
1692
|
-
count
|
|
1693
|
-
entities {
|
|
1694
|
-
color
|
|
1695
|
-
display_name
|
|
1696
|
-
purpose
|
|
1697
|
-
id
|
|
1698
|
-
addresses(first: 1) {
|
|
1699
|
-
entities {
|
|
1700
|
-
address
|
|
1701
|
-
type
|
|
1702
|
-
__typename
|
|
1703
|
-
}
|
|
1704
|
-
count
|
|
1705
|
-
__typename
|
|
1706
|
-
}
|
|
1707
|
-
public_key
|
|
1708
|
-
status
|
|
1709
|
-
local_balance {
|
|
1710
|
-
...CurrencyAmountFragment
|
|
1711
|
-
}
|
|
1712
|
-
remote_balance {
|
|
1713
|
-
...CurrencyAmountFragment
|
|
1714
|
-
}
|
|
1715
|
-
blockchain_balance {
|
|
1716
|
-
available_balance {
|
|
1717
|
-
...CurrencyAmountFragment
|
|
1718
|
-
}
|
|
1719
|
-
total_balance {
|
|
1720
|
-
...CurrencyAmountFragment
|
|
1721
|
-
}
|
|
1722
|
-
__typename
|
|
1723
|
-
}
|
|
1724
|
-
__typename
|
|
1725
|
-
}
|
|
1726
|
-
__typename
|
|
1727
|
-
}
|
|
1728
|
-
blockchain_balance(bitcoin_networks: [$network], node_ids: $nodeIds) {
|
|
1729
|
-
l1_balance: total_balance {
|
|
1730
|
-
...CurrencyAmountFragment
|
|
1731
|
-
}
|
|
1732
|
-
required_reserve {
|
|
1733
|
-
...CurrencyAmountFragment
|
|
1734
|
-
}
|
|
1735
|
-
available_balance {
|
|
1736
|
-
...CurrencyAmountFragment
|
|
1737
|
-
}
|
|
1738
|
-
unconfirmed_balance {
|
|
1739
|
-
...CurrencyAmountFragment
|
|
1740
|
-
}
|
|
1741
|
-
__typename
|
|
1742
|
-
}
|
|
1743
|
-
local_balance(bitcoin_networks: [$network], node_ids: $nodeIds) {
|
|
1744
|
-
...CurrencyAmountFragment
|
|
1745
|
-
}
|
|
1746
|
-
remote_balance(bitcoin_networks: [$network], node_ids: $nodeIds) {
|
|
1747
|
-
...CurrencyAmountFragment
|
|
1748
|
-
}
|
|
1749
|
-
}
|
|
1750
|
-
}
|
|
1751
|
-
|
|
1752
|
-
${FRAGMENT}
|
|
1753
|
-
`;
|
|
1754
|
-
|
|
1755
|
-
// src/objects/OutgoingPayment.ts
|
|
1756
|
-
var import_auto_bind7 = __toESM(require("auto-bind"), 1);
|
|
1757
|
-
|
|
1758
|
-
// src/objects/OutgoingPaymentAttempt.ts
|
|
1759
|
-
var import_auto_bind6 = __toESM(require("auto-bind"), 1);
|
|
1760
|
-
|
|
1761
|
-
// src/objects/HtlcAttemptFailureCode.ts
|
|
1762
|
-
var HtlcAttemptFailureCode = /* @__PURE__ */ ((HtlcAttemptFailureCode2) => {
|
|
1763
|
-
HtlcAttemptFailureCode2["FUTURE_VALUE"] = "FUTURE_VALUE";
|
|
1764
|
-
HtlcAttemptFailureCode2["INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS"] = "INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS";
|
|
1765
|
-
HtlcAttemptFailureCode2["INCORRECT_PAYMENT_AMOUNT"] = "INCORRECT_PAYMENT_AMOUNT";
|
|
1766
|
-
HtlcAttemptFailureCode2["FINAL_INCORRECT_CLTV_EXPIRY"] = "FINAL_INCORRECT_CLTV_EXPIRY";
|
|
1767
|
-
HtlcAttemptFailureCode2["FINAL_INCORRECT_HTLC_AMOUNT"] = "FINAL_INCORRECT_HTLC_AMOUNT";
|
|
1768
|
-
HtlcAttemptFailureCode2["FINAL_EXPIRY_TOO_SOON"] = "FINAL_EXPIRY_TOO_SOON";
|
|
1769
|
-
HtlcAttemptFailureCode2["INVALID_REALM"] = "INVALID_REALM";
|
|
1770
|
-
HtlcAttemptFailureCode2["EXPIRY_TOO_SOON"] = "EXPIRY_TOO_SOON";
|
|
1771
|
-
HtlcAttemptFailureCode2["INVALID_ONION_VERSION"] = "INVALID_ONION_VERSION";
|
|
1772
|
-
HtlcAttemptFailureCode2["INVALID_ONION_HMAC"] = "INVALID_ONION_HMAC";
|
|
1773
|
-
HtlcAttemptFailureCode2["INVALID_ONION_KEY"] = "INVALID_ONION_KEY";
|
|
1774
|
-
HtlcAttemptFailureCode2["AMOUNT_BELOW_MINIMUM"] = "AMOUNT_BELOW_MINIMUM";
|
|
1775
|
-
HtlcAttemptFailureCode2["FEE_INSUFFICIENT"] = "FEE_INSUFFICIENT";
|
|
1776
|
-
HtlcAttemptFailureCode2["INCORRECT_CLTV_EXPIRY"] = "INCORRECT_CLTV_EXPIRY";
|
|
1777
|
-
HtlcAttemptFailureCode2["CHANNEL_DISABLED"] = "CHANNEL_DISABLED";
|
|
1778
|
-
HtlcAttemptFailureCode2["TEMPORARY_CHANNEL_FAILURE"] = "TEMPORARY_CHANNEL_FAILURE";
|
|
1779
|
-
HtlcAttemptFailureCode2["REQUIRED_NODE_FEATURE_MISSING"] = "REQUIRED_NODE_FEATURE_MISSING";
|
|
1780
|
-
HtlcAttemptFailureCode2["REQUIRED_CHANNEL_FEATURE_MISSING"] = "REQUIRED_CHANNEL_FEATURE_MISSING";
|
|
1781
|
-
HtlcAttemptFailureCode2["UNKNOWN_NEXT_PEER"] = "UNKNOWN_NEXT_PEER";
|
|
1782
|
-
HtlcAttemptFailureCode2["TEMPORARY_NODE_FAILURE"] = "TEMPORARY_NODE_FAILURE";
|
|
1783
|
-
HtlcAttemptFailureCode2["PERMANENT_NODE_FAILURE"] = "PERMANENT_NODE_FAILURE";
|
|
1784
|
-
HtlcAttemptFailureCode2["PERMANENT_CHANNEL_FAILURE"] = "PERMANENT_CHANNEL_FAILURE";
|
|
1785
|
-
HtlcAttemptFailureCode2["EXPIRY_TOO_FAR"] = "EXPIRY_TOO_FAR";
|
|
1786
|
-
HtlcAttemptFailureCode2["MPP_TIMEOUT"] = "MPP_TIMEOUT";
|
|
1787
|
-
HtlcAttemptFailureCode2["INVALID_ONION_PAYLOAD"] = "INVALID_ONION_PAYLOAD";
|
|
1788
|
-
HtlcAttemptFailureCode2["INTERNAL_FAILURE"] = "INTERNAL_FAILURE";
|
|
1789
|
-
HtlcAttemptFailureCode2["UNKNOWN_FAILURE"] = "UNKNOWN_FAILURE";
|
|
1790
|
-
HtlcAttemptFailureCode2["UNREADABLE_FAILURE"] = "UNREADABLE_FAILURE";
|
|
1791
|
-
return HtlcAttemptFailureCode2;
|
|
1792
|
-
})(HtlcAttemptFailureCode || {});
|
|
1793
|
-
var HtlcAttemptFailureCode_default = HtlcAttemptFailureCode;
|
|
1794
|
-
|
|
1795
|
-
// src/objects/OutgoingPaymentAttemptStatus.ts
|
|
1796
|
-
var OutgoingPaymentAttemptStatus = /* @__PURE__ */ ((OutgoingPaymentAttemptStatus2) => {
|
|
1797
|
-
OutgoingPaymentAttemptStatus2["FUTURE_VALUE"] = "FUTURE_VALUE";
|
|
1798
|
-
OutgoingPaymentAttemptStatus2["IN_FLIGHT"] = "IN_FLIGHT";
|
|
1799
|
-
OutgoingPaymentAttemptStatus2["SUCCEEDED"] = "SUCCEEDED";
|
|
1800
|
-
OutgoingPaymentAttemptStatus2["FAILED"] = "FAILED";
|
|
1801
|
-
return OutgoingPaymentAttemptStatus2;
|
|
1802
|
-
})(OutgoingPaymentAttemptStatus || {});
|
|
1803
|
-
var OutgoingPaymentAttemptStatus_default = OutgoingPaymentAttemptStatus;
|
|
1804
|
-
|
|
1805
|
-
// src/objects/Hop.ts
|
|
1806
|
-
var HopFromJson = (obj) => {
|
|
1807
|
-
return {
|
|
1808
|
-
id: obj["hop_id"],
|
|
1809
|
-
createdAt: obj["hop_created_at"],
|
|
1810
|
-
updatedAt: obj["hop_updated_at"],
|
|
1811
|
-
index: obj["hop_index"],
|
|
1812
|
-
typename: "Hop",
|
|
1813
|
-
destinationId: obj["hop_destination"]?.id ?? void 0,
|
|
1814
|
-
publicKey: obj["hop_public_key"],
|
|
1815
|
-
amountToForward: !!obj["hop_amount_to_forward"] ? CurrencyAmountFromJson(obj["hop_amount_to_forward"]) : void 0,
|
|
1816
|
-
fee: !!obj["hop_fee"] ? CurrencyAmountFromJson(obj["hop_fee"]) : void 0,
|
|
1817
|
-
expiryBlockHeight: obj["hop_expiry_block_height"]
|
|
1818
|
-
};
|
|
1819
|
-
};
|
|
1820
|
-
var FRAGMENT10 = `
|
|
1821
|
-
fragment HopFragment on Hop {
|
|
1822
|
-
__typename
|
|
1823
|
-
hop_id: id
|
|
1824
|
-
hop_created_at: created_at
|
|
1825
|
-
hop_updated_at: updated_at
|
|
1826
|
-
hop_destination: destination {
|
|
1827
|
-
id
|
|
1828
|
-
}
|
|
1829
|
-
hop_index: index
|
|
1830
|
-
hop_public_key: public_key
|
|
1831
|
-
hop_amount_to_forward: amount_to_forward {
|
|
1832
|
-
__typename
|
|
1833
|
-
currency_amount_original_value: original_value
|
|
1834
|
-
currency_amount_original_unit: original_unit
|
|
1835
|
-
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
1836
|
-
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
1837
|
-
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
1838
|
-
}
|
|
1839
|
-
hop_fee: fee {
|
|
1840
|
-
__typename
|
|
1841
|
-
currency_amount_original_value: original_value
|
|
1842
|
-
currency_amount_original_unit: original_unit
|
|
1843
|
-
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
1844
|
-
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
1845
|
-
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
1846
|
-
}
|
|
1847
|
-
hop_expiry_block_height: expiry_block_height
|
|
1848
|
-
}`;
|
|
1849
|
-
var getHopQuery = (id) => {
|
|
1850
|
-
return {
|
|
1851
|
-
queryPayload: `
|
|
1852
|
-
query GetHop($id: ID!) {
|
|
1853
|
-
entity(id: $id) {
|
|
1854
|
-
... on Hop {
|
|
1855
|
-
...HopFragment
|
|
1856
|
-
}
|
|
1857
|
-
}
|
|
1858
|
-
}
|
|
1859
|
-
|
|
1860
|
-
${FRAGMENT10}
|
|
1861
|
-
`,
|
|
1862
|
-
variables: { id },
|
|
1863
|
-
constructObject: (data) => HopFromJson(data.entity)
|
|
1864
|
-
};
|
|
1865
|
-
};
|
|
1866
|
-
|
|
1867
|
-
// src/objects/OutgoingPaymentAttemptToHopsConnection.ts
|
|
1868
|
-
var OutgoingPaymentAttemptToHopsConnectionFromJson = (obj) => {
|
|
1869
|
-
return {
|
|
1870
|
-
count: obj["outgoing_payment_attempt_to_hops_connection_count"],
|
|
1871
|
-
entities: obj["outgoing_payment_attempt_to_hops_connection_entities"].map(
|
|
1872
|
-
(e) => HopFromJson(e)
|
|
1873
|
-
)
|
|
1874
|
-
};
|
|
1875
|
-
};
|
|
1876
|
-
|
|
1877
|
-
// src/objects/OutgoingPaymentAttempt.ts
|
|
1878
|
-
var OutgoingPaymentAttempt = class {
|
|
1879
|
-
constructor(id, createdAt, updatedAt, status, outgoingPaymentId, typename, failureCode, failureSourceIndex, resolvedAt, amount, fees) {
|
|
1880
|
-
this.id = id;
|
|
1881
|
-
this.createdAt = createdAt;
|
|
1882
|
-
this.updatedAt = updatedAt;
|
|
1883
|
-
this.status = status;
|
|
1884
|
-
this.outgoingPaymentId = outgoingPaymentId;
|
|
1885
|
-
this.typename = typename;
|
|
1886
|
-
this.failureCode = failureCode;
|
|
1887
|
-
this.failureSourceIndex = failureSourceIndex;
|
|
1888
|
-
this.resolvedAt = resolvedAt;
|
|
1889
|
-
this.amount = amount;
|
|
1890
|
-
this.fees = fees;
|
|
1891
|
-
(0, import_auto_bind6.default)(this);
|
|
1892
|
-
}
|
|
1893
|
-
async getHops(client, first = void 0) {
|
|
1894
|
-
return await client.executeRawQuery({
|
|
1895
|
-
queryPayload: `
|
|
1896
|
-
query FetchOutgoingPaymentAttemptToHopsConnection($entity_id: ID!, $first: Int) {
|
|
1897
|
-
entity(id: $entity_id) {
|
|
1898
|
-
... on OutgoingPaymentAttempt {
|
|
1899
|
-
hops(, first: $first) {
|
|
1900
|
-
__typename
|
|
1901
|
-
outgoing_payment_attempt_to_hops_connection_count: count
|
|
1902
|
-
outgoing_payment_attempt_to_hops_connection_entities: entities {
|
|
1903
|
-
__typename
|
|
1904
|
-
hop_id: id
|
|
1905
|
-
hop_created_at: created_at
|
|
1906
|
-
hop_updated_at: updated_at
|
|
1907
|
-
hop_destination: destination {
|
|
1908
|
-
id
|
|
1909
|
-
}
|
|
1910
|
-
hop_index: index
|
|
1911
|
-
hop_public_key: public_key
|
|
1912
|
-
hop_amount_to_forward: amount_to_forward {
|
|
1913
|
-
__typename
|
|
1914
|
-
currency_amount_original_value: original_value
|
|
1915
|
-
currency_amount_original_unit: original_unit
|
|
1916
|
-
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
1917
|
-
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
1918
|
-
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
1919
|
-
}
|
|
1920
|
-
hop_fee: fee {
|
|
1921
|
-
__typename
|
|
1922
|
-
currency_amount_original_value: original_value
|
|
1923
|
-
currency_amount_original_unit: original_unit
|
|
1924
|
-
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
1925
|
-
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
1926
|
-
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
1927
|
-
}
|
|
1928
|
-
hop_expiry_block_height: expiry_block_height
|
|
1929
|
-
}
|
|
1930
|
-
}
|
|
1702
|
+
currency_amount_original_value: original_value
|
|
1703
|
+
currency_amount_original_unit: original_unit
|
|
1704
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
1705
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
1706
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
1931
1707
|
}
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
}
|
|
1940
|
-
});
|
|
1941
|
-
}
|
|
1942
|
-
static getOutgoingPaymentAttemptQuery(id) {
|
|
1943
|
-
return {
|
|
1944
|
-
queryPayload: `
|
|
1945
|
-
query GetOutgoingPaymentAttempt($id: ID!) {
|
|
1946
|
-
entity(id: $id) {
|
|
1947
|
-
... on OutgoingPaymentAttempt {
|
|
1948
|
-
...OutgoingPaymentAttemptFragment
|
|
1708
|
+
lightspark_node_local_balance: local_balance {
|
|
1709
|
+
__typename
|
|
1710
|
+
currency_amount_original_value: original_value
|
|
1711
|
+
currency_amount_original_unit: original_unit
|
|
1712
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
1713
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
1714
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
1949
1715
|
}
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
var OutgoingPaymentAttemptFromJson = (obj) => {
|
|
1961
|
-
return new OutgoingPaymentAttempt(
|
|
1962
|
-
obj["outgoing_payment_attempt_id"],
|
|
1963
|
-
obj["outgoing_payment_attempt_created_at"],
|
|
1964
|
-
obj["outgoing_payment_attempt_updated_at"],
|
|
1965
|
-
OutgoingPaymentAttemptStatus_default[obj["outgoing_payment_attempt_status"]] ?? OutgoingPaymentAttemptStatus_default.FUTURE_VALUE,
|
|
1966
|
-
obj["outgoing_payment_attempt_outgoing_payment"].id,
|
|
1967
|
-
"OutgoingPaymentAttempt",
|
|
1968
|
-
!!obj["outgoing_payment_attempt_failure_code"] ? HtlcAttemptFailureCode_default[obj["outgoing_payment_attempt_failure_code"]] ?? HtlcAttemptFailureCode_default.FUTURE_VALUE : null,
|
|
1969
|
-
obj["outgoing_payment_attempt_failure_source_index"],
|
|
1970
|
-
obj["outgoing_payment_attempt_resolved_at"],
|
|
1971
|
-
!!obj["outgoing_payment_attempt_amount"] ? CurrencyAmountFromJson(obj["outgoing_payment_attempt_amount"]) : void 0,
|
|
1972
|
-
!!obj["outgoing_payment_attempt_fees"] ? CurrencyAmountFromJson(obj["outgoing_payment_attempt_fees"]) : void 0
|
|
1973
|
-
);
|
|
1974
|
-
};
|
|
1975
|
-
var FRAGMENT11 = `
|
|
1976
|
-
fragment OutgoingPaymentAttemptFragment on OutgoingPaymentAttempt {
|
|
1977
|
-
__typename
|
|
1978
|
-
outgoing_payment_attempt_id: id
|
|
1979
|
-
outgoing_payment_attempt_created_at: created_at
|
|
1980
|
-
outgoing_payment_attempt_updated_at: updated_at
|
|
1981
|
-
outgoing_payment_attempt_status: status
|
|
1982
|
-
outgoing_payment_attempt_failure_code: failure_code
|
|
1983
|
-
outgoing_payment_attempt_failure_source_index: failure_source_index
|
|
1984
|
-
outgoing_payment_attempt_resolved_at: resolved_at
|
|
1985
|
-
outgoing_payment_attempt_amount: amount {
|
|
1986
|
-
__typename
|
|
1987
|
-
currency_amount_original_value: original_value
|
|
1988
|
-
currency_amount_original_unit: original_unit
|
|
1989
|
-
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
1990
|
-
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
1991
|
-
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
1992
|
-
}
|
|
1993
|
-
outgoing_payment_attempt_fees: fees {
|
|
1994
|
-
__typename
|
|
1995
|
-
currency_amount_original_value: original_value
|
|
1996
|
-
currency_amount_original_unit: original_unit
|
|
1997
|
-
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
1998
|
-
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
1999
|
-
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
2000
|
-
}
|
|
2001
|
-
outgoing_payment_attempt_outgoing_payment: outgoing_payment {
|
|
2002
|
-
id
|
|
1716
|
+
lightspark_node_purpose: purpose
|
|
1717
|
+
lightspark_node_remote_balance: remote_balance {
|
|
1718
|
+
__typename
|
|
1719
|
+
currency_amount_original_value: original_value
|
|
1720
|
+
currency_amount_original_unit: original_unit
|
|
1721
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
1722
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
1723
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
1724
|
+
}
|
|
1725
|
+
lightspark_node_status: status
|
|
2003
1726
|
}
|
|
2004
1727
|
}`;
|
|
2005
|
-
var
|
|
2006
|
-
|
|
2007
|
-
// src/objects/OutgoingPaymentToAttemptsConnection.ts
|
|
2008
|
-
var OutgoingPaymentToAttemptsConnectionFromJson = (obj) => {
|
|
2009
|
-
return {
|
|
2010
|
-
count: obj["outgoing_payment_to_attempts_connection_count"],
|
|
2011
|
-
entities: obj["outgoing_payment_to_attempts_connection_entities"].map(
|
|
2012
|
-
(e) => OutgoingPaymentAttemptFromJson(e)
|
|
2013
|
-
)
|
|
2014
|
-
};
|
|
2015
|
-
};
|
|
2016
|
-
|
|
2017
|
-
// src/objects/PaymentFailureReason.ts
|
|
2018
|
-
var PaymentFailureReason = /* @__PURE__ */ ((PaymentFailureReason2) => {
|
|
2019
|
-
PaymentFailureReason2["FUTURE_VALUE"] = "FUTURE_VALUE";
|
|
2020
|
-
PaymentFailureReason2["NONE"] = "NONE";
|
|
2021
|
-
PaymentFailureReason2["TIMEOUT"] = "TIMEOUT";
|
|
2022
|
-
PaymentFailureReason2["NO_ROUTE"] = "NO_ROUTE";
|
|
2023
|
-
PaymentFailureReason2["ERROR"] = "ERROR";
|
|
2024
|
-
PaymentFailureReason2["INCORRECT_PAYMENT_DETAILS"] = "INCORRECT_PAYMENT_DETAILS";
|
|
2025
|
-
PaymentFailureReason2["INSUFFICIENT_BALANCE"] = "INSUFFICIENT_BALANCE";
|
|
2026
|
-
PaymentFailureReason2["INVOICE_ALREADY_PAID"] = "INVOICE_ALREADY_PAID";
|
|
2027
|
-
PaymentFailureReason2["SELF_PAYMENT"] = "SELF_PAYMENT";
|
|
2028
|
-
PaymentFailureReason2["INVOICE_EXPIRED"] = "INVOICE_EXPIRED";
|
|
2029
|
-
return PaymentFailureReason2;
|
|
2030
|
-
})(PaymentFailureReason || {});
|
|
2031
|
-
var PaymentFailureReason_default = PaymentFailureReason;
|
|
1728
|
+
var Node_default = Node;
|
|
2032
1729
|
|
|
2033
1730
|
// src/objects/PaymentRequestData.ts
|
|
2034
|
-
var import_core3 = require("@lightsparkdev/core");
|
|
2035
1731
|
var PaymentRequestDataFromJson = (obj) => {
|
|
2036
1732
|
if (obj["__typename"] == "InvoiceData") {
|
|
2037
1733
|
return {
|
|
@@ -2152,7 +1848,7 @@ query GetOutgoingPayment($id: ID!) {
|
|
|
2152
1848
|
}
|
|
2153
1849
|
}
|
|
2154
1850
|
|
|
2155
|
-
${
|
|
1851
|
+
${FRAGMENT10}
|
|
2156
1852
|
`,
|
|
2157
1853
|
variables: { id },
|
|
2158
1854
|
constructObject: (data) => OutgoingPaymentFromJson(data.entity)
|
|
@@ -2177,7 +1873,7 @@ var OutgoingPaymentFromJson = (obj) => {
|
|
|
2177
1873
|
!!obj["outgoing_payment_failure_message"] ? RichTextFromJson(obj["outgoing_payment_failure_message"]) : void 0
|
|
2178
1874
|
);
|
|
2179
1875
|
};
|
|
2180
|
-
var
|
|
1876
|
+
var FRAGMENT10 = `
|
|
2181
1877
|
fragment OutgoingPaymentFragment on OutgoingPayment {
|
|
2182
1878
|
__typename
|
|
2183
1879
|
outgoing_payment_id: id
|
|
@@ -2348,13 +2044,358 @@ fragment OutgoingPaymentFragment on OutgoingPayment {
|
|
|
2348
2044
|
}
|
|
2349
2045
|
}
|
|
2350
2046
|
}
|
|
2351
|
-
outgoing_payment_failure_reason: failure_reason
|
|
2352
|
-
outgoing_payment_failure_message: failure_message {
|
|
2047
|
+
outgoing_payment_failure_reason: failure_reason
|
|
2048
|
+
outgoing_payment_failure_message: failure_message {
|
|
2049
|
+
__typename
|
|
2050
|
+
rich_text_text: text
|
|
2051
|
+
}
|
|
2052
|
+
}`;
|
|
2053
|
+
var OutgoingPayment_default = OutgoingPayment;
|
|
2054
|
+
|
|
2055
|
+
// src/graphql/CreateTestModePayment.ts
|
|
2056
|
+
var CreateTestModePayment = `
|
|
2057
|
+
mutation CreateTestModePayment(
|
|
2058
|
+
$local_node_id: ID!
|
|
2059
|
+
$encoded_invoice: String!
|
|
2060
|
+
$amount_msats: Long
|
|
2061
|
+
) {
|
|
2062
|
+
create_test_mode_payment(input: {
|
|
2063
|
+
local_node_id: $local_node_id
|
|
2064
|
+
encoded_invoice: $encoded_invoice
|
|
2065
|
+
amount_msats: $amount_msats
|
|
2066
|
+
}) {
|
|
2067
|
+
payment {
|
|
2068
|
+
...OutgoingPaymentFragment
|
|
2069
|
+
}
|
|
2070
|
+
}
|
|
2071
|
+
}
|
|
2072
|
+
|
|
2073
|
+
${FRAGMENT10}
|
|
2074
|
+
`;
|
|
2075
|
+
|
|
2076
|
+
// src/objects/InvoiceData.ts
|
|
2077
|
+
var InvoiceDataFromJson = (obj) => {
|
|
2078
|
+
return {
|
|
2079
|
+
encodedPaymentRequest: obj["invoice_data_encoded_payment_request"],
|
|
2080
|
+
bitcoinNetwork: BitcoinNetwork_default[obj["invoice_data_bitcoin_network"]] ?? BitcoinNetwork_default.FUTURE_VALUE,
|
|
2081
|
+
paymentHash: obj["invoice_data_payment_hash"],
|
|
2082
|
+
amount: CurrencyAmountFromJson(obj["invoice_data_amount"]),
|
|
2083
|
+
createdAt: obj["invoice_data_created_at"],
|
|
2084
|
+
expiresAt: obj["invoice_data_expires_at"],
|
|
2085
|
+
destination: NodeFromJson(obj["invoice_data_destination"]),
|
|
2086
|
+
typename: "InvoiceData",
|
|
2087
|
+
memo: obj["invoice_data_memo"]
|
|
2088
|
+
};
|
|
2089
|
+
};
|
|
2090
|
+
var FRAGMENT11 = `
|
|
2091
|
+
fragment InvoiceDataFragment on InvoiceData {
|
|
2092
|
+
__typename
|
|
2093
|
+
invoice_data_encoded_payment_request: encoded_payment_request
|
|
2094
|
+
invoice_data_bitcoin_network: bitcoin_network
|
|
2095
|
+
invoice_data_payment_hash: payment_hash
|
|
2096
|
+
invoice_data_amount: amount {
|
|
2097
|
+
__typename
|
|
2098
|
+
currency_amount_original_value: original_value
|
|
2099
|
+
currency_amount_original_unit: original_unit
|
|
2100
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
2101
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
2102
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
2103
|
+
}
|
|
2104
|
+
invoice_data_created_at: created_at
|
|
2105
|
+
invoice_data_expires_at: expires_at
|
|
2106
|
+
invoice_data_memo: memo
|
|
2107
|
+
invoice_data_destination: destination {
|
|
2108
|
+
__typename
|
|
2109
|
+
... on GraphNode {
|
|
2110
|
+
__typename
|
|
2111
|
+
graph_node_id: id
|
|
2112
|
+
graph_node_created_at: created_at
|
|
2113
|
+
graph_node_updated_at: updated_at
|
|
2114
|
+
graph_node_alias: alias
|
|
2115
|
+
graph_node_bitcoin_network: bitcoin_network
|
|
2116
|
+
graph_node_color: color
|
|
2117
|
+
graph_node_conductivity: conductivity
|
|
2118
|
+
graph_node_display_name: display_name
|
|
2119
|
+
graph_node_public_key: public_key
|
|
2120
|
+
}
|
|
2121
|
+
... on LightsparkNode {
|
|
2122
|
+
__typename
|
|
2123
|
+
lightspark_node_id: id
|
|
2124
|
+
lightspark_node_created_at: created_at
|
|
2125
|
+
lightspark_node_updated_at: updated_at
|
|
2126
|
+
lightspark_node_alias: alias
|
|
2127
|
+
lightspark_node_bitcoin_network: bitcoin_network
|
|
2128
|
+
lightspark_node_color: color
|
|
2129
|
+
lightspark_node_conductivity: conductivity
|
|
2130
|
+
lightspark_node_display_name: display_name
|
|
2131
|
+
lightspark_node_public_key: public_key
|
|
2132
|
+
lightspark_node_account: account {
|
|
2133
|
+
id
|
|
2134
|
+
}
|
|
2135
|
+
lightspark_node_blockchain_balance: blockchain_balance {
|
|
2136
|
+
__typename
|
|
2137
|
+
blockchain_balance_total_balance: total_balance {
|
|
2138
|
+
__typename
|
|
2139
|
+
currency_amount_original_value: original_value
|
|
2140
|
+
currency_amount_original_unit: original_unit
|
|
2141
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
2142
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
2143
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
2144
|
+
}
|
|
2145
|
+
blockchain_balance_confirmed_balance: confirmed_balance {
|
|
2146
|
+
__typename
|
|
2147
|
+
currency_amount_original_value: original_value
|
|
2148
|
+
currency_amount_original_unit: original_unit
|
|
2149
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
2150
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
2151
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
2152
|
+
}
|
|
2153
|
+
blockchain_balance_unconfirmed_balance: unconfirmed_balance {
|
|
2154
|
+
__typename
|
|
2155
|
+
currency_amount_original_value: original_value
|
|
2156
|
+
currency_amount_original_unit: original_unit
|
|
2157
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
2158
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
2159
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
2160
|
+
}
|
|
2161
|
+
blockchain_balance_locked_balance: locked_balance {
|
|
2162
|
+
__typename
|
|
2163
|
+
currency_amount_original_value: original_value
|
|
2164
|
+
currency_amount_original_unit: original_unit
|
|
2165
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
2166
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
2167
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
2168
|
+
}
|
|
2169
|
+
blockchain_balance_required_reserve: required_reserve {
|
|
2170
|
+
__typename
|
|
2171
|
+
currency_amount_original_value: original_value
|
|
2172
|
+
currency_amount_original_unit: original_unit
|
|
2173
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
2174
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
2175
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
2176
|
+
}
|
|
2177
|
+
blockchain_balance_available_balance: available_balance {
|
|
2178
|
+
__typename
|
|
2179
|
+
currency_amount_original_value: original_value
|
|
2180
|
+
currency_amount_original_unit: original_unit
|
|
2181
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
2182
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
2183
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
2184
|
+
}
|
|
2185
|
+
}
|
|
2186
|
+
lightspark_node_encrypted_signing_private_key: encrypted_signing_private_key {
|
|
2187
|
+
__typename
|
|
2188
|
+
secret_encrypted_value: encrypted_value
|
|
2189
|
+
secret_cipher: cipher
|
|
2190
|
+
}
|
|
2191
|
+
lightspark_node_total_balance: total_balance {
|
|
2192
|
+
__typename
|
|
2193
|
+
currency_amount_original_value: original_value
|
|
2194
|
+
currency_amount_original_unit: original_unit
|
|
2195
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
2196
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
2197
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
2198
|
+
}
|
|
2199
|
+
lightspark_node_total_local_balance: total_local_balance {
|
|
2200
|
+
__typename
|
|
2201
|
+
currency_amount_original_value: original_value
|
|
2202
|
+
currency_amount_original_unit: original_unit
|
|
2203
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
2204
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
2205
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
2206
|
+
}
|
|
2207
|
+
lightspark_node_local_balance: local_balance {
|
|
2208
|
+
__typename
|
|
2209
|
+
currency_amount_original_value: original_value
|
|
2210
|
+
currency_amount_original_unit: original_unit
|
|
2211
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
2212
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
2213
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
2214
|
+
}
|
|
2215
|
+
lightspark_node_purpose: purpose
|
|
2216
|
+
lightspark_node_remote_balance: remote_balance {
|
|
2217
|
+
__typename
|
|
2218
|
+
currency_amount_original_value: original_value
|
|
2219
|
+
currency_amount_original_unit: original_unit
|
|
2220
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
2221
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
2222
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
2223
|
+
}
|
|
2224
|
+
lightspark_node_status: status
|
|
2225
|
+
}
|
|
2226
|
+
}
|
|
2227
|
+
}`;
|
|
2228
|
+
|
|
2229
|
+
// src/graphql/DecodeInvoice.ts
|
|
2230
|
+
var DecodeInvoice = `
|
|
2231
|
+
query DecodeInvoice($encoded_payment_request: String!) {
|
|
2232
|
+
decoded_payment_request(encoded_payment_request: $encoded_payment_request) {
|
|
2233
|
+
__typename
|
|
2234
|
+
... on InvoiceData {
|
|
2235
|
+
...InvoiceDataFragment
|
|
2236
|
+
}
|
|
2237
|
+
}
|
|
2238
|
+
}
|
|
2239
|
+
|
|
2240
|
+
${FRAGMENT11}
|
|
2241
|
+
`;
|
|
2242
|
+
|
|
2243
|
+
// src/graphql/DeleteApiToken.ts
|
|
2244
|
+
var DeleteApiToken = `
|
|
2245
|
+
mutation DeleteApiToken(
|
|
2246
|
+
$api_token_id: ID!
|
|
2247
|
+
) {
|
|
2248
|
+
delete_api_token(input: {
|
|
2249
|
+
api_token_id: $api_token_id
|
|
2250
|
+
}) {
|
|
2251
|
+
__typename
|
|
2252
|
+
}
|
|
2253
|
+
}
|
|
2254
|
+
`;
|
|
2255
|
+
|
|
2256
|
+
// src/graphql/FundNode.ts
|
|
2257
|
+
var FundNode = `
|
|
2258
|
+
mutation FundNode(
|
|
2259
|
+
$node_id: ID!,
|
|
2260
|
+
$amountSats: Long
|
|
2261
|
+
) {
|
|
2262
|
+
fund_node(input: { node_id: $node_id, amount_sats: $amountMsats }) {
|
|
2263
|
+
amount {
|
|
2264
|
+
...CurrencyAmountFragment
|
|
2265
|
+
}
|
|
2266
|
+
}
|
|
2267
|
+
}
|
|
2268
|
+
|
|
2269
|
+
${FRAGMENT}
|
|
2270
|
+
`;
|
|
2271
|
+
|
|
2272
|
+
// src/objects/LightningFeeEstimateOutput.ts
|
|
2273
|
+
var FRAGMENT12 = `
|
|
2274
|
+
fragment LightningFeeEstimateOutputFragment on LightningFeeEstimateOutput {
|
|
2275
|
+
__typename
|
|
2276
|
+
lightning_fee_estimate_output_fee_estimate: fee_estimate {
|
|
2353
2277
|
__typename
|
|
2354
|
-
|
|
2278
|
+
currency_amount_original_value: original_value
|
|
2279
|
+
currency_amount_original_unit: original_unit
|
|
2280
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
2281
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
2282
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
2355
2283
|
}
|
|
2356
2284
|
}`;
|
|
2357
|
-
|
|
2285
|
+
|
|
2286
|
+
// src/graphql/LightningFeeEstimateForInvoice.ts
|
|
2287
|
+
var LightningFeeEstimateForInvoice = `
|
|
2288
|
+
query LightningFeeEstimateForInvoice(
|
|
2289
|
+
$node_id: ID!
|
|
2290
|
+
$encoded_payment_request: String!
|
|
2291
|
+
$amount_msats: Long
|
|
2292
|
+
) {
|
|
2293
|
+
lightning_fee_estimate_for_invoice(input: {
|
|
2294
|
+
node_id: $node_id,
|
|
2295
|
+
encoded_payment_request: $encoded_payment_request,
|
|
2296
|
+
amount_msats: $amount_msats
|
|
2297
|
+
}) {
|
|
2298
|
+
...LightningFeeEstimateOutputFragment
|
|
2299
|
+
}
|
|
2300
|
+
}
|
|
2301
|
+
|
|
2302
|
+
${FRAGMENT12}
|
|
2303
|
+
`;
|
|
2304
|
+
|
|
2305
|
+
// src/graphql/LightningFeeEstimateForNode.ts
|
|
2306
|
+
var LightningFeeEstimateForNode = `
|
|
2307
|
+
query LightningFeeEstimateForNode(
|
|
2308
|
+
$node_id: ID!
|
|
2309
|
+
$destination_node_public_key: String!
|
|
2310
|
+
$amount_msats: Long!
|
|
2311
|
+
) {
|
|
2312
|
+
lightning_fee_estimate_for_node(input: {
|
|
2313
|
+
node_id: $node_id,
|
|
2314
|
+
destination_node_public_key: $destination_node_public_key,
|
|
2315
|
+
amount_msats: $amount_msats
|
|
2316
|
+
}) {
|
|
2317
|
+
...LightningFeeEstimateOutputFragment
|
|
2318
|
+
}
|
|
2319
|
+
}
|
|
2320
|
+
|
|
2321
|
+
${FRAGMENT12}
|
|
2322
|
+
`;
|
|
2323
|
+
|
|
2324
|
+
// src/graphql/MultiNodeDashboard.ts
|
|
2325
|
+
var MultiNodeDashboard = `
|
|
2326
|
+
query MultiNodeDashboard(
|
|
2327
|
+
$network: BitcoinNetwork!,
|
|
2328
|
+
$nodeIds: [ID!]
|
|
2329
|
+
) {
|
|
2330
|
+
current_account {
|
|
2331
|
+
id
|
|
2332
|
+
name
|
|
2333
|
+
dashboard_overview_nodes: nodes(
|
|
2334
|
+
bitcoin_networks: [$network]
|
|
2335
|
+
node_ids: $nodeIds
|
|
2336
|
+
) {
|
|
2337
|
+
count
|
|
2338
|
+
entities {
|
|
2339
|
+
color
|
|
2340
|
+
display_name
|
|
2341
|
+
purpose
|
|
2342
|
+
id
|
|
2343
|
+
addresses(first: 1) {
|
|
2344
|
+
entities {
|
|
2345
|
+
address
|
|
2346
|
+
type
|
|
2347
|
+
__typename
|
|
2348
|
+
}
|
|
2349
|
+
count
|
|
2350
|
+
__typename
|
|
2351
|
+
}
|
|
2352
|
+
public_key
|
|
2353
|
+
status
|
|
2354
|
+
local_balance {
|
|
2355
|
+
...CurrencyAmountFragment
|
|
2356
|
+
}
|
|
2357
|
+
remote_balance {
|
|
2358
|
+
...CurrencyAmountFragment
|
|
2359
|
+
}
|
|
2360
|
+
blockchain_balance {
|
|
2361
|
+
available_balance {
|
|
2362
|
+
...CurrencyAmountFragment
|
|
2363
|
+
}
|
|
2364
|
+
total_balance {
|
|
2365
|
+
...CurrencyAmountFragment
|
|
2366
|
+
}
|
|
2367
|
+
__typename
|
|
2368
|
+
}
|
|
2369
|
+
__typename
|
|
2370
|
+
}
|
|
2371
|
+
__typename
|
|
2372
|
+
}
|
|
2373
|
+
blockchain_balance(bitcoin_networks: [$network], node_ids: $nodeIds) {
|
|
2374
|
+
l1_balance: total_balance {
|
|
2375
|
+
...CurrencyAmountFragment
|
|
2376
|
+
}
|
|
2377
|
+
required_reserve {
|
|
2378
|
+
...CurrencyAmountFragment
|
|
2379
|
+
}
|
|
2380
|
+
available_balance {
|
|
2381
|
+
...CurrencyAmountFragment
|
|
2382
|
+
}
|
|
2383
|
+
unconfirmed_balance {
|
|
2384
|
+
...CurrencyAmountFragment
|
|
2385
|
+
}
|
|
2386
|
+
__typename
|
|
2387
|
+
}
|
|
2388
|
+
local_balance(bitcoin_networks: [$network], node_ids: $nodeIds) {
|
|
2389
|
+
...CurrencyAmountFragment
|
|
2390
|
+
}
|
|
2391
|
+
remote_balance(bitcoin_networks: [$network], node_ids: $nodeIds) {
|
|
2392
|
+
...CurrencyAmountFragment
|
|
2393
|
+
}
|
|
2394
|
+
}
|
|
2395
|
+
}
|
|
2396
|
+
|
|
2397
|
+
${FRAGMENT}
|
|
2398
|
+
`;
|
|
2358
2399
|
|
|
2359
2400
|
// src/graphql/PayInvoice.ts
|
|
2360
2401
|
var PayInvoice = `
|
|
@@ -2380,7 +2421,7 @@ var PayInvoice = `
|
|
|
2380
2421
|
}
|
|
2381
2422
|
}
|
|
2382
2423
|
|
|
2383
|
-
${
|
|
2424
|
+
${FRAGMENT10}
|
|
2384
2425
|
`;
|
|
2385
2426
|
|
|
2386
2427
|
// src/graphql/RecoverNodeSigningKey.ts
|
|
@@ -2834,7 +2875,7 @@ var SendPayment = `
|
|
|
2834
2875
|
}
|
|
2835
2876
|
}
|
|
2836
2877
|
|
|
2837
|
-
${
|
|
2878
|
+
${FRAGMENT10}
|
|
2838
2879
|
`;
|
|
2839
2880
|
|
|
2840
2881
|
// src/objects/Transaction.ts
|
|
@@ -5394,6 +5435,15 @@ fragment AccountFragment on Account {
|
|
|
5394
5435
|
}`;
|
|
5395
5436
|
var Account_default = Account;
|
|
5396
5437
|
|
|
5438
|
+
// src/objects/InvoiceType.ts
|
|
5439
|
+
var InvoiceType = /* @__PURE__ */ ((InvoiceType2) => {
|
|
5440
|
+
InvoiceType2["FUTURE_VALUE"] = "FUTURE_VALUE";
|
|
5441
|
+
InvoiceType2["STANDARD"] = "STANDARD";
|
|
5442
|
+
InvoiceType2["AMP"] = "AMP";
|
|
5443
|
+
return InvoiceType2;
|
|
5444
|
+
})(InvoiceType || {});
|
|
5445
|
+
var InvoiceType_default = InvoiceType;
|
|
5446
|
+
|
|
5397
5447
|
// src/client.ts
|
|
5398
5448
|
var LightsparkClient = class {
|
|
5399
5449
|
/**
|
|
@@ -5402,16 +5452,16 @@ var LightsparkClient = class {
|
|
|
5402
5452
|
* @param authProvider The auth provider to use for authentication. Defaults to a stub auth provider. For server-side
|
|
5403
5453
|
* use, you should use the `AccountTokenAuthProvider`.
|
|
5404
5454
|
* @param serverUrl The base URL of the server to connect to. Defaults to lightspark production.
|
|
5405
|
-
* @param
|
|
5406
|
-
*
|
|
5455
|
+
* @param cryptoImpl The crypto implementation to use. Defaults to web and node compatible crypto.
|
|
5456
|
+
* For React Native, you should use the `ReactNativeCrypto` implementation from `@lightsparkdev/react-native`.
|
|
5407
5457
|
*/
|
|
5408
|
-
constructor(authProvider = new
|
|
5458
|
+
constructor(authProvider = new import_core6.StubAuthProvider(), serverUrl = "api.lightspark.com", cryptoImpl = import_core6.DefaultCrypto) {
|
|
5409
5459
|
this.authProvider = authProvider;
|
|
5410
5460
|
this.serverUrl = serverUrl;
|
|
5411
5461
|
this.cryptoImpl = cryptoImpl;
|
|
5412
5462
|
const sdkVersion = require_package().version;
|
|
5413
|
-
this.nodeKeyCache = new
|
|
5414
|
-
this.requester = new
|
|
5463
|
+
this.nodeKeyCache = new import_core6.NodeKeyCache(this.cryptoImpl);
|
|
5464
|
+
this.requester = new import_core6.Requester(
|
|
5415
5465
|
this.nodeKeyCache,
|
|
5416
5466
|
LIGHTSPARK_SDK_ENDPOINT,
|
|
5417
5467
|
`js-lightspark-sdk/${sdkVersion}`,
|
|
@@ -5431,7 +5481,7 @@ var LightsparkClient = class {
|
|
|
5431
5481
|
*/
|
|
5432
5482
|
async setAuthProvider(authProvider) {
|
|
5433
5483
|
const sdkVersion = require_package().version;
|
|
5434
|
-
this.requester = new
|
|
5484
|
+
this.requester = new import_core6.Requester(
|
|
5435
5485
|
this.nodeKeyCache,
|
|
5436
5486
|
LIGHTSPARK_SDK_ENDPOINT,
|
|
5437
5487
|
`js-lightspark-sdk/${sdkVersion}`,
|
|
@@ -5504,10 +5554,10 @@ var LightsparkClient = class {
|
|
|
5504
5554
|
network: bitcoinNetwork
|
|
5505
5555
|
});
|
|
5506
5556
|
if (!response.current_account) {
|
|
5507
|
-
throw new
|
|
5557
|
+
throw new import_core6.LightsparkAuthException("No current account");
|
|
5508
5558
|
}
|
|
5509
5559
|
if (!response.current_account.dashboard_overview_nodes || response.current_account.dashboard_overview_nodes.entities.length === 0) {
|
|
5510
|
-
throw new
|
|
5560
|
+
throw new import_core6.LightsparkException(
|
|
5511
5561
|
"NO_NODES_FOUND",
|
|
5512
5562
|
`No nodes found for this dashboard request. This could mean one of a few things:
|
|
5513
5563
|
1. You are requesting MAINNET nodes, but you have no MAINNET nodes yet. In this case, request BitcoinNetwork.REGTEST instead.
|
|
@@ -5579,11 +5629,11 @@ var LightsparkClient = class {
|
|
|
5579
5629
|
}
|
|
5580
5630
|
);
|
|
5581
5631
|
if (!response.current_account) {
|
|
5582
|
-
throw new
|
|
5632
|
+
throw new import_core6.LightsparkAuthException("No current account");
|
|
5583
5633
|
}
|
|
5584
5634
|
const account = response.current_account;
|
|
5585
5635
|
if (!account.dashboard_overview_nodes || !account.dashboard_overview_nodes.entities || account.dashboard_overview_nodes.entities.length === 0) {
|
|
5586
|
-
throw new
|
|
5636
|
+
throw new import_core6.LightsparkException(
|
|
5587
5637
|
"InvalidOrMissingNode",
|
|
5588
5638
|
"No nodes found for node dashboard"
|
|
5589
5639
|
);
|
|
@@ -5632,6 +5682,8 @@ var LightsparkClient = class {
|
|
|
5632
5682
|
/**
|
|
5633
5683
|
* Creates an invoice for the given node.
|
|
5634
5684
|
*
|
|
5685
|
+
* Test mode note: You can simulate a payment of this invoice in test move using [createTestModePayment].
|
|
5686
|
+
*
|
|
5635
5687
|
* @param nodeId The node ID for which to create an invoice.
|
|
5636
5688
|
* @param amountMsats The amount of the invoice in msats. You can create a zero-amount invoice to accept any payment amount.
|
|
5637
5689
|
* @param memo A string memo to include in the invoice as a description.
|
|
@@ -5744,12 +5796,15 @@ var LightsparkClient = class {
|
|
|
5744
5796
|
}
|
|
5745
5797
|
let signingPrivateKeyPEM = "";
|
|
5746
5798
|
if (new Uint8Array(signingPrivateKey)[0] === 48) {
|
|
5747
|
-
signingPrivateKeyPEM = (0,
|
|
5799
|
+
signingPrivateKeyPEM = (0, import_core6.b64encode)(signingPrivateKey);
|
|
5748
5800
|
} else {
|
|
5749
5801
|
const dec = new TextDecoder();
|
|
5750
5802
|
signingPrivateKeyPEM = dec.decode(signingPrivateKey);
|
|
5751
5803
|
}
|
|
5752
|
-
await this.nodeKeyCache.loadKey(
|
|
5804
|
+
await this.nodeKeyCache.loadKey(
|
|
5805
|
+
nodeId,
|
|
5806
|
+
import_core6.KeyOrAlias.key(signingPrivateKeyPEM)
|
|
5807
|
+
);
|
|
5753
5808
|
return true;
|
|
5754
5809
|
}
|
|
5755
5810
|
async recoverNodeSigningKey(nodeId) {
|
|
@@ -5764,17 +5819,20 @@ var LightsparkClient = class {
|
|
|
5764
5819
|
return null;
|
|
5765
5820
|
}
|
|
5766
5821
|
/**
|
|
5767
|
-
* Directly unlocks a node with a signing private key.
|
|
5822
|
+
* Directly unlocks a node with a signing private key or alias.
|
|
5768
5823
|
*
|
|
5769
5824
|
* @param nodeId The ID of the node to unlock.
|
|
5770
5825
|
* @param signingPrivateKeyPEM The PEM-encoded signing private key.
|
|
5771
5826
|
*/
|
|
5772
|
-
async loadNodeKey(nodeId,
|
|
5773
|
-
await this.nodeKeyCache.loadKey(nodeId,
|
|
5827
|
+
async loadNodeKey(nodeId, signingPrivateKeyOrAlias) {
|
|
5828
|
+
await this.nodeKeyCache.loadKey(nodeId, signingPrivateKeyOrAlias);
|
|
5774
5829
|
}
|
|
5775
5830
|
/**
|
|
5776
5831
|
* Sends a lightning payment for a given invoice.
|
|
5777
5832
|
*
|
|
5833
|
+
* Test mode note: For test mode, you can use the [createTestModeInvoice] function to create an invoice you can
|
|
5834
|
+
* pay in test mode.
|
|
5835
|
+
*
|
|
5778
5836
|
* @param payerNodeId The ID of the node that will pay the invoice.
|
|
5779
5837
|
* @param encodedInvoice The encoded invoice to pay.
|
|
5780
5838
|
* @param maximumFeesMsats Maximum fees (in msats) to pay for the payment. This parameter is required.
|
|
@@ -5804,7 +5862,7 @@ var LightsparkClient = class {
|
|
|
5804
5862
|
payerNodeId
|
|
5805
5863
|
);
|
|
5806
5864
|
if (response.pay_invoice?.payment.outgoing_payment_failure_message) {
|
|
5807
|
-
throw new
|
|
5865
|
+
throw new import_core6.LightsparkException(
|
|
5808
5866
|
"PaymentError",
|
|
5809
5867
|
response.pay_invoice?.payment.outgoing_payment_failure_message.rich_text_text
|
|
5810
5868
|
);
|
|
@@ -5839,7 +5897,7 @@ var LightsparkClient = class {
|
|
|
5839
5897
|
payerNodeId
|
|
5840
5898
|
);
|
|
5841
5899
|
if (response.send_payment?.payment.outgoing_payment_failure_message) {
|
|
5842
|
-
throw new
|
|
5900
|
+
throw new import_core6.LightsparkException(
|
|
5843
5901
|
"PaymentError",
|
|
5844
5902
|
response.send_payment?.payment.outgoing_payment_failure_message.rich_text_text
|
|
5845
5903
|
);
|
|
@@ -5939,6 +5997,60 @@ var LightsparkClient = class {
|
|
|
5939
5997
|
async deleteApiToken(id) {
|
|
5940
5998
|
await this.requester.makeRawRequest(DeleteApiToken, { api_token_id: id });
|
|
5941
5999
|
}
|
|
6000
|
+
/**
|
|
6001
|
+
* In test mode, generates a Lightning Invoice which can be paid by a local node.
|
|
6002
|
+
* This call is only valid in test mode. You can then pay the invoice using [payInvoice].
|
|
6003
|
+
*
|
|
6004
|
+
* @param localNodeId The ID of the node that will pay the invoice.
|
|
6005
|
+
* @param amountMsats The amount to pay in milli-satoshis.
|
|
6006
|
+
* @param memo An optional memo to attach to the invoice.
|
|
6007
|
+
* @param invoiceType The type of invoice to create.
|
|
6008
|
+
*/
|
|
6009
|
+
async createTestModeInvoice(localNodeId, amountMsats, memo = void 0, invoiceType = InvoiceType_default.STANDARD) {
|
|
6010
|
+
return await this.executeRawQuery({
|
|
6011
|
+
queryPayload: CreateTestModeInvoice,
|
|
6012
|
+
variables: {
|
|
6013
|
+
local_node_id: localNodeId,
|
|
6014
|
+
amount_msats: amountMsats,
|
|
6015
|
+
memo,
|
|
6016
|
+
invoice_type: invoiceType
|
|
6017
|
+
},
|
|
6018
|
+
constructObject: (responseJson) => {
|
|
6019
|
+
const encodedPaymentRequest = responseJson.create_test_mode_invoice?.encoded_payment_request;
|
|
6020
|
+
if (!encodedPaymentRequest) {
|
|
6021
|
+
throw new import_core6.LightsparkException(
|
|
6022
|
+
"CreateTestModeInvoiceError",
|
|
6023
|
+
"Unable to create test mode invoice"
|
|
6024
|
+
);
|
|
6025
|
+
}
|
|
6026
|
+
return encodedPaymentRequest;
|
|
6027
|
+
}
|
|
6028
|
+
});
|
|
6029
|
+
}
|
|
6030
|
+
/**
|
|
6031
|
+
* In test mode, simulates a payment of a Lightning Invoice from another node.
|
|
6032
|
+
* This can only be used in test mode and should be used with invoices generated by [createInvoice].
|
|
6033
|
+
*
|
|
6034
|
+
* @param localNodeId The ID of the node that will receive the payment.
|
|
6035
|
+
* @param encodedInvoice The encoded invoice to pay.
|
|
6036
|
+
* @param amountMsats The amount to pay in milli-satoshis for 0-amount invoices. This should be null for non-zero
|
|
6037
|
+
* amount invoices.
|
|
6038
|
+
*/
|
|
6039
|
+
async createTestModePayment(localNodeId, encodedInvoice, amountMsats = void 0) {
|
|
6040
|
+
return await this.executeRawQuery({
|
|
6041
|
+
queryPayload: CreateTestModePayment,
|
|
6042
|
+
variables: {
|
|
6043
|
+
local_node_id: localNodeId,
|
|
6044
|
+
encoded_invoice: encodedInvoice,
|
|
6045
|
+
amount_msats: amountMsats
|
|
6046
|
+
},
|
|
6047
|
+
constructObject: (responseJson) => {
|
|
6048
|
+
return OutgoingPaymentFromJson(
|
|
6049
|
+
responseJson.create_test_mode_payment?.payment
|
|
6050
|
+
);
|
|
6051
|
+
}
|
|
6052
|
+
});
|
|
6053
|
+
}
|
|
5942
6054
|
/**
|
|
5943
6055
|
* Executes a raw `Query` against the Lightspark API.
|
|
5944
6056
|
*
|
|
@@ -5955,15 +6067,6 @@ var LightsparkClient = class {
|
|
|
5955
6067
|
var LIGHTSPARK_SDK_ENDPOINT = "graphql/server/2023-04-04";
|
|
5956
6068
|
var client_default = LightsparkClient;
|
|
5957
6069
|
|
|
5958
|
-
// src/objects/InvoiceType.ts
|
|
5959
|
-
var InvoiceType = /* @__PURE__ */ ((InvoiceType2) => {
|
|
5960
|
-
InvoiceType2["FUTURE_VALUE"] = "FUTURE_VALUE";
|
|
5961
|
-
InvoiceType2["STANDARD"] = "STANDARD";
|
|
5962
|
-
InvoiceType2["AMP"] = "AMP";
|
|
5963
|
-
return InvoiceType2;
|
|
5964
|
-
})(InvoiceType || {});
|
|
5965
|
-
var InvoiceType_default = InvoiceType;
|
|
5966
|
-
|
|
5967
6070
|
// src/objects/Deposit.ts
|
|
5968
6071
|
var DepositFromJson = (obj) => {
|
|
5969
6072
|
return {
|
|
@@ -6218,7 +6321,7 @@ ${FRAGMENT24}
|
|
|
6218
6321
|
};
|
|
6219
6322
|
|
|
6220
6323
|
// src/objects/LightningTransaction.ts
|
|
6221
|
-
var
|
|
6324
|
+
var import_core7 = require("@lightsparkdev/core");
|
|
6222
6325
|
var LightningTransactionFromJson = (obj) => {
|
|
6223
6326
|
if (obj["__typename"] == "IncomingPayment") {
|
|
6224
6327
|
return new IncomingPayment_default(
|
|
@@ -6272,7 +6375,7 @@ var LightningTransactionFromJson = (obj) => {
|
|
|
6272
6375
|
failureReason: !!obj["routing_transaction_failure_reason"] ? RoutingTransactionFailureReason_default[obj["routing_transaction_failure_reason"]] ?? RoutingTransactionFailureReason_default.FUTURE_VALUE : null
|
|
6273
6376
|
};
|
|
6274
6377
|
}
|
|
6275
|
-
throw new
|
|
6378
|
+
throw new import_core7.LightsparkException(
|
|
6276
6379
|
"DeserializationError",
|
|
6277
6380
|
`Couldn't find a concrete type for interface LightningTransaction corresponding to the typename=${obj["__typename"]}`
|
|
6278
6381
|
);
|
|
@@ -6538,7 +6641,7 @@ ${FRAGMENT25}
|
|
|
6538
6641
|
};
|
|
6539
6642
|
|
|
6540
6643
|
// src/objects/OnChainTransaction.ts
|
|
6541
|
-
var
|
|
6644
|
+
var import_core8 = require("@lightsparkdev/core");
|
|
6542
6645
|
var OnChainTransactionFromJson = (obj) => {
|
|
6543
6646
|
if (obj["__typename"] == "ChannelClosingTransaction") {
|
|
6544
6647
|
return {
|
|
@@ -6612,7 +6715,7 @@ var OnChainTransactionFromJson = (obj) => {
|
|
|
6612
6715
|
numConfirmations: obj["withdrawal_num_confirmations"]
|
|
6613
6716
|
};
|
|
6614
6717
|
}
|
|
6615
|
-
throw new
|
|
6718
|
+
throw new import_core8.LightsparkException(
|
|
6616
6719
|
"DeserializationError",
|
|
6617
6720
|
`Couldn't find a concrete type for interface OnChainTransaction corresponding to the typename=${obj["__typename"]}`
|
|
6618
6721
|
);
|