btc-wallet 0.4.0-beta → 0.4.2-beta

Sign up to get free protection for your applications and to get access to all the features.
package/esm/index.js CHANGED
@@ -3791,7 +3791,8 @@ var BTCWallet = (_0) => __async(void 0, [_0], function* ({
3791
3791
  trans.map((transaction, index) => convertTransactionToTxHex(transaction, index))
3792
3792
  );
3793
3793
  const nonceFromApi = yield getNonce(currentConfig.base_url, accountId);
3794
- const nonce = Number(nonceFromApi) > Number(accountInfo == null ? void 0 : accountInfo.nonce) ? String(nonceFromApi) : String(accountInfo == null ? void 0 : accountInfo.nonce);
3794
+ const nonceFromContract = (accountInfo == null ? void 0 : accountInfo.nonce) || 0;
3795
+ const nonce = Number(nonceFromApi) > Number(nonceFromContract) ? String(nonceFromApi) : String(nonceFromContract);
3795
3796
  const intention = {
3796
3797
  chain_id: "397",
3797
3798
  csna: accountId,
@@ -3873,8 +3874,10 @@ var BTCWallet = (_0) => __async(void 0, [_0], function* ({
3873
3874
  near_transactions: transactions2
3874
3875
  });
3875
3876
  const predictedGasAmount = new Big2(predictedGas).mul(1.2).toFixed(0);
3877
+ const miniGasAmount = 200;
3878
+ const gasAmount = Math.max(Number(predictedGasAmount), miniGasAmount);
3876
3879
  console.log("predictedGas:", predictedGasAmount);
3877
- return predictedGasAmount;
3880
+ return gasAmount.toString();
3878
3881
  });
3879
3882
  }
3880
3883
  function calculateGasStrategy(gasTokenBalance, transactions2) {
@@ -4006,7 +4009,7 @@ function setupBTCWallet({
4006
4009
 
4007
4010
  // src/index.ts
4008
4011
  var getVersion = () => {
4009
- return "0.4.0-beta";
4012
+ return "0.4.2-beta";
4010
4013
  };
4011
4014
  if (typeof window !== "undefined") {
4012
4015
  window.__BTC_WALLET_VERSION = getVersion();