xflows 1.3.3 → 1.3.4
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 +24 -15
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -18684,7 +18684,7 @@ import * as readline from "readline";
|
|
|
18684
18684
|
// package.json
|
|
18685
18685
|
var package_default = {
|
|
18686
18686
|
name: "xflows",
|
|
18687
|
-
version: "1.3.
|
|
18687
|
+
version: "1.3.4",
|
|
18688
18688
|
description: "CLI tool for Wanchain XFlows cross-chain bridge - wallet management, quote queries, and cross-chain transactions",
|
|
18689
18689
|
type: "module",
|
|
18690
18690
|
bin: {
|
|
@@ -19278,23 +19278,32 @@ Checking token approval for ${spender}...`);
|
|
|
19278
19278
|
printJson(txRequest);
|
|
19279
19279
|
return;
|
|
19280
19280
|
}
|
|
19281
|
-
|
|
19281
|
+
if (opts.gasLimit) {
|
|
19282
|
+
console.log(`
|
|
19283
|
+
Using manual gas limit: ${opts.gasLimit}`);
|
|
19284
|
+
} else {
|
|
19285
|
+
console.log(`
|
|
19282
19286
|
Estimating gas...`);
|
|
19283
|
-
|
|
19284
|
-
|
|
19285
|
-
|
|
19286
|
-
|
|
19287
|
-
|
|
19288
|
-
if (!txRequest.gasLimit) {
|
|
19287
|
+
try {
|
|
19288
|
+
const estimatedGas = await provider.estimateGas({
|
|
19289
|
+
...txRequest,
|
|
19290
|
+
from: wallet.address
|
|
19291
|
+
});
|
|
19289
19292
|
txRequest.gasLimit = estimatedGas * 120n / 100n;
|
|
19290
|
-
|
|
19291
|
-
|
|
19292
|
-
|
|
19293
|
-
|
|
19294
|
-
console.error(`
|
|
19293
|
+
console.log(`Estimated gas: ${estimatedGas.toString()}`);
|
|
19294
|
+
} catch (err) {
|
|
19295
|
+
const reason = err.reason || err.shortMessage || err.message;
|
|
19296
|
+
console.error(`
|
|
19295
19297
|
Transaction will fail: ${reason}`);
|
|
19296
|
-
|
|
19297
|
-
|
|
19298
|
+
if (!err.reason || err.reason === "require(false)") {
|
|
19299
|
+
console.error("Hint: The contract reverted without a reason. This may indicate:");
|
|
19300
|
+
console.error(" - The bridge storeman group is temporarily unavailable");
|
|
19301
|
+
console.error(" - The token pair or route is not supported at this time");
|
|
19302
|
+
console.error(" - Insufficient token balance for the requested amount");
|
|
19303
|
+
}
|
|
19304
|
+
console.error("The transaction was NOT sent. Use --gas-limit to force send.");
|
|
19305
|
+
process.exit(1);
|
|
19306
|
+
}
|
|
19298
19307
|
}
|
|
19299
19308
|
console.log("Sending transaction...");
|
|
19300
19309
|
const sentTx = await signer.sendTransaction(txRequest);
|