Skip to content
/ tkn Public

The easiest and most unruggable source of token data

Notifications You must be signed in to change notification settings

TickerDao/tkn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The Token Name Service

The easiest, most unruggable, and comprehensive token data service.

Installation

npm install tkn

Usage

import { tkn } from 'tkn';

// Lookup token information
const data = await tkn.lookup('eth');

API Reference

lookup(prefix)

Looks up token information by prefix.

const result = await tkn.lookup('eth');

lookupBySymbol(symbol)

Looks up token information by symbol.

const result = await tkn.lookupBySymbol('WETH');

lookupByAddress(address)

Looks up token information by contract address.

const result = await tkn.lookupByAddress('0x5979D7b546E38E414F7E9822514be443A4800529');

lookupBySymbolAndChain(symbol, chainId)

Looks up token information by symbol and chain ID.

const result = await tkn.lookupBySymbolAndChain('USDC', '1'); // For Ethereum mainnet

Response Types

Token Response

{
  id: string;
  name: string;
  description: string;
  symbol: string;
  avatar: string;
  dweb: string;
  discord: string | null;
  decimals: string;
  addresses: Array<{
    tokenAddress: string;
    chainID: {
      id: string;
    }
  }>;
}

Address Response

{
  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

About

The easiest and most unruggable source of token data

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •