@buildonspark/spark-sdk 0.1.43 → 0.1.44
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 +7 -0
- package/dist/{RequestLightningSendInput-Na1mHdWg.d.cts → RequestLightningSendInput-BxbCtwpV.d.cts} +43 -4
- package/dist/{RequestLightningSendInput-D7fZdT4A.d.ts → RequestLightningSendInput-RGel43ks.d.ts} +43 -4
- package/dist/address/index.d.cts +2 -2
- package/dist/address/index.d.ts +2 -2
- package/dist/address/index.js +2 -2
- package/dist/{chunk-M6A4KFIG.js → chunk-4Q2ZDYYU.js} +332 -221
- package/dist/{chunk-WWOTVNPP.js → chunk-A2ZLMH6I.js} +323 -142
- package/dist/{chunk-VA7MV4MZ.js → chunk-B3AMIGJG.js} +1 -1
- package/dist/{chunk-DQYKQJRZ.js → chunk-CIZNCBKE.js} +29 -9
- package/dist/{chunk-BUTZWYBW.js → chunk-DAXGVPVM.js} +2 -2
- package/dist/{chunk-DOA6QXYQ.js → chunk-EKFD62HN.js} +2 -1
- package/dist/{chunk-TIUBYNN5.js → chunk-HTMXTJRK.js} +1 -1
- package/dist/{chunk-TOSP3INR.js → chunk-I54FARY2.js} +4 -2
- package/dist/{chunk-MIVX3GHD.js → chunk-K4BJARWM.js} +1 -1
- package/dist/{chunk-O4RYNJNB.js → chunk-KEKGSH7B.js} +1 -1
- package/dist/{chunk-GYQR4B4P.js → chunk-NBCNYDWJ.js} +2 -2
- package/dist/{chunk-ABZA6R5S.js → chunk-SQKXGAIR.js} +1 -1
- package/dist/{chunk-VFJQNBFX.js → chunk-UBT6EDVJ.js} +5 -2
- package/dist/{chunk-HRQRRDSS.js → chunk-WPTRVD2V.js} +3 -3
- package/dist/{chunk-IRW5TWMH.js → chunk-XX4RRWOX.js} +5 -5
- package/dist/graphql/objects/index.d.cts +5 -43
- package/dist/graphql/objects/index.d.ts +5 -43
- package/dist/graphql/objects/index.js +1 -1
- package/dist/{index-BJOc8Ur-.d.cts → index-CZmDdSts.d.cts} +24 -10
- package/dist/{index-7RYRH5wc.d.ts → index-ClIRO_3y.d.ts} +24 -10
- package/dist/index.cjs +827 -414
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +15 -15
- package/dist/index.node.cjs +830 -417
- package/dist/index.node.d.cts +7 -7
- package/dist/index.node.d.ts +7 -7
- package/dist/index.node.js +18 -18
- package/dist/native/index.cjs +827 -414
- package/dist/native/index.d.cts +88 -23
- package/dist/native/index.d.ts +88 -23
- package/dist/native/index.js +819 -407
- package/dist/{network-D5lKssVl.d.cts → network-CfxLnaot.d.cts} +1 -1
- package/dist/{network-xkBSpaTn.d.ts → network-CroCOQ0B.d.ts} +1 -1
- package/dist/proto/lrc20.d.cts +1 -1
- package/dist/proto/lrc20.d.ts +1 -1
- package/dist/proto/lrc20.js +2 -2
- package/dist/proto/spark.cjs +332 -221
- package/dist/proto/spark.d.cts +1 -1
- package/dist/proto/spark.d.ts +1 -1
- package/dist/proto/spark.js +3 -5
- package/dist/proto/spark_token.cjs +149 -9
- package/dist/proto/spark_token.d.cts +1 -1
- package/dist/proto/spark_token.d.ts +1 -1
- package/dist/proto/spark_token.js +2 -2
- package/dist/{sdk-types-B-q9py_P.d.cts → sdk-types-BeCBoozO.d.cts} +1 -1
- package/dist/{sdk-types-BPoPgzda.d.ts → sdk-types-CTbTdDbE.d.ts} +1 -1
- package/dist/services/config.cjs +7 -3
- package/dist/services/config.d.cts +4 -4
- package/dist/services/config.d.ts +4 -4
- package/dist/services/config.js +5 -5
- package/dist/services/connection.cjs +334 -218
- package/dist/services/connection.d.cts +4 -4
- package/dist/services/connection.d.ts +4 -4
- package/dist/services/connection.js +4 -4
- package/dist/services/index.cjs +364 -227
- package/dist/services/index.d.cts +4 -4
- package/dist/services/index.d.ts +4 -4
- package/dist/services/index.js +9 -9
- package/dist/services/lrc-connection.cjs +5 -2
- package/dist/services/lrc-connection.d.cts +4 -4
- package/dist/services/lrc-connection.d.ts +4 -4
- package/dist/services/lrc-connection.js +4 -4
- package/dist/services/token-transactions.cjs +28 -8
- package/dist/services/token-transactions.d.cts +4 -4
- package/dist/services/token-transactions.d.ts +4 -4
- package/dist/services/token-transactions.js +3 -3
- package/dist/services/wallet-config.cjs +2 -1
- package/dist/services/wallet-config.d.cts +4 -4
- package/dist/services/wallet-config.d.ts +4 -4
- package/dist/services/wallet-config.js +1 -1
- package/dist/signer/signer.cjs +5 -2
- package/dist/signer/signer.d.cts +2 -2
- package/dist/signer/signer.d.ts +2 -2
- package/dist/signer/signer.js +2 -2
- package/dist/{signer-wqesWifN.d.ts → signer-D7vfYik9.d.ts} +1 -1
- package/dist/{signer-IO3oMRNj.d.cts → signer-DaY8c60s.d.cts} +1 -1
- package/dist/{spark-CDm4gqS6.d.ts → spark-C4ZrsgjC.d.cts} +47 -29
- package/dist/{spark-CDm4gqS6.d.cts → spark-C4ZrsgjC.d.ts} +47 -29
- package/dist/types/index.cjs +331 -219
- package/dist/types/index.d.cts +5 -5
- package/dist/types/index.d.ts +5 -5
- package/dist/types/index.js +3 -3
- package/dist/utils/index.cjs +298 -28
- package/dist/utils/index.d.cts +5 -5
- package/dist/utils/index.d.ts +5 -5
- package/dist/utils/index.js +6 -6
- package/package.json +1 -1
- package/src/constants.ts +5 -1
- package/src/graphql/client.ts +28 -0
- package/src/graphql/mutations/RequestCoopExit.ts +6 -0
- package/src/graphql/mutations/RequestSwapLeaves.ts +2 -0
- package/src/graphql/queries/GetCoopExitFeeQuote.ts +20 -0
- package/src/proto/spark.ts +454 -322
- package/src/services/token-transactions.ts +12 -0
- package/src/services/transfer.ts +0 -3
- package/src/services/wallet-config.ts +1 -0
- package/src/spark-wallet/spark-wallet.node.ts +3 -3
- package/src/spark-wallet/spark-wallet.ts +301 -125
- package/src/tests/integration/deposit.test.ts +16 -0
- package/src/tests/integration/ssp/coop-exit.test.ts +85 -21
- package/src/tests/integration/ssp/swap.test.ts +47 -0
- package/src/tests/tokens.test.ts +3 -2
- package/src/utils/token-hashing.ts +28 -10
- package/src/utils/transaction.ts +2 -2
- package/src/logger.ts +0 -3
package/dist/index.node.cjs
CHANGED
|
@@ -1497,7 +1497,7 @@ var import_uuidv75 = require("uuidv7");
|
|
|
1497
1497
|
|
|
1498
1498
|
// src/graphql/client.ts
|
|
1499
1499
|
init_buffer();
|
|
1500
|
-
var
|
|
1500
|
+
var import_core7 = require("@lightsparkdev/core");
|
|
1501
1501
|
var import_sha2 = require("@noble/hashes/sha2");
|
|
1502
1502
|
|
|
1503
1503
|
// src/graphql/mutations/ClaimStaticDeposit.ts
|
|
@@ -2066,6 +2066,9 @@ var RequestCoopExit = `
|
|
|
2066
2066
|
$withdrawal_address: String!
|
|
2067
2067
|
$idempotency_key: String!
|
|
2068
2068
|
$exit_speed: ExitSpeed!
|
|
2069
|
+
$withdraw_all: Boolean
|
|
2070
|
+
$fee_leaf_external_ids: [UUID!]
|
|
2071
|
+
$fee_quote_id: ID
|
|
2069
2072
|
) {
|
|
2070
2073
|
request_coop_exit(
|
|
2071
2074
|
input: {
|
|
@@ -2073,6 +2076,9 @@ var RequestCoopExit = `
|
|
|
2073
2076
|
withdrawal_address: $withdrawal_address
|
|
2074
2077
|
idempotency_key: $idempotency_key
|
|
2075
2078
|
exit_speed: $exit_speed
|
|
2079
|
+
withdraw_all: $withdraw_all
|
|
2080
|
+
fee_leaf_external_ids: $fee_leaf_external_ids
|
|
2081
|
+
fee_quote_id: $fee_quote_id
|
|
2076
2082
|
}
|
|
2077
2083
|
) {
|
|
2078
2084
|
request {
|
|
@@ -2317,6 +2323,7 @@ var RequestSwapLeaves = `
|
|
|
2317
2323
|
$fee_sats: Long!
|
|
2318
2324
|
$user_leaves: [UserLeafInput!]!
|
|
2319
2325
|
$idempotency_key: String!
|
|
2326
|
+
$target_amount_sats_list: [Long!]
|
|
2320
2327
|
) {
|
|
2321
2328
|
request_leaves_swap(input: {
|
|
2322
2329
|
adaptor_pubkey: $adaptor_pubkey
|
|
@@ -2325,6 +2332,7 @@ var RequestSwapLeaves = `
|
|
|
2325
2332
|
fee_sats: $fee_sats
|
|
2326
2333
|
user_leaves: $user_leaves
|
|
2327
2334
|
idempotency_key: $idempotency_key
|
|
2335
|
+
target_amount_sats_list: $target_amount_sats_list
|
|
2328
2336
|
}) {
|
|
2329
2337
|
request {
|
|
2330
2338
|
...LeavesSwapRequestFragment
|
|
@@ -2465,6 +2473,106 @@ fragment CoopExitFeeEstimatesOutputFragment on CoopExitFeeEstimatesOutput {
|
|
|
2465
2473
|
}
|
|
2466
2474
|
}`;
|
|
2467
2475
|
|
|
2476
|
+
// src/graphql/objects/CoopExitFeeQuote.ts
|
|
2477
|
+
init_buffer();
|
|
2478
|
+
var import_core5 = require("@lightsparkdev/core");
|
|
2479
|
+
var CoopExitFeeQuoteFromJson = (obj) => {
|
|
2480
|
+
return {
|
|
2481
|
+
id: obj["coop_exit_fee_quote_id"],
|
|
2482
|
+
createdAt: obj["coop_exit_fee_quote_created_at"],
|
|
2483
|
+
updatedAt: obj["coop_exit_fee_quote_updated_at"],
|
|
2484
|
+
network: BitcoinNetwork_default[obj["coop_exit_fee_quote_network"]] ?? BitcoinNetwork_default.FUTURE_VALUE,
|
|
2485
|
+
totalAmount: CurrencyAmountFromJson(
|
|
2486
|
+
obj["coop_exit_fee_quote_total_amount"]
|
|
2487
|
+
),
|
|
2488
|
+
userFeeFast: CurrencyAmountFromJson(
|
|
2489
|
+
obj["coop_exit_fee_quote_user_fee_fast"]
|
|
2490
|
+
),
|
|
2491
|
+
userFeeMedium: CurrencyAmountFromJson(
|
|
2492
|
+
obj["coop_exit_fee_quote_user_fee_medium"]
|
|
2493
|
+
),
|
|
2494
|
+
userFeeSlow: CurrencyAmountFromJson(
|
|
2495
|
+
obj["coop_exit_fee_quote_user_fee_slow"]
|
|
2496
|
+
),
|
|
2497
|
+
l1BroadcastFeeFast: CurrencyAmountFromJson(
|
|
2498
|
+
obj["coop_exit_fee_quote_l1_broadcast_fee_fast"]
|
|
2499
|
+
),
|
|
2500
|
+
l1BroadcastFeeMedium: CurrencyAmountFromJson(
|
|
2501
|
+
obj["coop_exit_fee_quote_l1_broadcast_fee_medium"]
|
|
2502
|
+
),
|
|
2503
|
+
l1BroadcastFeeSlow: CurrencyAmountFromJson(
|
|
2504
|
+
obj["coop_exit_fee_quote_l1_broadcast_fee_slow"]
|
|
2505
|
+
),
|
|
2506
|
+
expiresAt: obj["coop_exit_fee_quote_expires_at"],
|
|
2507
|
+
typename: "CoopExitFeeQuote"
|
|
2508
|
+
};
|
|
2509
|
+
};
|
|
2510
|
+
var FRAGMENT10 = `
|
|
2511
|
+
fragment CoopExitFeeQuoteFragment on CoopExitFeeQuote {
|
|
2512
|
+
__typename
|
|
2513
|
+
coop_exit_fee_quote_id: id
|
|
2514
|
+
coop_exit_fee_quote_created_at: created_at
|
|
2515
|
+
coop_exit_fee_quote_updated_at: updated_at
|
|
2516
|
+
coop_exit_fee_quote_network: network
|
|
2517
|
+
coop_exit_fee_quote_total_amount: total_amount {
|
|
2518
|
+
__typename
|
|
2519
|
+
currency_amount_original_value: original_value
|
|
2520
|
+
currency_amount_original_unit: original_unit
|
|
2521
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
2522
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
2523
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
2524
|
+
}
|
|
2525
|
+
coop_exit_fee_quote_user_fee_fast: user_fee_fast {
|
|
2526
|
+
__typename
|
|
2527
|
+
currency_amount_original_value: original_value
|
|
2528
|
+
currency_amount_original_unit: original_unit
|
|
2529
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
2530
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
2531
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
2532
|
+
}
|
|
2533
|
+
coop_exit_fee_quote_user_fee_medium: user_fee_medium {
|
|
2534
|
+
__typename
|
|
2535
|
+
currency_amount_original_value: original_value
|
|
2536
|
+
currency_amount_original_unit: original_unit
|
|
2537
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
2538
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
2539
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
2540
|
+
}
|
|
2541
|
+
coop_exit_fee_quote_user_fee_slow: user_fee_slow {
|
|
2542
|
+
__typename
|
|
2543
|
+
currency_amount_original_value: original_value
|
|
2544
|
+
currency_amount_original_unit: original_unit
|
|
2545
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
2546
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
2547
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
2548
|
+
}
|
|
2549
|
+
coop_exit_fee_quote_l1_broadcast_fee_fast: l1_broadcast_fee_fast {
|
|
2550
|
+
__typename
|
|
2551
|
+
currency_amount_original_value: original_value
|
|
2552
|
+
currency_amount_original_unit: original_unit
|
|
2553
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
2554
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
2555
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
2556
|
+
}
|
|
2557
|
+
coop_exit_fee_quote_l1_broadcast_fee_medium: l1_broadcast_fee_medium {
|
|
2558
|
+
__typename
|
|
2559
|
+
currency_amount_original_value: original_value
|
|
2560
|
+
currency_amount_original_unit: original_unit
|
|
2561
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
2562
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
2563
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
2564
|
+
}
|
|
2565
|
+
coop_exit_fee_quote_l1_broadcast_fee_slow: l1_broadcast_fee_slow {
|
|
2566
|
+
__typename
|
|
2567
|
+
currency_amount_original_value: original_value
|
|
2568
|
+
currency_amount_original_unit: original_unit
|
|
2569
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
2570
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
2571
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
2572
|
+
}
|
|
2573
|
+
coop_exit_fee_quote_expires_at: expires_at
|
|
2574
|
+
}`;
|
|
2575
|
+
|
|
2468
2576
|
// src/graphql/objects/LeavesSwapFeeEstimateOutput.ts
|
|
2469
2577
|
init_buffer();
|
|
2470
2578
|
var LeavesSwapFeeEstimateOutputFromJson = (obj) => {
|
|
@@ -2472,7 +2580,7 @@ var LeavesSwapFeeEstimateOutputFromJson = (obj) => {
|
|
|
2472
2580
|
feeEstimate: CurrencyAmountFromJson(obj["leaves_swap_fee_estimate_output_fee_estimate"])
|
|
2473
2581
|
};
|
|
2474
2582
|
};
|
|
2475
|
-
var
|
|
2583
|
+
var FRAGMENT11 = `
|
|
2476
2584
|
fragment LeavesSwapFeeEstimateOutputFragment on LeavesSwapFeeEstimateOutput {
|
|
2477
2585
|
__typename
|
|
2478
2586
|
leaves_swap_fee_estimate_output_fee_estimate: fee_estimate {
|
|
@@ -2492,7 +2600,7 @@ var LightningSendFeeEstimateOutputFromJson = (obj) => {
|
|
|
2492
2600
|
feeEstimate: CurrencyAmountFromJson(obj["lightning_send_fee_estimate_output_fee_estimate"])
|
|
2493
2601
|
};
|
|
2494
2602
|
};
|
|
2495
|
-
var
|
|
2603
|
+
var FRAGMENT12 = `
|
|
2496
2604
|
fragment LightningSendFeeEstimateOutputFragment on LightningSendFeeEstimateOutput {
|
|
2497
2605
|
__typename
|
|
2498
2606
|
lightning_send_fee_estimate_output_fee_estimate: fee_estimate {
|
|
@@ -2516,7 +2624,7 @@ var StaticDepositQuoteOutputFromJson = (obj) => {
|
|
|
2516
2624
|
signature: obj["static_deposit_quote_output_signature"]
|
|
2517
2625
|
};
|
|
2518
2626
|
};
|
|
2519
|
-
var
|
|
2627
|
+
var FRAGMENT13 = `
|
|
2520
2628
|
fragment StaticDepositQuoteOutputFragment on StaticDepositQuoteOutput {
|
|
2521
2629
|
__typename
|
|
2522
2630
|
static_deposit_quote_output_transaction_id: transaction_id
|
|
@@ -2563,7 +2671,28 @@ var GetClaimDepositQuote = `
|
|
|
2563
2671
|
...StaticDepositQuoteOutputFragment
|
|
2564
2672
|
}
|
|
2565
2673
|
}
|
|
2566
|
-
${
|
|
2674
|
+
${FRAGMENT13}
|
|
2675
|
+
`;
|
|
2676
|
+
|
|
2677
|
+
// src/graphql/queries/GetCoopExitFeeQuote.ts
|
|
2678
|
+
init_buffer();
|
|
2679
|
+
var GetCoopExitFeeQuote = `
|
|
2680
|
+
query CoopExitFeeQuote(
|
|
2681
|
+
$leaf_external_ids: [UUID!]!
|
|
2682
|
+
$withdrawal_address: String!
|
|
2683
|
+
) {
|
|
2684
|
+
coop_exit_fee_quote(
|
|
2685
|
+
input: {
|
|
2686
|
+
leaf_external_ids: $leaf_external_ids,
|
|
2687
|
+
withdrawal_address: $withdrawal_address
|
|
2688
|
+
}
|
|
2689
|
+
) {
|
|
2690
|
+
quote {
|
|
2691
|
+
...CoopExitFeeQuoteFragment
|
|
2692
|
+
}
|
|
2693
|
+
}
|
|
2694
|
+
}
|
|
2695
|
+
${FRAGMENT10}
|
|
2567
2696
|
`;
|
|
2568
2697
|
|
|
2569
2698
|
// src/graphql/queries/LeavesSwapFeeEstimate.ts
|
|
@@ -2580,7 +2709,7 @@ var LeavesSwapFeeEstimate = `
|
|
|
2580
2709
|
...LeavesSwapFeeEstimateOutputFragment
|
|
2581
2710
|
}
|
|
2582
2711
|
}
|
|
2583
|
-
${
|
|
2712
|
+
${FRAGMENT11}
|
|
2584
2713
|
`;
|
|
2585
2714
|
|
|
2586
2715
|
// src/graphql/queries/LightningSendFeeEstimate.ts
|
|
@@ -2599,7 +2728,7 @@ var LightningSendFeeEstimate = `
|
|
|
2599
2728
|
...LightningSendFeeEstimateOutputFragment
|
|
2600
2729
|
}
|
|
2601
2730
|
}
|
|
2602
|
-
${
|
|
2731
|
+
${FRAGMENT12}
|
|
2603
2732
|
`;
|
|
2604
2733
|
|
|
2605
2734
|
// src/graphql/queries/Transfer.ts
|
|
@@ -2618,13 +2747,13 @@ init_buffer();
|
|
|
2618
2747
|
|
|
2619
2748
|
// src/graphql/objects/UserRequest.ts
|
|
2620
2749
|
init_buffer();
|
|
2621
|
-
var
|
|
2750
|
+
var import_core6 = require("@lightsparkdev/core");
|
|
2622
2751
|
|
|
2623
2752
|
// src/graphql/objects/ClaimStaticDepositStatus.ts
|
|
2624
2753
|
init_buffer();
|
|
2625
2754
|
|
|
2626
2755
|
// src/graphql/objects/UserRequest.ts
|
|
2627
|
-
var
|
|
2756
|
+
var FRAGMENT14 = `
|
|
2628
2757
|
fragment UserRequestFragment on UserRequest {
|
|
2629
2758
|
__typename
|
|
2630
2759
|
... on ClaimStaticDeposit {
|
|
@@ -2856,7 +2985,7 @@ var UserRequest2 = `
|
|
|
2856
2985
|
...UserRequestFragment
|
|
2857
2986
|
}
|
|
2858
2987
|
}
|
|
2859
|
-
${
|
|
2988
|
+
${FRAGMENT14}
|
|
2860
2989
|
`;
|
|
2861
2990
|
|
|
2862
2991
|
// src/graphql/client.ts
|
|
@@ -2869,13 +2998,13 @@ var SspClient = class {
|
|
|
2869
2998
|
this.authProvider = new SparkAuthProvider();
|
|
2870
2999
|
const fetchFunction = typeof window !== "undefined" ? window.fetch.bind(window) : fetch;
|
|
2871
3000
|
const options = config.sspClientOptions;
|
|
2872
|
-
this.requester = new
|
|
2873
|
-
new
|
|
3001
|
+
this.requester = new import_core7.Requester(
|
|
3002
|
+
new import_core7.NodeKeyCache(import_core7.DefaultCrypto),
|
|
2874
3003
|
options.schemaEndpoint || `graphql/spark/2025-03-19`,
|
|
2875
3004
|
`spark-sdk/0.0.0`,
|
|
2876
3005
|
this.authProvider,
|
|
2877
3006
|
options.baseUrl,
|
|
2878
|
-
|
|
3007
|
+
import_core7.DefaultCrypto,
|
|
2879
3008
|
void 0,
|
|
2880
3009
|
fetchFunction
|
|
2881
3010
|
);
|
|
@@ -2978,7 +3107,10 @@ var SspClient = class {
|
|
|
2978
3107
|
leafExternalIds,
|
|
2979
3108
|
withdrawalAddress,
|
|
2980
3109
|
idempotencyKey,
|
|
2981
|
-
exitSpeed
|
|
3110
|
+
exitSpeed,
|
|
3111
|
+
feeLeafExternalIds,
|
|
3112
|
+
feeQuoteId,
|
|
3113
|
+
withdrawAll
|
|
2982
3114
|
}) {
|
|
2983
3115
|
return await this.executeRawQuery({
|
|
2984
3116
|
queryPayload: RequestCoopExit,
|
|
@@ -2986,7 +3118,10 @@ var SspClient = class {
|
|
|
2986
3118
|
leaf_external_ids: leafExternalIds,
|
|
2987
3119
|
withdrawal_address: withdrawalAddress,
|
|
2988
3120
|
idempotency_key: idempotencyKey,
|
|
2989
|
-
exit_speed: exitSpeed
|
|
3121
|
+
exit_speed: exitSpeed,
|
|
3122
|
+
fee_leaf_external_ids: feeLeafExternalIds,
|
|
3123
|
+
fee_quote_id: feeQuoteId,
|
|
3124
|
+
withdraw_all: withdrawAll
|
|
2990
3125
|
},
|
|
2991
3126
|
constructObject: (response) => {
|
|
2992
3127
|
return CoopExitRequestFromJson(response.request_coop_exit.request);
|
|
@@ -3048,7 +3183,8 @@ var SspClient = class {
|
|
|
3048
3183
|
targetAmountSats,
|
|
3049
3184
|
feeSats,
|
|
3050
3185
|
userLeaves,
|
|
3051
|
-
idempotencyKey
|
|
3186
|
+
idempotencyKey,
|
|
3187
|
+
targetAmountSatsList
|
|
3052
3188
|
}) {
|
|
3053
3189
|
const query = {
|
|
3054
3190
|
queryPayload: RequestSwapLeaves,
|
|
@@ -3058,7 +3194,8 @@ var SspClient = class {
|
|
|
3058
3194
|
target_amount_sats: targetAmountSats,
|
|
3059
3195
|
fee_sats: feeSats,
|
|
3060
3196
|
user_leaves: userLeaves,
|
|
3061
|
-
idempotency_key: idempotencyKey
|
|
3197
|
+
idempotency_key: idempotencyKey,
|
|
3198
|
+
target_amount_sats_list: targetAmountSatsList
|
|
3062
3199
|
},
|
|
3063
3200
|
constructObject: (response) => {
|
|
3064
3201
|
if (!response.request_leaves_swap) {
|
|
@@ -3201,7 +3338,7 @@ var SspClient = class {
|
|
|
3201
3338
|
{
|
|
3202
3339
|
queryPayload: GetChallenge,
|
|
3203
3340
|
variables: {
|
|
3204
|
-
public_key: (0,
|
|
3341
|
+
public_key: (0, import_core7.bytesToHex)(await this.signer.getIdentityPublicKey())
|
|
3205
3342
|
},
|
|
3206
3343
|
constructObject: (response) => {
|
|
3207
3344
|
return GetChallengeOutputFromJson(response.get_challenge);
|
|
@@ -3217,7 +3354,7 @@ var SspClient = class {
|
|
|
3217
3354
|
variables: {
|
|
3218
3355
|
protected_challenge: protectedChallenge,
|
|
3219
3356
|
signature,
|
|
3220
|
-
identity_public_key: (0,
|
|
3357
|
+
identity_public_key: (0, import_core7.bytesToHex)(
|
|
3221
3358
|
await this.signer.getIdentityPublicKey()
|
|
3222
3359
|
)
|
|
3223
3360
|
},
|
|
@@ -3250,6 +3387,21 @@ var SspClient = class {
|
|
|
3250
3387
|
new Date(verifyChallenge.validUntil)
|
|
3251
3388
|
);
|
|
3252
3389
|
}
|
|
3390
|
+
async getCoopExitFeeQuote({
|
|
3391
|
+
leafExternalIds,
|
|
3392
|
+
withdrawalAddress
|
|
3393
|
+
}) {
|
|
3394
|
+
return await this.executeRawQuery({
|
|
3395
|
+
queryPayload: GetCoopExitFeeQuote,
|
|
3396
|
+
variables: {
|
|
3397
|
+
leaf_external_ids: leafExternalIds,
|
|
3398
|
+
withdrawal_address: withdrawalAddress
|
|
3399
|
+
},
|
|
3400
|
+
constructObject: (response) => {
|
|
3401
|
+
return CoopExitFeeQuoteFromJson(response.coop_exit_fee_quote.quote);
|
|
3402
|
+
}
|
|
3403
|
+
});
|
|
3404
|
+
}
|
|
3253
3405
|
};
|
|
3254
3406
|
var SparkAuthProvider = class {
|
|
3255
3407
|
sessionToken;
|
|
@@ -3291,10 +3443,6 @@ init_buffer();
|
|
|
3291
3443
|
|
|
3292
3444
|
// src/graphql/objects/ClaimStaticDeposit.ts
|
|
3293
3445
|
init_buffer();
|
|
3294
|
-
var import_core7 = require("@lightsparkdev/core");
|
|
3295
|
-
|
|
3296
|
-
// src/graphql/objects/CoopExitFeeQuote.ts
|
|
3297
|
-
init_buffer();
|
|
3298
3446
|
var import_core8 = require("@lightsparkdev/core");
|
|
3299
3447
|
|
|
3300
3448
|
// src/graphql/objects/SparkUserRequestStatus.ts
|
|
@@ -3683,7 +3831,7 @@ var TransferStatus = /* @__PURE__ */ ((TransferStatus2) => {
|
|
|
3683
3831
|
TransferStatus2[TransferStatus2["TRANSFER_STATUS_SENDER_KEY_TWEAK_PENDING"] = 1] = "TRANSFER_STATUS_SENDER_KEY_TWEAK_PENDING";
|
|
3684
3832
|
TransferStatus2[TransferStatus2["TRANSFER_STATUS_SENDER_KEY_TWEAKED"] = 2] = "TRANSFER_STATUS_SENDER_KEY_TWEAKED";
|
|
3685
3833
|
TransferStatus2[TransferStatus2["TRANSFER_STATUS_RECEIVER_KEY_TWEAKED"] = 3] = "TRANSFER_STATUS_RECEIVER_KEY_TWEAKED";
|
|
3686
|
-
TransferStatus2[TransferStatus2["
|
|
3834
|
+
TransferStatus2[TransferStatus2["TRANSFER_STATUS_RECEIVER_REFUND_SIGNED"] = 4] = "TRANSFER_STATUS_RECEIVER_REFUND_SIGNED";
|
|
3687
3835
|
TransferStatus2[TransferStatus2["TRANSFER_STATUS_COMPLETED"] = 5] = "TRANSFER_STATUS_COMPLETED";
|
|
3688
3836
|
TransferStatus2[TransferStatus2["TRANSFER_STATUS_EXPIRED"] = 6] = "TRANSFER_STATUS_EXPIRED";
|
|
3689
3837
|
TransferStatus2[TransferStatus2["TRANSFER_STATUS_RETURNED"] = 7] = "TRANSFER_STATUS_RETURNED";
|
|
@@ -3708,8 +3856,8 @@ function transferStatusFromJSON(object) {
|
|
|
3708
3856
|
case "TRANSFER_STATUS_RECEIVER_KEY_TWEAKED":
|
|
3709
3857
|
return 3 /* TRANSFER_STATUS_RECEIVER_KEY_TWEAKED */;
|
|
3710
3858
|
case 4:
|
|
3711
|
-
case "
|
|
3712
|
-
return 4 /*
|
|
3859
|
+
case "TRANSFER_STATUS_RECEIVER_REFUND_SIGNED":
|
|
3860
|
+
return 4 /* TRANSFER_STATUS_RECEIVER_REFUND_SIGNED */;
|
|
3713
3861
|
case 5:
|
|
3714
3862
|
case "TRANSFER_STATUS_COMPLETED":
|
|
3715
3863
|
return 5 /* TRANSFER_STATUS_COMPLETED */;
|
|
@@ -3744,8 +3892,8 @@ function transferStatusToJSON(object) {
|
|
|
3744
3892
|
return "TRANSFER_STATUS_SENDER_KEY_TWEAKED";
|
|
3745
3893
|
case 3 /* TRANSFER_STATUS_RECEIVER_KEY_TWEAKED */:
|
|
3746
3894
|
return "TRANSFER_STATUS_RECEIVER_KEY_TWEAKED";
|
|
3747
|
-
case 4 /*
|
|
3748
|
-
return "
|
|
3895
|
+
case 4 /* TRANSFER_STATUS_RECEIVER_REFUND_SIGNED */:
|
|
3896
|
+
return "TRANSFER_STATUS_RECEIVER_REFUND_SIGNED";
|
|
3749
3897
|
case 5 /* TRANSFER_STATUS_COMPLETED */:
|
|
3750
3898
|
return "TRANSFER_STATUS_COMPLETED";
|
|
3751
3899
|
case 6 /* TRANSFER_STATUS_EXPIRED */:
|
|
@@ -4837,7 +4985,7 @@ var SigningJob = {
|
|
|
4837
4985
|
}
|
|
4838
4986
|
};
|
|
4839
4987
|
function createBaseSigningKeyshare() {
|
|
4840
|
-
return { ownerIdentifiers: [], threshold: 0, publicKey: new Uint8Array(0) };
|
|
4988
|
+
return { ownerIdentifiers: [], threshold: 0, publicKey: new Uint8Array(0), publicShares: {}, updatedTime: void 0 };
|
|
4841
4989
|
}
|
|
4842
4990
|
var SigningKeyshare = {
|
|
4843
4991
|
encode(message, writer = new import_wire4.BinaryWriter()) {
|
|
@@ -4850,6 +4998,12 @@ var SigningKeyshare = {
|
|
|
4850
4998
|
if (message.publicKey.length !== 0) {
|
|
4851
4999
|
writer.uint32(26).bytes(message.publicKey);
|
|
4852
5000
|
}
|
|
5001
|
+
Object.entries(message.publicShares).forEach(([key, value]) => {
|
|
5002
|
+
SigningKeyshare_PublicSharesEntry.encode({ key, value }, writer.uint32(34).fork()).join();
|
|
5003
|
+
});
|
|
5004
|
+
if (message.updatedTime !== void 0) {
|
|
5005
|
+
Timestamp.encode(toTimestamp(message.updatedTime), writer.uint32(42).fork()).join();
|
|
5006
|
+
}
|
|
4853
5007
|
return writer;
|
|
4854
5008
|
},
|
|
4855
5009
|
decode(input, length) {
|
|
@@ -4880,6 +5034,23 @@ var SigningKeyshare = {
|
|
|
4880
5034
|
message.publicKey = reader.bytes();
|
|
4881
5035
|
continue;
|
|
4882
5036
|
}
|
|
5037
|
+
case 4: {
|
|
5038
|
+
if (tag !== 34) {
|
|
5039
|
+
break;
|
|
5040
|
+
}
|
|
5041
|
+
const entry4 = SigningKeyshare_PublicSharesEntry.decode(reader, reader.uint32());
|
|
5042
|
+
if (entry4.value !== void 0) {
|
|
5043
|
+
message.publicShares[entry4.key] = entry4.value;
|
|
5044
|
+
}
|
|
5045
|
+
continue;
|
|
5046
|
+
}
|
|
5047
|
+
case 5: {
|
|
5048
|
+
if (tag !== 42) {
|
|
5049
|
+
break;
|
|
5050
|
+
}
|
|
5051
|
+
message.updatedTime = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
5052
|
+
continue;
|
|
5053
|
+
}
|
|
4883
5054
|
}
|
|
4884
5055
|
if ((tag & 7) === 4 || tag === 0) {
|
|
4885
5056
|
break;
|
|
@@ -4892,7 +5063,12 @@ var SigningKeyshare = {
|
|
|
4892
5063
|
return {
|
|
4893
5064
|
ownerIdentifiers: globalThis.Array.isArray(object?.ownerIdentifiers) ? object.ownerIdentifiers.map((e) => globalThis.String(e)) : [],
|
|
4894
5065
|
threshold: isSet3(object.threshold) ? globalThis.Number(object.threshold) : 0,
|
|
4895
|
-
publicKey: isSet3(object.publicKey) ? bytesFromBase642(object.publicKey) : new Uint8Array(0)
|
|
5066
|
+
publicKey: isSet3(object.publicKey) ? bytesFromBase642(object.publicKey) : new Uint8Array(0),
|
|
5067
|
+
publicShares: isObject9(object.publicShares) ? Object.entries(object.publicShares).reduce((acc, [key, value]) => {
|
|
5068
|
+
acc[key] = bytesFromBase642(value);
|
|
5069
|
+
return acc;
|
|
5070
|
+
}, {}) : {},
|
|
5071
|
+
updatedTime: isSet3(object.updatedTime) ? fromJsonTimestamp(object.updatedTime) : void 0
|
|
4896
5072
|
};
|
|
4897
5073
|
},
|
|
4898
5074
|
toJSON(message) {
|
|
@@ -4906,6 +5082,18 @@ var SigningKeyshare = {
|
|
|
4906
5082
|
if (message.publicKey.length !== 0) {
|
|
4907
5083
|
obj.publicKey = base64FromBytes2(message.publicKey);
|
|
4908
5084
|
}
|
|
5085
|
+
if (message.publicShares) {
|
|
5086
|
+
const entries = Object.entries(message.publicShares);
|
|
5087
|
+
if (entries.length > 0) {
|
|
5088
|
+
obj.publicShares = {};
|
|
5089
|
+
entries.forEach(([k, v]) => {
|
|
5090
|
+
obj.publicShares[k] = base64FromBytes2(v);
|
|
5091
|
+
});
|
|
5092
|
+
}
|
|
5093
|
+
}
|
|
5094
|
+
if (message.updatedTime !== void 0) {
|
|
5095
|
+
obj.updatedTime = message.updatedTime.toISOString();
|
|
5096
|
+
}
|
|
4909
5097
|
return obj;
|
|
4910
5098
|
},
|
|
4911
5099
|
create(base) {
|
|
@@ -4916,6 +5104,84 @@ var SigningKeyshare = {
|
|
|
4916
5104
|
message.ownerIdentifiers = object.ownerIdentifiers?.map((e) => e) || [];
|
|
4917
5105
|
message.threshold = object.threshold ?? 0;
|
|
4918
5106
|
message.publicKey = object.publicKey ?? new Uint8Array(0);
|
|
5107
|
+
message.publicShares = Object.entries(object.publicShares ?? {}).reduce(
|
|
5108
|
+
(acc, [key, value]) => {
|
|
5109
|
+
if (value !== void 0) {
|
|
5110
|
+
acc[key] = value;
|
|
5111
|
+
}
|
|
5112
|
+
return acc;
|
|
5113
|
+
},
|
|
5114
|
+
{}
|
|
5115
|
+
);
|
|
5116
|
+
message.updatedTime = object.updatedTime ?? void 0;
|
|
5117
|
+
return message;
|
|
5118
|
+
}
|
|
5119
|
+
};
|
|
5120
|
+
function createBaseSigningKeyshare_PublicSharesEntry() {
|
|
5121
|
+
return { key: "", value: new Uint8Array(0) };
|
|
5122
|
+
}
|
|
5123
|
+
var SigningKeyshare_PublicSharesEntry = {
|
|
5124
|
+
encode(message, writer = new import_wire4.BinaryWriter()) {
|
|
5125
|
+
if (message.key !== "") {
|
|
5126
|
+
writer.uint32(10).string(message.key);
|
|
5127
|
+
}
|
|
5128
|
+
if (message.value.length !== 0) {
|
|
5129
|
+
writer.uint32(18).bytes(message.value);
|
|
5130
|
+
}
|
|
5131
|
+
return writer;
|
|
5132
|
+
},
|
|
5133
|
+
decode(input, length) {
|
|
5134
|
+
const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
|
|
5135
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
5136
|
+
const message = createBaseSigningKeyshare_PublicSharesEntry();
|
|
5137
|
+
while (reader.pos < end) {
|
|
5138
|
+
const tag = reader.uint32();
|
|
5139
|
+
switch (tag >>> 3) {
|
|
5140
|
+
case 1: {
|
|
5141
|
+
if (tag !== 10) {
|
|
5142
|
+
break;
|
|
5143
|
+
}
|
|
5144
|
+
message.key = reader.string();
|
|
5145
|
+
continue;
|
|
5146
|
+
}
|
|
5147
|
+
case 2: {
|
|
5148
|
+
if (tag !== 18) {
|
|
5149
|
+
break;
|
|
5150
|
+
}
|
|
5151
|
+
message.value = reader.bytes();
|
|
5152
|
+
continue;
|
|
5153
|
+
}
|
|
5154
|
+
}
|
|
5155
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
5156
|
+
break;
|
|
5157
|
+
}
|
|
5158
|
+
reader.skip(tag & 7);
|
|
5159
|
+
}
|
|
5160
|
+
return message;
|
|
5161
|
+
},
|
|
5162
|
+
fromJSON(object) {
|
|
5163
|
+
return {
|
|
5164
|
+
key: isSet3(object.key) ? globalThis.String(object.key) : "",
|
|
5165
|
+
value: isSet3(object.value) ? bytesFromBase642(object.value) : new Uint8Array(0)
|
|
5166
|
+
};
|
|
5167
|
+
},
|
|
5168
|
+
toJSON(message) {
|
|
5169
|
+
const obj = {};
|
|
5170
|
+
if (message.key !== "") {
|
|
5171
|
+
obj.key = message.key;
|
|
5172
|
+
}
|
|
5173
|
+
if (message.value.length !== 0) {
|
|
5174
|
+
obj.value = base64FromBytes2(message.value);
|
|
5175
|
+
}
|
|
5176
|
+
return obj;
|
|
5177
|
+
},
|
|
5178
|
+
create(base) {
|
|
5179
|
+
return SigningKeyshare_PublicSharesEntry.fromPartial(base ?? {});
|
|
5180
|
+
},
|
|
5181
|
+
fromPartial(object) {
|
|
5182
|
+
const message = createBaseSigningKeyshare_PublicSharesEntry();
|
|
5183
|
+
message.key = object.key ?? "";
|
|
5184
|
+
message.value = object.value ?? new Uint8Array(0);
|
|
4919
5185
|
return message;
|
|
4920
5186
|
}
|
|
4921
5187
|
};
|
|
@@ -6612,7 +6878,8 @@ function createBaseStartTokenTransactionRequest() {
|
|
|
6612
6878
|
return {
|
|
6613
6879
|
identityPublicKey: new Uint8Array(0),
|
|
6614
6880
|
partialTokenTransaction: void 0,
|
|
6615
|
-
tokenTransactionSignatures: void 0
|
|
6881
|
+
tokenTransactionSignatures: void 0,
|
|
6882
|
+
sparkPaymentIntent: ""
|
|
6616
6883
|
};
|
|
6617
6884
|
}
|
|
6618
6885
|
var StartTokenTransactionRequest = {
|
|
@@ -6626,6 +6893,9 @@ var StartTokenTransactionRequest = {
|
|
|
6626
6893
|
if (message.tokenTransactionSignatures !== void 0) {
|
|
6627
6894
|
TokenTransactionSignatures.encode(message.tokenTransactionSignatures, writer.uint32(26).fork()).join();
|
|
6628
6895
|
}
|
|
6896
|
+
if (message.sparkPaymentIntent !== "") {
|
|
6897
|
+
writer.uint32(34).string(message.sparkPaymentIntent);
|
|
6898
|
+
}
|
|
6629
6899
|
return writer;
|
|
6630
6900
|
},
|
|
6631
6901
|
decode(input, length) {
|
|
@@ -6656,6 +6926,13 @@ var StartTokenTransactionRequest = {
|
|
|
6656
6926
|
message.tokenTransactionSignatures = TokenTransactionSignatures.decode(reader, reader.uint32());
|
|
6657
6927
|
continue;
|
|
6658
6928
|
}
|
|
6929
|
+
case 4: {
|
|
6930
|
+
if (tag !== 34) {
|
|
6931
|
+
break;
|
|
6932
|
+
}
|
|
6933
|
+
message.sparkPaymentIntent = reader.string();
|
|
6934
|
+
continue;
|
|
6935
|
+
}
|
|
6659
6936
|
}
|
|
6660
6937
|
if ((tag & 7) === 4 || tag === 0) {
|
|
6661
6938
|
break;
|
|
@@ -6668,7 +6945,8 @@ var StartTokenTransactionRequest = {
|
|
|
6668
6945
|
return {
|
|
6669
6946
|
identityPublicKey: isSet3(object.identityPublicKey) ? bytesFromBase642(object.identityPublicKey) : new Uint8Array(0),
|
|
6670
6947
|
partialTokenTransaction: isSet3(object.partialTokenTransaction) ? TokenTransaction.fromJSON(object.partialTokenTransaction) : void 0,
|
|
6671
|
-
tokenTransactionSignatures: isSet3(object.tokenTransactionSignatures) ? TokenTransactionSignatures.fromJSON(object.tokenTransactionSignatures) : void 0
|
|
6948
|
+
tokenTransactionSignatures: isSet3(object.tokenTransactionSignatures) ? TokenTransactionSignatures.fromJSON(object.tokenTransactionSignatures) : void 0,
|
|
6949
|
+
sparkPaymentIntent: isSet3(object.sparkPaymentIntent) ? globalThis.String(object.sparkPaymentIntent) : ""
|
|
6672
6950
|
};
|
|
6673
6951
|
},
|
|
6674
6952
|
toJSON(message) {
|
|
@@ -6682,6 +6960,9 @@ var StartTokenTransactionRequest = {
|
|
|
6682
6960
|
if (message.tokenTransactionSignatures !== void 0) {
|
|
6683
6961
|
obj.tokenTransactionSignatures = TokenTransactionSignatures.toJSON(message.tokenTransactionSignatures);
|
|
6684
6962
|
}
|
|
6963
|
+
if (message.sparkPaymentIntent !== "") {
|
|
6964
|
+
obj.sparkPaymentIntent = message.sparkPaymentIntent;
|
|
6965
|
+
}
|
|
6685
6966
|
return obj;
|
|
6686
6967
|
},
|
|
6687
6968
|
create(base) {
|
|
@@ -6692,6 +6973,7 @@ var StartTokenTransactionRequest = {
|
|
|
6692
6973
|
message.identityPublicKey = object.identityPublicKey ?? new Uint8Array(0);
|
|
6693
6974
|
message.partialTokenTransaction = object.partialTokenTransaction !== void 0 && object.partialTokenTransaction !== null ? TokenTransaction.fromPartial(object.partialTokenTransaction) : void 0;
|
|
6694
6975
|
message.tokenTransactionSignatures = object.tokenTransactionSignatures !== void 0 && object.tokenTransactionSignatures !== null ? TokenTransactionSignatures.fromPartial(object.tokenTransactionSignatures) : void 0;
|
|
6976
|
+
message.sparkPaymentIntent = object.sparkPaymentIntent ?? "";
|
|
6695
6977
|
return message;
|
|
6696
6978
|
}
|
|
6697
6979
|
};
|
|
@@ -7189,7 +7471,12 @@ var RevocationSecretWithIndex = {
|
|
|
7189
7471
|
}
|
|
7190
7472
|
};
|
|
7191
7473
|
function createBaseFinalizeTokenTransactionRequest() {
|
|
7192
|
-
return {
|
|
7474
|
+
return {
|
|
7475
|
+
finalTokenTransaction: void 0,
|
|
7476
|
+
revocationSecrets: [],
|
|
7477
|
+
identityPublicKey: new Uint8Array(0),
|
|
7478
|
+
sparkPaymentIntent: ""
|
|
7479
|
+
};
|
|
7193
7480
|
}
|
|
7194
7481
|
var FinalizeTokenTransactionRequest = {
|
|
7195
7482
|
encode(message, writer = new import_wire4.BinaryWriter()) {
|
|
@@ -7202,6 +7489,9 @@ var FinalizeTokenTransactionRequest = {
|
|
|
7202
7489
|
if (message.identityPublicKey.length !== 0) {
|
|
7203
7490
|
writer.uint32(26).bytes(message.identityPublicKey);
|
|
7204
7491
|
}
|
|
7492
|
+
if (message.sparkPaymentIntent !== "") {
|
|
7493
|
+
writer.uint32(34).string(message.sparkPaymentIntent);
|
|
7494
|
+
}
|
|
7205
7495
|
return writer;
|
|
7206
7496
|
},
|
|
7207
7497
|
decode(input, length) {
|
|
@@ -7232,6 +7522,13 @@ var FinalizeTokenTransactionRequest = {
|
|
|
7232
7522
|
message.identityPublicKey = reader.bytes();
|
|
7233
7523
|
continue;
|
|
7234
7524
|
}
|
|
7525
|
+
case 4: {
|
|
7526
|
+
if (tag !== 34) {
|
|
7527
|
+
break;
|
|
7528
|
+
}
|
|
7529
|
+
message.sparkPaymentIntent = reader.string();
|
|
7530
|
+
continue;
|
|
7531
|
+
}
|
|
7235
7532
|
}
|
|
7236
7533
|
if ((tag & 7) === 4 || tag === 0) {
|
|
7237
7534
|
break;
|
|
@@ -7244,7 +7541,8 @@ var FinalizeTokenTransactionRequest = {
|
|
|
7244
7541
|
return {
|
|
7245
7542
|
finalTokenTransaction: isSet3(object.finalTokenTransaction) ? TokenTransaction.fromJSON(object.finalTokenTransaction) : void 0,
|
|
7246
7543
|
revocationSecrets: globalThis.Array.isArray(object?.revocationSecrets) ? object.revocationSecrets.map((e) => RevocationSecretWithIndex.fromJSON(e)) : [],
|
|
7247
|
-
identityPublicKey: isSet3(object.identityPublicKey) ? bytesFromBase642(object.identityPublicKey) : new Uint8Array(0)
|
|
7544
|
+
identityPublicKey: isSet3(object.identityPublicKey) ? bytesFromBase642(object.identityPublicKey) : new Uint8Array(0),
|
|
7545
|
+
sparkPaymentIntent: isSet3(object.sparkPaymentIntent) ? globalThis.String(object.sparkPaymentIntent) : ""
|
|
7248
7546
|
};
|
|
7249
7547
|
},
|
|
7250
7548
|
toJSON(message) {
|
|
@@ -7258,6 +7556,9 @@ var FinalizeTokenTransactionRequest = {
|
|
|
7258
7556
|
if (message.identityPublicKey.length !== 0) {
|
|
7259
7557
|
obj.identityPublicKey = base64FromBytes2(message.identityPublicKey);
|
|
7260
7558
|
}
|
|
7559
|
+
if (message.sparkPaymentIntent !== "") {
|
|
7560
|
+
obj.sparkPaymentIntent = message.sparkPaymentIntent;
|
|
7561
|
+
}
|
|
7261
7562
|
return obj;
|
|
7262
7563
|
},
|
|
7263
7564
|
create(base) {
|
|
@@ -7268,6 +7569,7 @@ var FinalizeTokenTransactionRequest = {
|
|
|
7268
7569
|
message.finalTokenTransaction = object.finalTokenTransaction !== void 0 && object.finalTokenTransaction !== null ? TokenTransaction.fromPartial(object.finalTokenTransaction) : void 0;
|
|
7269
7570
|
message.revocationSecrets = object.revocationSecrets?.map((e) => RevocationSecretWithIndex.fromPartial(e)) || [];
|
|
7270
7571
|
message.identityPublicKey = object.identityPublicKey ?? new Uint8Array(0);
|
|
7572
|
+
message.sparkPaymentIntent = object.sparkPaymentIntent ?? "";
|
|
7271
7573
|
return message;
|
|
7272
7574
|
}
|
|
7273
7575
|
};
|
|
@@ -7960,7 +8262,10 @@ function createBaseTreeNode() {
|
|
|
7960
8262
|
ownerIdentityPublicKey: new Uint8Array(0),
|
|
7961
8263
|
signingKeyshare: void 0,
|
|
7962
8264
|
status: "",
|
|
7963
|
-
network: 0
|
|
8265
|
+
network: 0,
|
|
8266
|
+
createdTime: void 0,
|
|
8267
|
+
updatedTime: void 0,
|
|
8268
|
+
ownerSigningPublicKey: new Uint8Array(0)
|
|
7964
8269
|
};
|
|
7965
8270
|
}
|
|
7966
8271
|
var TreeNode = {
|
|
@@ -8001,6 +8306,15 @@ var TreeNode = {
|
|
|
8001
8306
|
if (message.network !== 0) {
|
|
8002
8307
|
writer.uint32(96).int32(message.network);
|
|
8003
8308
|
}
|
|
8309
|
+
if (message.createdTime !== void 0) {
|
|
8310
|
+
Timestamp.encode(toTimestamp(message.createdTime), writer.uint32(106).fork()).join();
|
|
8311
|
+
}
|
|
8312
|
+
if (message.updatedTime !== void 0) {
|
|
8313
|
+
Timestamp.encode(toTimestamp(message.updatedTime), writer.uint32(114).fork()).join();
|
|
8314
|
+
}
|
|
8315
|
+
if (message.ownerSigningPublicKey.length !== 0) {
|
|
8316
|
+
writer.uint32(122).bytes(message.ownerSigningPublicKey);
|
|
8317
|
+
}
|
|
8004
8318
|
return writer;
|
|
8005
8319
|
},
|
|
8006
8320
|
decode(input, length) {
|
|
@@ -8094,6 +8408,27 @@ var TreeNode = {
|
|
|
8094
8408
|
message.network = reader.int32();
|
|
8095
8409
|
continue;
|
|
8096
8410
|
}
|
|
8411
|
+
case 13: {
|
|
8412
|
+
if (tag !== 106) {
|
|
8413
|
+
break;
|
|
8414
|
+
}
|
|
8415
|
+
message.createdTime = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
8416
|
+
continue;
|
|
8417
|
+
}
|
|
8418
|
+
case 14: {
|
|
8419
|
+
if (tag !== 114) {
|
|
8420
|
+
break;
|
|
8421
|
+
}
|
|
8422
|
+
message.updatedTime = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
8423
|
+
continue;
|
|
8424
|
+
}
|
|
8425
|
+
case 15: {
|
|
8426
|
+
if (tag !== 122) {
|
|
8427
|
+
break;
|
|
8428
|
+
}
|
|
8429
|
+
message.ownerSigningPublicKey = reader.bytes();
|
|
8430
|
+
continue;
|
|
8431
|
+
}
|
|
8097
8432
|
}
|
|
8098
8433
|
if ((tag & 7) === 4 || tag === 0) {
|
|
8099
8434
|
break;
|
|
@@ -8115,7 +8450,10 @@ var TreeNode = {
|
|
|
8115
8450
|
ownerIdentityPublicKey: isSet3(object.ownerIdentityPublicKey) ? bytesFromBase642(object.ownerIdentityPublicKey) : new Uint8Array(0),
|
|
8116
8451
|
signingKeyshare: isSet3(object.signingKeyshare) ? SigningKeyshare.fromJSON(object.signingKeyshare) : void 0,
|
|
8117
8452
|
status: isSet3(object.status) ? globalThis.String(object.status) : "",
|
|
8118
|
-
network: isSet3(object.network) ? networkFromJSON(object.network) : 0
|
|
8453
|
+
network: isSet3(object.network) ? networkFromJSON(object.network) : 0,
|
|
8454
|
+
createdTime: isSet3(object.createdTime) ? fromJsonTimestamp(object.createdTime) : void 0,
|
|
8455
|
+
updatedTime: isSet3(object.updatedTime) ? fromJsonTimestamp(object.updatedTime) : void 0,
|
|
8456
|
+
ownerSigningPublicKey: isSet3(object.ownerSigningPublicKey) ? bytesFromBase642(object.ownerSigningPublicKey) : new Uint8Array(0)
|
|
8119
8457
|
};
|
|
8120
8458
|
},
|
|
8121
8459
|
toJSON(message) {
|
|
@@ -8156,6 +8494,15 @@ var TreeNode = {
|
|
|
8156
8494
|
if (message.network !== 0) {
|
|
8157
8495
|
obj.network = networkToJSON(message.network);
|
|
8158
8496
|
}
|
|
8497
|
+
if (message.createdTime !== void 0) {
|
|
8498
|
+
obj.createdTime = message.createdTime.toISOString();
|
|
8499
|
+
}
|
|
8500
|
+
if (message.updatedTime !== void 0) {
|
|
8501
|
+
obj.updatedTime = message.updatedTime.toISOString();
|
|
8502
|
+
}
|
|
8503
|
+
if (message.ownerSigningPublicKey.length !== 0) {
|
|
8504
|
+
obj.ownerSigningPublicKey = base64FromBytes2(message.ownerSigningPublicKey);
|
|
8505
|
+
}
|
|
8159
8506
|
return obj;
|
|
8160
8507
|
},
|
|
8161
8508
|
create(base) {
|
|
@@ -8175,6 +8522,9 @@ var TreeNode = {
|
|
|
8175
8522
|
message.signingKeyshare = object.signingKeyshare !== void 0 && object.signingKeyshare !== null ? SigningKeyshare.fromPartial(object.signingKeyshare) : void 0;
|
|
8176
8523
|
message.status = object.status ?? "";
|
|
8177
8524
|
message.network = object.network ?? 0;
|
|
8525
|
+
message.createdTime = object.createdTime ?? void 0;
|
|
8526
|
+
message.updatedTime = object.updatedTime ?? void 0;
|
|
8527
|
+
message.ownerSigningPublicKey = object.ownerSigningPublicKey ?? new Uint8Array(0);
|
|
8178
8528
|
return message;
|
|
8179
8529
|
}
|
|
8180
8530
|
};
|
|
@@ -8777,7 +9127,8 @@ function createBaseStartTransferRequest() {
|
|
|
8777
9127
|
leavesToSend: [],
|
|
8778
9128
|
receiverIdentityPublicKey: new Uint8Array(0),
|
|
8779
9129
|
expiryTime: void 0,
|
|
8780
|
-
transferPackage: void 0
|
|
9130
|
+
transferPackage: void 0,
|
|
9131
|
+
sparkPaymentIntent: ""
|
|
8781
9132
|
};
|
|
8782
9133
|
}
|
|
8783
9134
|
var StartTransferRequest = {
|
|
@@ -8800,6 +9151,9 @@ var StartTransferRequest = {
|
|
|
8800
9151
|
if (message.transferPackage !== void 0) {
|
|
8801
9152
|
TransferPackage.encode(message.transferPackage, writer.uint32(58).fork()).join();
|
|
8802
9153
|
}
|
|
9154
|
+
if (message.sparkPaymentIntent !== "") {
|
|
9155
|
+
writer.uint32(74).string(message.sparkPaymentIntent);
|
|
9156
|
+
}
|
|
8803
9157
|
return writer;
|
|
8804
9158
|
},
|
|
8805
9159
|
decode(input, length) {
|
|
@@ -8851,6 +9205,13 @@ var StartTransferRequest = {
|
|
|
8851
9205
|
message.transferPackage = TransferPackage.decode(reader, reader.uint32());
|
|
8852
9206
|
continue;
|
|
8853
9207
|
}
|
|
9208
|
+
case 9: {
|
|
9209
|
+
if (tag !== 74) {
|
|
9210
|
+
break;
|
|
9211
|
+
}
|
|
9212
|
+
message.sparkPaymentIntent = reader.string();
|
|
9213
|
+
continue;
|
|
9214
|
+
}
|
|
8854
9215
|
}
|
|
8855
9216
|
if ((tag & 7) === 4 || tag === 0) {
|
|
8856
9217
|
break;
|
|
@@ -8866,7 +9227,8 @@ var StartTransferRequest = {
|
|
|
8866
9227
|
leavesToSend: globalThis.Array.isArray(object?.leavesToSend) ? object.leavesToSend.map((e) => LeafRefundTxSigningJob.fromJSON(e)) : [],
|
|
8867
9228
|
receiverIdentityPublicKey: isSet3(object.receiverIdentityPublicKey) ? bytesFromBase642(object.receiverIdentityPublicKey) : new Uint8Array(0),
|
|
8868
9229
|
expiryTime: isSet3(object.expiryTime) ? fromJsonTimestamp(object.expiryTime) : void 0,
|
|
8869
|
-
transferPackage: isSet3(object.transferPackage) ? TransferPackage.fromJSON(object.transferPackage) : void 0
|
|
9230
|
+
transferPackage: isSet3(object.transferPackage) ? TransferPackage.fromJSON(object.transferPackage) : void 0,
|
|
9231
|
+
sparkPaymentIntent: isSet3(object.sparkPaymentIntent) ? globalThis.String(object.sparkPaymentIntent) : ""
|
|
8870
9232
|
};
|
|
8871
9233
|
},
|
|
8872
9234
|
toJSON(message) {
|
|
@@ -8889,6 +9251,9 @@ var StartTransferRequest = {
|
|
|
8889
9251
|
if (message.transferPackage !== void 0) {
|
|
8890
9252
|
obj.transferPackage = TransferPackage.toJSON(message.transferPackage);
|
|
8891
9253
|
}
|
|
9254
|
+
if (message.sparkPaymentIntent !== "") {
|
|
9255
|
+
obj.sparkPaymentIntent = message.sparkPaymentIntent;
|
|
9256
|
+
}
|
|
8892
9257
|
return obj;
|
|
8893
9258
|
},
|
|
8894
9259
|
create(base) {
|
|
@@ -8902,6 +9267,7 @@ var StartTransferRequest = {
|
|
|
8902
9267
|
message.receiverIdentityPublicKey = object.receiverIdentityPublicKey ?? new Uint8Array(0);
|
|
8903
9268
|
message.expiryTime = object.expiryTime ?? void 0;
|
|
8904
9269
|
message.transferPackage = object.transferPackage !== void 0 && object.transferPackage !== null ? TransferPackage.fromPartial(object.transferPackage) : void 0;
|
|
9270
|
+
message.sparkPaymentIntent = object.sparkPaymentIntent ?? "";
|
|
8905
9271
|
return message;
|
|
8906
9272
|
}
|
|
8907
9273
|
};
|
|
@@ -9421,7 +9787,7 @@ var SendLeafKeyTweak_PubkeySharesTweakEntry = {
|
|
|
9421
9787
|
}
|
|
9422
9788
|
};
|
|
9423
9789
|
function createBaseFinalizeTransferRequest() {
|
|
9424
|
-
return { transferId: "", ownerIdentityPublicKey: new Uint8Array(0), leavesToSend: [] };
|
|
9790
|
+
return { transferId: "", ownerIdentityPublicKey: new Uint8Array(0), leavesToSend: [], sparkPaymentIntent: "" };
|
|
9425
9791
|
}
|
|
9426
9792
|
var FinalizeTransferRequest = {
|
|
9427
9793
|
encode(message, writer = new import_wire4.BinaryWriter()) {
|
|
@@ -9434,6 +9800,9 @@ var FinalizeTransferRequest = {
|
|
|
9434
9800
|
for (const v of message.leavesToSend) {
|
|
9435
9801
|
SendLeafKeyTweak.encode(v, writer.uint32(26).fork()).join();
|
|
9436
9802
|
}
|
|
9803
|
+
if (message.sparkPaymentIntent !== "") {
|
|
9804
|
+
writer.uint32(34).string(message.sparkPaymentIntent);
|
|
9805
|
+
}
|
|
9437
9806
|
return writer;
|
|
9438
9807
|
},
|
|
9439
9808
|
decode(input, length) {
|
|
@@ -9464,6 +9833,13 @@ var FinalizeTransferRequest = {
|
|
|
9464
9833
|
message.leavesToSend.push(SendLeafKeyTweak.decode(reader, reader.uint32()));
|
|
9465
9834
|
continue;
|
|
9466
9835
|
}
|
|
9836
|
+
case 4: {
|
|
9837
|
+
if (tag !== 34) {
|
|
9838
|
+
break;
|
|
9839
|
+
}
|
|
9840
|
+
message.sparkPaymentIntent = reader.string();
|
|
9841
|
+
continue;
|
|
9842
|
+
}
|
|
9467
9843
|
}
|
|
9468
9844
|
if ((tag & 7) === 4 || tag === 0) {
|
|
9469
9845
|
break;
|
|
@@ -9476,7 +9852,8 @@ var FinalizeTransferRequest = {
|
|
|
9476
9852
|
return {
|
|
9477
9853
|
transferId: isSet3(object.transferId) ? globalThis.String(object.transferId) : "",
|
|
9478
9854
|
ownerIdentityPublicKey: isSet3(object.ownerIdentityPublicKey) ? bytesFromBase642(object.ownerIdentityPublicKey) : new Uint8Array(0),
|
|
9479
|
-
leavesToSend: globalThis.Array.isArray(object?.leavesToSend) ? object.leavesToSend.map((e) => SendLeafKeyTweak.fromJSON(e)) : []
|
|
9855
|
+
leavesToSend: globalThis.Array.isArray(object?.leavesToSend) ? object.leavesToSend.map((e) => SendLeafKeyTweak.fromJSON(e)) : [],
|
|
9856
|
+
sparkPaymentIntent: isSet3(object.sparkPaymentIntent) ? globalThis.String(object.sparkPaymentIntent) : ""
|
|
9480
9857
|
};
|
|
9481
9858
|
},
|
|
9482
9859
|
toJSON(message) {
|
|
@@ -9490,6 +9867,9 @@ var FinalizeTransferRequest = {
|
|
|
9490
9867
|
if (message.leavesToSend?.length) {
|
|
9491
9868
|
obj.leavesToSend = message.leavesToSend.map((e) => SendLeafKeyTweak.toJSON(e));
|
|
9492
9869
|
}
|
|
9870
|
+
if (message.sparkPaymentIntent !== "") {
|
|
9871
|
+
obj.sparkPaymentIntent = message.sparkPaymentIntent;
|
|
9872
|
+
}
|
|
9493
9873
|
return obj;
|
|
9494
9874
|
},
|
|
9495
9875
|
create(base) {
|
|
@@ -9500,6 +9880,7 @@ var FinalizeTransferRequest = {
|
|
|
9500
9880
|
message.transferId = object.transferId ?? "";
|
|
9501
9881
|
message.ownerIdentityPublicKey = object.ownerIdentityPublicKey ?? new Uint8Array(0);
|
|
9502
9882
|
message.leavesToSend = object.leavesToSend?.map((e) => SendLeafKeyTweak.fromPartial(e)) || [];
|
|
9883
|
+
message.sparkPaymentIntent = object.sparkPaymentIntent ?? "";
|
|
9503
9884
|
return message;
|
|
9504
9885
|
}
|
|
9505
9886
|
};
|
|
@@ -9940,7 +10321,7 @@ var TransferLeaf = {
|
|
|
9940
10321
|
}
|
|
9941
10322
|
};
|
|
9942
10323
|
function createBaseTransferFilter() {
|
|
9943
|
-
return { participant: void 0, transferIds: [], limit: 0, offset: 0, types: [], network: 0 };
|
|
10324
|
+
return { participant: void 0, transferIds: [], limit: 0, offset: 0, types: [], network: 0, statuses: [] };
|
|
9944
10325
|
}
|
|
9945
10326
|
var TransferFilter = {
|
|
9946
10327
|
encode(message, writer = new import_wire4.BinaryWriter()) {
|
|
@@ -9972,6 +10353,11 @@ var TransferFilter = {
|
|
|
9972
10353
|
if (message.network !== 0) {
|
|
9973
10354
|
writer.uint32(32).int32(message.network);
|
|
9974
10355
|
}
|
|
10356
|
+
writer.uint32(642).fork();
|
|
10357
|
+
for (const v of message.statuses) {
|
|
10358
|
+
writer.int32(v);
|
|
10359
|
+
}
|
|
10360
|
+
writer.join();
|
|
9975
10361
|
return writer;
|
|
9976
10362
|
},
|
|
9977
10363
|
decode(input, length) {
|
|
@@ -10047,6 +10433,20 @@ var TransferFilter = {
|
|
|
10047
10433
|
message.network = reader.int32();
|
|
10048
10434
|
continue;
|
|
10049
10435
|
}
|
|
10436
|
+
case 80: {
|
|
10437
|
+
if (tag === 640) {
|
|
10438
|
+
message.statuses.push(reader.int32());
|
|
10439
|
+
continue;
|
|
10440
|
+
}
|
|
10441
|
+
if (tag === 642) {
|
|
10442
|
+
const end2 = reader.uint32() + reader.pos;
|
|
10443
|
+
while (reader.pos < end2) {
|
|
10444
|
+
message.statuses.push(reader.int32());
|
|
10445
|
+
}
|
|
10446
|
+
continue;
|
|
10447
|
+
}
|
|
10448
|
+
break;
|
|
10449
|
+
}
|
|
10050
10450
|
}
|
|
10051
10451
|
if ((tag & 7) === 4 || tag === 0) {
|
|
10052
10452
|
break;
|
|
@@ -10068,7 +10468,8 @@ var TransferFilter = {
|
|
|
10068
10468
|
limit: isSet3(object.limit) ? globalThis.Number(object.limit) : 0,
|
|
10069
10469
|
offset: isSet3(object.offset) ? globalThis.Number(object.offset) : 0,
|
|
10070
10470
|
types: globalThis.Array.isArray(object?.types) ? object.types.map((e) => transferTypeFromJSON(e)) : [],
|
|
10071
|
-
network: isSet3(object.network) ? networkFromJSON(object.network) : 0
|
|
10471
|
+
network: isSet3(object.network) ? networkFromJSON(object.network) : 0,
|
|
10472
|
+
statuses: globalThis.Array.isArray(object?.statuses) ? object.statuses.map((e) => transferStatusFromJSON(e)) : []
|
|
10072
10473
|
};
|
|
10073
10474
|
},
|
|
10074
10475
|
toJSON(message) {
|
|
@@ -10095,6 +10496,9 @@ var TransferFilter = {
|
|
|
10095
10496
|
if (message.network !== 0) {
|
|
10096
10497
|
obj.network = networkToJSON(message.network);
|
|
10097
10498
|
}
|
|
10499
|
+
if (message.statuses?.length) {
|
|
10500
|
+
obj.statuses = message.statuses.map((e) => transferStatusToJSON(e));
|
|
10501
|
+
}
|
|
10098
10502
|
return obj;
|
|
10099
10503
|
},
|
|
10100
10504
|
create(base) {
|
|
@@ -10136,6 +10540,7 @@ var TransferFilter = {
|
|
|
10136
10540
|
message.offset = object.offset ?? 0;
|
|
10137
10541
|
message.types = object.types?.map((e) => e) || [];
|
|
10138
10542
|
message.network = object.network ?? 0;
|
|
10543
|
+
message.statuses = object.statuses?.map((e) => e) || [];
|
|
10139
10544
|
return message;
|
|
10140
10545
|
}
|
|
10141
10546
|
};
|
|
@@ -10434,189 +10839,53 @@ var ClaimTransferTweakKeysRequest = {
|
|
|
10434
10839
|
return {
|
|
10435
10840
|
transferId: isSet3(object.transferId) ? globalThis.String(object.transferId) : "",
|
|
10436
10841
|
ownerIdentityPublicKey: isSet3(object.ownerIdentityPublicKey) ? bytesFromBase642(object.ownerIdentityPublicKey) : new Uint8Array(0),
|
|
10437
|
-
leavesToReceive: globalThis.Array.isArray(object?.leavesToReceive) ? object.leavesToReceive.map((e) => ClaimLeafKeyTweak.fromJSON(e)) : []
|
|
10438
|
-
};
|
|
10439
|
-
},
|
|
10440
|
-
toJSON(message) {
|
|
10441
|
-
const obj = {};
|
|
10442
|
-
if (message.transferId !== "") {
|
|
10443
|
-
obj.transferId = message.transferId;
|
|
10444
|
-
}
|
|
10445
|
-
if (message.ownerIdentityPublicKey.length !== 0) {
|
|
10446
|
-
obj.ownerIdentityPublicKey = base64FromBytes2(message.ownerIdentityPublicKey);
|
|
10447
|
-
}
|
|
10448
|
-
if (message.leavesToReceive?.length) {
|
|
10449
|
-
obj.leavesToReceive = message.leavesToReceive.map((e) => ClaimLeafKeyTweak.toJSON(e));
|
|
10450
|
-
}
|
|
10451
|
-
return obj;
|
|
10452
|
-
},
|
|
10453
|
-
create(base) {
|
|
10454
|
-
return ClaimTransferTweakKeysRequest.fromPartial(base ?? {});
|
|
10455
|
-
},
|
|
10456
|
-
fromPartial(object) {
|
|
10457
|
-
const message = createBaseClaimTransferTweakKeysRequest();
|
|
10458
|
-
message.transferId = object.transferId ?? "";
|
|
10459
|
-
message.ownerIdentityPublicKey = object.ownerIdentityPublicKey ?? new Uint8Array(0);
|
|
10460
|
-
message.leavesToReceive = object.leavesToReceive?.map((e) => ClaimLeafKeyTweak.fromPartial(e)) || [];
|
|
10461
|
-
return message;
|
|
10462
|
-
}
|
|
10463
|
-
};
|
|
10464
|
-
function createBaseClaimTransferSignRefundsRequest() {
|
|
10465
|
-
return { transferId: "", ownerIdentityPublicKey: new Uint8Array(0), signingJobs: [] };
|
|
10466
|
-
}
|
|
10467
|
-
var ClaimTransferSignRefundsRequest = {
|
|
10468
|
-
encode(message, writer = new import_wire4.BinaryWriter()) {
|
|
10469
|
-
if (message.transferId !== "") {
|
|
10470
|
-
writer.uint32(10).string(message.transferId);
|
|
10471
|
-
}
|
|
10472
|
-
if (message.ownerIdentityPublicKey.length !== 0) {
|
|
10473
|
-
writer.uint32(18).bytes(message.ownerIdentityPublicKey);
|
|
10474
|
-
}
|
|
10475
|
-
for (const v of message.signingJobs) {
|
|
10476
|
-
LeafRefundTxSigningJob.encode(v, writer.uint32(26).fork()).join();
|
|
10477
|
-
}
|
|
10478
|
-
return writer;
|
|
10479
|
-
},
|
|
10480
|
-
decode(input, length) {
|
|
10481
|
-
const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
|
|
10482
|
-
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
10483
|
-
const message = createBaseClaimTransferSignRefundsRequest();
|
|
10484
|
-
while (reader.pos < end) {
|
|
10485
|
-
const tag = reader.uint32();
|
|
10486
|
-
switch (tag >>> 3) {
|
|
10487
|
-
case 1: {
|
|
10488
|
-
if (tag !== 10) {
|
|
10489
|
-
break;
|
|
10490
|
-
}
|
|
10491
|
-
message.transferId = reader.string();
|
|
10492
|
-
continue;
|
|
10493
|
-
}
|
|
10494
|
-
case 2: {
|
|
10495
|
-
if (tag !== 18) {
|
|
10496
|
-
break;
|
|
10497
|
-
}
|
|
10498
|
-
message.ownerIdentityPublicKey = reader.bytes();
|
|
10499
|
-
continue;
|
|
10500
|
-
}
|
|
10501
|
-
case 3: {
|
|
10502
|
-
if (tag !== 26) {
|
|
10503
|
-
break;
|
|
10504
|
-
}
|
|
10505
|
-
message.signingJobs.push(LeafRefundTxSigningJob.decode(reader, reader.uint32()));
|
|
10506
|
-
continue;
|
|
10507
|
-
}
|
|
10508
|
-
}
|
|
10509
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
10510
|
-
break;
|
|
10511
|
-
}
|
|
10512
|
-
reader.skip(tag & 7);
|
|
10513
|
-
}
|
|
10514
|
-
return message;
|
|
10515
|
-
},
|
|
10516
|
-
fromJSON(object) {
|
|
10517
|
-
return {
|
|
10518
|
-
transferId: isSet3(object.transferId) ? globalThis.String(object.transferId) : "",
|
|
10519
|
-
ownerIdentityPublicKey: isSet3(object.ownerIdentityPublicKey) ? bytesFromBase642(object.ownerIdentityPublicKey) : new Uint8Array(0),
|
|
10520
|
-
signingJobs: globalThis.Array.isArray(object?.signingJobs) ? object.signingJobs.map((e) => LeafRefundTxSigningJob.fromJSON(e)) : []
|
|
10521
|
-
};
|
|
10522
|
-
},
|
|
10523
|
-
toJSON(message) {
|
|
10524
|
-
const obj = {};
|
|
10525
|
-
if (message.transferId !== "") {
|
|
10526
|
-
obj.transferId = message.transferId;
|
|
10527
|
-
}
|
|
10528
|
-
if (message.ownerIdentityPublicKey.length !== 0) {
|
|
10529
|
-
obj.ownerIdentityPublicKey = base64FromBytes2(message.ownerIdentityPublicKey);
|
|
10530
|
-
}
|
|
10531
|
-
if (message.signingJobs?.length) {
|
|
10532
|
-
obj.signingJobs = message.signingJobs.map((e) => LeafRefundTxSigningJob.toJSON(e));
|
|
10533
|
-
}
|
|
10534
|
-
return obj;
|
|
10535
|
-
},
|
|
10536
|
-
create(base) {
|
|
10537
|
-
return ClaimTransferSignRefundsRequest.fromPartial(base ?? {});
|
|
10538
|
-
},
|
|
10539
|
-
fromPartial(object) {
|
|
10540
|
-
const message = createBaseClaimTransferSignRefundsRequest();
|
|
10541
|
-
message.transferId = object.transferId ?? "";
|
|
10542
|
-
message.ownerIdentityPublicKey = object.ownerIdentityPublicKey ?? new Uint8Array(0);
|
|
10543
|
-
message.signingJobs = object.signingJobs?.map((e) => LeafRefundTxSigningJob.fromPartial(e)) || [];
|
|
10544
|
-
return message;
|
|
10545
|
-
}
|
|
10546
|
-
};
|
|
10547
|
-
function createBaseClaimTransferSignRefundsResponse() {
|
|
10548
|
-
return { signingResults: [] };
|
|
10549
|
-
}
|
|
10550
|
-
var ClaimTransferSignRefundsResponse = {
|
|
10551
|
-
encode(message, writer = new import_wire4.BinaryWriter()) {
|
|
10552
|
-
for (const v of message.signingResults) {
|
|
10553
|
-
LeafRefundTxSigningResult.encode(v, writer.uint32(10).fork()).join();
|
|
10554
|
-
}
|
|
10555
|
-
return writer;
|
|
10556
|
-
},
|
|
10557
|
-
decode(input, length) {
|
|
10558
|
-
const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
|
|
10559
|
-
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
10560
|
-
const message = createBaseClaimTransferSignRefundsResponse();
|
|
10561
|
-
while (reader.pos < end) {
|
|
10562
|
-
const tag = reader.uint32();
|
|
10563
|
-
switch (tag >>> 3) {
|
|
10564
|
-
case 1: {
|
|
10565
|
-
if (tag !== 10) {
|
|
10566
|
-
break;
|
|
10567
|
-
}
|
|
10568
|
-
message.signingResults.push(LeafRefundTxSigningResult.decode(reader, reader.uint32()));
|
|
10569
|
-
continue;
|
|
10570
|
-
}
|
|
10571
|
-
}
|
|
10572
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
10573
|
-
break;
|
|
10574
|
-
}
|
|
10575
|
-
reader.skip(tag & 7);
|
|
10576
|
-
}
|
|
10577
|
-
return message;
|
|
10578
|
-
},
|
|
10579
|
-
fromJSON(object) {
|
|
10580
|
-
return {
|
|
10581
|
-
signingResults: globalThis.Array.isArray(object?.signingResults) ? object.signingResults.map((e) => LeafRefundTxSigningResult.fromJSON(e)) : []
|
|
10842
|
+
leavesToReceive: globalThis.Array.isArray(object?.leavesToReceive) ? object.leavesToReceive.map((e) => ClaimLeafKeyTweak.fromJSON(e)) : []
|
|
10582
10843
|
};
|
|
10583
10844
|
},
|
|
10584
10845
|
toJSON(message) {
|
|
10585
10846
|
const obj = {};
|
|
10586
|
-
if (message.
|
|
10587
|
-
obj.
|
|
10847
|
+
if (message.transferId !== "") {
|
|
10848
|
+
obj.transferId = message.transferId;
|
|
10849
|
+
}
|
|
10850
|
+
if (message.ownerIdentityPublicKey.length !== 0) {
|
|
10851
|
+
obj.ownerIdentityPublicKey = base64FromBytes2(message.ownerIdentityPublicKey);
|
|
10852
|
+
}
|
|
10853
|
+
if (message.leavesToReceive?.length) {
|
|
10854
|
+
obj.leavesToReceive = message.leavesToReceive.map((e) => ClaimLeafKeyTweak.toJSON(e));
|
|
10588
10855
|
}
|
|
10589
10856
|
return obj;
|
|
10590
10857
|
},
|
|
10591
10858
|
create(base) {
|
|
10592
|
-
return
|
|
10859
|
+
return ClaimTransferTweakKeysRequest.fromPartial(base ?? {});
|
|
10593
10860
|
},
|
|
10594
10861
|
fromPartial(object) {
|
|
10595
|
-
const message =
|
|
10596
|
-
message.
|
|
10862
|
+
const message = createBaseClaimTransferTweakKeysRequest();
|
|
10863
|
+
message.transferId = object.transferId ?? "";
|
|
10864
|
+
message.ownerIdentityPublicKey = object.ownerIdentityPublicKey ?? new Uint8Array(0);
|
|
10865
|
+
message.leavesToReceive = object.leavesToReceive?.map((e) => ClaimLeafKeyTweak.fromPartial(e)) || [];
|
|
10597
10866
|
return message;
|
|
10598
10867
|
}
|
|
10599
10868
|
};
|
|
10600
|
-
function
|
|
10601
|
-
return {
|
|
10869
|
+
function createBaseClaimTransferSignRefundsRequest() {
|
|
10870
|
+
return { transferId: "", ownerIdentityPublicKey: new Uint8Array(0), signingJobs: [] };
|
|
10602
10871
|
}
|
|
10603
|
-
var
|
|
10872
|
+
var ClaimTransferSignRefundsRequest = {
|
|
10604
10873
|
encode(message, writer = new import_wire4.BinaryWriter()) {
|
|
10605
|
-
|
|
10606
|
-
writer.uint32(10).string(
|
|
10607
|
-
}
|
|
10608
|
-
if (message.signingJob !== void 0) {
|
|
10609
|
-
SigningJob.encode(message.signingJob, writer.uint32(18).fork()).join();
|
|
10874
|
+
if (message.transferId !== "") {
|
|
10875
|
+
writer.uint32(10).string(message.transferId);
|
|
10610
10876
|
}
|
|
10611
10877
|
if (message.ownerIdentityPublicKey.length !== 0) {
|
|
10612
|
-
writer.uint32(
|
|
10878
|
+
writer.uint32(18).bytes(message.ownerIdentityPublicKey);
|
|
10879
|
+
}
|
|
10880
|
+
for (const v of message.signingJobs) {
|
|
10881
|
+
LeafRefundTxSigningJob.encode(v, writer.uint32(26).fork()).join();
|
|
10613
10882
|
}
|
|
10614
10883
|
return writer;
|
|
10615
10884
|
},
|
|
10616
10885
|
decode(input, length) {
|
|
10617
10886
|
const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
|
|
10618
10887
|
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
10619
|
-
const message =
|
|
10888
|
+
const message = createBaseClaimTransferSignRefundsRequest();
|
|
10620
10889
|
while (reader.pos < end) {
|
|
10621
10890
|
const tag = reader.uint32();
|
|
10622
10891
|
switch (tag >>> 3) {
|
|
@@ -10624,21 +10893,21 @@ var AggregateNodesRequest = {
|
|
|
10624
10893
|
if (tag !== 10) {
|
|
10625
10894
|
break;
|
|
10626
10895
|
}
|
|
10627
|
-
message.
|
|
10896
|
+
message.transferId = reader.string();
|
|
10628
10897
|
continue;
|
|
10629
10898
|
}
|
|
10630
10899
|
case 2: {
|
|
10631
10900
|
if (tag !== 18) {
|
|
10632
10901
|
break;
|
|
10633
10902
|
}
|
|
10634
|
-
message.
|
|
10903
|
+
message.ownerIdentityPublicKey = reader.bytes();
|
|
10635
10904
|
continue;
|
|
10636
10905
|
}
|
|
10637
10906
|
case 3: {
|
|
10638
10907
|
if (tag !== 26) {
|
|
10639
10908
|
break;
|
|
10640
10909
|
}
|
|
10641
|
-
message.
|
|
10910
|
+
message.signingJobs.push(LeafRefundTxSigningJob.decode(reader, reader.uint32()));
|
|
10642
10911
|
continue;
|
|
10643
10912
|
}
|
|
10644
10913
|
}
|
|
@@ -10651,63 +10920,49 @@ var AggregateNodesRequest = {
|
|
|
10651
10920
|
},
|
|
10652
10921
|
fromJSON(object) {
|
|
10653
10922
|
return {
|
|
10654
|
-
|
|
10655
|
-
|
|
10656
|
-
|
|
10923
|
+
transferId: isSet3(object.transferId) ? globalThis.String(object.transferId) : "",
|
|
10924
|
+
ownerIdentityPublicKey: isSet3(object.ownerIdentityPublicKey) ? bytesFromBase642(object.ownerIdentityPublicKey) : new Uint8Array(0),
|
|
10925
|
+
signingJobs: globalThis.Array.isArray(object?.signingJobs) ? object.signingJobs.map((e) => LeafRefundTxSigningJob.fromJSON(e)) : []
|
|
10657
10926
|
};
|
|
10658
10927
|
},
|
|
10659
10928
|
toJSON(message) {
|
|
10660
10929
|
const obj = {};
|
|
10661
|
-
if (message.
|
|
10662
|
-
obj.
|
|
10663
|
-
}
|
|
10664
|
-
if (message.signingJob !== void 0) {
|
|
10665
|
-
obj.signingJob = SigningJob.toJSON(message.signingJob);
|
|
10930
|
+
if (message.transferId !== "") {
|
|
10931
|
+
obj.transferId = message.transferId;
|
|
10666
10932
|
}
|
|
10667
10933
|
if (message.ownerIdentityPublicKey.length !== 0) {
|
|
10668
10934
|
obj.ownerIdentityPublicKey = base64FromBytes2(message.ownerIdentityPublicKey);
|
|
10669
10935
|
}
|
|
10936
|
+
if (message.signingJobs?.length) {
|
|
10937
|
+
obj.signingJobs = message.signingJobs.map((e) => LeafRefundTxSigningJob.toJSON(e));
|
|
10938
|
+
}
|
|
10670
10939
|
return obj;
|
|
10671
10940
|
},
|
|
10672
10941
|
create(base) {
|
|
10673
|
-
return
|
|
10942
|
+
return ClaimTransferSignRefundsRequest.fromPartial(base ?? {});
|
|
10674
10943
|
},
|
|
10675
10944
|
fromPartial(object) {
|
|
10676
|
-
const message =
|
|
10677
|
-
message.
|
|
10678
|
-
message.signingJob = object.signingJob !== void 0 && object.signingJob !== null ? SigningJob.fromPartial(object.signingJob) : void 0;
|
|
10945
|
+
const message = createBaseClaimTransferSignRefundsRequest();
|
|
10946
|
+
message.transferId = object.transferId ?? "";
|
|
10679
10947
|
message.ownerIdentityPublicKey = object.ownerIdentityPublicKey ?? new Uint8Array(0);
|
|
10948
|
+
message.signingJobs = object.signingJobs?.map((e) => LeafRefundTxSigningJob.fromPartial(e)) || [];
|
|
10680
10949
|
return message;
|
|
10681
10950
|
}
|
|
10682
10951
|
};
|
|
10683
|
-
function
|
|
10684
|
-
return {
|
|
10685
|
-
aggregateSignature: void 0,
|
|
10686
|
-
verifyingKey: new Uint8Array(0),
|
|
10687
|
-
parentNodeTx: new Uint8Array(0),
|
|
10688
|
-
parentNodeVout: 0
|
|
10689
|
-
};
|
|
10952
|
+
function createBaseClaimTransferSignRefundsResponse() {
|
|
10953
|
+
return { signingResults: [] };
|
|
10690
10954
|
}
|
|
10691
|
-
var
|
|
10955
|
+
var ClaimTransferSignRefundsResponse = {
|
|
10692
10956
|
encode(message, writer = new import_wire4.BinaryWriter()) {
|
|
10693
|
-
|
|
10694
|
-
|
|
10695
|
-
}
|
|
10696
|
-
if (message.verifyingKey.length !== 0) {
|
|
10697
|
-
writer.uint32(18).bytes(message.verifyingKey);
|
|
10698
|
-
}
|
|
10699
|
-
if (message.parentNodeTx.length !== 0) {
|
|
10700
|
-
writer.uint32(26).bytes(message.parentNodeTx);
|
|
10701
|
-
}
|
|
10702
|
-
if (message.parentNodeVout !== 0) {
|
|
10703
|
-
writer.uint32(32).uint32(message.parentNodeVout);
|
|
10957
|
+
for (const v of message.signingResults) {
|
|
10958
|
+
LeafRefundTxSigningResult.encode(v, writer.uint32(10).fork()).join();
|
|
10704
10959
|
}
|
|
10705
10960
|
return writer;
|
|
10706
10961
|
},
|
|
10707
10962
|
decode(input, length) {
|
|
10708
10963
|
const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
|
|
10709
10964
|
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
10710
|
-
const message =
|
|
10965
|
+
const message = createBaseClaimTransferSignRefundsResponse();
|
|
10711
10966
|
while (reader.pos < end) {
|
|
10712
10967
|
const tag = reader.uint32();
|
|
10713
10968
|
switch (tag >>> 3) {
|
|
@@ -10715,28 +10970,7 @@ var AggregateNodesResponse = {
|
|
|
10715
10970
|
if (tag !== 10) {
|
|
10716
10971
|
break;
|
|
10717
10972
|
}
|
|
10718
|
-
message.
|
|
10719
|
-
continue;
|
|
10720
|
-
}
|
|
10721
|
-
case 2: {
|
|
10722
|
-
if (tag !== 18) {
|
|
10723
|
-
break;
|
|
10724
|
-
}
|
|
10725
|
-
message.verifyingKey = reader.bytes();
|
|
10726
|
-
continue;
|
|
10727
|
-
}
|
|
10728
|
-
case 3: {
|
|
10729
|
-
if (tag !== 26) {
|
|
10730
|
-
break;
|
|
10731
|
-
}
|
|
10732
|
-
message.parentNodeTx = reader.bytes();
|
|
10733
|
-
continue;
|
|
10734
|
-
}
|
|
10735
|
-
case 4: {
|
|
10736
|
-
if (tag !== 32) {
|
|
10737
|
-
break;
|
|
10738
|
-
}
|
|
10739
|
-
message.parentNodeVout = reader.uint32();
|
|
10973
|
+
message.signingResults.push(LeafRefundTxSigningResult.decode(reader, reader.uint32()));
|
|
10740
10974
|
continue;
|
|
10741
10975
|
}
|
|
10742
10976
|
}
|
|
@@ -10749,37 +10983,22 @@ var AggregateNodesResponse = {
|
|
|
10749
10983
|
},
|
|
10750
10984
|
fromJSON(object) {
|
|
10751
10985
|
return {
|
|
10752
|
-
|
|
10753
|
-
verifyingKey: isSet3(object.verifyingKey) ? bytesFromBase642(object.verifyingKey) : new Uint8Array(0),
|
|
10754
|
-
parentNodeTx: isSet3(object.parentNodeTx) ? bytesFromBase642(object.parentNodeTx) : new Uint8Array(0),
|
|
10755
|
-
parentNodeVout: isSet3(object.parentNodeVout) ? globalThis.Number(object.parentNodeVout) : 0
|
|
10986
|
+
signingResults: globalThis.Array.isArray(object?.signingResults) ? object.signingResults.map((e) => LeafRefundTxSigningResult.fromJSON(e)) : []
|
|
10756
10987
|
};
|
|
10757
10988
|
},
|
|
10758
10989
|
toJSON(message) {
|
|
10759
10990
|
const obj = {};
|
|
10760
|
-
if (message.
|
|
10761
|
-
obj.
|
|
10762
|
-
}
|
|
10763
|
-
if (message.verifyingKey.length !== 0) {
|
|
10764
|
-
obj.verifyingKey = base64FromBytes2(message.verifyingKey);
|
|
10765
|
-
}
|
|
10766
|
-
if (message.parentNodeTx.length !== 0) {
|
|
10767
|
-
obj.parentNodeTx = base64FromBytes2(message.parentNodeTx);
|
|
10768
|
-
}
|
|
10769
|
-
if (message.parentNodeVout !== 0) {
|
|
10770
|
-
obj.parentNodeVout = Math.round(message.parentNodeVout);
|
|
10991
|
+
if (message.signingResults?.length) {
|
|
10992
|
+
obj.signingResults = message.signingResults.map((e) => LeafRefundTxSigningResult.toJSON(e));
|
|
10771
10993
|
}
|
|
10772
10994
|
return obj;
|
|
10773
10995
|
},
|
|
10774
10996
|
create(base) {
|
|
10775
|
-
return
|
|
10997
|
+
return ClaimTransferSignRefundsResponse.fromPartial(base ?? {});
|
|
10776
10998
|
},
|
|
10777
10999
|
fromPartial(object) {
|
|
10778
|
-
const message =
|
|
10779
|
-
message.
|
|
10780
|
-
message.verifyingKey = object.verifyingKey ?? new Uint8Array(0);
|
|
10781
|
-
message.parentNodeTx = object.parentNodeTx ?? new Uint8Array(0);
|
|
10782
|
-
message.parentNodeVout = object.parentNodeVout ?? 0;
|
|
11000
|
+
const message = createBaseClaimTransferSignRefundsResponse();
|
|
11001
|
+
message.signingResults = object.signingResults?.map((e) => LeafRefundTxSigningResult.fromPartial(e)) || [];
|
|
10783
11002
|
return message;
|
|
10784
11003
|
}
|
|
10785
11004
|
};
|
|
@@ -14183,7 +14402,7 @@ var CancelTransferResponse = {
|
|
|
14183
14402
|
}
|
|
14184
14403
|
};
|
|
14185
14404
|
function createBaseQueryUnusedDepositAddressesRequest() {
|
|
14186
|
-
return { identityPublicKey: new Uint8Array(0), network: 0 };
|
|
14405
|
+
return { identityPublicKey: new Uint8Array(0), network: 0, limit: 0, offset: 0 };
|
|
14187
14406
|
}
|
|
14188
14407
|
var QueryUnusedDepositAddressesRequest = {
|
|
14189
14408
|
encode(message, writer = new import_wire4.BinaryWriter()) {
|
|
@@ -14193,6 +14412,12 @@ var QueryUnusedDepositAddressesRequest = {
|
|
|
14193
14412
|
if (message.network !== 0) {
|
|
14194
14413
|
writer.uint32(16).int32(message.network);
|
|
14195
14414
|
}
|
|
14415
|
+
if (message.limit !== 0) {
|
|
14416
|
+
writer.uint32(24).int64(message.limit);
|
|
14417
|
+
}
|
|
14418
|
+
if (message.offset !== 0) {
|
|
14419
|
+
writer.uint32(32).int64(message.offset);
|
|
14420
|
+
}
|
|
14196
14421
|
return writer;
|
|
14197
14422
|
},
|
|
14198
14423
|
decode(input, length) {
|
|
@@ -14216,6 +14441,20 @@ var QueryUnusedDepositAddressesRequest = {
|
|
|
14216
14441
|
message.network = reader.int32();
|
|
14217
14442
|
continue;
|
|
14218
14443
|
}
|
|
14444
|
+
case 3: {
|
|
14445
|
+
if (tag !== 24) {
|
|
14446
|
+
break;
|
|
14447
|
+
}
|
|
14448
|
+
message.limit = longToNumber2(reader.int64());
|
|
14449
|
+
continue;
|
|
14450
|
+
}
|
|
14451
|
+
case 4: {
|
|
14452
|
+
if (tag !== 32) {
|
|
14453
|
+
break;
|
|
14454
|
+
}
|
|
14455
|
+
message.offset = longToNumber2(reader.int64());
|
|
14456
|
+
continue;
|
|
14457
|
+
}
|
|
14219
14458
|
}
|
|
14220
14459
|
if ((tag & 7) === 4 || tag === 0) {
|
|
14221
14460
|
break;
|
|
@@ -14227,7 +14466,9 @@ var QueryUnusedDepositAddressesRequest = {
|
|
|
14227
14466
|
fromJSON(object) {
|
|
14228
14467
|
return {
|
|
14229
14468
|
identityPublicKey: isSet3(object.identityPublicKey) ? bytesFromBase642(object.identityPublicKey) : new Uint8Array(0),
|
|
14230
|
-
network: isSet3(object.network) ? networkFromJSON(object.network) : 0
|
|
14469
|
+
network: isSet3(object.network) ? networkFromJSON(object.network) : 0,
|
|
14470
|
+
limit: isSet3(object.limit) ? globalThis.Number(object.limit) : 0,
|
|
14471
|
+
offset: isSet3(object.offset) ? globalThis.Number(object.offset) : 0
|
|
14231
14472
|
};
|
|
14232
14473
|
},
|
|
14233
14474
|
toJSON(message) {
|
|
@@ -14238,6 +14479,12 @@ var QueryUnusedDepositAddressesRequest = {
|
|
|
14238
14479
|
if (message.network !== 0) {
|
|
14239
14480
|
obj.network = networkToJSON(message.network);
|
|
14240
14481
|
}
|
|
14482
|
+
if (message.limit !== 0) {
|
|
14483
|
+
obj.limit = Math.round(message.limit);
|
|
14484
|
+
}
|
|
14485
|
+
if (message.offset !== 0) {
|
|
14486
|
+
obj.offset = Math.round(message.offset);
|
|
14487
|
+
}
|
|
14241
14488
|
return obj;
|
|
14242
14489
|
},
|
|
14243
14490
|
create(base) {
|
|
@@ -14247,6 +14494,8 @@ var QueryUnusedDepositAddressesRequest = {
|
|
|
14247
14494
|
const message = createBaseQueryUnusedDepositAddressesRequest();
|
|
14248
14495
|
message.identityPublicKey = object.identityPublicKey ?? new Uint8Array(0);
|
|
14249
14496
|
message.network = object.network ?? 0;
|
|
14497
|
+
message.limit = object.limit ?? 0;
|
|
14498
|
+
message.offset = object.offset ?? 0;
|
|
14250
14499
|
return message;
|
|
14251
14500
|
}
|
|
14252
14501
|
};
|
|
@@ -14452,13 +14701,16 @@ var DepositAddressQueryResult = {
|
|
|
14452
14701
|
}
|
|
14453
14702
|
};
|
|
14454
14703
|
function createBaseQueryUnusedDepositAddressesResponse() {
|
|
14455
|
-
return { depositAddresses: [] };
|
|
14704
|
+
return { depositAddresses: [], offset: 0 };
|
|
14456
14705
|
}
|
|
14457
14706
|
var QueryUnusedDepositAddressesResponse = {
|
|
14458
14707
|
encode(message, writer = new import_wire4.BinaryWriter()) {
|
|
14459
14708
|
for (const v of message.depositAddresses) {
|
|
14460
14709
|
DepositAddressQueryResult.encode(v, writer.uint32(10).fork()).join();
|
|
14461
14710
|
}
|
|
14711
|
+
if (message.offset !== 0) {
|
|
14712
|
+
writer.uint32(16).int64(message.offset);
|
|
14713
|
+
}
|
|
14462
14714
|
return writer;
|
|
14463
14715
|
},
|
|
14464
14716
|
decode(input, length) {
|
|
@@ -14475,6 +14727,13 @@ var QueryUnusedDepositAddressesResponse = {
|
|
|
14475
14727
|
message.depositAddresses.push(DepositAddressQueryResult.decode(reader, reader.uint32()));
|
|
14476
14728
|
continue;
|
|
14477
14729
|
}
|
|
14730
|
+
case 2: {
|
|
14731
|
+
if (tag !== 16) {
|
|
14732
|
+
break;
|
|
14733
|
+
}
|
|
14734
|
+
message.offset = longToNumber2(reader.int64());
|
|
14735
|
+
continue;
|
|
14736
|
+
}
|
|
14478
14737
|
}
|
|
14479
14738
|
if ((tag & 7) === 4 || tag === 0) {
|
|
14480
14739
|
break;
|
|
@@ -14485,7 +14744,8 @@ var QueryUnusedDepositAddressesResponse = {
|
|
|
14485
14744
|
},
|
|
14486
14745
|
fromJSON(object) {
|
|
14487
14746
|
return {
|
|
14488
|
-
depositAddresses: globalThis.Array.isArray(object?.depositAddresses) ? object.depositAddresses.map((e) => DepositAddressQueryResult.fromJSON(e)) : []
|
|
14747
|
+
depositAddresses: globalThis.Array.isArray(object?.depositAddresses) ? object.depositAddresses.map((e) => DepositAddressQueryResult.fromJSON(e)) : [],
|
|
14748
|
+
offset: isSet3(object.offset) ? globalThis.Number(object.offset) : 0
|
|
14489
14749
|
};
|
|
14490
14750
|
},
|
|
14491
14751
|
toJSON(message) {
|
|
@@ -14493,6 +14753,9 @@ var QueryUnusedDepositAddressesResponse = {
|
|
|
14493
14753
|
if (message.depositAddresses?.length) {
|
|
14494
14754
|
obj.depositAddresses = message.depositAddresses.map((e) => DepositAddressQueryResult.toJSON(e));
|
|
14495
14755
|
}
|
|
14756
|
+
if (message.offset !== 0) {
|
|
14757
|
+
obj.offset = Math.round(message.offset);
|
|
14758
|
+
}
|
|
14496
14759
|
return obj;
|
|
14497
14760
|
},
|
|
14498
14761
|
create(base) {
|
|
@@ -14501,6 +14764,7 @@ var QueryUnusedDepositAddressesResponse = {
|
|
|
14501
14764
|
fromPartial(object) {
|
|
14502
14765
|
const message = createBaseQueryUnusedDepositAddressesResponse();
|
|
14503
14766
|
message.depositAddresses = object.depositAddresses?.map((e) => DepositAddressQueryResult.fromPartial(e)) || [];
|
|
14767
|
+
message.offset = object.offset ?? 0;
|
|
14504
14768
|
return message;
|
|
14505
14769
|
}
|
|
14506
14770
|
};
|
|
@@ -16087,6 +16351,11 @@ var SparkServiceDefinition = {
|
|
|
16087
16351
|
responseStream: false,
|
|
16088
16352
|
options: {}
|
|
16089
16353
|
},
|
|
16354
|
+
/**
|
|
16355
|
+
* This is deprecated, please use finalize_transfer_with_transfer_package instead.
|
|
16356
|
+
*
|
|
16357
|
+
* @deprecated
|
|
16358
|
+
*/
|
|
16090
16359
|
finalize_transfer: {
|
|
16091
16360
|
name: "finalize_transfer",
|
|
16092
16361
|
requestType: FinalizeTransferRequest,
|
|
@@ -16143,14 +16412,6 @@ var SparkServiceDefinition = {
|
|
|
16143
16412
|
responseStream: false,
|
|
16144
16413
|
options: {}
|
|
16145
16414
|
},
|
|
16146
|
-
aggregate_nodes: {
|
|
16147
|
-
name: "aggregate_nodes",
|
|
16148
|
-
requestType: AggregateNodesRequest,
|
|
16149
|
-
requestStream: false,
|
|
16150
|
-
responseType: AggregateNodesResponse,
|
|
16151
|
-
responseStream: false,
|
|
16152
|
-
options: {}
|
|
16153
|
-
},
|
|
16154
16415
|
store_preimage_share: {
|
|
16155
16416
|
name: "store_preimage_share",
|
|
16156
16417
|
requestType: StorePreimageShareRequest,
|
|
@@ -16484,9 +16745,12 @@ init_buffer();
|
|
|
16484
16745
|
var import_core10 = require("@lightsparkdev/core");
|
|
16485
16746
|
var isReactNative = typeof navigator !== "undefined" && navigator.product === "ReactNative";
|
|
16486
16747
|
var isBun = globalThis.Bun !== void 0;
|
|
16487
|
-
var packageVersion = true ? "0.1.
|
|
16748
|
+
var packageVersion = true ? "0.1.44" : "unknown";
|
|
16488
16749
|
var baseEnvStr = "unknown";
|
|
16489
|
-
if (
|
|
16750
|
+
if (isBun) {
|
|
16751
|
+
const bunVersion = "version" in globalThis.Bun ? globalThis.Bun.version : "unknown-version";
|
|
16752
|
+
baseEnvStr = `bun/${bunVersion}`;
|
|
16753
|
+
} else if (import_core10.isNode) {
|
|
16490
16754
|
baseEnvStr = `node/${process.version}`;
|
|
16491
16755
|
} else if (isReactNative) {
|
|
16492
16756
|
baseEnvStr = "react-native";
|
|
@@ -17754,7 +18018,8 @@ var BASE_CONFIG = {
|
|
|
17754
18018
|
}
|
|
17755
18019
|
};
|
|
17756
18020
|
var LOCAL_WALLET_CONFIG = {
|
|
17757
|
-
...BASE_CONFIG
|
|
18021
|
+
...BASE_CONFIG,
|
|
18022
|
+
threshold: 3
|
|
17758
18023
|
};
|
|
17759
18024
|
var LOCAL_WALLET_CONFIG_SCHNORR = {
|
|
17760
18025
|
...LOCAL_WALLET_CONFIG,
|
|
@@ -20331,8 +20596,8 @@ function getNextTransactionSequence(currSequence, forRefresh) {
|
|
|
20331
20596
|
needRefresh: true
|
|
20332
20597
|
};
|
|
20333
20598
|
}
|
|
20334
|
-
if (nextTimelock <
|
|
20335
|
-
throw new ValidationError("timelock interval is less than
|
|
20599
|
+
if (nextTimelock < 0) {
|
|
20600
|
+
throw new ValidationError("timelock interval is less than 0", {
|
|
20336
20601
|
field: "nextTimelock",
|
|
20337
20602
|
value: nextTimelock
|
|
20338
20603
|
});
|
|
@@ -26270,17 +26535,30 @@ function hashTokenTransactionV1(tokenTransaction, partialHash = false) {
|
|
|
26270
26535
|
);
|
|
26271
26536
|
hashObj.update(networkBytes);
|
|
26272
26537
|
allHashes.push(hashObj.digest());
|
|
26273
|
-
const
|
|
26274
|
-
const
|
|
26275
|
-
const
|
|
26276
|
-
new
|
|
26538
|
+
const clientTimestampHashObj = import_sha211.sha256.create();
|
|
26539
|
+
const clientCreatedTs = tokenTransaction.clientCreatedTimestamp;
|
|
26540
|
+
const clientUnixTime = clientCreatedTs ? Math.floor(clientCreatedTs.getTime() / 1e3) : 0;
|
|
26541
|
+
const clientTimestampBytes = new Uint8Array(8);
|
|
26542
|
+
new DataView(clientTimestampBytes.buffer).setBigUint64(
|
|
26277
26543
|
0,
|
|
26278
|
-
BigInt(
|
|
26544
|
+
BigInt(clientUnixTime),
|
|
26279
26545
|
false
|
|
26280
|
-
// false for big-endian
|
|
26281
26546
|
);
|
|
26282
|
-
|
|
26283
|
-
allHashes.push(
|
|
26547
|
+
clientTimestampHashObj.update(clientTimestampBytes);
|
|
26548
|
+
allHashes.push(clientTimestampHashObj.digest());
|
|
26549
|
+
if (!partialHash) {
|
|
26550
|
+
const expiryHashObj = import_sha211.sha256.create();
|
|
26551
|
+
const expiryTimeBytes = new Uint8Array(8);
|
|
26552
|
+
const expiryUnixTime = tokenTransaction.expiryTime ? Math.floor(tokenTransaction.expiryTime.getTime() / 1e3) : 0;
|
|
26553
|
+
new DataView(expiryTimeBytes.buffer).setBigUint64(
|
|
26554
|
+
0,
|
|
26555
|
+
BigInt(expiryUnixTime),
|
|
26556
|
+
false
|
|
26557
|
+
// false for big-endian
|
|
26558
|
+
);
|
|
26559
|
+
expiryHashObj.update(expiryTimeBytes);
|
|
26560
|
+
allHashes.push(expiryHashObj.digest());
|
|
26561
|
+
}
|
|
26284
26562
|
const finalHashObj = import_sha211.sha256.create();
|
|
26285
26563
|
const concatenatedHashes = new Uint8Array(
|
|
26286
26564
|
allHashes.reduce((sum, hash) => sum + hash.length, 0)
|
|
@@ -26873,6 +27151,9 @@ var TokenTransactionService = class {
|
|
|
26873
27151
|
return txId;
|
|
26874
27152
|
}
|
|
26875
27153
|
async constructTransferTokenTransactionV0(selectedOutputs, tokenOutputData) {
|
|
27154
|
+
selectedOutputs.sort(
|
|
27155
|
+
(a, b) => a.previousTransactionVout - b.previousTransactionVout
|
|
27156
|
+
);
|
|
26876
27157
|
const availableTokenAmount = calculateAvailableTokenAmount(selectedOutputs);
|
|
26877
27158
|
const totalRequestedAmount = tokenOutputData.reduce(
|
|
26878
27159
|
(sum, output) => sum + output.tokenAmount,
|
|
@@ -26908,6 +27189,9 @@ var TokenTransactionService = class {
|
|
|
26908
27189
|
};
|
|
26909
27190
|
}
|
|
26910
27191
|
async constructTransferTokenTransaction(selectedOutputs, tokenOutputData) {
|
|
27192
|
+
selectedOutputs.sort(
|
|
27193
|
+
(a, b) => a.previousTransactionVout - b.previousTransactionVout
|
|
27194
|
+
);
|
|
26911
27195
|
const availableTokenAmount = calculateAvailableTokenAmount(selectedOutputs);
|
|
26912
27196
|
const totalRequestedAmount = tokenOutputData.reduce(
|
|
26913
27197
|
(sum, output) => sum + output.tokenAmount,
|
|
@@ -27374,6 +27658,7 @@ var TokenTransactionService = class {
|
|
|
27374
27658
|
await coordinatorClient.commit_transaction(
|
|
27375
27659
|
{
|
|
27376
27660
|
finalTokenTransaction,
|
|
27661
|
+
finalTokenTransactionHash,
|
|
27377
27662
|
inputTtxoSignaturesPerOperator,
|
|
27378
27663
|
ownerIdentityPublicKey: await this.config.signer.getIdentityPublicKey()
|
|
27379
27664
|
},
|
|
@@ -27611,7 +27896,7 @@ var import_utils18 = require("@noble/curves/abstract/utils");
|
|
|
27611
27896
|
var import_sha212 = require("@noble/hashes/sha2");
|
|
27612
27897
|
var import_btc_signer5 = require("@scure/btc-signer");
|
|
27613
27898
|
var INITIAL_TIME_LOCK3 = 2e3;
|
|
27614
|
-
function
|
|
27899
|
+
function maybeApplyFee2(amount) {
|
|
27615
27900
|
if (amount > BigInt(DEFAULT_FEE_SATS)) {
|
|
27616
27901
|
return amount - BigInt(DEFAULT_FEE_SATS);
|
|
27617
27902
|
}
|
|
@@ -27880,7 +28165,7 @@ var TreeCreationService = class {
|
|
|
27880
28165
|
const refundPkScript = import_btc_signer5.OutScript.encode(refundAddress);
|
|
27881
28166
|
refundTx.addOutput({
|
|
27882
28167
|
script: refundPkScript,
|
|
27883
|
-
amount:
|
|
28168
|
+
amount: maybeApplyFee2(parentTxOut.amount)
|
|
27884
28169
|
});
|
|
27885
28170
|
refundTx.addOutput(getEphemeralAnchorOutput());
|
|
27886
28171
|
const refundSigningNonceCommitment = await this.config.signer.getRandomSigningCommitment();
|
|
@@ -28796,13 +29081,34 @@ var SparkWallet = class _SparkWallet extends import_eventemitter3.EventEmitter {
|
|
|
28796
29081
|
([_, node]) => node.status === "AVAILABLE" && !leavesToIgnore.has(node.id)
|
|
28797
29082
|
).map(([_, node]) => node);
|
|
28798
29083
|
}
|
|
28799
|
-
async selectLeaves(
|
|
28800
|
-
if (
|
|
29084
|
+
async selectLeaves(targetAmounts) {
|
|
29085
|
+
if (targetAmounts.length === 0) {
|
|
29086
|
+
throw new ValidationError("Target amounts must be non-empty", {
|
|
29087
|
+
field: "targetAmounts",
|
|
29088
|
+
value: targetAmounts
|
|
29089
|
+
});
|
|
29090
|
+
}
|
|
29091
|
+
if (targetAmounts.some((amount) => amount <= 0)) {
|
|
28801
29092
|
throw new ValidationError("Target amount must be positive", {
|
|
28802
|
-
field: "
|
|
28803
|
-
value:
|
|
29093
|
+
field: "targetAmounts",
|
|
29094
|
+
value: targetAmounts
|
|
28804
29095
|
});
|
|
28805
29096
|
}
|
|
29097
|
+
const totalTargetAmount = targetAmounts.reduce(
|
|
29098
|
+
(acc, amount) => acc + amount,
|
|
29099
|
+
0
|
|
29100
|
+
);
|
|
29101
|
+
const totalBalance = this.getInternalBalance();
|
|
29102
|
+
if (totalTargetAmount > totalBalance) {
|
|
29103
|
+
throw new ValidationError(
|
|
29104
|
+
"Total target amount exceeds available balance",
|
|
29105
|
+
{
|
|
29106
|
+
field: "targetAmounts",
|
|
29107
|
+
value: totalTargetAmount,
|
|
29108
|
+
expected: `less than or equal to ${totalBalance}`
|
|
29109
|
+
}
|
|
29110
|
+
);
|
|
29111
|
+
}
|
|
28806
29112
|
const leaves = await this.getLeaves();
|
|
28807
29113
|
if (leaves.length === 0) {
|
|
28808
29114
|
throw new ValidationError("No owned leaves found", {
|
|
@@ -28810,33 +29116,49 @@ var SparkWallet = class _SparkWallet extends import_eventemitter3.EventEmitter {
|
|
|
28810
29116
|
});
|
|
28811
29117
|
}
|
|
28812
29118
|
leaves.sort((a, b) => b.value - a.value);
|
|
28813
|
-
|
|
28814
|
-
|
|
28815
|
-
|
|
28816
|
-
|
|
28817
|
-
|
|
28818
|
-
nodes
|
|
28819
|
-
|
|
28820
|
-
|
|
28821
|
-
|
|
28822
|
-
|
|
28823
|
-
|
|
28824
|
-
|
|
28825
|
-
|
|
28826
|
-
|
|
28827
|
-
|
|
28828
|
-
|
|
28829
|
-
amount += leaf.value;
|
|
28830
|
-
nodes.push(leaf);
|
|
29119
|
+
const selectLeavesForTargets = (targetAmounts2, leaves2) => {
|
|
29120
|
+
const usedLeaves = /* @__PURE__ */ new Set();
|
|
29121
|
+
const results2 = /* @__PURE__ */ new Map();
|
|
29122
|
+
let totalAmount = 0;
|
|
29123
|
+
for (const targetAmount of targetAmounts2) {
|
|
29124
|
+
const nodes = [];
|
|
29125
|
+
let amount = 0;
|
|
29126
|
+
for (const leaf of leaves2) {
|
|
29127
|
+
if (usedLeaves.has(leaf.id)) {
|
|
29128
|
+
continue;
|
|
29129
|
+
}
|
|
29130
|
+
if (targetAmount - amount >= leaf.value) {
|
|
29131
|
+
amount += leaf.value;
|
|
29132
|
+
nodes.push(leaf);
|
|
29133
|
+
usedLeaves.add(leaf.id);
|
|
29134
|
+
}
|
|
28831
29135
|
}
|
|
29136
|
+
totalAmount += amount;
|
|
29137
|
+
results2.set(targetAmount, nodes);
|
|
28832
29138
|
}
|
|
29139
|
+
return {
|
|
29140
|
+
results: results2,
|
|
29141
|
+
foundSelections: totalAmount === totalTargetAmount
|
|
29142
|
+
};
|
|
29143
|
+
};
|
|
29144
|
+
let { results, foundSelections } = selectLeavesForTargets(
|
|
29145
|
+
targetAmounts,
|
|
29146
|
+
leaves
|
|
29147
|
+
);
|
|
29148
|
+
if (!foundSelections) {
|
|
29149
|
+
const newLeaves = await this.requestLeavesSwap({ targetAmounts });
|
|
29150
|
+
newLeaves.sort((a, b) => b.value - a.value);
|
|
29151
|
+
({ results, foundSelections } = selectLeavesForTargets(
|
|
29152
|
+
targetAmounts,
|
|
29153
|
+
newLeaves
|
|
29154
|
+
));
|
|
28833
29155
|
}
|
|
28834
|
-
if (
|
|
29156
|
+
if (!foundSelections) {
|
|
28835
29157
|
throw new Error(
|
|
28836
|
-
`Failed to select leaves for target amount ${
|
|
29158
|
+
`Failed to select leaves for target amount ${totalTargetAmount}`
|
|
28837
29159
|
);
|
|
28838
29160
|
}
|
|
28839
|
-
return
|
|
29161
|
+
return results;
|
|
28840
29162
|
}
|
|
28841
29163
|
async selectLeavesForSwap(targetAmount) {
|
|
28842
29164
|
if (targetAmount == 0) {
|
|
@@ -29069,27 +29391,44 @@ var SparkWallet = class _SparkWallet extends import_eventemitter3.EventEmitter {
|
|
|
29069
29391
|
* @private
|
|
29070
29392
|
*/
|
|
29071
29393
|
async requestLeavesSwap({
|
|
29072
|
-
|
|
29394
|
+
targetAmounts,
|
|
29073
29395
|
leaves
|
|
29074
29396
|
}) {
|
|
29075
|
-
if (
|
|
29076
|
-
throw new Error("targetAmount must be positive");
|
|
29397
|
+
if (targetAmounts && targetAmounts.some((amount) => amount <= 0)) {
|
|
29398
|
+
throw new Error("specified targetAmount must be positive");
|
|
29077
29399
|
}
|
|
29078
|
-
if (
|
|
29400
|
+
if (targetAmounts && targetAmounts.some((amount) => !Number.isSafeInteger(amount))) {
|
|
29079
29401
|
throw new ValidationError("targetAmount must be less than 2^53", {
|
|
29080
|
-
field: "
|
|
29081
|
-
value:
|
|
29402
|
+
field: "targetAmounts",
|
|
29403
|
+
value: targetAmounts,
|
|
29082
29404
|
expected: "smaller or equal to " + Number.MAX_SAFE_INTEGER
|
|
29083
29405
|
});
|
|
29084
29406
|
}
|
|
29085
29407
|
let leavesToSwap;
|
|
29086
|
-
|
|
29087
|
-
|
|
29408
|
+
const totalTargetAmount = targetAmounts?.reduce(
|
|
29409
|
+
(acc, amount) => acc + amount,
|
|
29410
|
+
0
|
|
29411
|
+
);
|
|
29412
|
+
if (totalTargetAmount) {
|
|
29413
|
+
const totalBalance = this.getInternalBalance();
|
|
29414
|
+
if (totalTargetAmount > totalBalance) {
|
|
29415
|
+
throw new ValidationError(
|
|
29416
|
+
"Total target amount exceeds available balance",
|
|
29417
|
+
{
|
|
29418
|
+
field: "targetAmounts",
|
|
29419
|
+
value: totalTargetAmount,
|
|
29420
|
+
expected: `less than or equal to ${totalBalance}`
|
|
29421
|
+
}
|
|
29422
|
+
);
|
|
29423
|
+
}
|
|
29424
|
+
}
|
|
29425
|
+
if (totalTargetAmount && leaves && leaves.length > 0) {
|
|
29426
|
+
if (totalTargetAmount < leaves.reduce((acc, leaf) => acc + leaf.value, 0)) {
|
|
29088
29427
|
throw new Error("targetAmount is less than the sum of leaves");
|
|
29089
29428
|
}
|
|
29090
29429
|
leavesToSwap = leaves;
|
|
29091
|
-
} else if (
|
|
29092
|
-
leavesToSwap = await this.selectLeavesForSwap(
|
|
29430
|
+
} else if (totalTargetAmount) {
|
|
29431
|
+
leavesToSwap = await this.selectLeavesForSwap(totalTargetAmount);
|
|
29093
29432
|
} else if (leaves && leaves.length > 0) {
|
|
29094
29433
|
leavesToSwap = leaves;
|
|
29095
29434
|
} else {
|
|
@@ -29099,15 +29438,15 @@ var SparkWallet = class _SparkWallet extends import_eventemitter3.EventEmitter {
|
|
|
29099
29438
|
const batches = chunkArray(leavesToSwap, 100);
|
|
29100
29439
|
const results = [];
|
|
29101
29440
|
for (const batch of batches) {
|
|
29102
|
-
const result = await this.processSwapBatch(batch,
|
|
29103
|
-
results.push(...result
|
|
29441
|
+
const result = await this.processSwapBatch(batch, targetAmounts);
|
|
29442
|
+
results.push(...result);
|
|
29104
29443
|
}
|
|
29105
29444
|
return results;
|
|
29106
29445
|
}
|
|
29107
29446
|
/**
|
|
29108
29447
|
* Processes a single batch of leaves for swapping.
|
|
29109
29448
|
*/
|
|
29110
|
-
async processSwapBatch(leavesBatch,
|
|
29449
|
+
async processSwapBatch(leavesBatch, targetAmounts) {
|
|
29111
29450
|
const leafKeyTweaks = await Promise.all(
|
|
29112
29451
|
leavesBatch.map(async (leaf) => ({
|
|
29113
29452
|
leaf,
|
|
@@ -29171,8 +29510,9 @@ var SparkWallet = class _SparkWallet extends import_eventemitter3.EventEmitter {
|
|
|
29171
29510
|
request = await sspClient.requestLeaveSwap({
|
|
29172
29511
|
userLeaves,
|
|
29173
29512
|
adaptorPubkey,
|
|
29174
|
-
targetAmountSats:
|
|
29513
|
+
targetAmountSats: targetAmounts?.reduce((acc, amount) => acc + amount, 0) || leavesBatch.reduce((acc, leaf) => acc + leaf.value, 0),
|
|
29175
29514
|
totalAmountSats: leavesBatch.reduce((acc, leaf) => acc + leaf.value, 0),
|
|
29515
|
+
targetAmountSatsList: targetAmounts,
|
|
29176
29516
|
// TODO: Request fee from SSP
|
|
29177
29517
|
feeSats: 0,
|
|
29178
29518
|
idempotencyKey: (0, import_uuidv75.uuidv7)()
|
|
@@ -29228,11 +29568,21 @@ var SparkWallet = class _SparkWallet extends import_eventemitter3.EventEmitter {
|
|
|
29228
29568
|
userOutboundTransferExternalId: transfer.id,
|
|
29229
29569
|
leavesSwapRequestId: request.id
|
|
29230
29570
|
});
|
|
29231
|
-
if (!completeResponse) {
|
|
29571
|
+
if (!completeResponse || !completeResponse.inboundTransfer?.sparkId) {
|
|
29232
29572
|
throw new Error("Failed to complete leaves swap");
|
|
29233
29573
|
}
|
|
29234
|
-
await this.
|
|
29235
|
-
|
|
29574
|
+
const incomingTransfer = await this.transferService.queryTransfer(
|
|
29575
|
+
completeResponse.inboundTransfer.sparkId
|
|
29576
|
+
);
|
|
29577
|
+
if (!incomingTransfer) {
|
|
29578
|
+
throw new Error("Failed to get incoming transfer");
|
|
29579
|
+
}
|
|
29580
|
+
return await this.claimTransfer({
|
|
29581
|
+
transfer: incomingTransfer,
|
|
29582
|
+
emit: false,
|
|
29583
|
+
retryCount: 0,
|
|
29584
|
+
optimize: false
|
|
29585
|
+
});
|
|
29236
29586
|
} catch (e) {
|
|
29237
29587
|
await this.cancelAllSenderInitiatedTransfers();
|
|
29238
29588
|
throw new Error(`Failed to request leaves swap: ${e}`);
|
|
@@ -29769,13 +30119,45 @@ var SparkWallet = class _SparkWallet extends import_eventemitter3.EventEmitter {
|
|
|
29769
30119
|
* @returns {Promise<string[]>} The unused deposit addresses
|
|
29770
30120
|
*/
|
|
29771
30121
|
async getUnusedDepositAddresses() {
|
|
30122
|
+
return (await this.queryAllUnusedDepositAddresses({})).map(
|
|
30123
|
+
(addr) => addr.depositAddress
|
|
30124
|
+
);
|
|
30125
|
+
}
|
|
30126
|
+
/**
|
|
30127
|
+
* Gets all unused deposit addresses for the wallet.
|
|
30128
|
+
*
|
|
30129
|
+
* @param {Object} params - Parameters for querying unused deposit addresses
|
|
30130
|
+
* @param {Uint8Array<ArrayBufferLike>} [params.identityPublicKey] - The identity public key
|
|
30131
|
+
* @param {NetworkProto} [params.network] - The network
|
|
30132
|
+
* @returns {Promise<DepositAddressQueryResult[]>} The unused deposit addresses
|
|
30133
|
+
*/
|
|
30134
|
+
async queryAllUnusedDepositAddresses({
|
|
30135
|
+
identityPublicKey,
|
|
30136
|
+
network
|
|
30137
|
+
}) {
|
|
29772
30138
|
const sparkClient = await this.connectionManager.createSparkClient(
|
|
29773
30139
|
this.config.getCoordinatorAddress()
|
|
29774
30140
|
);
|
|
29775
|
-
|
|
29776
|
-
|
|
29777
|
-
|
|
29778
|
-
|
|
30141
|
+
let limit = 100;
|
|
30142
|
+
let offset = 0;
|
|
30143
|
+
const pastOffsets = /* @__PURE__ */ new Set();
|
|
30144
|
+
const depositAddresses = [];
|
|
30145
|
+
while (offset >= 0) {
|
|
30146
|
+
if (pastOffsets.has(offset)) {
|
|
30147
|
+
console.warn("Offset has already been seen, stopping");
|
|
30148
|
+
break;
|
|
30149
|
+
}
|
|
30150
|
+
const response = await sparkClient.query_unused_deposit_addresses({
|
|
30151
|
+
identityPublicKey: identityPublicKey ?? await this.config.signer.getIdentityPublicKey(),
|
|
30152
|
+
network: network ?? NetworkToProto[this.config.getNetwork()],
|
|
30153
|
+
limit,
|
|
30154
|
+
offset
|
|
30155
|
+
});
|
|
30156
|
+
depositAddresses.push(...response.depositAddresses);
|
|
30157
|
+
pastOffsets.add(offset);
|
|
30158
|
+
offset = response.offset;
|
|
30159
|
+
}
|
|
30160
|
+
return depositAddresses;
|
|
29779
30161
|
}
|
|
29780
30162
|
/**
|
|
29781
30163
|
* Claims a deposit to the wallet.
|
|
@@ -29824,14 +30206,11 @@ var SparkWallet = class _SparkWallet extends import_eventemitter3.EventEmitter {
|
|
|
29824
30206
|
});
|
|
29825
30207
|
}
|
|
29826
30208
|
const depositTx = getTxFromRawTxHex(txHex);
|
|
29827
|
-
const sparkClient = await this.connectionManager.createSparkClient(
|
|
29828
|
-
this.config.getCoordinatorAddress()
|
|
29829
|
-
);
|
|
29830
30209
|
const unusedDepositAddresses = new Map(
|
|
29831
|
-
(await
|
|
30210
|
+
(await this.queryAllUnusedDepositAddresses({
|
|
29832
30211
|
identityPublicKey: await this.config.signer.getIdentityPublicKey(),
|
|
29833
30212
|
network: NetworkToProto[this.config.getNetwork()]
|
|
29834
|
-
})).
|
|
30213
|
+
})).map((addr) => [addr.depositAddress, addr])
|
|
29835
30214
|
);
|
|
29836
30215
|
let depositAddress;
|
|
29837
30216
|
let vout = 0;
|
|
@@ -29885,14 +30264,11 @@ var SparkWallet = class _SparkWallet extends import_eventemitter3.EventEmitter {
|
|
|
29885
30264
|
*/
|
|
29886
30265
|
async advancedDeposit(txHex) {
|
|
29887
30266
|
const depositTx = getTxFromRawTxHex(txHex);
|
|
29888
|
-
const sparkClient = await this.connectionManager.createSparkClient(
|
|
29889
|
-
this.config.getCoordinatorAddress()
|
|
29890
|
-
);
|
|
29891
30267
|
const unusedDepositAddresses = new Map(
|
|
29892
|
-
(await
|
|
30268
|
+
(await this.queryAllUnusedDepositAddresses({
|
|
29893
30269
|
identityPublicKey: await this.config.signer.getIdentityPublicKey(),
|
|
29894
30270
|
network: NetworkToProto[this.config.getNetwork()]
|
|
29895
|
-
})).
|
|
30271
|
+
})).map((addr) => [addr.depositAddress, addr])
|
|
29896
30272
|
);
|
|
29897
30273
|
let vout = 0;
|
|
29898
30274
|
const responses = [];
|
|
@@ -29996,7 +30372,9 @@ var SparkWallet = class _SparkWallet extends import_eventemitter3.EventEmitter {
|
|
|
29996
30372
|
(0, import_utils23.hexToBytes)(receiverAddress.identityPublicKey)
|
|
29997
30373
|
);
|
|
29998
30374
|
return await this.withLeaves(async () => {
|
|
29999
|
-
let leavesToSend = await this.selectLeaves(amountSats)
|
|
30375
|
+
let leavesToSend = (await this.selectLeaves([amountSats])).get(
|
|
30376
|
+
amountSats
|
|
30377
|
+
);
|
|
30000
30378
|
leavesToSend = await this.checkRefreshTimelockNodes(leavesToSend);
|
|
30001
30379
|
leavesToSend = await this.checkExtendTimeLockNodes(leavesToSend);
|
|
30002
30380
|
const leafKeyTweaks = await Promise.all(
|
|
@@ -30239,7 +30617,7 @@ var SparkWallet = class _SparkWallet extends import_eventemitter3.EventEmitter {
|
|
|
30239
30617
|
if (type && transfer.type !== type) {
|
|
30240
30618
|
continue;
|
|
30241
30619
|
}
|
|
30242
|
-
if (transfer.status !== 2 /* TRANSFER_STATUS_SENDER_KEY_TWEAKED */ && transfer.status !== 3 /* TRANSFER_STATUS_RECEIVER_KEY_TWEAKED */ && transfer.status !== 4 /*
|
|
30620
|
+
if (transfer.status !== 2 /* TRANSFER_STATUS_SENDER_KEY_TWEAKED */ && transfer.status !== 3 /* TRANSFER_STATUS_RECEIVER_KEY_TWEAKED */ && transfer.status !== 4 /* TRANSFER_STATUS_RECEIVER_REFUND_SIGNED */ && transfer.status !== 10 /* TRANSFER_STATUS_RECEIVER_KEY_TWEAK_APPLIED */) {
|
|
30243
30621
|
continue;
|
|
30244
30622
|
}
|
|
30245
30623
|
promises.push(
|
|
@@ -30498,7 +30876,7 @@ var SparkWallet = class _SparkWallet extends import_eventemitter3.EventEmitter {
|
|
|
30498
30876
|
expected: `${totalAmount} sats`
|
|
30499
30877
|
});
|
|
30500
30878
|
}
|
|
30501
|
-
let leaves = await this.selectLeaves(totalAmount);
|
|
30879
|
+
let leaves = (await this.selectLeaves([totalAmount])).get(totalAmount);
|
|
30502
30880
|
leaves = await this.checkRefreshTimelockNodes(leaves);
|
|
30503
30881
|
leaves = await this.checkExtendTimeLockNodes(leaves);
|
|
30504
30882
|
const leavesToSend = await Promise.all(
|
|
@@ -30608,13 +30986,18 @@ var SparkWallet = class _SparkWallet extends import_eventemitter3.EventEmitter {
|
|
|
30608
30986
|
*
|
|
30609
30987
|
* @param {Object} params - Parameters for the withdrawal
|
|
30610
30988
|
* @param {string} params.onchainAddress - The Bitcoin address where the funds should be sent
|
|
30611
|
-
* @param {
|
|
30989
|
+
* @param {CoopExitFeeQuote} params.feeQuote - The fee quote for the withdrawal
|
|
30990
|
+
* @param {ExitSpeed} params.exitSpeed - The exit speed chosen for the withdrawal
|
|
30991
|
+
* @param {number} [params.amountSats] - The amount in satoshis to withdraw. If not specified, attempts to withdraw all available funds and deductFeeFromWithdrawalAmount is set to true.
|
|
30992
|
+
* @param {boolean} [params.deductFeeFromWithdrawalAmount] - Controls how the withdrawal fee is handled. If true, the fee is deducted from the withdrawal amount (amountSats), meaning the recipient will receive amountSats minus the fee. If false, the fee is paid separately from the wallet balance, meaning the recipient will receive the full amountSats.
|
|
30612
30993
|
* @returns {Promise<CoopExitRequest | null | undefined>} The withdrawal request details, or null/undefined if the request cannot be completed
|
|
30613
30994
|
*/
|
|
30614
30995
|
async withdraw({
|
|
30615
30996
|
onchainAddress,
|
|
30616
30997
|
exitSpeed,
|
|
30617
|
-
|
|
30998
|
+
feeQuote,
|
|
30999
|
+
amountSats,
|
|
31000
|
+
deductFeeFromWithdrawalAmount = true
|
|
30618
31001
|
}) {
|
|
30619
31002
|
if (!Number.isSafeInteger(amountSats)) {
|
|
30620
31003
|
throw new ValidationError("Sats amount must be less than 2^53", {
|
|
@@ -30624,7 +31007,13 @@ var SparkWallet = class _SparkWallet extends import_eventemitter3.EventEmitter {
|
|
|
30624
31007
|
});
|
|
30625
31008
|
}
|
|
30626
31009
|
return await this.withLeaves(async () => {
|
|
30627
|
-
return await this.coopExit(
|
|
31010
|
+
return await this.coopExit(
|
|
31011
|
+
onchainAddress,
|
|
31012
|
+
feeQuote,
|
|
31013
|
+
exitSpeed,
|
|
31014
|
+
deductFeeFromWithdrawalAmount,
|
|
31015
|
+
amountSats
|
|
31016
|
+
);
|
|
30628
31017
|
});
|
|
30629
31018
|
}
|
|
30630
31019
|
/**
|
|
@@ -30635,7 +31024,7 @@ var SparkWallet = class _SparkWallet extends import_eventemitter3.EventEmitter {
|
|
|
30635
31024
|
* @returns {Promise<Object | null | undefined>} The exit request details
|
|
30636
31025
|
* @private
|
|
30637
31026
|
*/
|
|
30638
|
-
async coopExit(onchainAddress, exitSpeed, targetAmountSats) {
|
|
31027
|
+
async coopExit(onchainAddress, feeEstimate, exitSpeed, deductFeeFromWithdrawalAmount, targetAmountSats) {
|
|
30639
31028
|
if (!Number.isSafeInteger(targetAmountSats)) {
|
|
30640
31029
|
throw new ValidationError("Sats amount must be less than 2^53", {
|
|
30641
31030
|
field: "targetAmountSats",
|
|
@@ -30643,41 +31032,34 @@ var SparkWallet = class _SparkWallet extends import_eventemitter3.EventEmitter {
|
|
|
30643
31032
|
expected: "smaller or equal to " + Number.MAX_SAFE_INTEGER
|
|
30644
31033
|
});
|
|
30645
31034
|
}
|
|
30646
|
-
|
|
30647
|
-
|
|
30648
|
-
leavesToSend = await this.selectLeaves(targetAmountSats);
|
|
30649
|
-
} else {
|
|
30650
|
-
leavesToSend = this.leaves.map((leaf) => ({
|
|
30651
|
-
...leaf
|
|
30652
|
-
}));
|
|
31035
|
+
if (!targetAmountSats) {
|
|
31036
|
+
deductFeeFromWithdrawalAmount = true;
|
|
30653
31037
|
}
|
|
30654
|
-
|
|
30655
|
-
|
|
30656
|
-
|
|
30657
|
-
|
|
30658
|
-
|
|
30659
|
-
|
|
30660
|
-
|
|
30661
|
-
|
|
30662
|
-
|
|
30663
|
-
|
|
30664
|
-
|
|
30665
|
-
|
|
30666
|
-
|
|
30667
|
-
|
|
30668
|
-
|
|
30669
|
-
|
|
30670
|
-
|
|
30671
|
-
|
|
30672
|
-
|
|
30673
|
-
|
|
30674
|
-
|
|
30675
|
-
|
|
30676
|
-
|
|
30677
|
-
}
|
|
30678
|
-
if (fee !== void 0 && fee > leavesToSend.reduce((acc, leaf) => acc + leaf.value, 0)) {
|
|
31038
|
+
let fee;
|
|
31039
|
+
switch (exitSpeed) {
|
|
31040
|
+
case ExitSpeed_default.FAST:
|
|
31041
|
+
fee = (feeEstimate.l1BroadcastFeeFast?.originalValue || 0) + (feeEstimate.userFeeFast?.originalValue || 0);
|
|
31042
|
+
break;
|
|
31043
|
+
case ExitSpeed_default.MEDIUM:
|
|
31044
|
+
fee = (feeEstimate.l1BroadcastFeeMedium?.originalValue || 0) + (feeEstimate.userFeeMedium?.originalValue || 0);
|
|
31045
|
+
break;
|
|
31046
|
+
case ExitSpeed_default.SLOW:
|
|
31047
|
+
fee = (feeEstimate.l1BroadcastFeeSlow?.originalValue || 0) + (feeEstimate.userFeeSlow?.originalValue || 0);
|
|
31048
|
+
break;
|
|
31049
|
+
default:
|
|
31050
|
+
throw new ValidationError("Invalid exit speed", {
|
|
31051
|
+
field: "exitSpeed",
|
|
31052
|
+
value: exitSpeed,
|
|
31053
|
+
expected: "FAST, MEDIUM, or SLOW"
|
|
31054
|
+
});
|
|
31055
|
+
}
|
|
31056
|
+
let leavesToSendToSsp = [];
|
|
31057
|
+
let leavesToSendToSE = [];
|
|
31058
|
+
if (deductFeeFromWithdrawalAmount) {
|
|
31059
|
+
leavesToSendToSsp = targetAmountSats ? (await this.selectLeaves([targetAmountSats])).get(targetAmountSats) : this.leaves;
|
|
31060
|
+
if (fee > leavesToSendToSsp.reduce((acc, leaf) => acc + leaf.value, 0)) {
|
|
30679
31061
|
throw new ValidationError(
|
|
30680
|
-
"The fee for the withdrawal is greater than the target amount",
|
|
31062
|
+
"The fee for the withdrawal is greater than the target withdrawal amount",
|
|
30681
31063
|
{
|
|
30682
31064
|
field: "fee",
|
|
30683
31065
|
value: fee,
|
|
@@ -30685,11 +31067,32 @@ var SparkWallet = class _SparkWallet extends import_eventemitter3.EventEmitter {
|
|
|
30685
31067
|
}
|
|
30686
31068
|
);
|
|
30687
31069
|
}
|
|
31070
|
+
} else {
|
|
31071
|
+
if (!targetAmountSats) {
|
|
31072
|
+
throw new ValidationError(
|
|
31073
|
+
"targetAmountSats is required when deductFeeFromWithdrawalAmount is false",
|
|
31074
|
+
{
|
|
31075
|
+
field: "targetAmountSats",
|
|
31076
|
+
value: targetAmountSats,
|
|
31077
|
+
expected: "defined when deductFeeFromWithdrawalAmount is false"
|
|
31078
|
+
}
|
|
31079
|
+
);
|
|
31080
|
+
}
|
|
31081
|
+
const leaves = await this.selectLeaves([targetAmountSats, fee]);
|
|
31082
|
+
const leavesForTargetAmount = leaves.get(targetAmountSats);
|
|
31083
|
+
const leavesForFee = leaves.get(fee);
|
|
31084
|
+
if (!leavesForTargetAmount || !leavesForFee) {
|
|
31085
|
+
throw new Error("Failed to select leaves for target amount and fee");
|
|
31086
|
+
}
|
|
31087
|
+
leavesToSendToSsp = leavesForTargetAmount;
|
|
31088
|
+
leavesToSendToSE = leavesForFee;
|
|
30688
31089
|
}
|
|
30689
|
-
|
|
30690
|
-
|
|
31090
|
+
leavesToSendToSsp = await this.checkRefreshTimelockNodes(leavesToSendToSsp);
|
|
31091
|
+
leavesToSendToSsp = await this.checkExtendTimeLockNodes(leavesToSendToSsp);
|
|
31092
|
+
leavesToSendToSE = await this.checkRefreshTimelockNodes(leavesToSendToSE);
|
|
31093
|
+
leavesToSendToSE = await this.checkExtendTimeLockNodes(leavesToSendToSE);
|
|
30691
31094
|
const leafKeyTweaks = await Promise.all(
|
|
30692
|
-
|
|
31095
|
+
[...leavesToSendToSE, ...leavesToSendToSsp].map(async (leaf) => ({
|
|
30693
31096
|
leaf,
|
|
30694
31097
|
signingPubKey: await this.config.signer.generatePublicKey(
|
|
30695
31098
|
(0, import_sha213.sha256)(leaf.id)
|
|
@@ -30697,13 +31100,23 @@ var SparkWallet = class _SparkWallet extends import_eventemitter3.EventEmitter {
|
|
|
30697
31100
|
newSigningPubKey: await this.config.signer.generatePublicKey()
|
|
30698
31101
|
}))
|
|
30699
31102
|
);
|
|
30700
|
-
const
|
|
30701
|
-
leafExternalIds:
|
|
31103
|
+
const requestCoopExitParams = {
|
|
31104
|
+
leafExternalIds: leavesToSendToSsp.map((leaf) => leaf.id),
|
|
30702
31105
|
withdrawalAddress: onchainAddress,
|
|
30703
31106
|
idempotencyKey: (0, import_uuidv75.uuidv7)(),
|
|
30704
31107
|
exitSpeed,
|
|
30705
|
-
withdrawAll:
|
|
30706
|
-
}
|
|
31108
|
+
withdrawAll: deductFeeFromWithdrawalAmount
|
|
31109
|
+
};
|
|
31110
|
+
if (!deductFeeFromWithdrawalAmount) {
|
|
31111
|
+
requestCoopExitParams.feeQuoteId = feeEstimate.id;
|
|
31112
|
+
requestCoopExitParams.feeLeafExternalIds = leavesToSendToSE.map(
|
|
31113
|
+
(leaf) => leaf.id
|
|
31114
|
+
);
|
|
31115
|
+
}
|
|
31116
|
+
const sspClient = this.getSspClient();
|
|
31117
|
+
const coopExitRequest = await sspClient.requestCoopExit(
|
|
31118
|
+
requestCoopExitParams
|
|
31119
|
+
);
|
|
30707
31120
|
if (!coopExitRequest?.rawConnectorTransaction) {
|
|
30708
31121
|
throw new Error("Failed to request coop exit");
|
|
30709
31122
|
}
|
|
@@ -30741,9 +31154,9 @@ var SparkWallet = class _SparkWallet extends import_eventemitter3.EventEmitter {
|
|
|
30741
31154
|
* @param {Object} params - Input parameters for fee estimation
|
|
30742
31155
|
* @param {number} params.amountSats - The amount in satoshis to withdraw
|
|
30743
31156
|
* @param {string} params.withdrawalAddress - The Bitcoin address where the funds should be sent
|
|
30744
|
-
* @returns {Promise<
|
|
31157
|
+
* @returns {Promise<CoopExitFeeQuote | null>} Fee estimate for the withdrawal
|
|
30745
31158
|
*/
|
|
30746
|
-
async
|
|
31159
|
+
async getWithdrawalFeeQuote({
|
|
30747
31160
|
amountSats,
|
|
30748
31161
|
withdrawalAddress
|
|
30749
31162
|
}) {
|
|
@@ -30755,10 +31168,10 @@ var SparkWallet = class _SparkWallet extends import_eventemitter3.EventEmitter {
|
|
|
30755
31168
|
expected: "smaller or equal to " + Number.MAX_SAFE_INTEGER
|
|
30756
31169
|
});
|
|
30757
31170
|
}
|
|
30758
|
-
let leaves = await this.selectLeaves(amountSats);
|
|
31171
|
+
let leaves = (await this.selectLeaves([amountSats])).get(amountSats);
|
|
30759
31172
|
leaves = await this.checkRefreshTimelockNodes(leaves);
|
|
30760
31173
|
leaves = await this.checkExtendTimeLockNodes(leaves);
|
|
30761
|
-
const feeEstimate = await sspClient.
|
|
31174
|
+
const feeEstimate = await sspClient.getCoopExitFeeQuote({
|
|
30762
31175
|
leafExternalIds: leaves.map((leaf) => leaf.id),
|
|
30763
31176
|
withdrawalAddress
|
|
30764
31177
|
});
|
|
@@ -31482,9 +31895,9 @@ var SparkWallet2 = class extends SparkWallet {
|
|
|
31482
31895
|
"SparkWallet.withdraw",
|
|
31483
31896
|
this.withdraw.bind(this)
|
|
31484
31897
|
);
|
|
31485
|
-
this.
|
|
31486
|
-
"SparkWallet.
|
|
31487
|
-
this.
|
|
31898
|
+
this.getWithdrawalFeeQuote = this.wrapWithOtelSpan(
|
|
31899
|
+
"SparkWallet.getWithdrawalFeeQuote",
|
|
31900
|
+
this.getWithdrawalFeeQuote.bind(this)
|
|
31488
31901
|
);
|
|
31489
31902
|
}
|
|
31490
31903
|
async initWallet(mnemonicOrSeed, accountNumber) {
|