@buildonspark/spark-sdk 0.2.4 → 0.2.5

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.
Files changed (60) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/{chunk-3SEOTO43.js → chunk-3SPMJMUX.js} +3 -2
  3. package/dist/{chunk-WAQKYSDI.js → chunk-CQY5ML2A.js} +3 -2
  4. package/dist/{chunk-TVUMSHWA.js → chunk-LQZL2D3Y.js} +1 -1
  5. package/dist/{chunk-W4ZRBSWM.js → chunk-U7LRIWTF.js} +174 -45
  6. package/dist/{client-KhNkrXz4.d.cts → client-C88GCTPB.d.cts} +199 -104
  7. package/dist/{client-BF4cn8F4.d.ts → client-Dg6vS_2I.d.ts} +199 -104
  8. package/dist/debug.cjs +231 -71
  9. package/dist/debug.d.cts +6 -6
  10. package/dist/debug.d.ts +6 -6
  11. package/dist/debug.js +3 -3
  12. package/dist/graphql/objects/index.d.cts +6 -51
  13. package/dist/graphql/objects/index.d.ts +6 -51
  14. package/dist/graphql/objects/index.js +1 -1
  15. package/dist/index.cjs +208 -45
  16. package/dist/index.d.cts +5 -6
  17. package/dist/index.d.ts +5 -6
  18. package/dist/index.js +6 -4
  19. package/dist/index.node.cjs +208 -45
  20. package/dist/index.node.d.cts +5 -6
  21. package/dist/index.node.d.ts +5 -6
  22. package/dist/index.node.js +5 -3
  23. package/dist/native/index.cjs +208 -45
  24. package/dist/native/index.d.cts +217 -147
  25. package/dist/native/index.d.ts +217 -147
  26. package/dist/native/index.js +209 -45
  27. package/dist/proto/lrc20.d.cts +1 -1
  28. package/dist/proto/lrc20.d.ts +1 -1
  29. package/dist/proto/spark.d.cts +1 -1
  30. package/dist/proto/spark.d.ts +1 -1
  31. package/dist/proto/spark_token.d.cts +1 -1
  32. package/dist/proto/spark_token.d.ts +1 -1
  33. package/dist/{spark-B_7nZx6T.d.cts → spark-ESAfZARg.d.cts} +1 -1
  34. package/dist/{spark-B_7nZx6T.d.ts → spark-ESAfZARg.d.ts} +1 -1
  35. package/dist/{spark-wallet-C1Tr_VKI.d.ts → spark-wallet-B2WwKN8W.d.ts} +27 -11
  36. package/dist/{spark-wallet-DG3x2obf.d.cts → spark-wallet-Di65w0Us.d.cts} +27 -11
  37. package/dist/{spark-wallet.node-CN9LoB_O.d.cts → spark-wallet.node-7R0Rxyj9.d.cts} +1 -1
  38. package/dist/{spark-wallet.node-CGxoeCpH.d.ts → spark-wallet.node-CSPWOWRu.d.ts} +1 -1
  39. package/dist/tests/test-utils.cjs +9 -5
  40. package/dist/tests/test-utils.d.cts +4 -5
  41. package/dist/tests/test-utils.d.ts +4 -5
  42. package/dist/tests/test-utils.js +4 -4
  43. package/dist/types/index.cjs +3 -2
  44. package/dist/types/index.d.cts +3 -4
  45. package/dist/types/index.d.ts +3 -4
  46. package/dist/types/index.js +2 -2
  47. package/dist/{xchain-address-BHu6CpZC.d.ts → xchain-address-BsveIy5l.d.ts} +5 -4
  48. package/dist/{xchain-address-HBr6isnc.d.cts → xchain-address-CqRu3F21.d.cts} +5 -4
  49. package/package.json +1 -1
  50. package/src/graphql/client.ts +49 -8
  51. package/src/graphql/objects/SparkWalletUser.ts +1 -1
  52. package/src/graphql/queries/Transfers.ts +15 -0
  53. package/src/spark-wallet/spark-wallet.ts +156 -39
  54. package/src/tests/integration/ssp/static_deposit.test.ts +83 -1
  55. package/src/tests/integration/ssp/transfers.test.ts +97 -0
  56. package/src/types/sdk-types.ts +15 -0
  57. package/src/utils/bitcoin.ts +13 -0
  58. package/dist/sdk-types-CB9HrW5O.d.cts +0 -44
  59. package/dist/sdk-types-CkRNraXT.d.ts +0 -44
  60. package/src/graphql/queries/Transfer.ts +0 -10
package/dist/debug.cjs CHANGED
@@ -1411,7 +1411,7 @@ var ConfigurationError = class extends SparkSDKError {
1411
1411
 
1412
1412
  // src/graphql/client.ts
1413
1413
  init_buffer();
1414
- var import_core7 = require("@lightsparkdev/core");
1414
+ var import_core8 = require("@lightsparkdev/core");
1415
1415
  var import_sha2 = require("@noble/hashes/sha2");
1416
1416
 
1417
1417
  // src/errors/index.ts
@@ -2318,6 +2318,47 @@ var VerifyChallenge = `
2318
2318
  ${FRAGMENT8}
2319
2319
  `;
2320
2320
 
2321
+ // src/graphql/objects/ClaimStaticDeposit.ts
2322
+ init_buffer();
2323
+ var import_core5 = require("@lightsparkdev/core");
2324
+
2325
+ // src/graphql/objects/ClaimStaticDepositStatus.ts
2326
+ init_buffer();
2327
+ var ClaimStaticDepositStatus = /* @__PURE__ */ ((ClaimStaticDepositStatus2) => {
2328
+ ClaimStaticDepositStatus2["FUTURE_VALUE"] = "FUTURE_VALUE";
2329
+ ClaimStaticDepositStatus2["CREATED"] = "CREATED";
2330
+ ClaimStaticDepositStatus2["TRANSFER_CREATED"] = "TRANSFER_CREATED";
2331
+ ClaimStaticDepositStatus2["TRANSFER_CREATION_FAILED"] = "TRANSFER_CREATION_FAILED";
2332
+ ClaimStaticDepositStatus2["REFUND_SIGNING_COMMITMENTS_QUERYING_FAILED"] = "REFUND_SIGNING_COMMITMENTS_QUERYING_FAILED";
2333
+ ClaimStaticDepositStatus2["REFUND_SIGNING_FAILED"] = "REFUND_SIGNING_FAILED";
2334
+ ClaimStaticDepositStatus2["UTXO_SWAPPING_FAILED"] = "UTXO_SWAPPING_FAILED";
2335
+ ClaimStaticDepositStatus2["TRANSFER_COMPLETED"] = "TRANSFER_COMPLETED";
2336
+ ClaimStaticDepositStatus2["SPEND_TX_CREATED"] = "SPEND_TX_CREATED";
2337
+ ClaimStaticDepositStatus2["SPEND_TX_BROADCAST"] = "SPEND_TX_BROADCAST";
2338
+ return ClaimStaticDepositStatus2;
2339
+ })(ClaimStaticDepositStatus || {});
2340
+ var ClaimStaticDepositStatus_default = ClaimStaticDepositStatus;
2341
+
2342
+ // src/graphql/objects/ClaimStaticDeposit.ts
2343
+ var ClaimStaticDepositFromJson = (obj) => {
2344
+ return {
2345
+ id: obj["claim_static_deposit_id"],
2346
+ createdAt: obj["claim_static_deposit_created_at"],
2347
+ updatedAt: obj["claim_static_deposit_updated_at"],
2348
+ network: BitcoinNetwork_default[obj["claim_static_deposit_network"]] ?? BitcoinNetwork_default.FUTURE_VALUE,
2349
+ creditAmount: CurrencyAmountFromJson(
2350
+ obj["claim_static_deposit_credit_amount"]
2351
+ ),
2352
+ maxFee: CurrencyAmountFromJson(obj["claim_static_deposit_max_fee"]),
2353
+ status: ClaimStaticDepositStatus_default[obj["claim_static_deposit_status"]] ?? ClaimStaticDepositStatus_default.FUTURE_VALUE,
2354
+ transactionId: obj["claim_static_deposit_transaction_id"],
2355
+ outputIndex: obj["claim_static_deposit_output_index"],
2356
+ bitcoinNetwork: BitcoinNetwork_default[obj["claim_static_deposit_bitcoin_network"]] ?? BitcoinNetwork_default.FUTURE_VALUE,
2357
+ typename: "ClaimStaticDeposit",
2358
+ transferSparkId: obj["claim_static_deposit_transfer_spark_id"]
2359
+ };
2360
+ };
2361
+
2321
2362
  // src/graphql/objects/ClaimStaticDepositRequestType.ts
2322
2363
  init_buffer();
2323
2364
  var ClaimStaticDepositRequestType = /* @__PURE__ */ ((ClaimStaticDepositRequestType2) => {
@@ -2412,7 +2453,7 @@ fragment CoopExitFeeEstimatesOutputFragment on CoopExitFeeEstimatesOutput {
2412
2453
 
2413
2454
  // src/graphql/objects/CoopExitFeeQuote.ts
2414
2455
  init_buffer();
2415
- var import_core5 = require("@lightsparkdev/core");
2456
+ var import_core6 = require("@lightsparkdev/core");
2416
2457
  var CoopExitFeeQuoteFromJson = (obj) => {
2417
2458
  return {
2418
2459
  id: obj["coop_exit_fee_quote_id"],
@@ -2668,28 +2709,12 @@ var LightningSendFeeEstimate = `
2668
2709
  ${FRAGMENT12}
2669
2710
  `;
2670
2711
 
2671
- // src/graphql/queries/Transfer.ts
2672
- init_buffer();
2673
- var GetTransfer = `
2674
- query Transfer($transfer_spark_id: UUID!) {
2675
- transfer(transfer_spark_id: $transfer_spark_id) {
2676
- ...TransferFragment
2677
- }
2678
- }
2679
- ${FRAGMENT2}
2680
- `;
2681
-
2682
- // src/graphql/queries/UserRequest.ts
2712
+ // src/graphql/queries/Transfers.ts
2683
2713
  init_buffer();
2684
2714
 
2685
2715
  // src/graphql/objects/UserRequest.ts
2686
2716
  init_buffer();
2687
- var import_core6 = require("@lightsparkdev/core");
2688
-
2689
- // src/graphql/objects/ClaimStaticDepositStatus.ts
2690
- init_buffer();
2691
-
2692
- // src/graphql/objects/UserRequest.ts
2717
+ var import_core7 = require("@lightsparkdev/core");
2693
2718
  var FRAGMENT14 = `
2694
2719
  fragment UserRequestFragment on UserRequest {
2695
2720
  __typename
@@ -2919,7 +2944,22 @@ fragment UserRequestFragment on UserRequest {
2919
2944
  }
2920
2945
  }`;
2921
2946
 
2947
+ // src/graphql/queries/Transfers.ts
2948
+ var GetTransfers = `
2949
+ query Transfers($transfer_spark_ids: [UUID!]!) {
2950
+ transfers(transfer_spark_ids: $transfer_spark_ids) {
2951
+ ...TransferFragment
2952
+ transfer_user_request: user_request {
2953
+ ...UserRequestFragment
2954
+ }
2955
+ }
2956
+ }
2957
+ ${FRAGMENT2}
2958
+ ${FRAGMENT14}
2959
+ `;
2960
+
2922
2961
  // src/graphql/queries/UserRequest.ts
2962
+ init_buffer();
2923
2963
  var UserRequest2 = `
2924
2964
  query UserRequest($request_id: ID!) {
2925
2965
  user_request(request_id: $request_id) {
@@ -2940,13 +2980,13 @@ var SspClient = class {
2940
2980
  this.authProvider = new SparkAuthProvider();
2941
2981
  const fetchFunction = typeof window !== "undefined" ? window.fetch.bind(window) : fetch;
2942
2982
  const options = config.sspClientOptions;
2943
- this.requester = new import_core7.Requester(
2944
- new import_core7.NodeKeyCache(import_core7.DefaultCrypto),
2983
+ this.requester = new import_core8.Requester(
2984
+ new import_core8.NodeKeyCache(import_core8.DefaultCrypto),
2945
2985
  options.schemaEndpoint || `graphql/spark/2025-03-19`,
2946
2986
  `spark-sdk/0.0.0`,
2947
2987
  this.authProvider,
2948
2988
  options.baseUrl,
2949
- import_core7.DefaultCrypto,
2989
+ import_core8.DefaultCrypto,
2950
2990
  void 0,
2951
2991
  fetchFunction
2952
2992
  );
@@ -3272,14 +3312,47 @@ var SspClient = class {
3272
3312
  }
3273
3313
  });
3274
3314
  }
3275
- async getTransfer(id) {
3315
+ async getTransfers(ids) {
3276
3316
  return await this.executeRawQuery({
3277
- queryPayload: GetTransfer,
3317
+ queryPayload: GetTransfers,
3278
3318
  variables: {
3279
- transfer_spark_id: id
3319
+ transfer_spark_ids: ids
3280
3320
  },
3281
3321
  constructObject: (response) => {
3282
- return TransferFromJson(response.transfer);
3322
+ return response.transfers.map((transfer) => {
3323
+ const transferObj = TransferFromJson(
3324
+ transfer
3325
+ );
3326
+ switch (transfer.transfer_user_request.__typename) {
3327
+ case "ClaimStaticDeposit":
3328
+ transferObj.userRequest = ClaimStaticDepositFromJson(
3329
+ transfer.transfer_user_request
3330
+ );
3331
+ break;
3332
+ case "CoopExitRequest":
3333
+ transferObj.userRequest = CoopExitRequestFromJson(
3334
+ transfer.transfer_user_request
3335
+ );
3336
+ break;
3337
+ case "LeavesSwapRequest":
3338
+ transferObj.userRequest = LeavesSwapRequestFromJson(
3339
+ transfer.transfer_user_request
3340
+ );
3341
+ break;
3342
+ case "LightningReceiveRequest":
3343
+ transferObj.userRequest = LightningReceiveRequestFromJson(
3344
+ transfer.transfer_user_request
3345
+ );
3346
+ break;
3347
+ case "LightningSendRequest":
3348
+ transferObj.userRequest = LightningSendRequestFromJson(
3349
+ transfer.transfer_user_request
3350
+ );
3351
+ break;
3352
+ }
3353
+ const { userRequestId, ...rest } = transferObj;
3354
+ return rest;
3355
+ });
3283
3356
  }
3284
3357
  });
3285
3358
  }
@@ -3288,7 +3361,7 @@ var SspClient = class {
3288
3361
  {
3289
3362
  queryPayload: GetChallenge,
3290
3363
  variables: {
3291
- public_key: (0, import_core7.bytesToHex)(await this.signer.getIdentityPublicKey())
3364
+ public_key: (0, import_core8.bytesToHex)(await this.signer.getIdentityPublicKey())
3292
3365
  },
3293
3366
  constructObject: (response) => {
3294
3367
  return GetChallengeOutputFromJson(response.get_challenge);
@@ -3304,7 +3377,7 @@ var SspClient = class {
3304
3377
  variables: {
3305
3378
  protected_challenge: protectedChallenge,
3306
3379
  signature,
3307
- identity_public_key: (0, import_core7.bytesToHex)(
3380
+ identity_public_key: (0, import_core8.bytesToHex)(
3308
3381
  await this.signer.getIdentityPublicKey()
3309
3382
  )
3310
3383
  },
@@ -3349,7 +3422,7 @@ var SspClient = class {
3349
3422
  );
3350
3423
  return;
3351
3424
  } catch (err) {
3352
- if ((0, import_core7.isError)(err) && err.message.toLowerCase().includes("challenge expired")) {
3425
+ if ((0, import_core8.isError)(err) && err.message.toLowerCase().includes("challenge expired")) {
3353
3426
  lastErr = err;
3354
3427
  continue;
3355
3428
  }
@@ -3419,10 +3492,6 @@ var SparkAuthProvider = class {
3419
3492
  // src/graphql/objects/index.ts
3420
3493
  init_buffer();
3421
3494
 
3422
- // src/graphql/objects/ClaimStaticDeposit.ts
3423
- init_buffer();
3424
- var import_core8 = require("@lightsparkdev/core");
3425
-
3426
3495
  // src/graphql/objects/SparkUserRequestStatus.ts
3427
3496
  init_buffer();
3428
3497
 
@@ -17980,7 +18049,7 @@ init_buffer();
17980
18049
  var import_core10 = require("@lightsparkdev/core");
17981
18050
  var isReactNative = typeof navigator !== "undefined" && navigator.product === "ReactNative";
17982
18051
  var isBun = globalThis.Bun !== void 0;
17983
- var packageVersion = true ? "0.2.4" : "unknown";
18052
+ var packageVersion = true ? "0.2.5" : "unknown";
17984
18053
  var baseEnvStr = "unknown";
17985
18054
  if (isBun) {
17986
18055
  const bunVersion = "version" in globalThis.Bun ? globalThis.Bun.version : "unknown-version";
@@ -23202,6 +23271,12 @@ function getTxId(tx) {
23202
23271
  function getTxIdNoReverse(tx) {
23203
23272
  return (0, import_utils6.bytesToHex)((0, import_sha24.sha256)((0, import_sha24.sha256)(tx.toBytes(true))));
23204
23273
  }
23274
+ function getTxEstimatedVbytesSizeByNumberOfInputsOutputs(numInputs, numOutputs) {
23275
+ const TX_OVERHEAD = 10;
23276
+ const IN_VBYTES = 150;
23277
+ const OUT_VBYTES = 34;
23278
+ return TX_OVERHEAD + numInputs * IN_VBYTES + numOutputs * OUT_VBYTES;
23279
+ }
23205
23280
 
23206
23281
  // src/utils/transaction.ts
23207
23282
  init_buffer();
@@ -30344,7 +30419,7 @@ function mapTransferLeafToWalletTransferLeaf(proto) {
30344
30419
  intermediateRefundTx: (0, import_utils22.bytesToHex)(proto.intermediateRefundTx)
30345
30420
  };
30346
30421
  }
30347
- function mapTransferToWalletTransfer(proto, identityPublicKey) {
30422
+ function mapTransferToWalletTransfer(proto, identityPublicKey, userRequest) {
30348
30423
  const receiverIdentityPublicKey = (0, import_utils22.bytesToHex)(proto.receiverIdentityPublicKey);
30349
30424
  const senderIdentityPublicKey = (0, import_utils22.bytesToHex)(proto.senderIdentityPublicKey);
30350
30425
  return {
@@ -30358,7 +30433,8 @@ function mapTransferToWalletTransfer(proto, identityPublicKey) {
30358
30433
  createdTime: proto.createdTime ? new Date(proto.createdTime) : void 0,
30359
30434
  updatedTime: proto.updatedTime ? new Date(proto.updatedTime) : void 0,
30360
30435
  type: TransferType[proto.type],
30361
- transferDirection: receiverIdentityPublicKey === identityPublicKey ? "INCOMING" /* INCOMING */ : "OUTGOING" /* OUTGOING */
30436
+ transferDirection: receiverIdentityPublicKey === identityPublicKey ? "INCOMING" /* INCOMING */ : "OUTGOING" /* OUTGOING */,
30437
+ userRequest
30362
30438
  };
30363
30439
  }
30364
30440
 
@@ -31436,9 +31512,22 @@ var SparkWallet = class _SparkWallet extends import_eventemitter3.EventEmitter {
31436
31512
  const identityPublicKey = (0, import_utils23.bytesToHex)(
31437
31513
  await this.config.signer.getIdentityPublicKey()
31438
31514
  );
31515
+ const userRequests = await this.sspClient?.getTransfers(
31516
+ transfers.transfers.map((transfer) => transfer.id)
31517
+ );
31518
+ const userRequestsMap = /* @__PURE__ */ new Map();
31519
+ for (const userRequest of userRequests || []) {
31520
+ if (userRequest && userRequest.sparkId && userRequest.userRequest) {
31521
+ userRequestsMap.set(userRequest.sparkId, userRequest.userRequest);
31522
+ }
31523
+ }
31439
31524
  return {
31440
31525
  transfers: transfers.transfers.map(
31441
- (transfer) => mapTransferToWalletTransfer(transfer, identityPublicKey)
31526
+ (transfer) => mapTransferToWalletTransfer(
31527
+ transfer,
31528
+ identityPublicKey,
31529
+ userRequestsMap.get(transfer.id)
31530
+ )
31442
31531
  ),
31443
31532
  offset: transfers.offset
31444
31533
  };
@@ -31621,7 +31710,9 @@ var SparkWallet = class _SparkWallet extends import_eventemitter3.EventEmitter {
31621
31710
  network = BitcoinNetwork_default.REGTEST;
31622
31711
  }
31623
31712
  if (outputIndex === void 0) {
31624
- outputIndex = await this.getDepositTransactionVout(transactionId);
31713
+ outputIndex = await this.getDepositTransactionVout({
31714
+ txid: transactionId
31715
+ });
31625
31716
  }
31626
31717
  const quote = await sspClient.getClaimDepositQuote({
31627
31718
  transactionId,
@@ -31652,7 +31743,9 @@ var SparkWallet = class _SparkWallet extends import_eventemitter3.EventEmitter {
31652
31743
  throw new Error("SSP client not initialized");
31653
31744
  }
31654
31745
  if (outputIndex === void 0) {
31655
- outputIndex = await this.getDepositTransactionVout(transactionId);
31746
+ outputIndex = await this.getDepositTransactionVout({
31747
+ txid: transactionId
31748
+ });
31656
31749
  }
31657
31750
  let network = this.config.getSspNetwork();
31658
31751
  if (network === BitcoinNetwork_default.FUTURE_VALUE) {
@@ -31686,25 +31779,94 @@ var SparkWallet = class _SparkWallet extends import_eventemitter3.EventEmitter {
31686
31779
  }
31687
31780
  return response;
31688
31781
  }
31782
+ /**
31783
+ * Get a quote on how much credit you can claim for a deposit from the SSP. If the quote charges less fees than the max fee, claim the deposit.
31784
+ *
31785
+ * @param {Object} params - The parameters object
31786
+ * @param {string} params.transactionId - The ID of the transaction
31787
+ * @param {number} params.maxFee - The maximum fee to claim the deposit for
31788
+ * @param {number} [params.outputIndex] - The index of the output
31789
+ * @returns {Promise<StaticDepositQuoteOutput>} Quote for claiming a deposit to a static deposit address
31790
+ */
31791
+ async claimStaticDepositWithMaxFee({
31792
+ transactionId,
31793
+ maxFee,
31794
+ outputIndex
31795
+ }) {
31796
+ const sspClient = this.getSspClient();
31797
+ let network = this.config.getSspNetwork();
31798
+ if (network === BitcoinNetwork_default.FUTURE_VALUE) {
31799
+ network = BitcoinNetwork_default.REGTEST;
31800
+ }
31801
+ const depositTx = await this.getDepositTransaction(transactionId);
31802
+ if (outputIndex === void 0) {
31803
+ outputIndex = await this.getDepositTransactionVout({
31804
+ txid: transactionId,
31805
+ depositTx
31806
+ });
31807
+ }
31808
+ const depositAmount = Number(depositTx.getOutput(outputIndex).amount);
31809
+ const quote = await sspClient.getClaimDepositQuote({
31810
+ transactionId,
31811
+ outputIndex,
31812
+ network
31813
+ });
31814
+ if (!quote) {
31815
+ throw new Error("Failed to get claim deposit quote");
31816
+ }
31817
+ const { creditAmountSats, signature: sspSignature } = quote;
31818
+ const feeCharged = depositAmount - creditAmountSats;
31819
+ if (feeCharged > maxFee) {
31820
+ throw new ValidationError("Fee larger than max fee", {
31821
+ field: "feeCharged",
31822
+ value: feeCharged
31823
+ });
31824
+ }
31825
+ const response = await this.claimStaticDeposit({
31826
+ transactionId,
31827
+ creditAmountSats,
31828
+ sspSignature,
31829
+ outputIndex
31830
+ });
31831
+ if (!response) {
31832
+ throw new Error("Failed to claim static deposit");
31833
+ }
31834
+ return response;
31835
+ }
31689
31836
  /**
31690
31837
  * Refunds a static deposit to a destination address.
31691
31838
  *
31692
- * @param {string} depositTransactionId - The ID of the transaction
31693
- * @param {number} [outputIndex] - The index of the output
31694
- * @param {string} destinationAddress - The destination address
31695
- * @param {number} fee - The fee to refund
31839
+ * @param {Object} params - The refund parameters
31840
+ * @param {string} params.depositTransactionId - The ID of the transaction
31841
+ * @param {number} [params.outputIndex] - The index of the output
31842
+ * @param {string} params.destinationAddress - The destination address
31843
+ * @param {number} [params.fee] - **@deprecated** The fee to refund
31844
+ * @param {number} [params.satsPerVbyteFee] - The fee per vbyte to refund
31696
31845
  * @returns {Promise<string>} The hex of the refund transaction
31697
31846
  */
31698
31847
  async refundStaticDeposit({
31699
31848
  depositTransactionId,
31700
31849
  outputIndex,
31701
31850
  destinationAddress,
31702
- fee
31851
+ fee,
31852
+ satsPerVbyteFee
31703
31853
  }) {
31704
- if (fee <= 300) {
31854
+ if (fee !== void 0) {
31855
+ console.warn(
31856
+ `refundStaticDeposit(): \`fee\` parameter is deprecated and will be removed; please switch to \`satsPerVbyteFee\`.`
31857
+ );
31858
+ }
31859
+ if (fee === void 0 && satsPerVbyteFee === void 0) {
31860
+ throw new ValidationError("Fee or satsPerVbyteFee must be provided");
31861
+ }
31862
+ if (satsPerVbyteFee && satsPerVbyteFee > 150) {
31863
+ throw new ValidationError("satsPerVbyteFee must be less than 150");
31864
+ }
31865
+ const finalFee = satsPerVbyteFee ? satsPerVbyteFee * getTxEstimatedVbytesSizeByNumberOfInputsOutputs(1, 1) : fee;
31866
+ if (finalFee <= 200) {
31705
31867
  throw new ValidationError("Fee must be greater than 300", {
31706
31868
  field: "fee",
31707
- value: fee
31869
+ value: finalFee
31708
31870
  });
31709
31871
  }
31710
31872
  let network = this.config.getNetwork();
@@ -31712,10 +31874,13 @@ var SparkWallet = class _SparkWallet extends import_eventemitter3.EventEmitter {
31712
31874
  const networkJSON = networkToJSON(networkType);
31713
31875
  const depositTx = await this.getDepositTransaction(depositTransactionId);
31714
31876
  if (outputIndex === void 0) {
31715
- outputIndex = await this.getDepositTransactionVout(depositTransactionId);
31877
+ outputIndex = await this.getDepositTransactionVout({
31878
+ txid: depositTransactionId,
31879
+ depositTx
31880
+ });
31716
31881
  }
31717
31882
  const totalAmount = depositTx.getOutput(outputIndex).amount;
31718
- const creditAmountSats = Number(totalAmount) - fee;
31883
+ const creditAmountSats = Number(totalAmount) - finalFee;
31719
31884
  if (creditAmountSats <= 0) {
31720
31885
  throw new ValidationError(
31721
31886
  "Fee too large. Credit amount must be greater than 0",
@@ -31763,26 +31928,14 @@ var SparkWallet = class _SparkWallet extends import_eventemitter3.EventEmitter {
31763
31928
  const sparkClient = await this.connectionManager.createSparkClient(
31764
31929
  this.config.getCoordinatorAddress()
31765
31930
  );
31766
- const transferId = (0, import_uuidv75.uuidv7)();
31767
- const swapResponse = await sparkClient.initiate_utxo_swap({
31931
+ const swapResponse = await sparkClient.initiate_static_deposit_utxo_refund({
31768
31932
  onChainUtxo: {
31769
31933
  txid: (0, import_utils23.hexToBytes)(depositTransactionId),
31770
31934
  vout: outputIndex,
31771
31935
  network: networkType
31772
31936
  },
31773
- requestType: 2 /* Refund */,
31774
- amount: {
31775
- creditAmountSats: 0,
31776
- $case: "creditAmountSats"
31777
- },
31778
31937
  userSignature: swapResponseUserSignature,
31779
- sspSignature: new Uint8Array(),
31780
- transfer: {
31781
- transferId,
31782
- ownerIdentityPublicKey: await this.config.signer.getIdentityPublicKey(),
31783
- receiverIdentityPublicKey: await this.config.signer.getIdentityPublicKey()
31784
- },
31785
- spendTxSigningJob: signingJob
31938
+ refundTxSigningJob: signingJob
31786
31939
  });
31787
31940
  if (!swapResponse) {
31788
31941
  throw new Error("Failed to initiate utxo swap");
@@ -31795,15 +31948,15 @@ var SparkWallet = class _SparkWallet extends import_eventemitter3.EventEmitter {
31795
31948
  path: 0
31796
31949
  },
31797
31950
  selfCommitment: signingNonceCommitment,
31798
- statechainCommitments: swapResponse.spendTxSigningResult.signingNonceCommitments,
31951
+ statechainCommitments: swapResponse.refundTxSigningResult.signingNonceCommitments,
31799
31952
  verifyingKey: swapResponse.depositAddress.verifyingPublicKey
31800
31953
  });
31801
31954
  const signatureResult = await this.config.signer.aggregateFrost({
31802
31955
  message: spendTxSighash,
31803
- statechainSignatures: swapResponse.spendTxSigningResult.signatureShares,
31804
- statechainPublicKeys: swapResponse.spendTxSigningResult.publicKeys,
31956
+ statechainSignatures: swapResponse.refundTxSigningResult.signatureShares,
31957
+ statechainPublicKeys: swapResponse.refundTxSigningResult.publicKeys,
31805
31958
  verifyingKey: swapResponse.depositAddress.verifyingPublicKey,
31806
- statechainCommitments: swapResponse.spendTxSigningResult.signingNonceCommitments,
31959
+ statechainCommitments: swapResponse.refundTxSigningResult.signingNonceCommitments,
31807
31960
  selfCommitment: signingNonceCommitment,
31808
31961
  publicKey: await this.config.signer.getStaticDepositSigningKey(0),
31809
31962
  selfSignature: userSignature
@@ -31856,8 +32009,13 @@ var SparkWallet = class _SparkWallet extends import_eventemitter3.EventEmitter {
31856
32009
  }
31857
32010
  return payload;
31858
32011
  }
31859
- async getDepositTransactionVout(txid) {
31860
- const depositTx = await this.getDepositTransaction(txid);
32012
+ async getDepositTransactionVout({
32013
+ txid,
32014
+ depositTx
32015
+ }) {
32016
+ if (!depositTx) {
32017
+ depositTx = await this.getDepositTransaction(txid);
32018
+ }
31861
32019
  const staticDepositAddresses = new Set(
31862
32020
  await this.queryStaticDepositAddresses()
31863
32021
  );
@@ -33072,11 +33230,12 @@ var SparkWallet = class _SparkWallet extends import_eventemitter3.EventEmitter {
33072
33230
  * Gets a transfer that has been sent by the SSP to the wallet.
33073
33231
  *
33074
33232
  * @param {string} id - The ID of the transfer
33075
- * @returns {Promise<GraphQLTransferObj | null>} The transfer
33233
+ * @returns {Promise<TransferWithUserRequest | undefined>} The transfer
33076
33234
  */
33077
33235
  async getTransferFromSsp(id) {
33078
33236
  const sspClient = this.getSspClient();
33079
- return await sspClient.getTransfer(id);
33237
+ const transfers = await sspClient.getTransfers([id]);
33238
+ return transfers?.[0];
33080
33239
  }
33081
33240
  /**
33082
33241
  * Gets a transfer, that the wallet is a participant of, in the Spark network.
@@ -33741,6 +33900,7 @@ __export(utils_exports, {
33741
33900
  getSparkAddressFromTaproot: () => getSparkAddressFromTaproot,
33742
33901
  getTransactionSequence: () => getTransactionSequence,
33743
33902
  getTransferPackageSigningPayload: () => getTransferPackageSigningPayload,
33903
+ getTxEstimatedVbytesSizeByNumberOfInputsOutputs: () => getTxEstimatedVbytesSizeByNumberOfInputsOutputs,
33744
33904
  getTxFromRawTxBytes: () => getTxFromRawTxBytes,
33745
33905
  getTxFromRawTxHex: () => getTxFromRawTxHex,
33746
33906
  getTxId: () => getTxId,
package/dist/debug.d.cts CHANGED
@@ -1,7 +1,7 @@
1
- import { B as Bech32mTokenIdentifier, n as Bech32mTokenIdentifierData, D as DecodedSparkAddressData, L as LRC_WALLET_NETWORK, k as LRC_WALLET_NETWORK_TYPE, N as Network, h as NetworkToProto, g as NetworkType, c as SparkAddressData, S as SparkAddressFormat, q as decodeBech32mTokenIdentifier, d as decodeSparkAddress, o as encodeBech32mTokenIdentifier, e as encodeSparkAddress, j as getNetwork, l as getNetworkFromAddress, m as getNetworkFromString, f as isValidPublicKey, i as isValidSparkAddress, p as protoToNetwork, y as SparkWallet, b as ConfigOptions } from './spark-wallet-DG3x2obf.cjs';
2
- import { aa as BroadcastConfig, ab as BroadcastResult, P as DEFAULT_FEE_SATS, L as DIRECT_TIMELOCK_OFFSET, a8 as FeeBumpTxChain, a7 as FeeBumpTxPackage, a6 as FeeRate, N as INITIAL_DIRECT_SEQUENCE, M as INITIAL_SEQUENCE, a4 as LeafInfo, O as TEST_UNILATERAL_DIRECT_SEQUENCE, T as TEST_UNILATERAL_SEQUENCE, a9 as TxChain, a5 as Utxo, p as addPrivateKeys, n as addPublicKeys, b as applyAdaptorToSignature, o as applyAdditiveTweakToPublicKey, I as checkIfSelectedOutputsAreAvailable, a0 as checkIfValidSequence, y as collectResponses, c as computeTaprootKeyNoScript, af as constructFeeBumpTx, ae as constructUnilateralExitFeeBumpPackages, ad as constructUnilateralExitTxs, Z as createConnectorRefundTransactions, W as createLeafNodeTx, U as createNodeTx, V as createNodeTxs, X as createRefundTx, Y as createRefundTxs, R as createRootTx, E as createSigningCommitment, A as createSigningNonce, S as createSplitTx, G as decodeBytesToSigningCommitment, D as decodeBytesToSigningNonce, a1 as doesLeafNeedRefresh, F as encodeSigningCommitmentToBytes, C as encodeSigningNonceToBytes, J as filterTokenBalanceForTokenPublicKey, a as generateAdaptorFromSignature, g as generateSignatureFromExistingAdaptor, _ as getCurrentTimelock, a3 as getEphemeralAnchorOutput, u as getLatestDepositTxId, a2 as getNextTransactionSequence, f as getP2TRAddressFromPkScript, e as getP2TRAddressFromPublicKey, d as getP2TRScriptFromPublicKey, h as getP2WPKHAddressFromPublicKey, z as getRandomSigningNonce, k as getSigHashFromTx, B as getSigningCommitmentFromNonce, ag as getSparkAddressFromTaproot, $ as getTransactionSequence, K as getTransferPackageSigningPayload, j as getTxFromRawTxBytes, i as getTxFromRawTxHex, l as getTxId, m as getTxIdNoReverse, ac as isEphemeralAnchorOutput, w as isTxBroadcast, t as lastKeyWithTarget, Q as maybeApplyFee, x as proofOfPossessionMessageHashForDepositAddress, q as subtractPrivateKeys, s as subtractPublicKeys, H as sumAvailableTokens, r as sumOfPrivateKeys, v as validateOutboundAdaptorSignature } from './xchain-address-HBr6isnc.cjs';
3
- import { V as VerifiableSecretShare, h as bigIntToPrivateKey, c as computerLagrangeCoefficients, e as evaluatePolynomial, f as fieldDiv, b as generatePolynomialForSecretSharing, g as getRandomBigInt, m as modInverse, r as recoverSecret, s as splitSecret, d as splitSecretWithProofs, v as validateShare } from './client-KhNkrXz4.cjs';
4
- import './spark-B_7nZx6T.cjs';
1
+ import { B as Bech32mTokenIdentifier, n as Bech32mTokenIdentifierData, D as DecodedSparkAddressData, L as LRC_WALLET_NETWORK, k as LRC_WALLET_NETWORK_TYPE, N as Network, h as NetworkToProto, g as NetworkType, c as SparkAddressData, S as SparkAddressFormat, q as decodeBech32mTokenIdentifier, d as decodeSparkAddress, o as encodeBech32mTokenIdentifier, e as encodeSparkAddress, j as getNetwork, l as getNetworkFromAddress, m as getNetworkFromString, f as isValidPublicKey, i as isValidSparkAddress, p as protoToNetwork, y as SparkWallet, b as ConfigOptions } from './spark-wallet-Di65w0Us.cjs';
2
+ import { ab as BroadcastConfig, ac as BroadcastResult, Q as DEFAULT_FEE_SATS, M as DIRECT_TIMELOCK_OFFSET, a9 as FeeBumpTxChain, a8 as FeeBumpTxPackage, a7 as FeeRate, O as INITIAL_DIRECT_SEQUENCE, N as INITIAL_SEQUENCE, a5 as LeafInfo, P as TEST_UNILATERAL_DIRECT_SEQUENCE, T as TEST_UNILATERAL_SEQUENCE, aa as TxChain, a6 as Utxo, q as addPrivateKeys, o as addPublicKeys, b as applyAdaptorToSignature, p as applyAdditiveTweakToPublicKey, J as checkIfSelectedOutputsAreAvailable, a1 as checkIfValidSequence, z as collectResponses, c as computeTaprootKeyNoScript, ag as constructFeeBumpTx, af as constructUnilateralExitFeeBumpPackages, ae as constructUnilateralExitTxs, _ as createConnectorRefundTransactions, X as createLeafNodeTx, V as createNodeTx, W as createNodeTxs, Y as createRefundTx, Z as createRefundTxs, S as createRootTx, F as createSigningCommitment, B as createSigningNonce, U as createSplitTx, H as decodeBytesToSigningCommitment, E as decodeBytesToSigningNonce, a2 as doesLeafNeedRefresh, G as encodeSigningCommitmentToBytes, D as encodeSigningNonceToBytes, K as filterTokenBalanceForTokenPublicKey, a as generateAdaptorFromSignature, g as generateSignatureFromExistingAdaptor, $ as getCurrentTimelock, a4 as getEphemeralAnchorOutput, w as getLatestDepositTxId, a3 as getNextTransactionSequence, f as getP2TRAddressFromPkScript, e as getP2TRAddressFromPublicKey, d as getP2TRScriptFromPublicKey, h as getP2WPKHAddressFromPublicKey, A as getRandomSigningNonce, k as getSigHashFromTx, C as getSigningCommitmentFromNonce, ah as getSparkAddressFromTaproot, a0 as getTransactionSequence, L as getTransferPackageSigningPayload, n as getTxEstimatedVbytesSizeByNumberOfInputsOutputs, j as getTxFromRawTxBytes, i as getTxFromRawTxHex, l as getTxId, m as getTxIdNoReverse, ad as isEphemeralAnchorOutput, x as isTxBroadcast, u as lastKeyWithTarget, R as maybeApplyFee, y as proofOfPossessionMessageHashForDepositAddress, r as subtractPrivateKeys, s as subtractPublicKeys, I as sumAvailableTokens, t as sumOfPrivateKeys, v as validateOutboundAdaptorSignature } from './xchain-address-CqRu3F21.cjs';
3
+ import { V as VerifiableSecretShare, h as bigIntToPrivateKey, c as computerLagrangeCoefficients, e as evaluatePolynomial, f as fieldDiv, b as generatePolynomialForSecretSharing, g as getRandomBigInt, m as modInverse, r as recoverSecret, s as splitSecret, d as splitSecretWithProofs, v as validateShare } from './client-C88GCTPB.cjs';
4
+ import './spark-ESAfZARg.cjs';
5
5
  import '@bufbuild/protobuf/wire';
6
6
  import 'nice-grpc-common';
7
7
  import '@buildonspark/lrc20-sdk';
@@ -11,7 +11,6 @@ import 'nice-grpc';
11
11
  import 'nice-grpc-web';
12
12
  import './proto/spark_token.cjs';
13
13
  import 'eventemitter3';
14
- import './sdk-types-CB9HrW5O.cjs';
15
14
  import '@scure/btc-signer/psbt';
16
15
  import '@lightsparkdev/core';
17
16
  import '@scure/bip32';
@@ -98,6 +97,7 @@ declare const utils_getSigningCommitmentFromNonce: typeof getSigningCommitmentFr
98
97
  declare const utils_getSparkAddressFromTaproot: typeof getSparkAddressFromTaproot;
99
98
  declare const utils_getTransactionSequence: typeof getTransactionSequence;
100
99
  declare const utils_getTransferPackageSigningPayload: typeof getTransferPackageSigningPayload;
100
+ declare const utils_getTxEstimatedVbytesSizeByNumberOfInputsOutputs: typeof getTxEstimatedVbytesSizeByNumberOfInputsOutputs;
101
101
  declare const utils_getTxFromRawTxBytes: typeof getTxFromRawTxBytes;
102
102
  declare const utils_getTxFromRawTxHex: typeof getTxFromRawTxHex;
103
103
  declare const utils_getTxId: typeof getTxId;
@@ -121,7 +121,7 @@ declare const utils_sumOfPrivateKeys: typeof sumOfPrivateKeys;
121
121
  declare const utils_validateOutboundAdaptorSignature: typeof validateOutboundAdaptorSignature;
122
122
  declare const utils_validateShare: typeof validateShare;
123
123
  declare namespace utils {
124
- export { utils_Bech32mTokenIdentifier as Bech32mTokenIdentifier, utils_Bech32mTokenIdentifierData as Bech32mTokenIdentifierData, utils_BroadcastConfig as BroadcastConfig, utils_BroadcastResult as BroadcastResult, utils_DEFAULT_FEE_SATS as DEFAULT_FEE_SATS, utils_DIRECT_TIMELOCK_OFFSET as DIRECT_TIMELOCK_OFFSET, utils_DecodedSparkAddressData as DecodedSparkAddressData, utils_FeeBumpTxChain as FeeBumpTxChain, utils_FeeBumpTxPackage as FeeBumpTxPackage, utils_FeeRate as FeeRate, utils_INITIAL_DIRECT_SEQUENCE as INITIAL_DIRECT_SEQUENCE, utils_INITIAL_SEQUENCE as INITIAL_SEQUENCE, utils_LRC_WALLET_NETWORK as LRC_WALLET_NETWORK, utils_LRC_WALLET_NETWORK_TYPE as LRC_WALLET_NETWORK_TYPE, utils_LeafInfo as LeafInfo, utils_Network as Network, utils_NetworkToProto as NetworkToProto, utils_NetworkType as NetworkType, utils_SparkAddressData as SparkAddressData, utils_SparkAddressFormat as SparkAddressFormat, utils_TEST_UNILATERAL_DIRECT_SEQUENCE as TEST_UNILATERAL_DIRECT_SEQUENCE, utils_TEST_UNILATERAL_SEQUENCE as TEST_UNILATERAL_SEQUENCE, utils_TxChain as TxChain, utils_Utxo as Utxo, utils_VerifiableSecretShare as VerifiableSecretShare, utils_addPrivateKeys as addPrivateKeys, utils_addPublicKeys as addPublicKeys, utils_applyAdaptorToSignature as applyAdaptorToSignature, utils_applyAdditiveTweakToPublicKey as applyAdditiveTweakToPublicKey, utils_bigIntToPrivateKey as bigIntToPrivateKey, utils_checkIfSelectedOutputsAreAvailable as checkIfSelectedOutputsAreAvailable, utils_checkIfValidSequence as checkIfValidSequence, utils_collectResponses as collectResponses, utils_computeTaprootKeyNoScript as computeTaprootKeyNoScript, utils_computerLagrangeCoefficients as computerLagrangeCoefficients, utils_constructFeeBumpTx as constructFeeBumpTx, utils_constructUnilateralExitFeeBumpPackages as constructUnilateralExitFeeBumpPackages, utils_constructUnilateralExitTxs as constructUnilateralExitTxs, utils_createConnectorRefundTransactions as createConnectorRefundTransactions, utils_createLeafNodeTx as createLeafNodeTx, utils_createNodeTx as createNodeTx, utils_createNodeTxs as createNodeTxs, utils_createRefundTx as createRefundTx, utils_createRefundTxs as createRefundTxs, utils_createRootTx as createRootTx, utils_createSigningCommitment as createSigningCommitment, utils_createSigningNonce as createSigningNonce, utils_createSplitTx as createSplitTx, utils_decodeBech32mTokenIdentifier as decodeBech32mTokenIdentifier, utils_decodeBytesToSigningCommitment as decodeBytesToSigningCommitment, utils_decodeBytesToSigningNonce as decodeBytesToSigningNonce, utils_decodeSparkAddress as decodeSparkAddress, utils_doesLeafNeedRefresh as doesLeafNeedRefresh, utils_encodeBech32mTokenIdentifier as encodeBech32mTokenIdentifier, utils_encodeSigningCommitmentToBytes as encodeSigningCommitmentToBytes, utils_encodeSigningNonceToBytes as encodeSigningNonceToBytes, utils_encodeSparkAddress as encodeSparkAddress, utils_evaluatePolynomial as evaluatePolynomial, utils_fieldDiv as fieldDiv, utils_filterTokenBalanceForTokenPublicKey as filterTokenBalanceForTokenPublicKey, utils_generateAdaptorFromSignature as generateAdaptorFromSignature, utils_generatePolynomialForSecretSharing as generatePolynomialForSecretSharing, utils_generateSignatureFromExistingAdaptor as generateSignatureFromExistingAdaptor, utils_getCurrentTimelock as getCurrentTimelock, utils_getEphemeralAnchorOutput as getEphemeralAnchorOutput, utils_getLatestDepositTxId as getLatestDepositTxId, utils_getNetwork as getNetwork, utils_getNetworkFromAddress as getNetworkFromAddress, utils_getNetworkFromString as getNetworkFromString, utils_getNextTransactionSequence as getNextTransactionSequence, utils_getP2TRAddressFromPkScript as getP2TRAddressFromPkScript, utils_getP2TRAddressFromPublicKey as getP2TRAddressFromPublicKey, utils_getP2TRScriptFromPublicKey as getP2TRScriptFromPublicKey, utils_getP2WPKHAddressFromPublicKey as getP2WPKHAddressFromPublicKey, utils_getRandomBigInt as getRandomBigInt, utils_getRandomSigningNonce as getRandomSigningNonce, utils_getSigHashFromTx as getSigHashFromTx, utils_getSigningCommitmentFromNonce as getSigningCommitmentFromNonce, utils_getSparkAddressFromTaproot as getSparkAddressFromTaproot, utils_getTransactionSequence as getTransactionSequence, utils_getTransferPackageSigningPayload as getTransferPackageSigningPayload, utils_getTxFromRawTxBytes as getTxFromRawTxBytes, utils_getTxFromRawTxHex as getTxFromRawTxHex, utils_getTxId as getTxId, utils_getTxIdNoReverse as getTxIdNoReverse, utils_isEphemeralAnchorOutput as isEphemeralAnchorOutput, utils_isTxBroadcast as isTxBroadcast, utils_isValidPublicKey as isValidPublicKey, utils_isValidSparkAddress as isValidSparkAddress, utils_lastKeyWithTarget as lastKeyWithTarget, utils_maybeApplyFee as maybeApplyFee, utils_modInverse as modInverse, utils_proofOfPossessionMessageHashForDepositAddress as proofOfPossessionMessageHashForDepositAddress, utils_protoToNetwork as protoToNetwork, utils_recoverSecret as recoverSecret, utils_splitSecret as splitSecret, utils_splitSecretWithProofs as splitSecretWithProofs, utils_subtractPrivateKeys as subtractPrivateKeys, utils_subtractPublicKeys as subtractPublicKeys, utils_sumAvailableTokens as sumAvailableTokens, utils_sumOfPrivateKeys as sumOfPrivateKeys, utils_validateOutboundAdaptorSignature as validateOutboundAdaptorSignature, utils_validateShare as validateShare };
124
+ export { utils_Bech32mTokenIdentifier as Bech32mTokenIdentifier, utils_Bech32mTokenIdentifierData as Bech32mTokenIdentifierData, utils_BroadcastConfig as BroadcastConfig, utils_BroadcastResult as BroadcastResult, utils_DEFAULT_FEE_SATS as DEFAULT_FEE_SATS, utils_DIRECT_TIMELOCK_OFFSET as DIRECT_TIMELOCK_OFFSET, utils_DecodedSparkAddressData as DecodedSparkAddressData, utils_FeeBumpTxChain as FeeBumpTxChain, utils_FeeBumpTxPackage as FeeBumpTxPackage, utils_FeeRate as FeeRate, utils_INITIAL_DIRECT_SEQUENCE as INITIAL_DIRECT_SEQUENCE, utils_INITIAL_SEQUENCE as INITIAL_SEQUENCE, utils_LRC_WALLET_NETWORK as LRC_WALLET_NETWORK, utils_LRC_WALLET_NETWORK_TYPE as LRC_WALLET_NETWORK_TYPE, utils_LeafInfo as LeafInfo, utils_Network as Network, utils_NetworkToProto as NetworkToProto, utils_NetworkType as NetworkType, utils_SparkAddressData as SparkAddressData, utils_SparkAddressFormat as SparkAddressFormat, utils_TEST_UNILATERAL_DIRECT_SEQUENCE as TEST_UNILATERAL_DIRECT_SEQUENCE, utils_TEST_UNILATERAL_SEQUENCE as TEST_UNILATERAL_SEQUENCE, utils_TxChain as TxChain, utils_Utxo as Utxo, utils_VerifiableSecretShare as VerifiableSecretShare, utils_addPrivateKeys as addPrivateKeys, utils_addPublicKeys as addPublicKeys, utils_applyAdaptorToSignature as applyAdaptorToSignature, utils_applyAdditiveTweakToPublicKey as applyAdditiveTweakToPublicKey, utils_bigIntToPrivateKey as bigIntToPrivateKey, utils_checkIfSelectedOutputsAreAvailable as checkIfSelectedOutputsAreAvailable, utils_checkIfValidSequence as checkIfValidSequence, utils_collectResponses as collectResponses, utils_computeTaprootKeyNoScript as computeTaprootKeyNoScript, utils_computerLagrangeCoefficients as computerLagrangeCoefficients, utils_constructFeeBumpTx as constructFeeBumpTx, utils_constructUnilateralExitFeeBumpPackages as constructUnilateralExitFeeBumpPackages, utils_constructUnilateralExitTxs as constructUnilateralExitTxs, utils_createConnectorRefundTransactions as createConnectorRefundTransactions, utils_createLeafNodeTx as createLeafNodeTx, utils_createNodeTx as createNodeTx, utils_createNodeTxs as createNodeTxs, utils_createRefundTx as createRefundTx, utils_createRefundTxs as createRefundTxs, utils_createRootTx as createRootTx, utils_createSigningCommitment as createSigningCommitment, utils_createSigningNonce as createSigningNonce, utils_createSplitTx as createSplitTx, utils_decodeBech32mTokenIdentifier as decodeBech32mTokenIdentifier, utils_decodeBytesToSigningCommitment as decodeBytesToSigningCommitment, utils_decodeBytesToSigningNonce as decodeBytesToSigningNonce, utils_decodeSparkAddress as decodeSparkAddress, utils_doesLeafNeedRefresh as doesLeafNeedRefresh, utils_encodeBech32mTokenIdentifier as encodeBech32mTokenIdentifier, utils_encodeSigningCommitmentToBytes as encodeSigningCommitmentToBytes, utils_encodeSigningNonceToBytes as encodeSigningNonceToBytes, utils_encodeSparkAddress as encodeSparkAddress, utils_evaluatePolynomial as evaluatePolynomial, utils_fieldDiv as fieldDiv, utils_filterTokenBalanceForTokenPublicKey as filterTokenBalanceForTokenPublicKey, utils_generateAdaptorFromSignature as generateAdaptorFromSignature, utils_generatePolynomialForSecretSharing as generatePolynomialForSecretSharing, utils_generateSignatureFromExistingAdaptor as generateSignatureFromExistingAdaptor, utils_getCurrentTimelock as getCurrentTimelock, utils_getEphemeralAnchorOutput as getEphemeralAnchorOutput, utils_getLatestDepositTxId as getLatestDepositTxId, utils_getNetwork as getNetwork, utils_getNetworkFromAddress as getNetworkFromAddress, utils_getNetworkFromString as getNetworkFromString, utils_getNextTransactionSequence as getNextTransactionSequence, utils_getP2TRAddressFromPkScript as getP2TRAddressFromPkScript, utils_getP2TRAddressFromPublicKey as getP2TRAddressFromPublicKey, utils_getP2TRScriptFromPublicKey as getP2TRScriptFromPublicKey, utils_getP2WPKHAddressFromPublicKey as getP2WPKHAddressFromPublicKey, utils_getRandomBigInt as getRandomBigInt, utils_getRandomSigningNonce as getRandomSigningNonce, utils_getSigHashFromTx as getSigHashFromTx, utils_getSigningCommitmentFromNonce as getSigningCommitmentFromNonce, utils_getSparkAddressFromTaproot as getSparkAddressFromTaproot, utils_getTransactionSequence as getTransactionSequence, utils_getTransferPackageSigningPayload as getTransferPackageSigningPayload, utils_getTxEstimatedVbytesSizeByNumberOfInputsOutputs as getTxEstimatedVbytesSizeByNumberOfInputsOutputs, utils_getTxFromRawTxBytes as getTxFromRawTxBytes, utils_getTxFromRawTxHex as getTxFromRawTxHex, utils_getTxId as getTxId, utils_getTxIdNoReverse as getTxIdNoReverse, utils_isEphemeralAnchorOutput as isEphemeralAnchorOutput, utils_isTxBroadcast as isTxBroadcast, utils_isValidPublicKey as isValidPublicKey, utils_isValidSparkAddress as isValidSparkAddress, utils_lastKeyWithTarget as lastKeyWithTarget, utils_maybeApplyFee as maybeApplyFee, utils_modInverse as modInverse, utils_proofOfPossessionMessageHashForDepositAddress as proofOfPossessionMessageHashForDepositAddress, utils_protoToNetwork as protoToNetwork, utils_recoverSecret as recoverSecret, utils_splitSecret as splitSecret, utils_splitSecretWithProofs as splitSecretWithProofs, utils_subtractPrivateKeys as subtractPrivateKeys, utils_subtractPublicKeys as subtractPublicKeys, utils_sumAvailableTokens as sumAvailableTokens, utils_sumOfPrivateKeys as sumOfPrivateKeys, utils_validateOutboundAdaptorSignature as validateOutboundAdaptorSignature, utils_validateShare as validateShare };
125
125
  }
126
126
 
127
127
  declare const s: {
package/dist/debug.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { B as Bech32mTokenIdentifier, n as Bech32mTokenIdentifierData, D as DecodedSparkAddressData, L as LRC_WALLET_NETWORK, k as LRC_WALLET_NETWORK_TYPE, N as Network, h as NetworkToProto, g as NetworkType, c as SparkAddressData, S as SparkAddressFormat, q as decodeBech32mTokenIdentifier, d as decodeSparkAddress, o as encodeBech32mTokenIdentifier, e as encodeSparkAddress, j as getNetwork, l as getNetworkFromAddress, m as getNetworkFromString, f as isValidPublicKey, i as isValidSparkAddress, p as protoToNetwork, y as SparkWallet, b as ConfigOptions } from './spark-wallet-C1Tr_VKI.js';
2
- import { aa as BroadcastConfig, ab as BroadcastResult, P as DEFAULT_FEE_SATS, L as DIRECT_TIMELOCK_OFFSET, a8 as FeeBumpTxChain, a7 as FeeBumpTxPackage, a6 as FeeRate, N as INITIAL_DIRECT_SEQUENCE, M as INITIAL_SEQUENCE, a4 as LeafInfo, O as TEST_UNILATERAL_DIRECT_SEQUENCE, T as TEST_UNILATERAL_SEQUENCE, a9 as TxChain, a5 as Utxo, p as addPrivateKeys, n as addPublicKeys, b as applyAdaptorToSignature, o as applyAdditiveTweakToPublicKey, I as checkIfSelectedOutputsAreAvailable, a0 as checkIfValidSequence, y as collectResponses, c as computeTaprootKeyNoScript, af as constructFeeBumpTx, ae as constructUnilateralExitFeeBumpPackages, ad as constructUnilateralExitTxs, Z as createConnectorRefundTransactions, W as createLeafNodeTx, U as createNodeTx, V as createNodeTxs, X as createRefundTx, Y as createRefundTxs, R as createRootTx, E as createSigningCommitment, A as createSigningNonce, S as createSplitTx, G as decodeBytesToSigningCommitment, D as decodeBytesToSigningNonce, a1 as doesLeafNeedRefresh, F as encodeSigningCommitmentToBytes, C as encodeSigningNonceToBytes, J as filterTokenBalanceForTokenPublicKey, a as generateAdaptorFromSignature, g as generateSignatureFromExistingAdaptor, _ as getCurrentTimelock, a3 as getEphemeralAnchorOutput, u as getLatestDepositTxId, a2 as getNextTransactionSequence, f as getP2TRAddressFromPkScript, e as getP2TRAddressFromPublicKey, d as getP2TRScriptFromPublicKey, h as getP2WPKHAddressFromPublicKey, z as getRandomSigningNonce, k as getSigHashFromTx, B as getSigningCommitmentFromNonce, ag as getSparkAddressFromTaproot, $ as getTransactionSequence, K as getTransferPackageSigningPayload, j as getTxFromRawTxBytes, i as getTxFromRawTxHex, l as getTxId, m as getTxIdNoReverse, ac as isEphemeralAnchorOutput, w as isTxBroadcast, t as lastKeyWithTarget, Q as maybeApplyFee, x as proofOfPossessionMessageHashForDepositAddress, q as subtractPrivateKeys, s as subtractPublicKeys, H as sumAvailableTokens, r as sumOfPrivateKeys, v as validateOutboundAdaptorSignature } from './xchain-address-BHu6CpZC.js';
3
- import { V as VerifiableSecretShare, h as bigIntToPrivateKey, c as computerLagrangeCoefficients, e as evaluatePolynomial, f as fieldDiv, b as generatePolynomialForSecretSharing, g as getRandomBigInt, m as modInverse, r as recoverSecret, s as splitSecret, d as splitSecretWithProofs, v as validateShare } from './client-BF4cn8F4.js';
4
- import './spark-B_7nZx6T.js';
1
+ import { B as Bech32mTokenIdentifier, n as Bech32mTokenIdentifierData, D as DecodedSparkAddressData, L as LRC_WALLET_NETWORK, k as LRC_WALLET_NETWORK_TYPE, N as Network, h as NetworkToProto, g as NetworkType, c as SparkAddressData, S as SparkAddressFormat, q as decodeBech32mTokenIdentifier, d as decodeSparkAddress, o as encodeBech32mTokenIdentifier, e as encodeSparkAddress, j as getNetwork, l as getNetworkFromAddress, m as getNetworkFromString, f as isValidPublicKey, i as isValidSparkAddress, p as protoToNetwork, y as SparkWallet, b as ConfigOptions } from './spark-wallet-B2WwKN8W.js';
2
+ import { ab as BroadcastConfig, ac as BroadcastResult, Q as DEFAULT_FEE_SATS, M as DIRECT_TIMELOCK_OFFSET, a9 as FeeBumpTxChain, a8 as FeeBumpTxPackage, a7 as FeeRate, O as INITIAL_DIRECT_SEQUENCE, N as INITIAL_SEQUENCE, a5 as LeafInfo, P as TEST_UNILATERAL_DIRECT_SEQUENCE, T as TEST_UNILATERAL_SEQUENCE, aa as TxChain, a6 as Utxo, q as addPrivateKeys, o as addPublicKeys, b as applyAdaptorToSignature, p as applyAdditiveTweakToPublicKey, J as checkIfSelectedOutputsAreAvailable, a1 as checkIfValidSequence, z as collectResponses, c as computeTaprootKeyNoScript, ag as constructFeeBumpTx, af as constructUnilateralExitFeeBumpPackages, ae as constructUnilateralExitTxs, _ as createConnectorRefundTransactions, X as createLeafNodeTx, V as createNodeTx, W as createNodeTxs, Y as createRefundTx, Z as createRefundTxs, S as createRootTx, F as createSigningCommitment, B as createSigningNonce, U as createSplitTx, H as decodeBytesToSigningCommitment, E as decodeBytesToSigningNonce, a2 as doesLeafNeedRefresh, G as encodeSigningCommitmentToBytes, D as encodeSigningNonceToBytes, K as filterTokenBalanceForTokenPublicKey, a as generateAdaptorFromSignature, g as generateSignatureFromExistingAdaptor, $ as getCurrentTimelock, a4 as getEphemeralAnchorOutput, w as getLatestDepositTxId, a3 as getNextTransactionSequence, f as getP2TRAddressFromPkScript, e as getP2TRAddressFromPublicKey, d as getP2TRScriptFromPublicKey, h as getP2WPKHAddressFromPublicKey, A as getRandomSigningNonce, k as getSigHashFromTx, C as getSigningCommitmentFromNonce, ah as getSparkAddressFromTaproot, a0 as getTransactionSequence, L as getTransferPackageSigningPayload, n as getTxEstimatedVbytesSizeByNumberOfInputsOutputs, j as getTxFromRawTxBytes, i as getTxFromRawTxHex, l as getTxId, m as getTxIdNoReverse, ad as isEphemeralAnchorOutput, x as isTxBroadcast, u as lastKeyWithTarget, R as maybeApplyFee, y as proofOfPossessionMessageHashForDepositAddress, r as subtractPrivateKeys, s as subtractPublicKeys, I as sumAvailableTokens, t as sumOfPrivateKeys, v as validateOutboundAdaptorSignature } from './xchain-address-BsveIy5l.js';
3
+ import { V as VerifiableSecretShare, h as bigIntToPrivateKey, c as computerLagrangeCoefficients, e as evaluatePolynomial, f as fieldDiv, b as generatePolynomialForSecretSharing, g as getRandomBigInt, m as modInverse, r as recoverSecret, s as splitSecret, d as splitSecretWithProofs, v as validateShare } from './client-Dg6vS_2I.js';
4
+ import './spark-ESAfZARg.js';
5
5
  import '@bufbuild/protobuf/wire';
6
6
  import 'nice-grpc-common';
7
7
  import '@buildonspark/lrc20-sdk';
@@ -11,7 +11,6 @@ import 'nice-grpc';
11
11
  import 'nice-grpc-web';
12
12
  import './proto/spark_token.js';
13
13
  import 'eventemitter3';
14
- import './sdk-types-CkRNraXT.js';
15
14
  import '@scure/btc-signer/psbt';
16
15
  import '@lightsparkdev/core';
17
16
  import '@scure/bip32';
@@ -98,6 +97,7 @@ declare const utils_getSigningCommitmentFromNonce: typeof getSigningCommitmentFr
98
97
  declare const utils_getSparkAddressFromTaproot: typeof getSparkAddressFromTaproot;
99
98
  declare const utils_getTransactionSequence: typeof getTransactionSequence;
100
99
  declare const utils_getTransferPackageSigningPayload: typeof getTransferPackageSigningPayload;
100
+ declare const utils_getTxEstimatedVbytesSizeByNumberOfInputsOutputs: typeof getTxEstimatedVbytesSizeByNumberOfInputsOutputs;
101
101
  declare const utils_getTxFromRawTxBytes: typeof getTxFromRawTxBytes;
102
102
  declare const utils_getTxFromRawTxHex: typeof getTxFromRawTxHex;
103
103
  declare const utils_getTxId: typeof getTxId;
@@ -121,7 +121,7 @@ declare const utils_sumOfPrivateKeys: typeof sumOfPrivateKeys;
121
121
  declare const utils_validateOutboundAdaptorSignature: typeof validateOutboundAdaptorSignature;
122
122
  declare const utils_validateShare: typeof validateShare;
123
123
  declare namespace utils {
124
- export { utils_Bech32mTokenIdentifier as Bech32mTokenIdentifier, utils_Bech32mTokenIdentifierData as Bech32mTokenIdentifierData, utils_BroadcastConfig as BroadcastConfig, utils_BroadcastResult as BroadcastResult, utils_DEFAULT_FEE_SATS as DEFAULT_FEE_SATS, utils_DIRECT_TIMELOCK_OFFSET as DIRECT_TIMELOCK_OFFSET, utils_DecodedSparkAddressData as DecodedSparkAddressData, utils_FeeBumpTxChain as FeeBumpTxChain, utils_FeeBumpTxPackage as FeeBumpTxPackage, utils_FeeRate as FeeRate, utils_INITIAL_DIRECT_SEQUENCE as INITIAL_DIRECT_SEQUENCE, utils_INITIAL_SEQUENCE as INITIAL_SEQUENCE, utils_LRC_WALLET_NETWORK as LRC_WALLET_NETWORK, utils_LRC_WALLET_NETWORK_TYPE as LRC_WALLET_NETWORK_TYPE, utils_LeafInfo as LeafInfo, utils_Network as Network, utils_NetworkToProto as NetworkToProto, utils_NetworkType as NetworkType, utils_SparkAddressData as SparkAddressData, utils_SparkAddressFormat as SparkAddressFormat, utils_TEST_UNILATERAL_DIRECT_SEQUENCE as TEST_UNILATERAL_DIRECT_SEQUENCE, utils_TEST_UNILATERAL_SEQUENCE as TEST_UNILATERAL_SEQUENCE, utils_TxChain as TxChain, utils_Utxo as Utxo, utils_VerifiableSecretShare as VerifiableSecretShare, utils_addPrivateKeys as addPrivateKeys, utils_addPublicKeys as addPublicKeys, utils_applyAdaptorToSignature as applyAdaptorToSignature, utils_applyAdditiveTweakToPublicKey as applyAdditiveTweakToPublicKey, utils_bigIntToPrivateKey as bigIntToPrivateKey, utils_checkIfSelectedOutputsAreAvailable as checkIfSelectedOutputsAreAvailable, utils_checkIfValidSequence as checkIfValidSequence, utils_collectResponses as collectResponses, utils_computeTaprootKeyNoScript as computeTaprootKeyNoScript, utils_computerLagrangeCoefficients as computerLagrangeCoefficients, utils_constructFeeBumpTx as constructFeeBumpTx, utils_constructUnilateralExitFeeBumpPackages as constructUnilateralExitFeeBumpPackages, utils_constructUnilateralExitTxs as constructUnilateralExitTxs, utils_createConnectorRefundTransactions as createConnectorRefundTransactions, utils_createLeafNodeTx as createLeafNodeTx, utils_createNodeTx as createNodeTx, utils_createNodeTxs as createNodeTxs, utils_createRefundTx as createRefundTx, utils_createRefundTxs as createRefundTxs, utils_createRootTx as createRootTx, utils_createSigningCommitment as createSigningCommitment, utils_createSigningNonce as createSigningNonce, utils_createSplitTx as createSplitTx, utils_decodeBech32mTokenIdentifier as decodeBech32mTokenIdentifier, utils_decodeBytesToSigningCommitment as decodeBytesToSigningCommitment, utils_decodeBytesToSigningNonce as decodeBytesToSigningNonce, utils_decodeSparkAddress as decodeSparkAddress, utils_doesLeafNeedRefresh as doesLeafNeedRefresh, utils_encodeBech32mTokenIdentifier as encodeBech32mTokenIdentifier, utils_encodeSigningCommitmentToBytes as encodeSigningCommitmentToBytes, utils_encodeSigningNonceToBytes as encodeSigningNonceToBytes, utils_encodeSparkAddress as encodeSparkAddress, utils_evaluatePolynomial as evaluatePolynomial, utils_fieldDiv as fieldDiv, utils_filterTokenBalanceForTokenPublicKey as filterTokenBalanceForTokenPublicKey, utils_generateAdaptorFromSignature as generateAdaptorFromSignature, utils_generatePolynomialForSecretSharing as generatePolynomialForSecretSharing, utils_generateSignatureFromExistingAdaptor as generateSignatureFromExistingAdaptor, utils_getCurrentTimelock as getCurrentTimelock, utils_getEphemeralAnchorOutput as getEphemeralAnchorOutput, utils_getLatestDepositTxId as getLatestDepositTxId, utils_getNetwork as getNetwork, utils_getNetworkFromAddress as getNetworkFromAddress, utils_getNetworkFromString as getNetworkFromString, utils_getNextTransactionSequence as getNextTransactionSequence, utils_getP2TRAddressFromPkScript as getP2TRAddressFromPkScript, utils_getP2TRAddressFromPublicKey as getP2TRAddressFromPublicKey, utils_getP2TRScriptFromPublicKey as getP2TRScriptFromPublicKey, utils_getP2WPKHAddressFromPublicKey as getP2WPKHAddressFromPublicKey, utils_getRandomBigInt as getRandomBigInt, utils_getRandomSigningNonce as getRandomSigningNonce, utils_getSigHashFromTx as getSigHashFromTx, utils_getSigningCommitmentFromNonce as getSigningCommitmentFromNonce, utils_getSparkAddressFromTaproot as getSparkAddressFromTaproot, utils_getTransactionSequence as getTransactionSequence, utils_getTransferPackageSigningPayload as getTransferPackageSigningPayload, utils_getTxFromRawTxBytes as getTxFromRawTxBytes, utils_getTxFromRawTxHex as getTxFromRawTxHex, utils_getTxId as getTxId, utils_getTxIdNoReverse as getTxIdNoReverse, utils_isEphemeralAnchorOutput as isEphemeralAnchorOutput, utils_isTxBroadcast as isTxBroadcast, utils_isValidPublicKey as isValidPublicKey, utils_isValidSparkAddress as isValidSparkAddress, utils_lastKeyWithTarget as lastKeyWithTarget, utils_maybeApplyFee as maybeApplyFee, utils_modInverse as modInverse, utils_proofOfPossessionMessageHashForDepositAddress as proofOfPossessionMessageHashForDepositAddress, utils_protoToNetwork as protoToNetwork, utils_recoverSecret as recoverSecret, utils_splitSecret as splitSecret, utils_splitSecretWithProofs as splitSecretWithProofs, utils_subtractPrivateKeys as subtractPrivateKeys, utils_subtractPublicKeys as subtractPublicKeys, utils_sumAvailableTokens as sumAvailableTokens, utils_sumOfPrivateKeys as sumOfPrivateKeys, utils_validateOutboundAdaptorSignature as validateOutboundAdaptorSignature, utils_validateShare as validateShare };
124
+ export { utils_Bech32mTokenIdentifier as Bech32mTokenIdentifier, utils_Bech32mTokenIdentifierData as Bech32mTokenIdentifierData, utils_BroadcastConfig as BroadcastConfig, utils_BroadcastResult as BroadcastResult, utils_DEFAULT_FEE_SATS as DEFAULT_FEE_SATS, utils_DIRECT_TIMELOCK_OFFSET as DIRECT_TIMELOCK_OFFSET, utils_DecodedSparkAddressData as DecodedSparkAddressData, utils_FeeBumpTxChain as FeeBumpTxChain, utils_FeeBumpTxPackage as FeeBumpTxPackage, utils_FeeRate as FeeRate, utils_INITIAL_DIRECT_SEQUENCE as INITIAL_DIRECT_SEQUENCE, utils_INITIAL_SEQUENCE as INITIAL_SEQUENCE, utils_LRC_WALLET_NETWORK as LRC_WALLET_NETWORK, utils_LRC_WALLET_NETWORK_TYPE as LRC_WALLET_NETWORK_TYPE, utils_LeafInfo as LeafInfo, utils_Network as Network, utils_NetworkToProto as NetworkToProto, utils_NetworkType as NetworkType, utils_SparkAddressData as SparkAddressData, utils_SparkAddressFormat as SparkAddressFormat, utils_TEST_UNILATERAL_DIRECT_SEQUENCE as TEST_UNILATERAL_DIRECT_SEQUENCE, utils_TEST_UNILATERAL_SEQUENCE as TEST_UNILATERAL_SEQUENCE, utils_TxChain as TxChain, utils_Utxo as Utxo, utils_VerifiableSecretShare as VerifiableSecretShare, utils_addPrivateKeys as addPrivateKeys, utils_addPublicKeys as addPublicKeys, utils_applyAdaptorToSignature as applyAdaptorToSignature, utils_applyAdditiveTweakToPublicKey as applyAdditiveTweakToPublicKey, utils_bigIntToPrivateKey as bigIntToPrivateKey, utils_checkIfSelectedOutputsAreAvailable as checkIfSelectedOutputsAreAvailable, utils_checkIfValidSequence as checkIfValidSequence, utils_collectResponses as collectResponses, utils_computeTaprootKeyNoScript as computeTaprootKeyNoScript, utils_computerLagrangeCoefficients as computerLagrangeCoefficients, utils_constructFeeBumpTx as constructFeeBumpTx, utils_constructUnilateralExitFeeBumpPackages as constructUnilateralExitFeeBumpPackages, utils_constructUnilateralExitTxs as constructUnilateralExitTxs, utils_createConnectorRefundTransactions as createConnectorRefundTransactions, utils_createLeafNodeTx as createLeafNodeTx, utils_createNodeTx as createNodeTx, utils_createNodeTxs as createNodeTxs, utils_createRefundTx as createRefundTx, utils_createRefundTxs as createRefundTxs, utils_createRootTx as createRootTx, utils_createSigningCommitment as createSigningCommitment, utils_createSigningNonce as createSigningNonce, utils_createSplitTx as createSplitTx, utils_decodeBech32mTokenIdentifier as decodeBech32mTokenIdentifier, utils_decodeBytesToSigningCommitment as decodeBytesToSigningCommitment, utils_decodeBytesToSigningNonce as decodeBytesToSigningNonce, utils_decodeSparkAddress as decodeSparkAddress, utils_doesLeafNeedRefresh as doesLeafNeedRefresh, utils_encodeBech32mTokenIdentifier as encodeBech32mTokenIdentifier, utils_encodeSigningCommitmentToBytes as encodeSigningCommitmentToBytes, utils_encodeSigningNonceToBytes as encodeSigningNonceToBytes, utils_encodeSparkAddress as encodeSparkAddress, utils_evaluatePolynomial as evaluatePolynomial, utils_fieldDiv as fieldDiv, utils_filterTokenBalanceForTokenPublicKey as filterTokenBalanceForTokenPublicKey, utils_generateAdaptorFromSignature as generateAdaptorFromSignature, utils_generatePolynomialForSecretSharing as generatePolynomialForSecretSharing, utils_generateSignatureFromExistingAdaptor as generateSignatureFromExistingAdaptor, utils_getCurrentTimelock as getCurrentTimelock, utils_getEphemeralAnchorOutput as getEphemeralAnchorOutput, utils_getLatestDepositTxId as getLatestDepositTxId, utils_getNetwork as getNetwork, utils_getNetworkFromAddress as getNetworkFromAddress, utils_getNetworkFromString as getNetworkFromString, utils_getNextTransactionSequence as getNextTransactionSequence, utils_getP2TRAddressFromPkScript as getP2TRAddressFromPkScript, utils_getP2TRAddressFromPublicKey as getP2TRAddressFromPublicKey, utils_getP2TRScriptFromPublicKey as getP2TRScriptFromPublicKey, utils_getP2WPKHAddressFromPublicKey as getP2WPKHAddressFromPublicKey, utils_getRandomBigInt as getRandomBigInt, utils_getRandomSigningNonce as getRandomSigningNonce, utils_getSigHashFromTx as getSigHashFromTx, utils_getSigningCommitmentFromNonce as getSigningCommitmentFromNonce, utils_getSparkAddressFromTaproot as getSparkAddressFromTaproot, utils_getTransactionSequence as getTransactionSequence, utils_getTransferPackageSigningPayload as getTransferPackageSigningPayload, utils_getTxEstimatedVbytesSizeByNumberOfInputsOutputs as getTxEstimatedVbytesSizeByNumberOfInputsOutputs, utils_getTxFromRawTxBytes as getTxFromRawTxBytes, utils_getTxFromRawTxHex as getTxFromRawTxHex, utils_getTxId as getTxId, utils_getTxIdNoReverse as getTxIdNoReverse, utils_isEphemeralAnchorOutput as isEphemeralAnchorOutput, utils_isTxBroadcast as isTxBroadcast, utils_isValidPublicKey as isValidPublicKey, utils_isValidSparkAddress as isValidSparkAddress, utils_lastKeyWithTarget as lastKeyWithTarget, utils_maybeApplyFee as maybeApplyFee, utils_modInverse as modInverse, utils_proofOfPossessionMessageHashForDepositAddress as proofOfPossessionMessageHashForDepositAddress, utils_protoToNetwork as protoToNetwork, utils_recoverSecret as recoverSecret, utils_splitSecret as splitSecret, utils_splitSecretWithProofs as splitSecretWithProofs, utils_subtractPrivateKeys as subtractPrivateKeys, utils_subtractPublicKeys as subtractPublicKeys, utils_sumAvailableTokens as sumAvailableTokens, utils_sumOfPrivateKeys as sumOfPrivateKeys, utils_validateOutboundAdaptorSignature as validateOutboundAdaptorSignature, utils_validateShare as validateShare };
125
125
  }
126
126
 
127
127
  declare const s: {