@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.js
CHANGED
|
@@ -10128,10 +10128,10 @@ function validateCalls(calls, config = {}) {
|
|
|
10128
10128
|
}
|
|
10129
10129
|
for (const call2 of calls) {
|
|
10130
10130
|
validateCallValue(call2.value);
|
|
10131
|
-
if (call2.gasLimit
|
|
10132
|
-
throw new Error("call.gasLimit must be
|
|
10131
|
+
if (call2.gasLimit < 0n) {
|
|
10132
|
+
throw new Error("call.gasLimit must be >= 0");
|
|
10133
10133
|
}
|
|
10134
|
-
if (call2.gasLimit > maxGasLimit) {
|
|
10134
|
+
if (call2.gasLimit > 0n && call2.gasLimit > maxGasLimit) {
|
|
10135
10135
|
throw new Error(`call.gasLimit (${call2.gasLimit}) exceeds maximum (${maxGasLimit})`);
|
|
10136
10136
|
}
|
|
10137
10137
|
const dataBytes = call2.data.startsWith("0x") ? (call2.data.length - 2) / 2 : call2.data.length / 2;
|
|
@@ -18331,8 +18331,10 @@ async function sendCalls(args) {
|
|
|
18331
18331
|
for (let i = 0; i < normalizedCalls.length && i < precheckQuote.estimatedGasPerCall.length; i++) {
|
|
18332
18332
|
const estimatedGas = BigInt(precheckQuote.estimatedGasPerCall[i] ?? "0");
|
|
18333
18333
|
const currentGas = normalizedCalls[i]?.gasLimit ?? 0n;
|
|
18334
|
-
if (
|
|
18335
|
-
console.log(`[sendCalls] Call #${i}:
|
|
18334
|
+
if (currentGas > 0n) {
|
|
18335
|
+
console.log(`[sendCalls] Call #${i}: keeping frontend gasLimit ${currentGas} (backend estimated: ${estimatedGas})`);
|
|
18336
|
+
} else if (estimatedGas > 0n) {
|
|
18337
|
+
console.log(`[sendCalls] Call #${i}: using backend gasLimit ${estimatedGas}`);
|
|
18336
18338
|
normalizedCalls[i].gasLimit = estimatedGas;
|
|
18337
18339
|
}
|
|
18338
18340
|
}
|