simple-erc20
A library to help with integration with ERC20 Contracts
Last updated 2 years ago by freydal .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install simple-erc20 
SYNC missed versions from official npm registry.

Installation:

npm i simple-erc20

Usage:

  import SimpleERC20 from 'simple-erc20'
  
  const token = new SimpleERC20('0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2');
  token.name().then(console.log);
  //Should print Wrapped Ether
  
  const asyncFunction = async () => {
    console.log(await token.symbol())
  };
  
  asyncFunction();
  //Should print WETH

The SimpleERC20 function can receive three parameters.

  1. A ERC20 token address
  2. The network name or id Ethereum network (optional, defaults to main)
  3. An existing web3 object to wrap (optional)

The resulting object currently provides data from the basic erc20 public function calls.

Current Tags

  • 1.0.6                                ...           latest (2 years ago)

6 Versions

  • 1.0.6                                ...           2 years ago
  • 1.0.5                                ...           2 years ago
  • 1.0.4                                ...           2 years ago
  • 1.0.3                                ...           2 years ago
  • 1.0.2                                ...           2 years ago
  • 1.0.1                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (3)
Dev Dependencies (0)
None
Dependents (2)

Copyright 2014 - 2016 © taobao.org |