Add option to automatically switch chain before sending transaction. #3867
Replies: 1 comment 1 reply
-
Wagmi attempts to follow Unix principles and keep function atomic and composable so unlikely this gets added. Better to be explicit and call what you need when you need it. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I noticed that there's a chainId parameter in sendTransaction that'll error if the current chain does not match.
Is it possible to add an option to automatically switch chain to the specified parameter if you're not currently connected to that chain?
Otherwise I'd have to create a wrapper
useSendTransaction
that manually callsuseSwitchChain
that'd satisfy my use-case when I think this feature is pretty valuable to have built in IMO.Beta Was this translation helpful? Give feedback.
All reactions