@volr/react 0.1.26 → 0.1.28
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 +7 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +7 -5
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -10152,10 +10152,10 @@ function validateCalls(calls, config = {}) {
|
|
|
10152
10152
|
}
|
|
10153
10153
|
for (const call2 of calls) {
|
|
10154
10154
|
validateCallValue(call2.value);
|
|
10155
|
-
if (call2.gasLimit
|
|
10156
|
-
throw new Error("call.gasLimit must be
|
|
10155
|
+
if (call2.gasLimit < 0n) {
|
|
10156
|
+
throw new Error("call.gasLimit must be >= 0");
|
|
10157
10157
|
}
|
|
10158
|
-
if (call2.gasLimit > maxGasLimit) {
|
|
10158
|
+
if (call2.gasLimit > 0n && call2.gasLimit > maxGasLimit) {
|
|
10159
10159
|
throw new Error(`call.gasLimit (${call2.gasLimit}) exceeds maximum (${maxGasLimit})`);
|
|
10160
10160
|
}
|
|
10161
10161
|
const dataBytes = call2.data.startsWith("0x") ? (call2.data.length - 2) / 2 : call2.data.length / 2;
|
|
@@ -18355,8 +18355,10 @@ async function sendCalls(args) {
|
|
|
18355
18355
|
for (let i = 0; i < normalizedCalls.length && i < precheckQuote.estimatedGasPerCall.length; i++) {
|
|
18356
18356
|
const estimatedGas = BigInt(precheckQuote.estimatedGasPerCall[i] ?? "0");
|
|
18357
18357
|
const currentGas = normalizedCalls[i]?.gasLimit ?? 0n;
|
|
18358
|
-
if (
|
|
18359
|
-
console.log(`[sendCalls] Call #${i}:
|
|
18358
|
+
if (currentGas > 0n) {
|
|
18359
|
+
console.log(`[sendCalls] Call #${i}: keeping frontend gasLimit ${currentGas} (backend estimated: ${estimatedGas})`);
|
|
18360
|
+
} else if (estimatedGas > 0n) {
|
|
18361
|
+
console.log(`[sendCalls] Call #${i}: using backend gasLimit ${estimatedGas}`);
|
|
18360
18362
|
normalizedCalls[i].gasLimit = estimatedGas;
|
|
18361
18363
|
}
|
|
18362
18364
|
}
|