Overview
The CoW Protocol Python SDK supports multiple blockchain networks through theChain enum. Each chain includes configuration for chain IDs, network names, and block explorer URLs.
Accessing Chain Information
Import theChain enum from the SDK:
Supported Networks
Ethereum Mainnet
Chain ID: 1
Network Name: ethereum
Explorer: etherscan.io
Network Name: ethereum
Explorer: etherscan.io
Sepolia Testnet
Chain ID: 11155111
Network Name: sepolia
Explorer: sepolia.etherscan.io
Network Name: sepolia
Explorer: sepolia.etherscan.io
Gnosis Chain
Chain ID: 100
Network Name: gnosis
Explorer: gnosisscan.io
Network Name: gnosis
Explorer: gnosisscan.io
Arbitrum One
Chain ID: 42161
Network Name: arbitrum_one
Explorer: arbiscan.io
Network Name: arbitrum_one
Explorer: arbiscan.io
Base
Chain ID: 8453
Network Name: base
Explorer: basescan.org
Network Name: base
Explorer: basescan.org
Polygon
Chain ID: 137
Network Name: polygon
Explorer: polygonscan.com
Network Name: polygon
Explorer: polygonscan.com
Avalanche
Chain ID: 43114
Network Name: avalanche
Explorer: snowtrace.io
Network Name: avalanche
Explorer: snowtrace.io
BNB Chain
Chain ID: 56
Network Name: bnb
Explorer: bscscan.com
Network Name: bnb
Explorer: bscscan.com
Lens Network
Chain ID: 232
Network Name: lens
Explorer: explorer.lens.xyz
Network Name: lens
Explorer: explorer.lens.xyz
Chain Properties
EachChain enum value provides three key properties:
chain_id
chain_id
Returns the
SupportedChainId enum value representing the numeric chain identifier.name
name
Returns the network name as a string, useful for display and configuration purposes.
explorer
explorer
Returns the block explorer URL for viewing transactions and addresses on the network.
Usage Example
Here’s a complete example showing how to use chains when creating a swap:When testing your integration, start with
Chain.SEPOLIA to avoid risking real funds on mainnet.Getting All Supported Chains
You can retrieve all supported chains using theSUPPORTED_CHAINS constant:
The chain configuration is used internally by the SDK to determine API endpoints, contract addresses, and other network-specific settings.
