diff --git a/.changeset/thirty-birds-look.md b/.changeset/thirty-birds-look.md new file mode 100644 index 00000000..e24136ee --- /dev/null +++ b/.changeset/thirty-birds-look.md @@ -0,0 +1,5 @@ +--- +"@delvtech/evm-client": patch +--- + +Fix handling of single params diff --git a/packages/evm-client/src/contract/utils/friendlyToArray.ts b/packages/evm-client/src/contract/utils/friendlyToArray.ts index c304db8a..efc2db71 100644 --- a/packages/evm-client/src/contract/utils/friendlyToArray.ts +++ b/packages/evm-client/src/contract/utils/friendlyToArray.ts @@ -81,6 +81,11 @@ export function friendlyToArray< return [] as AbiArrayType; } + // Single parameters + if (parameters.length === 1) { + return [value] as AbiArrayType; + } + const valueObject: Record = !!value && typeof value === 'object' ? value : {};