provider.env

Documentation for eth_defi.provider.env Python module.

Get JSON-RPC URL from environment varbless.

Functions

get_json_rpc_env(chain)

Get the JSON-RPC URL environment variable based on the chain id.

read_json_rpc_url(chain)

Read JSON-RPC URL from environment variable based on the chain id.

get_json_rpc_env(chain)

Get the JSON-RPC URL environment variable based on the chain id.

  • Map chain id to a name and from there to environment variables.

Parameters

chain (int) –

Return type

str

read_json_rpc_url(chain)

Read JSON-RPC URL from environment variable based on the chain id.

Raises

ValueError – If the environment variable is not set for the given chain.

Parameters

chain (int) –

Return type

str