Skip to content
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

@ant-design/web3-wagmi upgrade to wagmi@2.0 #461

Closed
yutingzhao1991 opened this issue Jan 5, 2024 · 1 comment · Fixed by #485
Closed

@ant-design/web3-wagmi upgrade to wagmi@2.0 #461

yutingzhao1991 opened this issue Jan 5, 2024 · 1 comment · Fixed by #485
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@yutingzhao1991
Copy link
Collaborator

wagmi just release 2.0 version

https://github.com/wevm/wagmi/releases

@yutingzhao1991 yutingzhao1991 added enhancement New feature or request help wanted Extra attention is needed labels Jan 5, 2024
@yutingzhao1991
Copy link
Collaborator Author

看了一下 wagmi 1 和 wagmi 2 的差异 https://wagmi.sh/react/guides/migrate-from-v1-to-v2 , 主要是一下几个点:

  • 需要引入 @tanstack/react-query,这个我们要看看是否需要默认帮用户引入,我们现在是封装了 WagmiProvider,我理解 QueryClientProvider 也可以封装进去。或者干脆 WagmiProvider 我们也不要再内置了。
  • useNetwork 去掉了,要用 useAccount 替代。
  • InjectedConnector 改名为 injected,并且同意从 'wagmi/connectors' 导出。
  • MetaMaskConnector 去掉了,应该可以用 injected 实现。
  • WalletConnectConnector 和 CoinbaseWalletConnector 换了个名字。
  • wagmi 不再需要 configureChains 了,直接通过 createConfig 配置,demo 都需要对应修改。
  • WagmiConfig 改名为 WagmiProvider 了。

整体看还要。@ant-design/web3-wagmi 直接在现在基础上修改,升级到 wagmi 2.0,对应也发一个 2.0 的包就行。以后主推 2.0 即可。1.0 用的应该还不多,拉一个分支来维护(应该不太怎么需要改动),文档里面做一下说明。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant