Skip to main content

networks

Interfaces

L1Network

Represents an L1 chain, e.g. Ethereum Mainnet or Sepolia.

Extends

  • Network

Properties

PropertyTypeDescriptionInherited from
blockTimenumberMinimum possible block time for the chain (in seconds).Network.blockTime
partnerChainIDsnumber[]Chain ids of children chains, i.e. chains that settle to this chain.Network.partnerChainIDs

L2Network

Represents an Arbitrum chain, e.g. Arbitrum One, Arbitrum Sepolia, or an L3 chain.

Extends

  • Network

Properties

PropertyTypeDescriptionInherited from
blockTimenumberMinimum possible block time for the chain (in seconds).Network.blockTime
depositTimeoutnumberHow long to wait (ms) for a deposit to arrive on l2 before timing out a request-
nativeToken?stringIn case of a chain that uses ETH as its native/gas token, this is either undefined or the zero address

In case of a chain that uses an ERC-20 token from the parent chain as its native/gas token, this is the address of said token on the parent chain
-
partnerChainIDnumberChain id of the parent chain, i.e. the chain on which this chain settles to.-
partnerChainIDsnumber[]Chain ids of children chains, i.e. chains that settle to this chain.Network.partnerChainIDs

Variables

l1Networks

l1Networks: L1Networks;

Index of only L1 chains that have been added.

Source

dataEntities/networks.ts:448


l2Networks

l2Networks: L2Networks;

Index of all Arbitrum chains that have been added.

Source

dataEntities/networks.ts:453


networks

const networks: Networks;

Storage for all networks, either L1, L2 or L3.

Source

dataEntities/networks.ts:149

Functions

addCustomNetwork()

function addCustomNetwork(__namedParameters: object): void

Registers a pair of custom L1 and L2 chains, or a single custom Arbitrum chain (L2 or L3).

Parameters

ParameterType
__namedParametersobject
__namedParameters.customL1Network?L1Network
__namedParameters.customL2NetworkL2Network

Returns

void

Source

dataEntities/networks.ts:583


addDefaultLocalNetwork()

function addDefaultLocalNetwork(): object

Registers a custom network that matches the one created by a Nitro local node. Useful in development.

Returns

object

MemberType
l1NetworkL1Network
l2NetworkL2Network

See

https://github.com/OffchainLabs/nitro

Source

dataEntities/networks.ts:627


getEthBridgeInformation()

function getEthBridgeInformation(rollupContractAddress: string, l1SignerOrProvider: SignerOrProvider): Promise<EthBridge>

Returns the addresses of all contracts that make up the ETH bridge

Parameters

ParameterTypeDescription
rollupContractAddressstringAddress of the Rollup contract
l1SignerOrProviderSignerOrProviderA parent chain signer or provider

Returns

Promise<EthBridge>

EthBridge object with all information about the ETH bridge

Source

dataEntities/networks.ts:518


getL1Network()

function getL1Network(signerOrProviderOrChainID: number | SignerOrProvider): Promise<L1Network>

Returns the L1 chain associated with the given signer, provider or chain id.

Parameters

ParameterType
signerOrProviderOrChainIDnumber | SignerOrProvider

Returns

Promise <L1Network>

Note

Throws if the chain is not an L1 chain.

Source

dataEntities/networks.ts:495


getL2Network()

function getL2Network(signerOrProviderOrChainID: number | SignerOrProvider): Promise<L2Network>

Returns the Arbitrum chain associated with the given signer, provider or chain id.

Parameters

ParameterType
signerOrProviderOrChainIDnumber | SignerOrProvider

Returns

Promise <L2Network>

Note

Throws if the chain is not an Arbitrum chain.

Source

dataEntities/networks.ts:506


getNetwork()

function getNetwork(signerOrProviderOrChainID: number | SignerOrProvider, layer: 1 | 2): Promise<L1Network | L2Network>

Returns the network associated with the given Signer, Provider or chain id.

Parameters

ParameterType
signerOrProviderOrChainIDnumber | SignerOrProvider
layer1 | 2

Returns

Promise <L1Network | L2Network>

Note

Throws if the chain is not recognized.

Source

dataEntities/networks.ts:459


getParentForNetwork()

function getParentForNetwork(chain: L1Network | L2Network): L1Network | L2Network

Returns the parent chain for the given chain.

Parameters

ParameterType
chainL1Network | L2Network

Returns

L1Network | L2Network

Source

dataEntities/networks.ts:417


isL1Network()

function isL1Network(chain: L1Network | L2Network): chain is L1Network

Determines if a chain is specifically an L1 chain (not L2 or L3).

Parameters

ParameterType
chainL1Network | L2Network

Returns

chain is L1Network

Source

dataEntities/networks.ts:386