Skip to content

Commit

Permalink
Add missing function name (#3612)
Browse files Browse the repository at this point in the history
  • Loading branch information
m1heng authored Mar 21, 2024
1 parent c403563 commit 97237bb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/tiny-bees-own.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"wagmi": patch
---

Added missing `functionName` parameter to `useWriteContract` codegen helper.
6 changes: 6 additions & 0 deletions packages/react/src/hooks/codegen/createUseWriteContract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,9 @@ export function createUseWriteContract<
const variables = {
...(args[0] as any),
address: chainId ? config.address?.[chainId] : undefined,
...(config.functionName
? { functionName: config.functionName }
: {}),
abi: config.abi,
}
result.writeContract(variables, args[1] as any)
Expand All @@ -196,6 +199,9 @@ export function createUseWriteContract<
const variables = {
...(args[0] as any),
address: chainId ? config.address?.[chainId] : undefined,
...(config.functionName
? { functionName: config.functionName }
: {}),
abi: config.abi,
}
return result.writeContractAsync(variables, args[1] as any)
Expand Down

0 comments on commit 97237bb

Please sign in to comment.