ethers.js is a library that interact with Ethereum Blockchain.
It is a very useful library but the official documentation was a little hard to read...
For further actions, you may consider blocking this person and/or reporting abuse
Nice write up. Please did you know how i can validate erc721 token ID input field with ether.js?
Thank you. Um...I've never done that so I don't know, sorry.
Awesome. Btw, for ES Modules -> import { ethers } from 'ethers';
You have a typo there.
Oh thank you. Fixed;)
In Convert (Wei -> Ether), const balance = ethers.utils.formatEther(balance.toString());
Please change balance.toString() to balanceBigNumber.toString()
Thanks for providing this cheatsheet.
Oh I was careless. Thank you so much!
I have connected with window.ethereum.request function and now I have a disconnect button, how can I do that?
How we can write using rpc only ?
If you implement only with RPC, probably can't change states on blockchain.
OK
We can but we need private to do that, btw thanks
This is soo comprehensive & helpful, thanks for sharing man.... Also is it possible to call a contract in ethersJS without passing in the provider?
Thanks! You can do this by connecting from your wallet and passing the signer in parameter when initializing a new contract.
Strong list! To help folks even further, let's list all the popular chains you might need to connect to with their ID's:
Polygon: 137
Arbitrum One: 42161
Optimism: 10
Avalanche: 43114
BSC: 56
Thanks! Added them;)