Skip to content

Commit

Permalink
fix: resolves #2979
Browse files Browse the repository at this point in the history
  • Loading branch information
jxom committed Nov 7, 2024
1 parent 4b04289 commit af1fe2d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/gold-olives-shop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"viem": patch
---

Fixed inference for overloaded functions on \`readContract\` + \`simulateContract\` Actions.
4 changes: 2 additions & 2 deletions src/clients/decorators/public.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1458,7 +1458,7 @@ export type PublicActions<
readContract: <
const abi extends Abi | readonly unknown[],
functionName extends ContractFunctionName<abi, 'pure' | 'view'>,
args extends ContractFunctionArgs<abi, 'pure' | 'view', functionName>,
const args extends ContractFunctionArgs<abi, 'pure' | 'view', functionName>,
>(
args: ReadContractParameters<abi, functionName, args>,
) => Promise<ReadContractReturnType<abi, functionName, args>>
Expand Down Expand Up @@ -1522,7 +1522,7 @@ export type PublicActions<
simulateContract: <
const abi extends Abi | readonly unknown[],
functionName extends ContractFunctionName<abi, 'nonpayable' | 'payable'>,
args extends ContractFunctionArgs<
const args extends ContractFunctionArgs<
abi,
'nonpayable' | 'payable',
functionName
Expand Down

0 comments on commit af1fe2d

Please sign in to comment.