btc-wallet 0.5.17-beta → 0.5.19-beta
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.js +18 -32
- package/dist/index.js.map +2 -2
- package/esm/index.js +18 -32
- package/esm/index.js.map +2 -2
- package/package.json +1 -1
package/esm/index.js
CHANGED
@@ -3466,21 +3466,15 @@ function calculateGasStrategy(_0) {
|
|
3466
3466
|
console.log("perTxFee:", perTxFee);
|
3467
3467
|
const protocolFee = new Big(perTxFee || "0").mul(convertTx.length).toFixed(0);
|
3468
3468
|
console.log("protocolFee:", protocolFee);
|
3469
|
-
|
3470
|
-
|
3471
|
-
|
3472
|
-
|
3473
|
-
|
3474
|
-
|
3475
|
-
|
3476
|
-
|
3477
|
-
|
3478
|
-
transactions: convertTx,
|
3479
|
-
useNearPayGas: true,
|
3480
|
-
perTxFee: perTxFee.toString(),
|
3481
|
-
env
|
3482
|
-
});
|
3483
|
-
}
|
3469
|
+
const transferTx = yield createGasTokenTransfer({ csna, amount: protocolFee, env });
|
3470
|
+
return recalculateGasWithTransfer({
|
3471
|
+
csna,
|
3472
|
+
transferTx,
|
3473
|
+
transactions: convertTx,
|
3474
|
+
useNearPayGas: true,
|
3475
|
+
perTxFee: perTxFee.toString(),
|
3476
|
+
env
|
3477
|
+
});
|
3484
3478
|
} else {
|
3485
3479
|
console.log("near balance is not enough, predict the gas token amount required");
|
3486
3480
|
const adjustedGas = yield getPredictedGasAmount({
|
@@ -3489,20 +3483,14 @@ function calculateGasStrategy(_0) {
|
|
3489
3483
|
transactions: convertTx.map((t) => t.txHex),
|
3490
3484
|
env
|
3491
3485
|
});
|
3492
|
-
|
3493
|
-
|
3494
|
-
|
3495
|
-
|
3496
|
-
|
3497
|
-
|
3498
|
-
|
3499
|
-
|
3500
|
-
transferTx,
|
3501
|
-
transactions: convertTx,
|
3502
|
-
useNearPayGas: false,
|
3503
|
-
env
|
3504
|
-
});
|
3505
|
-
}
|
3486
|
+
const transferTx = yield createGasTokenTransfer({ csna, amount: adjustedGas, env });
|
3487
|
+
return recalculateGasWithTransfer({
|
3488
|
+
csna,
|
3489
|
+
transferTx,
|
3490
|
+
transactions: convertTx,
|
3491
|
+
useNearPayGas: false,
|
3492
|
+
env
|
3493
|
+
});
|
3506
3494
|
}
|
3507
3495
|
});
|
3508
3496
|
}
|
@@ -4426,7 +4414,6 @@ var BTCWallet = (_0) => __async(void 0, [_0], function* ({
|
|
4426
4414
|
const btcPublicKey = yield btcContext.getPublicKey();
|
4427
4415
|
if (btcPublicKey) {
|
4428
4416
|
yield getNearAccountByBtcPublicKey(btcPublicKey);
|
4429
|
-
yield checkSatoshiWhitelist(btcContext.account, env);
|
4430
4417
|
removeWalletButton();
|
4431
4418
|
setupWalletButton(env, wallet, btcContext);
|
4432
4419
|
}
|
@@ -4586,7 +4573,6 @@ var BTCWallet = (_0) => __async(void 0, [_0], function* ({
|
|
4586
4573
|
const btcContext = window.btcContext;
|
4587
4574
|
const csna = state_default.getAccount();
|
4588
4575
|
const accountInfo = yield getAccountInfo({ csna, env });
|
4589
|
-
yield checkGasTokenDebt(csna, env, true);
|
4590
4576
|
const trans = [...params.transactions];
|
4591
4577
|
console.log("signAndSendTransactions raw trans:", trans);
|
4592
4578
|
const { transferGasTransaction, useNearPayGas, gasLimit } = yield calculateGasStrategy({
|
@@ -4687,7 +4673,7 @@ function setupBTCWallet({
|
|
4687
4673
|
|
4688
4674
|
// src/index.ts
|
4689
4675
|
var getVersion = () => {
|
4690
|
-
return "0.5.
|
4676
|
+
return "0.5.19-beta";
|
4691
4677
|
};
|
4692
4678
|
if (typeof window !== "undefined") {
|
4693
4679
|
window.__BTC_WALLET_VERSION = getVersion();
|