@energi/energiswap-default-token-list
Advanced tools
Energiswap Default Token List
Weekly downloads
Readme
This NPM module contains the default token list for all dApss used in the Energi ecosystem. It also contains all SVG logo files.
yarn
yarn build
The dist/index.js
will be created with all tokens.
yarn build
yarn publish
Add library to project using one of the following commands.
yarn add @energi/energiswap-default-token-list
# or
npm install @energi/energiswap-default-token-list
import energiswapDefaultTokens from '@energi/energiswap-default-token-list'
console.log(energiswapDefaultTokens)
// {
// name: "Energiswap Default Token List",
// timestamp: "2022-01-28T10:31:02.051Z",
// version: {
// "major": 3,
// "minor": 0,
// "patch": 0
// },
// tags: {},
// keywords: [
// "energiswap",
// "default"
// ],
// tokens: [ {...}, {...}, {...}, ... ]
// }
const tokensList = energiswapDefaultTokens.tokens
// For mainnet tokens filter the token list using the chainId 39797
// and for testnet use chainId 49797
const mainnetTokens = tokens.filter((token) => token.chainId === 39797)
const tokensList = energiswapDefaultTokens.tokens
// should return DAI, index 0 is reserved for WNRG
const token = tokensList[1]
console.log(token)
// {
// address: "0x0ee5893f434017d8881750101Ea2F7c49c0eb503"
// chainId: 39797
// decimals: 18
// ethereum: "0x6b175474e89094c44da98b954eedeac495271d0f"
// logo: <svg />
// name: "Dai"
// symbol: "DAI"
// }
// For a specific token, search the list using token address
// or symbol (NOTE: Symbols are not guaranteed to be unique)
// by token address
const BTC = tokens.find((token) => token.address === '0x29a791703e5A5A8D1578F8611b4D3691377CEbc0')
// by token symbol
const BTC = tokens.find((token) => token.symbol === 'BTC')
import tokensList from '@energi/energiswap-default-token-list';
// accepts two paramters, either mainnet or testnet
const tokens = tokensList.utility.getTokens('mainnet');
// returns a promise with a list of tokens with following format as a result:
// [
// {
// address: "0x0ee5893f434017d8881750101Ea2F7c49c0eb503"
// chainId: 39797
// decimals: 18
// ethereum: "0x6b175474e89094c44da98b954eedeac495271d0f"
// name: "Dai"
// symbol: "DAI"
// },
// ...
// ]
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.
FAQs
Energiswap Default Token List
The npm package @energi/energiswap-default-token-list receives a total of 493 weekly downloads. As such, @energi/energiswap-default-token-list popularity was classified as not popular.
We found that @energi/energiswap-default-token-list demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.