Skip to content

Commit f6b64b0

Browse files
committed
Handle single unnamed param
1 parent e9ab8cb commit f6b64b0

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

packages/thirdweb/src/utils/abi/normalizeFunctionParams.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,14 @@ export function normalizeFunctionParams(
1313
abiFunction.inputs.map((i) => i.type),
1414
abiFunction.inputs.map((input, index) => {
1515
const value = input.name;
16-
if (value === undefined) {
17-
throw new Error(
18-
`Missing named parameter for ${"name" in abiFunction ? abiFunction.name : "constructor"} at index ${index}`,
19-
);
16+
if (value === undefined || value.length === 0) {
17+
if (!params["*"]) {
18+
throw new Error(
19+
`Missing named parameter for ${"name" in abiFunction ? abiFunction.name : "constructor"} at index ${index}`,
20+
);
21+
}
22+
23+
return params["*"];
2024
}
2125
const valueWithoutUnderscore = value.replace(/^_+/, "");
2226
const normalizedValue =

0 commit comments

Comments
 (0)