btc-wallet 0.5.17-beta → 0.5.19-beta
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/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/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
|
}
|
@@ -4476,7 +4464,6 @@ var BTCWallet = (_0) => __async(void 0, [_0], function* ({
|
|
4476
4464
|
const btcPublicKey = yield btcContext.getPublicKey();
|
4477
4465
|
if (btcPublicKey) {
|
4478
4466
|
yield getNearAccountByBtcPublicKey(btcPublicKey);
|
4479
|
-
yield checkSatoshiWhitelist(btcContext.account, env);
|
4480
4467
|
removeWalletButton();
|
4481
4468
|
setupWalletButton(env, wallet, btcContext);
|
4482
4469
|
}
|
@@ -4636,7 +4623,6 @@ var BTCWallet = (_0) => __async(void 0, [_0], function* ({
|
|
4636
4623
|
const btcContext = window.btcContext;
|
4637
4624
|
const csna = state_default.getAccount();
|
4638
4625
|
const accountInfo = yield getAccountInfo({ csna, env });
|
4639
|
-
yield checkGasTokenDebt(csna, env, true);
|
4640
4626
|
const trans = [...params.transactions];
|
4641
4627
|
console.log("signAndSendTransactions raw trans:", trans);
|
4642
4628
|
const { transferGasTransaction, useNearPayGas, gasLimit } = yield calculateGasStrategy({
|
@@ -4737,7 +4723,7 @@ function setupBTCWallet({
|
|
4737
4723
|
|
4738
4724
|
// src/index.ts
|
4739
4725
|
var getVersion = () => {
|
4740
|
-
return "0.5.
|
4726
|
+
return "0.5.19-beta";
|
4741
4727
|
};
|
4742
4728
|
if (typeof window !== "undefined") {
|
4743
4729
|
window.__BTC_WALLET_VERSION = getVersion();
|