Skip to content

Network

eth_rpc.types.Network #

Bases: BaseModel

http class-attribute #

http

wss class-attribute #

wss

chain_id class-attribute #

chain_id

name class-attribute #

name

native_currency class-attribute #

native_currency

rpc class-attribute #

rpc

block_explorer class-attribute #

block_explorer

alchemy_str class-attribute #

alchemy_str = None

multicall3 class-attribute #

multicall3 = HexAddress(
    HexStr("0xca11bde05977b3631167028862be2a173976ca11")
)

ens_registry class-attribute #

ens_registry = HexAddress(
    HexStr("0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e")
)

ens_universal_resolver class-attribute #

ens_universal_resolver = HexAddress(
    HexStr("0xce01f8eee7E479C928F8919abD53E553a36CeF67")
)

apprx_block_time class-attribute #

apprx_block_time = 12.0

set classmethod #

set(http=None, wss=None, api_key=None)
Source code in eth_rpc/types/network.py
@classmethod
def set(
    cls,
    http: str | None = None,
    wss: str | None = None,
    api_key: str | None = None,
):
    if http:
        cls.rpc.default.http = Url(http)
        cls.http = str(cls.rpc.default.http)
    if wss:
        cls.rpc.default.wss = Url(wss)
        cls.wss = str(cls.rpc.default.wss)
    if api_key:
        cls.block_explorer.api_key = api_key
    return cls