networks
Interfaces
L1Network
Represents an L1 chain, e.g. Ethereum Mainnet or Sepolia.
Extends
Network
Properties
Property | Type | Description | Inherited from | Defined in |
---|---|---|---|---|
blockTime | number | Minimum possible block time for the chain (in seconds). | Network.blockTime | dataEntities/networks.ts:36 |
partnerChainIDs | number [] | Chain ids of children chains, i.e. chains that settle to this chain. | Network.partnerChainIDs | dataEntities/networks.ts:40 |
L2Network
Represents an Arbitrum chain, e.g. Arbitrum One, Arbitrum Sepolia, or an L3 chain.
Extends
Network
Properties
Property | Type | Description | Inherited from | Defined in |
---|---|---|---|---|
blockTime | number | Minimum possible block time for the chain (in seconds). | Network.blockTime | dataEntities/networks.ts:36 |
depositTimeout | number | How long to wait (ms) for a deposit to arrive on l2 before timing out a request | - | dataEntities/networks.ts:68 |
nativeToken? | string | In 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 |
partnerChainID | number | Chain id of the parent chain, i.e. the chain on which this chain settles to. | - | dataEntities/networks.ts:59 |
partnerChainIDs | number [] | Chain ids of children chains, i.e. chains that settle to this chain. | Network.partnerChainIDs | dataEntities/networks.ts:40 |
Variables
l1Networks
l1Networks: L1Networks;
Index of only L1 chains that have been added.
Defined in
l2Networks
l2Networks: L2Networks;
Index of all Arbitrum chains that have been added.
Defined in
networks
const networks: Networks;
Storage for all networks, either L1, L2 or L3.
Defined in
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
Parameter | Type |
---|---|
__namedParameters | object |
__namedParameters.customL1Network ? | L1Network |
__namedParameters.customL2Network | L2Network |
Returns
void
Defined in
addDefaultLocalNetwork()
function addDefaultLocalNetwork(): object
Registers a custom network that matches the one created by a Nitro local node. Useful in development.
Returns
object
Name | Type | Defined in |
---|---|---|
l1Network | L1Network | dataEntities/networks.ts:628 |
l2Network | L2Network | dataEntities/networks.ts:629 |
Defined in
getEthBridgeInformation()
function getEthBridgeInformation(rollupContractAddress: string, l1SignerOrProvider: SignerOrProvider): Promise<EthBridge>
Parameters
Parameter | Type | Description |
---|---|---|
rollupContractAddress | string | Address of the Rollup contract |
l1SignerOrProvider | SignerOrProvider | A parent chain signer or provider |
Returns
Promise
<EthBridge
>
EthBridge object with all information about the ETH bridge
Defined in
getL1Network()
function getL1Network(signerOrProviderOrChainID: number | SignerOrProvider): Promise<L1Network>
Returns the L1 chain associated with the given signer, provider or chain id.
Parameters
Parameter | Type |
---|---|
signerOrProviderOrChainID | number | SignerOrProvider |
Returns
Promise
<L1Network
>
Defined in
getL2Network()
function getL2Network(signerOrProviderOrChainID: number | SignerOrProvider): Promise<L2Network>
Returns the Arbitrum chain associated with the given signer, provider or chain id.
Parameters
Parameter | Type |
---|---|
signerOrProviderOrChainID | number | SignerOrProvider |
Returns
Promise
<L2Network
>
Defined in
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
Parameter | Type |
---|---|
signerOrProviderOrChainID | number | SignerOrProvider |
layer | 1 | 2 |
Returns
Promise
<L1Network
| L2Network
>
Defined in
getParentForNetwork()
function getParentForNetwork(chain: L1Network | L2Network): L1Network | L2Network
Returns the parent chain for the given chain.
Parameters
Parameter | Type |
---|---|
chain | L1Network | L2Network |
Returns
Defined in
isL1Network()
function isL1Network(chain: L1Network | L2Network): chain is L1Network
Determines if a chain is specifically an L1 chain (not L2 or L3).
Parameters
Parameter | Type |
---|---|
chain | L1Network | L2Network |
Returns
chain is L1Network