btc-wallet 0.5.18-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/dist/index.js CHANGED
@@ -3276,12 +3276,13 @@ function checkBridgeTransactionStatus(url, txHash) {
3276
3276
  maxPollingAttempts: 60,
3277
3277
  shouldStopPolling: (res) => {
3278
3278
  var _a;
3279
- return res.result_code === 0 && [4, 102].includes(((_a = res.result_data) == null ? void 0 : _a.Status) || 0);
3279
+ const status = ((_a = res.result_data) == null ? void 0 : _a.Status) || 0;
3280
+ return res.result_code === 0 && (status === 4 || status >= 50);
3280
3281
  }
3281
3282
  });
3282
3283
  console.log("checkTransactionStatus resp:", { result_code, result_message, result_data });
3283
3284
  if ((result_data == null ? void 0 : result_data.Status) !== 4) {
3284
- throw new Error(result_message);
3285
+ throw new Error(result_message || `Transaction failed, status: ${result_data == null ? void 0 : result_data.Status}`);
3285
3286
  }
3286
3287
  return result_data;
3287
3288
  });
@@ -3294,12 +3295,13 @@ function checkBtcTransactionStatus(url, sig) {
3294
3295
  maxPollingAttempts: 60,
3295
3296
  shouldStopPolling: (res) => {
3296
3297
  var _a;
3297
- return res.result_code === 0 && [3, 101, 102].includes(((_a = res.result_data) == null ? void 0 : _a.Status) || 0);
3298
+ const status = ((_a = res.result_data) == null ? void 0 : _a.Status) || 0;
3299
+ return res.result_code === 0 && (status === 3 || status >= 10);
3298
3300
  }
3299
3301
  });
3300
3302
  console.log("checkBtcTransactionStatus resp:", { result_code, result_message, result_data });
3301
3303
  if ((result_data == null ? void 0 : result_data.Status) !== 3) {
3302
- throw new Error(result_message);
3304
+ throw new Error(result_message || `Transaction failed, status: ${result_data == null ? void 0 : result_data.Status}`);
3303
3305
  }
3304
3306
  return result_data;
3305
3307
  });
@@ -4464,7 +4466,6 @@ var BTCWallet = (_0) => __async(void 0, [_0], function* ({
4464
4466
  const btcPublicKey = yield btcContext.getPublicKey();
4465
4467
  if (btcPublicKey) {
4466
4468
  yield getNearAccountByBtcPublicKey(btcPublicKey);
4467
- yield checkSatoshiWhitelist(btcContext.account, env);
4468
4469
  removeWalletButton();
4469
4470
  setupWalletButton(env, wallet, btcContext);
4470
4471
  }
@@ -4624,6 +4625,7 @@ var BTCWallet = (_0) => __async(void 0, [_0], function* ({
4624
4625
  const btcContext = window.btcContext;
4625
4626
  const csna = state_default.getAccount();
4626
4627
  const accountInfo = yield getAccountInfo({ csna, env });
4628
+ yield checkGasTokenDebt(csna, env, true);
4627
4629
  const trans = [...params.transactions];
4628
4630
  console.log("signAndSendTransactions raw trans:", trans);
4629
4631
  const { transferGasTransaction, useNearPayGas, gasLimit } = yield calculateGasStrategy({
@@ -4724,7 +4726,7 @@ function setupBTCWallet({
4724
4726
 
4725
4727
  // src/index.ts
4726
4728
  var getVersion = () => {
4727
- return "0.5.18-beta";
4729
+ return "0.5.20-beta";
4728
4730
  };
4729
4731
  if (typeof window !== "undefined") {
4730
4732
  window.__BTC_WALLET_VERSION = getVersion();