-
-
Notifications
You must be signed in to change notification settings - Fork 821
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: assert that client chain matches wallet's active chain #223
Conversation
🦋 Changeset detectedLatest commit: 62fdd02 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -270,6 +270,49 @@ await walletClient.writeContract({ | |||
}) | |||
``` | |||
|
|||
### assertChain (optional) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding missing docs on writeContract
.
Size Change: -7 B (0%) Total Size: 45.8 kB
ℹ️ View Unchanged
|
Codecov Report
@@ Coverage Diff @@
## main #223 +/- ##
=======================================
Coverage 99.84% 99.84%
=======================================
Files 221 221
Lines 13116 13119 +3
Branches 1406 1402 -4
=======================================
+ Hits 13096 13099 +3
Misses 19 19
Partials 1 1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
sendTransaction(walletClient, { | ||
account: getAccount(sourceAccount.address), | ||
to: targetAccount.address, | ||
value: parseEther('1'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be good to pass in some kind of autoSwitch: true
here that would automatically switch chains first if connected to wrong chain. Made a discussion here
We currently check if the
chain
arg onsendTransaction
matches the wallet's active chain, but we don't check if the wallet clientchain
matches the wallet's active chain. Would be good to add it in.