btc-wallet 0.5.19-beta → 0.5.20-beta
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.js +8 -5
- package/dist/index.js.map +2 -2
- package/esm/index.js +8 -5
- package/esm/index.js.map +2 -2
- package/package.json +1 -1
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
|
-
|
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
|
-
|
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
|
});
|
@@ -4623,6 +4625,7 @@ var BTCWallet = (_0) => __async(void 0, [_0], function* ({
|
|
4623
4625
|
const btcContext = window.btcContext;
|
4624
4626
|
const csna = state_default.getAccount();
|
4625
4627
|
const accountInfo = yield getAccountInfo({ csna, env });
|
4628
|
+
yield checkGasTokenDebt(csna, env, true);
|
4626
4629
|
const trans = [...params.transactions];
|
4627
4630
|
console.log("signAndSendTransactions raw trans:", trans);
|
4628
4631
|
const { transferGasTransaction, useNearPayGas, gasLimit } = yield calculateGasStrategy({
|
@@ -4723,7 +4726,7 @@ function setupBTCWallet({
|
|
4723
4726
|
|
4724
4727
|
// src/index.ts
|
4725
4728
|
var getVersion = () => {
|
4726
|
-
return "0.5.
|
4729
|
+
return "0.5.20-beta";
|
4727
4730
|
};
|
4728
4731
|
if (typeof window !== "undefined") {
|
4729
4732
|
window.__BTC_WALLET_VERSION = getVersion();
|