Data structures and information about EVM based blockchains. Because the same trading pair and smart contract can across multiple blockchains, we need to have a way to identify blockchains. See
ChainIdenum class for passing the identity of a blockchain around. This is based on the underlying web3.eth.chain_id attribute of a chain.
- exception tradingstrategy.chain.ChainDataDoesNotExist¶
Cannot find data for a specific chain
- class tradingstrategy.chain.ChainId¶
Ethereum EVM chain ids and chain metadata.
Chain id is an integer that defines the identity of a blockchain, all running on same or different EVM implementations.
This class also provides various other metadata attributes besides ChainId.value, like ChainId.get_slug(). Some of this data is handcoded, some is pulled from chains submodule.
For the full chain id list see:
- ethereum = 1¶
Ethereum mainnet chain id
- bsc = 56¶
Binance Smarrt Chain mainnet chain id
- polygon = 137¶
Polygon chain id
- avalanche = 43114¶
Avalanche C-chain id
- ethereum_classic = 61¶
Ethereum Classic chain id. This is also the value used by EthereumTester in unit tests. https://github.com/ethereum/eth-tester
- ganache = 1337¶
Ganache test chain. This is the chain id for Ganache local tester / mainnet forks.
Get an absolute SVG image link to a chain icon, transparent background
Get one address link.
Use EIP3091 format.
Get one tx link