Skip to main content

networks

Interfaces

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
isBold?booleanHas the network been upgraded to bold. True if yes, otherwise undefined
This is a temporary property and will be removed in future if Bold is widely adopted and
the legacy challenge protocol is deprecated
isCustombooleanWhether or not the chain was registered by the user.
isTestnetbooleanWhether or not it is a testnet chain.
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.
teleporter?TeleporterThe teleporter contracts.
tokenBridge?TokenBridgeThe token bridge contracts.

L2NetworkTokenBridge

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

Please see TokenBridge for the latest type.

Deprecated

since v4

Type Aliases

L2Network

type L2Network: Prettify<Omit<ArbitrumNetwork, "chainId" | "parentChainId" | "tokenBridge"> & object>;

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

dataEntities/networks.ts:94

Functions

assertArbitrumNetworkHasTokenBridge()

function assertArbitrumNetworkHasTokenBridge<T>(network: T): asserts network is T & Object

Asserts that the given object has a token bridge. This is useful because not all Arbitrum network operations require a token bridge.

Type parameters

Type parameter
T extends ArbitrumNetwork

Parameters

ParameterTypeDescription
networkTArbitrumNetwork object

Returns

asserts network is T & Object

Throws

ArbSdkError if the object does not have a token bridge

Source

dataEntities/networks.ts:554


getArbitrumNetwork()

function getArbitrumNetwork(chainId: number): ArbitrumNetwork

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

Parameters

ParameterType
chainIdnumber

Returns

ArbitrumNetwork

Note

Throws if the chain is not an Arbitrum chain.

Source

dataEntities/networks.ts:316


getArbitrumNetworkInformationFromRollup()

function getArbitrumNetworkInformationFromRollup(rollupAddress: string, parentProvider: Provider): 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

dataEntities/networks.ts:376


getArbitrumNetworks()

function getArbitrumNetworks(): ArbitrumNetwork[]

Returns all Arbitrum networks registered in the SDK, both default and custom.

Returns

ArbitrumNetwork[]

Source

dataEntities/networks.ts:359


getChildrenForNetwork()

function getChildrenForNetwork(parentChainOrChainId: number | ArbitrumNetwork): ArbitrumNetwork[]

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

Parameters

ParameterType
parentChainOrChainIdnumber | ArbitrumNetwork

Returns

ArbitrumNetwork[]

Source

dataEntities/networks.ts:298


isParentNetwork()

function isParentNetwork(parentChainOrChainId: number | ArbitrumNetwork): 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

dataEntities/networks.ts:283


mapL2NetworkToArbitrumNetwork()

function mapL2NetworkToArbitrumNetwork(l2Network: object): 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.isBold?booleanHas the network been upgraded to bold. True if yes, otherwise undefined
This is a temporary property and will be removed in future if Bold is widely adopted and
the legacy challenge protocol is deprecated
l2Network.isCustombooleanWhether or not the chain was registered by the user.
l2Network.isTestnetbooleanWhether or not it is a testnet chain.
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.teleporter?TeleporterThe teleporter contracts.
l2Network.tokenBridgeL2NetworkTokenBridge-

Returns

ArbitrumNetwork

Source

dataEntities/networks.ts:534


mapL2NetworkTokenBridgeToTokenBridge()

function mapL2NetworkTokenBridgeToTokenBridge(input: L2NetworkTokenBridge): TokenBridge

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

Parameters

ParameterType
inputL2NetworkTokenBridge

Returns

TokenBridge

Source

dataEntities/networks.ts:510


registerCustomArbitrumNetwork()

function registerCustomArbitrumNetwork(network: ArbitrumNetwork, options?: object): 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

dataEntities/networks.ts:415