btc-wallet 0.5.17-beta → 0.5.18-beta
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.js +18 -31
- package/dist/index.js.map +2 -2
- package/esm/index.js +18 -31
- package/esm/index.js.map +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -3516,21 +3516,15 @@ function calculateGasStrategy(_0) {
|
|
3516
3516
|
console.log("perTxFee:", perTxFee);
|
3517
3517
|
const protocolFee = new import_big.default(perTxFee || "0").mul(convertTx.length).toFixed(0);
|
3518
3518
|
console.log("protocolFee:", protocolFee);
|
3519
|
-
|
3520
|
-
|
3521
|
-
|
3522
|
-
|
3523
|
-
|
3524
|
-
|
3525
|
-
|
3526
|
-
|
3527
|
-
|
3528
|
-
transactions: convertTx,
|
3529
|
-
useNearPayGas: true,
|
3530
|
-
perTxFee: perTxFee.toString(),
|
3531
|
-
env
|
3532
|
-
});
|
3533
|
-
}
|
3519
|
+
const transferTx = yield createGasTokenTransfer({ csna, amount: protocolFee, env });
|
3520
|
+
return recalculateGasWithTransfer({
|
3521
|
+
csna,
|
3522
|
+
transferTx,
|
3523
|
+
transactions: convertTx,
|
3524
|
+
useNearPayGas: true,
|
3525
|
+
perTxFee: perTxFee.toString(),
|
3526
|
+
env
|
3527
|
+
});
|
3534
3528
|
} else {
|
3535
3529
|
console.log("near balance is not enough, predict the gas token amount required");
|
3536
3530
|
const adjustedGas = yield getPredictedGasAmount({
|
@@ -3539,20 +3533,14 @@ function calculateGasStrategy(_0) {
|
|
3539
3533
|
transactions: convertTx.map((t) => t.txHex),
|
3540
3534
|
env
|
3541
3535
|
});
|
3542
|
-
|
3543
|
-
|
3544
|
-
|
3545
|
-
|
3546
|
-
|
3547
|
-
|
3548
|
-
|
3549
|
-
|
3550
|
-
transferTx,
|
3551
|
-
transactions: convertTx,
|
3552
|
-
useNearPayGas: false,
|
3553
|
-
env
|
3554
|
-
});
|
3555
|
-
}
|
3536
|
+
const transferTx = yield createGasTokenTransfer({ csna, amount: adjustedGas, env });
|
3537
|
+
return recalculateGasWithTransfer({
|
3538
|
+
csna,
|
3539
|
+
transferTx,
|
3540
|
+
transactions: convertTx,
|
3541
|
+
useNearPayGas: false,
|
3542
|
+
env
|
3543
|
+
});
|
3556
3544
|
}
|
3557
3545
|
});
|
3558
3546
|
}
|
@@ -4636,7 +4624,6 @@ var BTCWallet = (_0) => __async(void 0, [_0], function* ({
|
|
4636
4624
|
const btcContext = window.btcContext;
|
4637
4625
|
const csna = state_default.getAccount();
|
4638
4626
|
const accountInfo = yield getAccountInfo({ csna, env });
|
4639
|
-
yield checkGasTokenDebt(csna, env, true);
|
4640
4627
|
const trans = [...params.transactions];
|
4641
4628
|
console.log("signAndSendTransactions raw trans:", trans);
|
4642
4629
|
const { transferGasTransaction, useNearPayGas, gasLimit } = yield calculateGasStrategy({
|
@@ -4737,7 +4724,7 @@ function setupBTCWallet({
|
|
4737
4724
|
|
4738
4725
|
// src/index.ts
|
4739
4726
|
var getVersion = () => {
|
4740
|
-
return "0.5.
|
4727
|
+
return "0.5.18-beta";
|
4741
4728
|
};
|
4742
4729
|
if (typeof window !== "undefined") {
|
4743
4730
|
window.__BTC_WALLET_VERSION = getVersion();
|