Require chainId to be passed to hooks globally #4436
Unanswered
giliamverheide
asked this question in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In multi-chain apps (with multiple defined chains in the wagmi config), there's a scenario where some (read) hooks get data from one chain, while other hooks use another chain. For example: getting data (read calls) from
base
and receiving payments (write calls) on ethmainnet
.I want to force all wagmi hooks (and actions), and/or specifically read hooks, to require
chainId
to be passed explicitly, so that multi-chain apps won't interact with the wrong chain accidentally.Can anyone recommend a solution similar to how we can register the config globally with (typescript) declaration merging?
Additionally, this is also typescript related, but when declaration merging the config, is there a way to provide an inferred description for each chainId, so that intellisense can show it? Perhaps this requires a change to wagmi itself.
Beta Was this translation helpful? Give feedback.
All reactions