btc-wallet 0.3.30 → 0.3.31
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.js +7 -14
- package/dist/index.js.map +2 -2
- package/esm/index.js +7 -14
- package/esm/index.js.map +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -2271,7 +2271,6 @@ var ConnectProvider = ({
|
|
2271
2271
|
})
|
2272
2272
|
})
|
2273
2273
|
);
|
2274
|
-
console.log("walletEntryPlugin init");
|
2275
2274
|
}
|
2276
2275
|
}, [options, evmSupportChainIds, accountContract]);
|
2277
2276
|
(0, import_react10.useEffect)(() => {
|
@@ -2280,7 +2279,6 @@ var ConnectProvider = ({
|
|
2280
2279
|
import_wallet.walletEntryPlugin.setWalletCore({
|
2281
2280
|
ethereum: smartAccount.provider
|
2282
2281
|
});
|
2283
|
-
console.log("walletEntryPlugin setWalletCore");
|
2284
2282
|
}
|
2285
2283
|
}, [smartAccount, options]);
|
2286
2284
|
(0, import_react10.useEffect)(() => {
|
@@ -2288,10 +2286,8 @@ var ConnectProvider = ({
|
|
2288
2286
|
if (((_a2 = options.walletOptions) == null ? void 0 : _a2.visible) !== false) {
|
2289
2287
|
if (evmAccount) {
|
2290
2288
|
import_wallet.walletEntryPlugin.walletEntryCreate();
|
2291
|
-
console.log("walletEntryPlugin walletEntryCreate");
|
2292
2289
|
} else {
|
2293
2290
|
import_wallet.walletEntryPlugin.walletEntryDestroy();
|
2294
|
-
console.log("walletEntryPlugin walletEntryDestroy");
|
2295
2291
|
}
|
2296
2292
|
}
|
2297
2293
|
}, [evmAccount, smartAccount, options]);
|
@@ -3228,8 +3224,7 @@ Dialog.style = `
|
|
3228
3224
|
`;
|
3229
3225
|
|
3230
3226
|
// src/core/btcUtils.ts
|
3231
|
-
var
|
3232
|
-
var MINIMUM_DEPOSIT_AMOUNT_BASE = 1e3;
|
3227
|
+
var MINIMUM_DEPOSIT_AMOUNT_BASE = 0;
|
3233
3228
|
var NEAR_STORAGE_DEPOSIT_AMOUNT = "1250000000000000000000";
|
3234
3229
|
var NBTC_STORAGE_DEPOSIT_AMOUNT = 3e3;
|
3235
3230
|
var GAS_LIMIT = "50000000000000";
|
@@ -3384,13 +3379,10 @@ function getDepositAmount(amount, option) {
|
|
3384
3379
|
return __async(this, null, function* () {
|
3385
3380
|
const config = yield getConfig((option == null ? void 0 : option.env) || "mainnet");
|
3386
3381
|
const {
|
3387
|
-
deposit_bridge_fee: { fee_min, fee_rate }
|
3388
|
-
|
3389
|
-
|
3390
|
-
|
3391
|
-
{}
|
3392
|
-
);
|
3393
|
-
const depositAmount = (option == null ? void 0 : option.isEstimate) ? Number(amount) : Math.max(MINIMUM_DEPOSIT_AMOUNT + MINIMUM_DEPOSIT_AMOUNT_BASE, Number(amount));
|
3382
|
+
deposit_bridge_fee: { fee_min, fee_rate },
|
3383
|
+
min_deposit_amount
|
3384
|
+
} = yield nearCall(config.bridgeContractId, "get_config", {});
|
3385
|
+
const depositAmount = (option == null ? void 0 : option.isEstimate) ? Number(amount) : Math.max(Number(min_deposit_amount) + MINIMUM_DEPOSIT_AMOUNT_BASE, Number(amount));
|
3394
3386
|
const fee = Math.max(Number(fee_min), Number(depositAmount) * fee_rate);
|
3395
3387
|
const receiveAmount = new import_big.default(depositAmount).minus(fee).minus(MINIMUM_DEPOSIT_AMOUNT_BASE).round(0, import_big.default.roundDown).toNumber();
|
3396
3388
|
console.log("getDepositAmount:", { depositAmount, receiveAmount, fee });
|
@@ -3596,6 +3588,7 @@ var BTCWallet = (_0) => __async(void 0, [_0], function* ({
|
|
3596
3588
|
const accountId = state.getAccount();
|
3597
3589
|
const btcContext = window.btcContext;
|
3598
3590
|
if (accountId && btcContext.account) {
|
3591
|
+
removeWalletButton();
|
3599
3592
|
setupWalletButton(env, wallet, btcContext);
|
3600
3593
|
} else {
|
3601
3594
|
removeWalletButton();
|
@@ -4005,7 +3998,7 @@ function setupBTCWallet({
|
|
4005
3998
|
|
4006
3999
|
// src/index.ts
|
4007
4000
|
var getVersion = () => {
|
4008
|
-
return "0.3.
|
4001
|
+
return "0.3.31";
|
4009
4002
|
};
|
4010
4003
|
if (typeof window !== "undefined") {
|
4011
4004
|
window.__BTC_WALLET_VERSION = getVersion();
|