btc-wallet 0.5.16-beta → 0.5.18-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
  }
@@ -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.16-beta";
4677
+ return "0.5.18-beta";
4691
4678
  };
4692
4679
  if (typeof window !== "undefined") {
4693
4680
  window.__BTC_WALLET_VERSION = getVersion();
@@ -4706,6 +4693,7 @@ export {
4706
4693
  UnisatConnector,
4707
4694
  WizzConnector,
4708
4695
  XverseConnector,
4696
+ btcRpcUrls,
4709
4697
  checkGasTokenDebt,
4710
4698
  checkSatoshiWhitelist,
4711
4699
  estimateDepositAmount,
@@ -4715,7 +4703,9 @@ export {
4715
4703
  getCsnaAccountId,
4716
4704
  getDepositAmount,
4717
4705
  getVersion,
4706
+ getWalletConfig,
4718
4707
  getWithdrawTransaction,
4708
+ nearRpcUrls,
4719
4709
  sendBitcoin,
4720
4710
  setupBTCWallet,
4721
4711
  useAccountContract,
@@ -4724,6 +4714,7 @@ export {
4724
4714
  useBtcWalletSelector,
4725
4715
  useConnectModal,
4726
4716
  useConnector,
4727
- useETHProvider
4717
+ useETHProvider,
4718
+ walletConfig
4728
4719
  };
4729
4720
  //# sourceMappingURL=index.js.map