diff --git a/.changeset/perfect-tigers-raise.md b/.changeset/perfect-tigers-raise.md new file mode 100644 index 0000000000..5bf3bd05b1 --- /dev/null +++ b/.changeset/perfect-tigers-raise.md @@ -0,0 +1,5 @@ +--- +"@wagmi/core": patch +--- + +Fixed `createWatchContractEvent` internal wiring, where `eventName` was incorrectly `functionName`. diff --git a/packages/core/src/actions/codegen/createWatchContractEvent.ts b/packages/core/src/actions/codegen/createWatchContractEvent.ts index 6a1b1a8604..2817efc704 100644 --- a/packages/core/src/actions/codegen/createWatchContractEvent.ts +++ b/packages/core/src/actions/codegen/createWatchContractEvent.ts @@ -71,7 +71,7 @@ export function createWatchContractEvent< configChainId return watchContractEvent(config, { ...(parameters as any), - ...(c.eventName ? { functionName: c.eventName } : {}), + ...(c.eventName ? { eventName: c.eventName } : {}), address: c.address?.[chainId], abi: c.abi, }) @@ -81,7 +81,7 @@ export function createWatchContractEvent< return watchContractEvent(config, { ...(parameters as any), ...(c.address ? { address: c.address } : {}), - ...(c.eventName ? { functionName: c.eventName } : {}), + ...(c.eventName ? { eventName: c.eventName } : {}), abi: c.abi, }) }