The easiest, most unruggable, and comprehensive token data service.
npm install tkn
import { tkn } from 'tkn';
// Lookup token information
const data = await tkn.lookup('eth');
Looks up token information by prefix.
const result = await tkn.lookup('eth');
Looks up token information by symbol.
const result = await tkn.lookupBySymbol('WETH');
Looks up token information by contract address.
const result = await tkn.lookupByAddress('0x5979D7b546E38E414F7E9822514be443A4800529');
Looks up token information by symbol and chain ID.
const result = await tkn.lookupBySymbolAndChain('USDC', '1'); // For Ethereum mainnet
{
id: string;
name: string;
description: string;
symbol: string;
avatar: string;
dweb: string;
discord: string | null;
decimals: string;
addresses: Array<{
tokenAddress: string;
chainID: {
id: string;
}
}>;
}
{
addressID: string | null;
chainID: {
id: string;
};
tokenAddress: string;
nonEVMAddress: string | null;
id: string;
tokenID: {
avatar: string;
description: string;
decimals: string;
name: string;
symbol: string;
tokenSupply: string | null;
twitter: string | null;
};
}
Publishing:
Update version in package.json
git commit -m "commit message"
npm login
git tag <v0.1.0 (version label)> <1f2d3a4 (commit sha)>
git push origin --tags
npm publish