For the complete documentation index, see llms.txt. This page is also available as Markdown.
Querying the Dataset
Overview
The Token Name Service uses ENS, and can be queried anywhere .eth domains are supported
The Token name set is persisted as subdomains of the .tkn.eth domain
For instance, the contract for USDC can be found at usdc.tkn.eth and Wrapped Bitcoin at wbtc.tkn.eth
Descriptive metadata can be found on chain in each token's ENS resolver. Including name, description, avatar, url, dweb, decimals, notice, version, twitter, & github.
The TNS.sol contract exposes additional queries; such as: fetch all metadata, fetch token contracts on all chains, and token balance for address. TNS.sol is hosted at tkn.eth
Get token contract address
Retrieves the address where the token contract resides.
Useful for converting a user supplied token symbol into an actionable contract.
Useful for a token's contract addresses for all chains in a single query.
Decoding non-EVM contract addresses:
Non-EVM contract addresses can be decoded with https://www.npmjs.com/package/@ensdomains/address-encoderaddressEncoder.formatsByName['SOL'].encoder(Buffer.from(tokenData.sol_address.substring(2), 'hex'))
Get tokens owned by an address
Lookup how many tokens an address owns, using a token symbol.
Helpful for looking up an ERC20 account balance without having to fetch the token contract address separately.
Get all TKN tokens
There are multiple ways to fetch the complete list of tokens
Registry.tkn.eth: a simple JSON array with the symbols for all listed tokens. The current source of truth for TKN listings. Can be fetched with an IPFS dweb resolver, or eth.limo. https://registry.tkn.eth.limo/
TheGraph: TKN now has it's very own subgraph. Can conveniently produce all tokens and metadata in a single query.