btc-wallet 0.4.0-beta → 0.4.2-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 CHANGED
@@ -3838,7 +3838,8 @@ var BTCWallet = (_0) => __async(void 0, [_0], function* ({
3838
3838
  trans.map((transaction, index) => convertTransactionToTxHex(transaction, index))
3839
3839
  );
3840
3840
  const nonceFromApi = yield getNonce(currentConfig.base_url, accountId);
3841
- const nonce = Number(nonceFromApi) > Number(accountInfo == null ? void 0 : accountInfo.nonce) ? String(nonceFromApi) : String(accountInfo == null ? void 0 : accountInfo.nonce);
3841
+ const nonceFromContract = (accountInfo == null ? void 0 : accountInfo.nonce) || 0;
3842
+ const nonce = Number(nonceFromApi) > Number(nonceFromContract) ? String(nonceFromApi) : String(nonceFromContract);
3842
3843
  const intention = {
3843
3844
  chain_id: "397",
3844
3845
  csna: accountId,
@@ -3920,8 +3921,10 @@ var BTCWallet = (_0) => __async(void 0, [_0], function* ({
3920
3921
  near_transactions: transactions2
3921
3922
  });
3922
3923
  const predictedGasAmount = new import_big2.default(predictedGas).mul(1.2).toFixed(0);
3924
+ const miniGasAmount = 200;
3925
+ const gasAmount = Math.max(Number(predictedGasAmount), miniGasAmount);
3923
3926
  console.log("predictedGas:", predictedGasAmount);
3924
- return predictedGasAmount;
3927
+ return gasAmount.toString();
3925
3928
  });
3926
3929
  }
3927
3930
  function calculateGasStrategy(gasTokenBalance, transactions2) {
@@ -4053,7 +4056,7 @@ function setupBTCWallet({
4053
4056
 
4054
4057
  // src/index.ts
4055
4058
  var getVersion = () => {
4056
- return "0.4.0-beta";
4059
+ return "0.4.2-beta";
4057
4060
  };
4058
4061
  if (typeof window !== "undefined") {
4059
4062
  window.__BTC_WALLET_VERSION = getVersion();