btc-wallet 0.3.31 → 0.3.32

Sign up to get free protection for your applications and to get access to all the features.
@@ -9,3 +9,4 @@ export declare function retryOperation<T>(operation: () => Promise<T> | T, shoul
9
9
  maxRetries?: number;
10
10
  delayMs?: number;
11
11
  }): Promise<T>;
12
+ export declare function toHex(originalString: string): string;
package/esm/index.js CHANGED
@@ -1332,6 +1332,14 @@ function retryOperation(_0, _1) {
1332
1332
  throw new Error("Unexpected execution path");
1333
1333
  });
1334
1334
  }
1335
+ function toHex(originalString) {
1336
+ const charArray = originalString.split("");
1337
+ const asciiArray = charArray.map((char) => char.charCodeAt(0));
1338
+ const hexArray = asciiArray.map((code) => code.toString(16));
1339
+ let hexString = hexArray.join("");
1340
+ hexString = hexString.replace(/(^0+)/g, "");
1341
+ return hexString;
1342
+ }
1335
1343
 
1336
1344
  // src/utils/ethereumUtils.ts
1337
1345
  import {
@@ -2979,7 +2987,7 @@ function checkBridgeTransactionStatus(url, txHash) {
2979
2987
  }
2980
2988
  function checkBtcTransactionStatus(url, sig) {
2981
2989
  return __async(this, null, function* () {
2982
- const { result_code, result_message, result_data } = yield request(`${url}/v1/btcTx?sig=${sig}`, {
2990
+ const { result_code, result_message, result_data } = yield request(`${url}/v1/btcTx?sig=${toHex(sig)}`, {
2983
2991
  timeout: 3e5,
2984
2992
  pollingInterval: 5e3,
2985
2993
  maxPollingAttempts: 60,
@@ -3913,14 +3921,6 @@ var BTCWallet = (_0) => __async(void 0, [_0], function* ({
3913
3921
  }
3914
3922
  return wallet;
3915
3923
  });
3916
- function toHex(originalString) {
3917
- const charArray = originalString.split("");
3918
- const asciiArray = charArray.map((char) => char.charCodeAt(0));
3919
- const hexArray = asciiArray.map((code) => code.toString(16));
3920
- let hexString = hexArray.join("");
3921
- hexString = hexString.replace(/(^0+)/g, "");
3922
- return hexString;
3923
- }
3924
3924
  function setupBTCWallet({
3925
3925
  iconUrl = "https://assets.deltatrade.ai/assets/chain/btc.svg",
3926
3926
  deprecated = false,
@@ -3952,7 +3952,7 @@ function setupBTCWallet({
3952
3952
 
3953
3953
  // src/index.ts
3954
3954
  var getVersion = () => {
3955
- return "0.3.31";
3955
+ return "0.3.32";
3956
3956
  };
3957
3957
  if (typeof window !== "undefined") {
3958
3958
  window.__BTC_WALLET_VERSION = getVersion();