btc-wallet 0.5.38-beta → 0.5.40-beta

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/esm/index.js CHANGED
@@ -3215,9 +3215,9 @@ function receiveDepositMsg(_0, _1) {
3215
3215
  function checkBridgeTransactionStatus(url, txHash) {
3216
3216
  return __async(this, null, function* () {
3217
3217
  const { result_code, result_message, result_data } = yield request(`${url}/v1/bridgeFromTx?fromTxHash=${txHash}&fromChainId=1`, {
3218
- timeout: 3e5,
3218
+ timeout: 3 * 60 * 60 * 1e3,
3219
3219
  pollingInterval: 5e3,
3220
- maxPollingAttempts: 60,
3220
+ maxPollingAttempts: 3e3,
3221
3221
  shouldStopPolling: (res) => {
3222
3222
  var _a;
3223
3223
  const status = ((_a = res.result_data) == null ? void 0 : _a.Status) || 0;
@@ -3876,8 +3876,6 @@ function calculateGasFee(account, amount, feeRate) {
3876
3876
  }
3877
3877
  function getBtcBalance(account, option) {
3878
3878
  return __async(this, null, function* () {
3879
- const env = (option == null ? void 0 : option.env) || "mainnet";
3880
- let csna = "";
3881
3879
  if (!account) {
3882
3880
  const res = yield retryOperation(getBtcProvider, (res2) => !!res2.account);
3883
3881
  if (!res.account) {
@@ -3885,7 +3883,6 @@ function getBtcBalance(account, option) {
3885
3883
  return { rawBalance: 0, balance: 0, availableBalance: 0 };
3886
3884
  }
3887
3885
  account = res.account;
3888
- csna = yield getCsnaAccountId(env);
3889
3886
  }
3890
3887
  const utxos = yield getBtcUtxos(account);
3891
3888
  const btcDecimals = 8;
@@ -3893,11 +3890,8 @@ function getBtcBalance(account, option) {
3893
3890
  const balance = rawBalance / __pow(10, btcDecimals);
3894
3891
  const estimatedFee = yield calculateGasFee(account, rawBalance);
3895
3892
  let availableRawBalance = (rawBalance - estimatedFee).toFixed(0);
3896
- if (csna) {
3897
- const { protocolFee, repayAmount } = yield getDepositAmount(rawBalance.toString(), {
3898
- env,
3899
- csna
3900
- });
3893
+ if (option == null ? void 0 : option.csna) {
3894
+ const { protocolFee, repayAmount } = yield getDepositAmount(rawBalance.toString(), option);
3901
3895
  availableRawBalance = new Big2(availableRawBalance).minus(protocolFee).minus(repayAmount).toFixed(0);
3902
3896
  }
3903
3897
  const availableBalance = new Big2(availableRawBalance).div(__pow(10, btcDecimals)).round(btcDecimals, Big2.roundDown).toNumber();
@@ -4855,7 +4849,7 @@ function getGroup(state) {
4855
4849
 
4856
4850
  // src/index.ts
4857
4851
  var getVersion = () => {
4858
- return "0.5.38-beta";
4852
+ return "0.5.40-beta";
4859
4853
  };
4860
4854
  if (typeof window !== "undefined") {
4861
4855
  window.__BTC_WALLET_VERSION = getVersion();