btc-wallet 0.5.88-beta → 0.5.89-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
@@ -3837,14 +3837,14 @@ function checkGasTokenDebt(_0) {
3837
3837
  }
3838
3838
  });
3839
3839
  }
3840
- function getBtcGasPrice() {
3840
+ function getBtcGasPrice(type = "halfHour") {
3841
3841
  return __async(this, null, function* () {
3842
3842
  const network = yield getNetwork();
3843
3843
  const defaultFeeRate = network === "mainnet" ? 5 : 2500;
3844
3844
  try {
3845
3845
  const btcRpcUrl = yield getBtcRpcUrl();
3846
3846
  const res = yield fetch(`${btcRpcUrl}/v1/fees/recommended`).then((res2) => res2.json());
3847
- const feeRate = res.fastestFee ? Number(res.fastestFee) + 1 : defaultFeeRate;
3847
+ const feeRate = res[type + "Fee"] ? Number(res[type + "Fee"]) : defaultFeeRate;
3848
3848
  return feeRate;
3849
3849
  } catch (error) {
3850
3850
  return defaultFeeRate;
@@ -3865,7 +3865,7 @@ function calculateGasFee(account, amount, feeRate) {
3865
3865
  const _feeRate = feeRate || (yield getBtcGasPrice());
3866
3866
  const utxos = yield getBtcUtxos(account);
3867
3867
  const { fee } = coinselect(utxos, [{ address: account, value: amount }], Math.ceil(_feeRate));
3868
- console.log("calculateGasFee fee:", fee);
3868
+ console.log("calculateGasFee fee:", fee, "feeRate:", _feeRate);
3869
3869
  return fee;
3870
3870
  });
3871
3871
  }
@@ -5340,7 +5340,7 @@ function getGroup(state) {
5340
5340
 
5341
5341
  // src/index.ts
5342
5342
  var getVersion = () => {
5343
- return "0.5.88-beta";
5343
+ return "0.5.89-beta";
5344
5344
  };
5345
5345
  if (typeof window !== "undefined") {
5346
5346
  window.__BTC_WALLET_VERSION = getVersion();