Installation:
npm i simple-erc20
Usage:
const token = '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'; tokenname; //Should print Wrapped Ether const asyncFunction = async { console }; ; //Should print WETH
The SimpleERC20 function can receive three parameters.
- A ERC20 token address
- The network name or id Ethereum network (optional, defaults to main)
- An existing web3 object to wrap (optional)
The resulting object currently provides data from the basic erc20 public function calls.