-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
Check existing issues
- I checked there isn't already an issue for the bug I encountered.
Describe the bug
With the changes implemented in the Wagmi@3.3.2 update, some generated read contract hooks coming from the @wagmi/cli package started returning incorrect types.
See the minimal reproducible example:
For the ABI generated, the return type of the ilks function should be
readonly [bigint, rate: bigint, bigint, bigint, bigint]
However, that type is only returned by the specific react contract function hook (useReadMcdVatIlks), if I use the more general read contract hook (useReadMcdVat), passing the same function name and argument, the return type is
bigint | readonly [bigint, rate: bigint, bigint, bigint, bigint]
Link to Minimal Reproducible Example
https://stackblitz.com/edit/new-wagmi-t3ymsfba?file=src%2FApp.tsx
Steps To Reproduce
In case you want to regenerate the ABI and hooks:
- Replace the etherscan API key in the
wagmi.config.tsfile - Run
pnpm wagmi generate
Then,
- Check the
App.tsxfile and look at the return type of thedataprop of both hooks. They should be the same, but they're not
What Wagmi package(s) are you using?
wagmi
Wagmi Package(s) Version(s)
3.5.0
Viem Version
2.46.3
TypeScript Version
5.9.3
Anything else?
No response