btc-wallet 0.5.19-beta → 0.5.20-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/esm/index.js CHANGED
@@ -3226,12 +3226,13 @@ function checkBridgeTransactionStatus(url, txHash) {
3226
3226
  maxPollingAttempts: 60,
3227
3227
  shouldStopPolling: (res) => {
3228
3228
  var _a;
3229
- return res.result_code === 0 && [4, 102].includes(((_a = res.result_data) == null ? void 0 : _a.Status) || 0);
3229
+ const status = ((_a = res.result_data) == null ? void 0 : _a.Status) || 0;
3230
+ return res.result_code === 0 && (status === 4 || status >= 50);
3230
3231
  }
3231
3232
  });
3232
3233
  console.log("checkTransactionStatus resp:", { result_code, result_message, result_data });
3233
3234
  if ((result_data == null ? void 0 : result_data.Status) !== 4) {
3234
- throw new Error(result_message);
3235
+ throw new Error(result_message || `Transaction failed, status: ${result_data == null ? void 0 : result_data.Status}`);
3235
3236
  }
3236
3237
  return result_data;
3237
3238
  });
@@ -3244,12 +3245,13 @@ function checkBtcTransactionStatus(url, sig) {
3244
3245
  maxPollingAttempts: 60,
3245
3246
  shouldStopPolling: (res) => {
3246
3247
  var _a;
3247
- return res.result_code === 0 && [3, 101, 102].includes(((_a = res.result_data) == null ? void 0 : _a.Status) || 0);
3248
+ const status = ((_a = res.result_data) == null ? void 0 : _a.Status) || 0;
3249
+ return res.result_code === 0 && (status === 3 || status >= 10);
3248
3250
  }
3249
3251
  });
3250
3252
  console.log("checkBtcTransactionStatus resp:", { result_code, result_message, result_data });
3251
3253
  if ((result_data == null ? void 0 : result_data.Status) !== 3) {
3252
- throw new Error(result_message);
3254
+ throw new Error(result_message || `Transaction failed, status: ${result_data == null ? void 0 : result_data.Status}`);
3253
3255
  }
3254
3256
  return result_data;
3255
3257
  });
@@ -4573,6 +4575,7 @@ var BTCWallet = (_0) => __async(void 0, [_0], function* ({
4573
4575
  const btcContext = window.btcContext;
4574
4576
  const csna = state_default.getAccount();
4575
4577
  const accountInfo = yield getAccountInfo({ csna, env });
4578
+ yield checkGasTokenDebt(csna, env, true);
4576
4579
  const trans = [...params.transactions];
4577
4580
  console.log("signAndSendTransactions raw trans:", trans);
4578
4581
  const { transferGasTransaction, useNearPayGas, gasLimit } = yield calculateGasStrategy({
@@ -4673,7 +4676,7 @@ function setupBTCWallet({
4673
4676
 
4674
4677
  // src/index.ts
4675
4678
  var getVersion = () => {
4676
- return "0.5.19-beta";
4679
+ return "0.5.20-beta";
4677
4680
  };
4678
4681
  if (typeof window !== "undefined") {
4679
4682
  window.__BTC_WALLET_VERSION = getVersion();