Skip to main content

networks

Interfaces

L1Network

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

Extends

  • Network

Properties

PropertyTypeDescriptionInherited fromDefined in
blockTimenumberMinimum possible block time for the chain (in seconds).Network.blockTimedataEntities/networks.ts:36
partnerChainIDsnumber[]Chain ids of children chains, i.e. chains that settle to this chain.Network.partnerChainIDsdataEntities/networks.ts:40

L2Network

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

Extends

  • Network

Properties

PropertyTypeDescriptionInherited fromDefined in
blockTimenumberMinimum possible block time for the chain (in seconds).Network.blockTimedataEntities/networks.ts:36
depositTimeoutnumberHow long to wait (ms) for a deposit to arrive on l2 before timing out a request-dataEntities/networks.ts:68
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-dataEntities/networks.ts:74
partnerChainIDnumberChain id of the parent chain, i.e. the chain on which this chain settles to.-dataEntities/networks.ts:59
partnerChainIDsnumber[]Chain ids of children chains, i.e. chains that settle to this chain.Network.partnerChainIDsdataEntities/networks.ts:40

Variables

l1Networks

l1Networks: L1Networks;

Index of only L1 chains that have been added.

Defined in

dataEntities/networks.ts:448


l2Networks

l2Networks: L2Networks;

Index of all Arbitrum chains that have been added.

Defined in

dataEntities/networks.ts:453


networks

const networks: Networks;

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

Defined in

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

Defined in

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

NameTypeDefined in
l1NetworkL1NetworkdataEntities/networks.ts:628
l2NetworkL2NetworkdataEntities/networks.ts:629

See

https://github.com/OffchainLabs/nitro

Defined in

dataEntities/networks.ts:627


getEthBridgeInformation()

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

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

Defined in

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.

Defined in

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.

Defined in

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.

Defined in

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

Defined in

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

Defined in

dataEntities/networks.ts:386