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/esm/index.js CHANGED
@@ -3265,7 +3265,7 @@ function getBtcBalance() {
3265
3265
  return {
3266
3266
  rawBalance,
3267
3267
  balance,
3268
- availableBalance
3268
+ availableBalance: Math.max(availableBalance, 0)
3269
3269
  };
3270
3270
  });
3271
3271
  }
@@ -3294,7 +3294,8 @@ function getDepositAmount(amount, option) {
3294
3294
  );
3295
3295
  const depositAmount = (option == null ? void 0 : option.isEstimate) ? Number(amount) : Math.max(MINIMUM_DEPOSIT_AMOUNT + MINIMUM_DEPOSIT_AMOUNT_BASE, Number(amount));
3296
3296
  const fee = Math.max(Number(fee_min), Number(depositAmount) * fee_rate);
3297
- const receiveAmount = new Big(depositAmount).minus(fee).round(0, Big.roundDown).toNumber();
3297
+ const receiveAmount = new Big(depositAmount).minus(fee).minus(MINIMUM_DEPOSIT_AMOUNT_BASE).round(0, Big.roundDown).toNumber();
3298
+ console.log("getDepositAmount:", { depositAmount, receiveAmount, fee });
3298
3299
  return {
3299
3300
  depositAmount,
3300
3301
  receiveAmount: Math.max(receiveAmount, 0),
@@ -3868,7 +3869,7 @@ function setupBTCWallet({
3868
3869
 
3869
3870
  // src/index.ts
3870
3871
  var getVersion = () => {
3871
- return "0.3.16";
3872
+ return "0.3.17";
3872
3873
  };
3873
3874
  if (typeof window !== "undefined") {
3874
3875
  window.__BTC_WALLET_VERSION = getVersion();