Skip to main content

Module: dataEntities/networks

ArbitrumNetwork

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

Properties

PropertyTypeDescription
chainIdnumberId of the chain.
confirmPeriodBlocksnumberThe time allowed for validators to dispute or challenge state assertions. Measured in L1 blocks.
ethBridgeEthBridgeThe core contracts
isCustombooleanWhether or not the chain was registered by the user.
namestringName of the chain.
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
parentChainIdnumberChain id of the parent chain, i.e. the chain on which this chain settles to.
retryableLifetimeSeconds?numberRepresents how long a retryable ticket lasts for before it expires (in seconds). Defaults to 7 days.
tokenBridgeTokenBridgeThe token bridge contracts.

L2Network

L2Network: Prettify<
Omit<ArbitrumNetwork, 'chainId' | 'parentChainId'> & { chainID: number; partnerChainID: number }
>;

This type is only here for when you want to achieve backwards compatibility between SDK v3 and v4.

Please see ArbitrumNetwork for the latest type.

Deprecated

since v4

Source

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


l2Networks

let l2Networks: Networks;

Index of all Arbitrum chains that have been added.

Source

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


networks

const networks: Networks;

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

Source

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


addDefaultLocalNetwork()

addDefaultLocalNetwork(): ArbitrumNetwork

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

See

https://github.com/OffchainLabs/nitro

Returns

ArbitrumNetwork

Source

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


getArbitrumNetwork()

getArbitrumNetwork(signerOrProviderOrChainId): Promise< ArbitrumNetwork >

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< ArbitrumNetwork >

Source

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


getArbitrumNetworkInformationFromRollup()

getArbitrumNetworkInformationFromRollup(rollupAddress, parentProvider): Promise< ArbitrumNetworkInformationFromRollup >

Returns all the information about an Arbitrum network that can be fetched from its Rollup contract.

Parameters

ParameterTypeDescription
rollupAddressstringAddress of the Rollup contract on the parent chain
parentProviderProviderProvider for the parent chain

Returns

Promise< ArbitrumNetworkInformationFromRollup >

An ArbitrumNetworkInformationFromRollup object

Source

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


getChildrenForNetwork()

getChildrenForNetwork(parentChainOrChainId): ArbitrumNetwork[]

Returns a list of children chains for the given chain or chain id.

Parameters

ParameterType
parentChainOrChainIdnumber | ArbitrumNetwork

Returns

ArbitrumNetwork[]

Source

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


isParentNetwork()

isParentNetwork(parentChainOrChainId): boolean

Determines if a chain is a parent of any other chain. Could be an L1 or an L2 chain.

Parameters

ParameterType
parentChainOrChainIdnumber | ArbitrumNetwork

Returns

boolean

Source

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


mapL2NetworkToArbitrumNetwork()

mapL2NetworkToArbitrumNetwork(l2Network): ArbitrumNetwork

Maps the old L2Network (from SDK v3) to ArbitrumNetwork (from SDK v4).

Parameters

ParameterTypeDescription
l2Networkobject-
l2Network.chainIDnumber-
l2Network.confirmPeriodBlocksnumberThe time allowed for validators to dispute or challenge state assertions. Measured in L1 blocks.
l2Network.ethBridgeEthBridgeThe core contracts
l2Network.isCustombooleanWhether or not the chain was registered by the user.
l2Network.namestringName of the chain.
l2Network.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
l2Network.partnerChainIDnumber-
l2Network.retryableLifetimeSeconds?numberRepresents how long a retryable ticket lasts for before it expires (in seconds). Defaults to 7 days.
l2Network.tokenBridgeTokenBridgeThe token bridge contracts.

Returns

ArbitrumNetwork

Source

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


registerCustomArbitrumNetwork()

registerCustomArbitrumNetwork(network, options?): ArbitrumNetwork

Registers a custom Arbitrum network.

Parameters

ParameterTypeDescription
networkArbitrumNetworkArbitrumNetwork to be registered
options?objectAdditional options
options.throwIfAlreadyRegistered?booleanWhether or not the function should throw if the network is already registered, defaults to false

Returns

ArbitrumNetwork

Source

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