Cartouche.Chain (Cartouche v0.3.0)

Copy Markdown View Source

Chain registry and chain-id parsing helpers.

API Functions

FunctionArityDescriptionParam Kinds
parse_id1Parse an Ethereum chain id from either a numeric id or a known chain name.chain_id: value

Summary

Functions

Parses a chain id, which can be given as an integer or an atom of a known network.

Functions

parse_id(chain_id)

@spec parse_id(atom() | integer()) :: integer() | no_return()

Parses a chain id, which can be given as an integer or an atom of a known network.

Examples

iex> Cartouche.Chain.parse_id(5)
5

iex> Cartouche.Chain.parse_id(:unichain)
130