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/esm/index.js
CHANGED
@@ -2225,7 +2225,6 @@ var ConnectProvider = ({
|
|
2225
2225
|
})
|
2226
2226
|
})
|
2227
2227
|
);
|
2228
|
-
console.log("walletEntryPlugin init");
|
2229
2228
|
}
|
2230
2229
|
}, [options, evmSupportChainIds, accountContract]);
|
2231
2230
|
useEffect5(() => {
|
@@ -2234,7 +2233,6 @@ var ConnectProvider = ({
|
|
2234
2233
|
walletEntryPlugin.setWalletCore({
|
2235
2234
|
ethereum: smartAccount.provider
|
2236
2235
|
});
|
2237
|
-
console.log("walletEntryPlugin setWalletCore");
|
2238
2236
|
}
|
2239
2237
|
}, [smartAccount, options]);
|
2240
2238
|
useEffect5(() => {
|
@@ -2242,10 +2240,8 @@ var ConnectProvider = ({
|
|
2242
2240
|
if (((_a2 = options.walletOptions) == null ? void 0 : _a2.visible) !== false) {
|
2243
2241
|
if (evmAccount) {
|
2244
2242
|
walletEntryPlugin.walletEntryCreate();
|
2245
|
-
console.log("walletEntryPlugin walletEntryCreate");
|
2246
2243
|
} else {
|
2247
2244
|
walletEntryPlugin.walletEntryDestroy();
|
2248
|
-
console.log("walletEntryPlugin walletEntryDestroy");
|
2249
2245
|
}
|
2250
2246
|
}
|
2251
2247
|
}, [evmAccount, smartAccount, options]);
|
@@ -3182,8 +3178,7 @@ Dialog.style = `
|
|
3182
3178
|
`;
|
3183
3179
|
|
3184
3180
|
// src/core/btcUtils.ts
|
3185
|
-
var
|
3186
|
-
var MINIMUM_DEPOSIT_AMOUNT_BASE = 1e3;
|
3181
|
+
var MINIMUM_DEPOSIT_AMOUNT_BASE = 0;
|
3187
3182
|
var NEAR_STORAGE_DEPOSIT_AMOUNT = "1250000000000000000000";
|
3188
3183
|
var NBTC_STORAGE_DEPOSIT_AMOUNT = 3e3;
|
3189
3184
|
var GAS_LIMIT = "50000000000000";
|
@@ -3338,13 +3333,10 @@ function getDepositAmount(amount, option) {
|
|
3338
3333
|
return __async(this, null, function* () {
|
3339
3334
|
const config = yield getConfig((option == null ? void 0 : option.env) || "mainnet");
|
3340
3335
|
const {
|
3341
|
-
deposit_bridge_fee: { fee_min, fee_rate }
|
3342
|
-
|
3343
|
-
|
3344
|
-
|
3345
|
-
{}
|
3346
|
-
);
|
3347
|
-
const depositAmount = (option == null ? void 0 : option.isEstimate) ? Number(amount) : Math.max(MINIMUM_DEPOSIT_AMOUNT + MINIMUM_DEPOSIT_AMOUNT_BASE, Number(amount));
|
3336
|
+
deposit_bridge_fee: { fee_min, fee_rate },
|
3337
|
+
min_deposit_amount
|
3338
|
+
} = yield nearCall(config.bridgeContractId, "get_config", {});
|
3339
|
+
const depositAmount = (option == null ? void 0 : option.isEstimate) ? Number(amount) : Math.max(Number(min_deposit_amount) + MINIMUM_DEPOSIT_AMOUNT_BASE, Number(amount));
|
3348
3340
|
const fee = Math.max(Number(fee_min), Number(depositAmount) * fee_rate);
|
3349
3341
|
const receiveAmount = new Big(depositAmount).minus(fee).minus(MINIMUM_DEPOSIT_AMOUNT_BASE).round(0, Big.roundDown).toNumber();
|
3350
3342
|
console.log("getDepositAmount:", { depositAmount, receiveAmount, fee });
|
@@ -3550,6 +3542,7 @@ var BTCWallet = (_0) => __async(void 0, [_0], function* ({
|
|
3550
3542
|
const accountId = state.getAccount();
|
3551
3543
|
const btcContext = window.btcContext;
|
3552
3544
|
if (accountId && btcContext.account) {
|
3545
|
+
removeWalletButton();
|
3553
3546
|
setupWalletButton(env, wallet, btcContext);
|
3554
3547
|
} else {
|
3555
3548
|
removeWalletButton();
|
@@ -3959,7 +3952,7 @@ function setupBTCWallet({
|
|
3959
3952
|
|
3960
3953
|
// src/index.ts
|
3961
3954
|
var getVersion = () => {
|
3962
|
-
return "0.3.
|
3955
|
+
return "0.3.31";
|
3963
3956
|
};
|
3964
3957
|
if (typeof window !== "undefined") {
|
3965
3958
|
window.__BTC_WALLET_VERSION = getVersion();
|