Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

Chains

The root sushi entrypoint exposes a unified chain registry across supported environments.

import { ChainId, chains, getChainById, isChainId } from 'sushi'
 
const ethereum = getChainById(ChainId.ETHEREUM)
 
if (isChainId(1)) {
  const chain = getChainById(1)
  console.log(chain.name)
}
 
console.log(chains.length)

Root chain exports

ExportPurpose
chainsAll known chains across EVM, SVM, MVM, and Stellar.
ChainIdEnum-like chain ID lookup by uppercase chain key.
chainIdsArray of known chain IDs.
isChainIdType guard for unknown numbers.
getChainByIdGet chain metadata by ID.
isMainnetChainIdGuard for mainnet chain IDs.
isTestnetChainIdGuard for testnet chain IDs.
getChainByKeyGet chain metadata by chain key.

Chain-specific registries

Use subpath exports when you only want one chain environment.

import { evmChains, EvmChainId } from 'sushi/evm'
import { stellarChains, StellarChainId } from 'sushi/stellar'
import { svmChains, SvmChainId } from 'sushi/svm'
import { mvmChains, MvmChainId } from 'sushi/mvm'

Chain support is not feature support

A chain can be present in chains without supporting every Sushi feature. For EVM feature support, use the config exports from sushi/evm, such as API, V2, V3, subgraph, and contract support maps.