ChainId#
tradingstrategy.chain.ChainId class.
- class ChainId[source]#
Bases:
Enum
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:
- __init__()#
Methods
get_name
()Get full human readab name for this blockchain
get_slug
()Get URL slug for this chain
Get homepage link for this blockchain
Get an absolute SVG image link to a chain icon, transparent background
Get explorer landing page for this blockchain
get_address_link
(address)Get one address link.
get_tx_link
(tx)Get one tx link
get_by_slug
(slug)Map a slug back to the chain.
Attributes
Ethereum mainnet chain id
Binance Smarrt Chain mainnet chain id
Polygon chain id
Avalanche C-chain id
Ethereum Classic chain id.
Ganache test chain.
Chain id not known
Osmosis on Cosmos Does not have chain registry entry, beacuse Cosmos maintains its own registry
Get chain data entry for this chain.
- 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.
- unknown = 0#
Chain id not known
- osmosis = -100#
Osmosis on Cosmos Does not have chain registry entry, beacuse Cosmos maintains its own registry
- get_svg_icon_link()[source]#
Get an absolute SVG image link to a chain icon, transparent background
- Return type
- get_address_link(address)[source]#
Get one address link.
Use EIP3091 format.
https://eips.ethereum.org/EIPS/eip-3091
- Return type