btc-wallet 0.3.16 → 0.3.17

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/dist/index.js CHANGED
@@ -3309,7 +3309,7 @@ function getBtcBalance() {
3309
3309
  return {
3310
3310
  rawBalance,
3311
3311
  balance,
3312
- availableBalance
3312
+ availableBalance: Math.max(availableBalance, 0)
3313
3313
  };
3314
3314
  });
3315
3315
  }
@@ -3338,7 +3338,8 @@ function getDepositAmount(amount, option) {
3338
3338
  );
3339
3339
  const depositAmount = (option == null ? void 0 : option.isEstimate) ? Number(amount) : Math.max(MINIMUM_DEPOSIT_AMOUNT + MINIMUM_DEPOSIT_AMOUNT_BASE, Number(amount));
3340
3340
  const fee = Math.max(Number(fee_min), Number(depositAmount) * fee_rate);
3341
- const receiveAmount = new import_big.default(depositAmount).minus(fee).round(0, import_big.default.roundDown).toNumber();
3341
+ const receiveAmount = new import_big.default(depositAmount).minus(fee).minus(MINIMUM_DEPOSIT_AMOUNT_BASE).round(0, import_big.default.roundDown).toNumber();
3342
+ console.log("getDepositAmount:", { depositAmount, receiveAmount, fee });
3342
3343
  return {
3343
3344
  depositAmount,
3344
3345
  receiveAmount: Math.max(receiveAmount, 0),
@@ -3912,7 +3913,7 @@ function setupBTCWallet({
3912
3913
 
3913
3914
  // src/index.ts
3914
3915
  var getVersion = () => {
3915
- return "0.3.16";
3916
+ return "0.3.17";
3916
3917
  };
3917
3918
  if (typeof window !== "undefined") {
3918
3919
  window.__BTC_WALLET_VERSION = getVersion();