@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.js
CHANGED
|
@@ -18061,15 +18061,11 @@ function validateCalls2(calls) {
|
|
|
18061
18061
|
}
|
|
18062
18062
|
|
|
18063
18063
|
// src/wallet/normalize.ts
|
|
18064
|
-
function defaultGasLimit(data) {
|
|
18065
|
-
const normalized = normalizeHex(data);
|
|
18066
|
-
return normalized === "0x" || normalized === "0x0" ? 21000n : 100000n;
|
|
18067
|
-
}
|
|
18068
18064
|
function normalizeCall(call2) {
|
|
18069
18065
|
const normalizedTarget = getAddress(call2.target);
|
|
18070
18066
|
const normalizedData = normalizeHex(call2.data);
|
|
18071
18067
|
const value = call2.value ?? 0n;
|
|
18072
|
-
const gasLimit = call2.gasLimit
|
|
18068
|
+
const gasLimit = call2.gasLimit ?? 0n;
|
|
18073
18069
|
return {
|
|
18074
18070
|
target: normalizedTarget,
|
|
18075
18071
|
data: normalizedData,
|
|
@@ -18188,6 +18184,17 @@ function extractFailureReason(response) {
|
|
|
18188
18184
|
}
|
|
18189
18185
|
const diag = meta.developerDiagnostics;
|
|
18190
18186
|
if (diag) {
|
|
18187
|
+
const topLevel = diag.topLevel;
|
|
18188
|
+
if (topLevel) {
|
|
18189
|
+
if (typeof topLevel.reason === "string" && topLevel.reason) {
|
|
18190
|
+
reasons.push(topLevel.reason);
|
|
18191
|
+
}
|
|
18192
|
+
if (topLevel.oogSuspected) {
|
|
18193
|
+
reasons.push(
|
|
18194
|
+
"Likely Out-of-gas via VolrInvoker. The transaction consumed almost all provided gas without a clear revert reason."
|
|
18195
|
+
);
|
|
18196
|
+
}
|
|
18197
|
+
}
|
|
18191
18198
|
if (typeof diag.revertReason === "string" && diag.revertReason) {
|
|
18192
18199
|
reasons.push(diag.revertReason);
|
|
18193
18200
|
}
|
|
@@ -18232,12 +18239,13 @@ async function pollTransactionStatus(txId, client, maxAttempts = 60, intervalMs
|
|
|
18232
18239
|
if (meta) {
|
|
18233
18240
|
console.error("[pollTransactionStatus] Full meta:", JSON.stringify(meta, null, 2));
|
|
18234
18241
|
}
|
|
18235
|
-
|
|
18242
|
+
const failedResult = {
|
|
18236
18243
|
txId,
|
|
18237
18244
|
status: "FAILED",
|
|
18238
18245
|
txHash,
|
|
18239
18246
|
reason: failureReason
|
|
18240
18247
|
};
|
|
18248
|
+
return failedResult;
|
|
18241
18249
|
}
|
|
18242
18250
|
console.log(`[pollTransactionStatus] Transaction ${txId} is ${status}, attempt ${attempt + 1}/${maxAttempts}`);
|
|
18243
18251
|
await new Promise((resolve) => setTimeout(resolve, intervalMs));
|
|
@@ -18323,7 +18331,7 @@ async function sendCalls(args) {
|
|
|
18323
18331
|
for (let i = 0; i < normalizedCalls.length && i < precheckQuote.estimatedGasPerCall.length; i++) {
|
|
18324
18332
|
const estimatedGas = BigInt(precheckQuote.estimatedGasPerCall[i] ?? "0");
|
|
18325
18333
|
const currentGas = normalizedCalls[i]?.gasLimit ?? 0n;
|
|
18326
|
-
if (estimatedGas >
|
|
18334
|
+
if (estimatedGas > 0n) {
|
|
18327
18335
|
console.log(`[sendCalls] Call #${i}: updating gasLimit from ${currentGas} to ${estimatedGas}`);
|
|
18328
18336
|
normalizedCalls[i].gasLimit = estimatedGas;
|
|
18329
18337
|
}
|