btc-wallet 0.5.17-beta → 0.5.18-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 -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/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
|
}
|
@@ -4586,7 +4574,6 @@ var BTCWallet = (_0) => __async(void 0, [_0], function* ({
|
|
4586
4574
|
const btcContext = window.btcContext;
|
4587
4575
|
const csna = state_default.getAccount();
|
4588
4576
|
const accountInfo = yield getAccountInfo({ csna, env });
|
4589
|
-
yield checkGasTokenDebt(csna, env, true);
|
4590
4577
|
const trans = [...params.transactions];
|
4591
4578
|
console.log("signAndSendTransactions raw trans:", trans);
|
4592
4579
|
const { transferGasTransaction, useNearPayGas, gasLimit } = yield calculateGasStrategy({
|
@@ -4687,7 +4674,7 @@ function setupBTCWallet({
|
|
4687
4674
|
|
4688
4675
|
// src/index.ts
|
4689
4676
|
var getVersion = () => {
|
4690
|
-
return "0.5.
|
4677
|
+
return "0.5.18-beta";
|
4691
4678
|
};
|
4692
4679
|
if (typeof window !== "undefined") {
|
4693
4680
|
window.__BTC_WALLET_VERSION = getVersion();
|