-
Notifications
You must be signed in to change notification settings - Fork 252
feat: update wagmi permissionless and viem #2341
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
base: master
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| "private": true, | ||
| "scripts": { | ||
| "dev": "next dev", | ||
| "dev": "next dev --webpack", |
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.
nextjs 16 is using turbopack by default which causes issue on the demo
arch1995
left a comment
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.
lgtm
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.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
| const { signMessageAsync, data: signedMessageData } = useSignMessage(); | ||
| const { address, isConnected: isWagmiConnected } = useAccount(); | ||
| const { mutateAsync: signMessageAsync, data: signedMessageData } = useSignMessage(); | ||
| const { address, isConnected: isWagmiConnected } = useConnection(); |
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.
Wrong hook used for account address and connection status
Medium Severity
The migration from useAccount to useConnection may be incorrect. According to wagmi documentation, useAccount is the hook for getting account information including address and isConnected. The useConnection hook has a different purpose and return type. The Vue demo uses { status, address } from useConnection (with status, not isConnected), suggesting the React code's attempt to destructure isConnected from useConnection may not work correctly, potentially causing the wagmi connection status to always appear disconnected.
Motivation and Context
Jira Link: https://consensyssoftware.atlassian.net/browse/W3APD-5237?atlOrigin=eyJpIjoiN2NmMDcxN2MzZTdlNDhiOWI0MTVkNWJlNDExNTM4MmUiLCJwIjoiaiJ9
Description
Updated wagmi to v3 and fixed deprecated exports
Updated viem and permissionless
How has this been tested?
Screenshots (if appropriate):
Types of changes
Checklist:
Note
Migrates demo code to wagmi v3 patterns and updates Next.js setup.
components/Main.tsx(Next.js SSR demo) to wagmi v3: replaceuseAccountwithuseConnection, introduceuseChains, and switch tomutate/mutateAsyncsignatures foruseSwitchChain,useSignMessage, anduseSignTypedDataapp/layout.tsxasync andawait headers()beforecookieToWeb3AuthStatefor initial Web3Auth stateeslint.config.mjs) with Next core-web-vitalsnext-env.d.tsto include Next route types and updated docs linkWritten by Cursor Bugbot for commit ae93ea4. This will update automatically on new commits. Configure here.