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/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
- if (new Big(gasTokenBalance).gte(protocolFee)) {
3470
- console.log("use near pay gas and enough gas token balance");
3471
- return { useNearPayGas: true, gasLimit: protocolFee };
3472
- } else {
3473
- console.log("use near pay gas and not enough gas token balance");
3474
- const transferTx = yield createGasTokenTransfer({ csna, amount: protocolFee, env });
3475
- return recalculateGasWithTransfer({
3476
- csna,
3477
- transferTx,
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
- if (new Big(gasTokenBalance).gte(adjustedGas)) {
3493
- console.log("use gas token and gas token balance is enough");
3494
- return { useNearPayGas: false, gasLimit: adjustedGas };
3495
- } else {
3496
- console.log("use gas token and gas token balance is not enough, need to transfer");
3497
- const transferTx = yield createGasTokenTransfer({ csna, amount: adjustedGas, env });
3498
- return recalculateGasWithTransfer({
3499
- csna,
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.17-beta";
4676
+ return "0.5.19-beta";
4691
4677
  };
4692
4678
  if (typeof window !== "undefined") {
4693
4679
  window.__BTC_WALLET_VERSION = getVersion();