@volr/react 0.1.23 → 0.1.25
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.cjs +15 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +15 -7
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -18085,15 +18085,11 @@ function validateCalls2(calls) {
|
|
|
18085
18085
|
}
|
|
18086
18086
|
|
|
18087
18087
|
// src/wallet/normalize.ts
|
|
18088
|
-
function defaultGasLimit(data) {
|
|
18089
|
-
const normalized = normalizeHex(data);
|
|
18090
|
-
return normalized === "0x" || normalized === "0x0" ? 21000n : 100000n;
|
|
18091
|
-
}
|
|
18092
18088
|
function normalizeCall(call2) {
|
|
18093
18089
|
const normalizedTarget = getAddress(call2.target);
|
|
18094
18090
|
const normalizedData = normalizeHex(call2.data);
|
|
18095
18091
|
const value = call2.value ?? 0n;
|
|
18096
|
-
const gasLimit = call2.gasLimit
|
|
18092
|
+
const gasLimit = call2.gasLimit ?? 0n;
|
|
18097
18093
|
return {
|
|
18098
18094
|
target: normalizedTarget,
|
|
18099
18095
|
data: normalizedData,
|
|
@@ -18212,6 +18208,17 @@ function extractFailureReason(response) {
|
|
|
18212
18208
|
}
|
|
18213
18209
|
const diag = meta.developerDiagnostics;
|
|
18214
18210
|
if (diag) {
|
|
18211
|
+
const topLevel = diag.topLevel;
|
|
18212
|
+
if (topLevel) {
|
|
18213
|
+
if (typeof topLevel.reason === "string" && topLevel.reason) {
|
|
18214
|
+
reasons.push(topLevel.reason);
|
|
18215
|
+
}
|
|
18216
|
+
if (topLevel.oogSuspected) {
|
|
18217
|
+
reasons.push(
|
|
18218
|
+
"Likely Out-of-gas via VolrInvoker. The transaction consumed almost all provided gas without a clear revert reason."
|
|
18219
|
+
);
|
|
18220
|
+
}
|
|
18221
|
+
}
|
|
18215
18222
|
if (typeof diag.revertReason === "string" && diag.revertReason) {
|
|
18216
18223
|
reasons.push(diag.revertReason);
|
|
18217
18224
|
}
|
|
@@ -18256,12 +18263,13 @@ async function pollTransactionStatus(txId, client, maxAttempts = 60, intervalMs
|
|
|
18256
18263
|
if (meta) {
|
|
18257
18264
|
console.error("[pollTransactionStatus] Full meta:", JSON.stringify(meta, null, 2));
|
|
18258
18265
|
}
|
|
18259
|
-
|
|
18266
|
+
const failedResult = {
|
|
18260
18267
|
txId,
|
|
18261
18268
|
status: "FAILED",
|
|
18262
18269
|
txHash,
|
|
18263
18270
|
reason: failureReason
|
|
18264
18271
|
};
|
|
18272
|
+
return failedResult;
|
|
18265
18273
|
}
|
|
18266
18274
|
console.log(`[pollTransactionStatus] Transaction ${txId} is ${status}, attempt ${attempt + 1}/${maxAttempts}`);
|
|
18267
18275
|
await new Promise((resolve) => setTimeout(resolve, intervalMs));
|
|
@@ -18347,7 +18355,7 @@ async function sendCalls(args) {
|
|
|
18347
18355
|
for (let i = 0; i < normalizedCalls.length && i < precheckQuote.estimatedGasPerCall.length; i++) {
|
|
18348
18356
|
const estimatedGas = BigInt(precheckQuote.estimatedGasPerCall[i] ?? "0");
|
|
18349
18357
|
const currentGas = normalizedCalls[i]?.gasLimit ?? 0n;
|
|
18350
|
-
if (estimatedGas >
|
|
18358
|
+
if (estimatedGas > 0n) {
|
|
18351
18359
|
console.log(`[sendCalls] Call #${i}: updating gasLimit from ${currentGas} to ${estimatedGas}`);
|
|
18352
18360
|
normalizedCalls[i].gasLimit = estimatedGas;
|
|
18353
18361
|
}
|