fix args length for read/simulate method functions

This commit is contained in:
tom
2024-09-26 12:17:22 +02:00
parent 8971b9f458
commit e9f91cdaa0
@@ -28,11 +28,14 @@ export default function useCallMethodPublicClient(): (params: Params) => Promise
}
const address = getAddress(addressHash);
// for write payable methods we add additional input for native coin value
// so in simulate mode we need to strip it off
const _args = args.slice(0, item.inputs.length);
const params = {
abi: [ item ],
functionName: item.name,
args: args,
args: _args,
address,
account,
};