-
Notifications
You must be signed in to change notification settings - Fork 917
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
Migration to wagmi v1 and viem #352
Conversation
I started with updating |
#215 has the reason why it was removed, but were planning to add it again in #269 due to #216 (comment) But in wagmi v1 its not mandatory also : Also, they removed have removed the problem mentioned in #216 (comment) from https://wagmi.sh/react/prepare-hooks page So I think we won't be needing #269 since the issue can be resolved without using |
Update :
BUG's Noticed :
We have this logic in if (["array", "tuple"].includes(baseTypeOfArg)) But it seems now viem / wagmi does like to parse it as : We can maybe check if there includes Here is the example contract to test it out -> 1f22545 (look at previous changes) |
packages/nextjs/components/scaffold-eth/Contract/utilsDisplay.tsx
Outdated
Show resolved
Hide resolved
Cleaned it up a bit. I also found a very nice utility type |
Omg love this, great find !! Such a great utility always had a hard time seeing just the Abstract type name instead of the resultant type, Yes we should it update wherever possible |
Fixed some bugs and clean up starting from 9ab3636... Also tested all the things nicely and everything seems to work as Marking this We have just 2 todo's (can be conqured async with testing) :
|
I'm live testing & debugging with @technophile-04 at ETH Barcelona 🤓 We notices that there was an error when inputting decimals on the tx value field (Interger Input). It was because an uncomplete decimal can't be converted to BigInit. Pushed a fix |
We think the main stuff looks great (maybe some bugs will come up), so let's merge!!! Really nice work @technophile-04 & @sverps |
Plan of action :
Migrate all the easy files ( File not using ethers / not deeply dependent on wagmi )
Migrate main file ( Deeply dependent on ethers and wagmi )
getWalletClient
instead ofgetSigner
etc (@technophile-04)decodeTxData.ts
(@technophile-04 )Lastly remove
ethers
as dependencies fromnextjs
workspace@uniswap/sdk
still rely onethers
providerBugs Iteration :
Work In progress :
useContractWrite
not working with burner without prepare hook check -> Migration to wagmi v1 and viem #352 (comment)AddressInput
while usinguseState("")
debug
page checkout Migration to wagmi v1 and viem #352 (comment) for more desc (@sverps )Notes :
The viem migration guide and wagmi migration guide are pretty robust and nice
But here is the main difference between
ethers
andviem
:viem
instead ofproviders / signers
we haveclients
, so there are total 3 types of clientviem
likes to call themactions
)eth_blockNumber
etceth_sendTransaction
etc (There is no concept ofSigner
instead it calls theAccounts
)Additional Information
Related Issues
Fixes #229
Your ENS/address: shivbhonde.eth , solidixen.eth