0.14.0 • Published 3 years ago
currencies.8 v0.14.0
@8pay/tokens
This package contains the list of tokens supported by 8Pay along with some helpers to handle decimals.
Usage
const Tokens = require('@8pay/tokens');
const tokens = new Tokens(Tokens.Network.BSC);
// Get token by symbol
const token1 = tokens.get('8PAY');
// Get token by address
const token2 = tokens.get('0x0d338e1a67966c995d754e06bd53fa5e59c1988b');
// List all tokens
const allTokens = tokens.all();
// Parse amount with decimals
tokens.parseAmount('1', '8PAY'); // 1000000000000000000
// Format amount with decimals
tokens.formatAmount('1000000000000000000', '8PAY'); // 1
console.log(token1);
/*
{
name: '8PAY Token',
symbol: '8PAY',
decimals: 18,
address: '0x0d338e1a67966c995d754e06bd53fa5e59c1988b'
}
*/
Supported networks
- BSC
0.14.0
3 years ago
0.13.0
3 years ago
0.12.0
3 years ago
0.11.4
3 years ago
0.11.2
3 years ago
0.11.3
3 years ago
0.11.1
3 years ago
0.10.0
3 years ago
0.11.0
3 years ago
0.9.0
4 years ago
0.8.0
4 years ago
0.7.0
4 years ago
0.6.0
4 years ago
0.5.0
4 years ago
0.4.1
4 years ago
0.4.0
4 years ago
0.3.0
4 years ago
0.2.0
4 years ago
0.1.1
4 years ago
0.1.0
4 years ago