Skip to main content

Module chains

Module chains 

Source
Expand description

Extended chain enums, chain info types, and utility functions.

Mirrors the TypeScript SDK chains package. This module is the authoritative source for chain metadata beyond what SupportedChainId provides — it covers bridge-only chains, non-EVM chains (BTC, Solana), rich per-chain metadata (ChainInfo), and classification helpers.

§Key items

ItemPurpose
EvmChainsSuperset of SupportedChainId including bridge-only EVM chains
NonEvmChainsBTC and Solana chain IDs
AdditionalTargetChainIdBridge destination chains not in SupportedChainId
ChainInfoRich per-chain metadata (RPC URLs, contracts, tokens, …)
get_chain_infoLook up ChainInfo by numeric chain ID
is_evm_chain / is_btc_chainChain classification helpers
all_supported_chains / all_chain_idsIteration helpers

Structs§

ApiContext
The CoW Protocol API context.
ChainContract
An on-chain contract reference with an optional creation block.
ChainContracts
Well-known contracts on an EVM chain.
ChainRpcUrls
RPC URL configuration for an EVM chain.
ChainTokenInfo
Token info used in chain metadata.
EvmCall
An EVM call with a target address, calldata, and value.
EvmChainInfo
Metadata for an EVM chain.
IpfsConfig
IPFS configuration for reading and writing app data.
NonEvmChainInfo
Metadata for a non-EVM chain (e.g. Bitcoin, Solana).
ProtocolOptions
Protocol-level options for overriding CoW Protocol contract addresses and environment.
ThemedImage
A themed image with light and dark variants.
WebUrl
A named URL.

Enums§

AdditionalTargetChainId
Chains where you can buy tokens using bridge functionality but that are not directly supported by CoW Protocol for selling.
ChainInfo
A chain on the network – either an EVM chain or a non-EVM chain.
EvmChains
All EVM chains supported by CoW Protocol or available for bridging.
NonEvmChains
All non-EVM chains available for bridging only.
TargetChainId
A chain ID that is either a SupportedChainId or an AdditionalTargetChainId.

Constants§

RAW_CHAINS_FILES_PATH
CDN path for chain data.
RAW_FILES_PATH
Base CDN path for SDK files.
TOKEN_LIST_IMAGES_PATH
CDN path for token list images.

Functions§

additional_target_chain_info
Return the ChainInfo for an AdditionalTargetChainId.
all_additional_target_chain_ids
Return all chain IDs for additional target chains (bridge-only).
all_additional_target_chains
Return chain info for all additional target chains (bridge-only).
all_chain_ids
Return all known chain IDs as TargetChainId values.
all_chains
Return chain info for all known chains (both supported and bridge-only).
all_chains_map
Return a map of every known chain keyed by its numeric chain ID.
all_supported_chain_ids
Return all supported chain IDs as a Vec.
all_supported_chains
Return chain info for all supported chains.
get_chain_info
Return the chain info for a given chain ID, or None if the chain is not known.
is_additional_target_chain
Check if a chain ID is a bridge-only target chain.
is_btc_chain
Check if a chain ID represents Bitcoin.
is_chain_deprecated
Check if a chain is deprecated (no new trading; chain remains for history/Explorer).
is_chain_under_development
Check if a chain is under development.
is_evm_chain
Check if a chain ID represents an EVM chain (including bridge-only ones like Optimism).
is_evm_chain_info
Check if a ChainInfo represents an EVM chain.
is_non_evm_chain
Check if a chain ID represents a non-EVM chain (Bitcoin, Solana).
is_non_evm_chain_info
Check if a ChainInfo represents a non-EVM chain.
is_solana_chain
Check if a chain ID is the Solana non-EVM chain.
is_supported_chain
Check if a chain ID is directly supported by CoW Protocol for trading.
is_target_chain_id
Check if a chain ID is either a supported chain or a bridge target.
is_zk_sync_chain
Check if a chain is zkSync-based.
map_address_to_supported_networks
Map an address to all supported networks.
map_all_networks
Map a value across all target chains (supported + additional), returning a Vec of (TargetChainId, T) pairs.
map_supported_networks
Map a value across all supported chains, returning a Vec of (SupportedChainId, T) pairs.
supported_chain_info
Return the ChainInfo for a SupportedChainId.
tradable_supported_chain_ids
Return chain IDs where new trading is allowed (excludes deprecated chains).
tradable_supported_chains
Return chain info for tradable supported chains (excludes deprecated).

Type Aliases§

AddressPerChain
Per-chain address mapping for supported chains.
ApiBaseUrls
Per-chain base URL mapping for supported chains.