@energi/energiswap-default-token-list
This NPM module contains the default token list for all dApss used in the Energi ecosystem. It also contains all SVG logo files.
Requirements
- nodejs v14.17.*
- yarn v1.22.*
Build Token List
yarn
yarn build
The dist/index.js
will be created with all tokens.
Publishing
yarn build
yarn publish
How To Use
Install
Add library to project using one of the following commands.
yarn add @energi/energiswap-default-token-list
npm install @energi/energiswap-default-token-list
Usage
import energiswapDefaultTokens from '@energi/energiswap-default-token-list'
console.log(energiswapDefaultTokens)
const tokensList = energiswapDefaultTokens.tokens
const mainnetTokens = tokens.filter((token) => token.chainId === 39797)
Token Example
const tokensList = energiswapDefaultTokens.tokens
const token = tokensList[1]
console.log(token)
const BTC = tokens.find((token) => token.address === '0x29a791703e5A5A8D1578F8611b4D3691377CEbc0')
const BTC = tokens.find((token) => token.symbol === 'BTC')
Fetch tokens from blockchain
import tokensList from '@energi/energiswap-default-token-list';
const tokens = tokensList.utility.getTokens('mainnet');
Disclaimer
Filing an issue does not guarantee addition to this default token list.
We do not review token addition requests in any particular order and we do not
guarantee that we will review your request to add the token to the default list.