4.2.2 • Published 2 years ago
@asset-projects/token-list v4.2.2
@asset-projects/token-list
This library maintains a list of ERC20 tokens that exist on the ethereum mainnet, L2 and sidechain.
It manages the main tokens and the top 100 or so tokens.
Support for Ethereum mainnet, optimistic-ethereum, arbitrum, polygon, and Other chains will be supported in the future.
Install on your project
# npm
npm i @asset-projects/token-list
# yarn
yarn add @asset-projects/token-list
How to Use
import { getTokenList } from '@asset-projects/token-list';
console.log(getTokenList(1).ERC20);
// [{"chainId": 1, "type": "ERC20", "address": "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599", "name": "Wrapped BTC", ...}]
console.log(getTokenList(1).ERC721);
// [{"chainId": 1, "type": "ERC721", "address": "0x57f1887a8bf19b14fc0df6fd9b2acc9af147ea85", "name": "Ethereum Name Service", ...}]
Other imports
import { tokens } from '@asset-projects/token-list';
console.log(tokens().filter((token) => token.chainId === 1 && token.symbol === 'DAI'));
// [
// {
// chainId: 1,
// type: 'ERC20',
// address: '0x6b175474e89094c44da98b954eedeac495271d0f',
// name: 'Dai Stablecoin',
// symbol: 'DAI',
// decimals: 18,
// logoURI: 'https://raw.githubusercontent.com/asset-projects/token-list/main/public/dai.png'
// }
// ]
console.log(
tokens().filter(
(token) =>
token.chainId === 1 && token.address === '0x57f1887a8bf19b14fc0df6fd9b2acc9af147ea85', // ENS
),
);
// [
// {
// chainId: 1,
// type: 'ERC721',
// address: '0x57f1887a8bf19b14fc0df6fd9b2acc9af147ea85',
// name: 'Ethereum Name Service',
// symbol: 'ENS',
// logoURI: ''
// }
// ]
License
MIT
4.1.4
2 years ago
4.2.2
2 years ago
4.1.0
2 years ago
4.2.1
2 years ago
4.1.2
2 years ago
4.2.0
2 years ago
3.2.1
2 years ago
4.0.0
2 years ago
3.2.0
2 years ago
3.1.1
2 years ago
3.1.0
2 years ago
3.0.5
2 years ago
3.0.4
2 years ago
3.0.3
2 years ago
3.0.2
2 years ago
3.0.1
2 years ago
3.0.0
2 years ago
2.3.0
2 years ago
2.2.0
2 years ago
2.1.0
2 years ago
2.0.6
2 years ago
2.0.5
2 years ago
2.0.4
2 years ago
2.0.3
2 years ago
2.0.2
2 years ago
2.0.1
2 years ago
2.0.0
2 years ago
1.2.0
2 years ago
1.1.0
2 years ago
1.0.3
2 years ago
1.0.2
2 years ago
1.0.1
2 years ago
1.0.0
2 years ago