Exciting news!Announcing our $4.6M Series Seed. Learn more
Socket
LoveBlogFAQ
Install
Log in

erc20-contract-js

Package Overview
Dependencies
0
Maintainers
1
Versions
10
Issues
File Explorer

Advanced tools

erc20-contract-js

Simple JS library used to manipulate with ERC-20 token contracts

    1.3.2latest

Version published
Maintainers
1
Yearly downloads
10,327
increased by347.25%

Weekly downloads

Changelog

Source

Readme

Source

erc20-contract-js

Simple JS library used to manipulate with ERC-20 token contracts

Build Status npm version license

Install

NodeJS

yarn add erc20-contract-js

or

npm install erc20-contract-js

Browser (from v1.3.0)

<!-- Unpkg CDN --> <script src="https://unpkg.com/erc20-contract-js"></script>

or

<!-- Install the library via NPM/Yarn, then request it locally --> <script src="/node_modules/dist/erc20-contract-js.min.js"></script>

Example

const Web3 = require('web3'); const ERC20Contract = require('erc20-contract-js'); // Web3 instance const web3 = new Web3( new Web3.providers.HttpProvider('https://mainnet.infura.io') ); const walletAddr = '0x8d12a197cb00d4747a1fe03395095ce2a5cc6819', // EtherDelta contract address contractAddr = '0x86fa049857e0209aa7d9e616f7eb3b3b78ecfdb0'; // EOS contract address // Create new instance of ERC20Contract const erc20Contract = new ERC20Contract(web3, contractAddr); // Get balance of erc20Contract.balanceOf(walletAddr).call() .then(balance => console.log(`Balance: ${balance}`)); // Get total supply erc20Contract.totalSupply().call() .then(totalBalance => console.log(`Total supply: ${totalBalance}`)); // Get allowance erc20Contract.allowance(walletAddr, walletAddr).call() .then(allowance => console.log(`Allowance: ${allowance}`));

Testing

$ yarn test

or

$ npm test

Contribute

Contributions to the package are always welcome!

  • Report any bugs or issues you find on the issue tracker.
  • You can grab the source code at the package's Git repository.

Donation

Give me a Star if you like it. 😊

License

All contents of this package are licensed under the MIT license.

Keywords

FAQs

What is erc20-contract-js?

Simple JS library used to manipulate with ERC-20 token contracts

Is erc20-contract-js popular?

The npm package erc20-contract-js receives a total of 95 weekly downloads. As such, erc20-contract-js popularity was classified as not popular.

Is erc20-contract-js well maintained?

We found that erc20-contract-js demonstrated a healthy version release cadence and project activity. It has 1 open source maintainer collaborating on the project.

Last updated on 25 Jan 2022
Socket

Product

Subscribe to our newsletter

Get open source security insights delivered straight into your inbox. Be the first to learn about new features and product updates.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc