Skip to main content

Module: dataEntities/networks

L1Network

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

Extends

  • Network

Properties

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

L2Network

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

Extends

  • Network

Properties

PropertyTypeDescription
blockTimenumberMinimum possible block time for the chain (in seconds).
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.

l1Networks

let l1Networks: L1Networks;

Index of only L1 chains that have been added.

Source

arbitrum-sdk/src/lib/dataEntities/networks.ts:452


l2Networks

let l2Networks: L2Networks;

Index of all Arbitrum chains that have been added.

Source

arbitrum-sdk/src/lib/dataEntities/networks.ts:457


networks

const networks: Networks;

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

Source

arbitrum-sdk/src/lib/dataEntities/networks.ts:149


addCustomNetwork()

addCustomNetwork(__namedParameters): 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

arbitrum-sdk/src/lib/dataEntities/networks.ts:587


addDefaultLocalNetwork()

addDefaultLocalNetwork(): object

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

See

https://github.com/OffchainLabs/nitro

Returns

MemberType
l1NetworkL1Network
l2NetworkL2Network

Source

arbitrum-sdk/src/lib/dataEntities/networks.ts:631


getEthBridgeInformation()

getEthBridgeInformation(rollupContractAddress, l1SignerOrProvider): 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

arbitrum-sdk/src/lib/dataEntities/networks.ts:522


getL1Network()

getL1Network(signerOrProviderOrChainID): Promise< L1Network >

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

Note

Throws if the chain is not an L1 chain.

Parameters

ParameterType
signerOrProviderOrChainIDnumber | SignerOrProvider

Returns

Promise\< L1Network >

Source

arbitrum-sdk/src/lib/dataEntities/networks.ts:499


getL2Network()

getL2Network(signerOrProviderOrChainID): Promise< L2Network >

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

Note

Throws if the chain is not an Arbitrum chain.

Parameters

ParameterType
signerOrProviderOrChainIDnumber | SignerOrProvider

Returns

Promise\< L2Network >

Source

arbitrum-sdk/src/lib/dataEntities/networks.ts:510


getNetwork()

getNetwork(signerOrProviderOrChainID, layer): Promise< L1Network | L2Network >

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

Note

Throws if the chain is not recognized.

Parameters

ParameterType
signerOrProviderOrChainIDnumber | SignerOrProvider
layer2 | 1

Returns

Promise\< L1Network | L2Network >

Source

arbitrum-sdk/src/lib/dataEntities/networks.ts:463


getParentForNetwork()

getParentForNetwork(chain): L1Network | L2Network

Returns the parent chain for the given chain.

Parameters

ParameterType
chainL1Network | L2Network

Returns

L1Network | L2Network

Source

arbitrum-sdk/src/lib/dataEntities/networks.ts:421


isL1Network()

isL1Network(chain): 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

arbitrum-sdk/src/lib/dataEntities/networks.ts:390