1.12.0 • Published 9 months ago

@8pay/tokens v1.12.0

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

@8pay/tokens

An helper module that keeps track of all 8pay's supported tokens.

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('0xFeea0bDd3D07eb6FE305938878C0caDBFa169042');
// 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 Network',
    symbol: '8PAY',
    decimals: 18,
    address: '0xFeea0bDd3D07eb6FE305938878C0caDBFa169042'
}
*/

Supported networks

  • BSC
  • ETHEREUM
  • POLYGON
  • SANDBOX
1.12.0

9 months ago

1.11.0

1 year ago

1.10.0

2 years ago

1.9.0

2 years ago

1.8.0

2 years ago

1.7.0

2 years ago

1.6.0

2 years ago

1.5.2

2 years ago

1.5.1

2 years ago

1.5.0

2 years ago

1.4.0

2 years ago

1.3.0

3 years ago

1.2.0

3 years ago

1.1.0

3 years ago

1.0.0

3 years ago