Module: dataEntities/networks
L1Network
Represents an L1 chain, e.g. Ethereum Mainnet or Sepolia.
Extends
Network
Properties
Property | Type | Description |
---|---|---|
blockTime | number | Minimum possible block time for the chain (in seconds). |
partnerChainIDs | number [] | 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
Property | Type | Description |
---|---|---|
blockTime | number | Minimum possible block time for the chain (in seconds). |
depositTimeout | number | How long to wait (ms) for a deposit to arrive on l2 before timing out a request |
nativeToken ? | string | In case of a chain that uses ETH as its native/gas token, this is either undefined or the zero addressIn 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 |
partnerChainID | number | Chain id of the parent chain, i.e. the chain on which this chain settles to. |
partnerChainIDs | number [] | 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
Parameter | Type |
---|---|
__namedParameters | object |
__namedParameters.customL1Network ? | L1Network |
__namedParameters.customL2Network | L2Network |
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
Member | Type |
---|---|
l1Network | L1Network |
l2Network | L2Network |
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
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
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
Parameter | Type |
---|---|
signerOrProviderOrChainID | number | 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
Parameter | Type |
---|---|
signerOrProviderOrChainID | number | 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
Parameter | Type |
---|---|
signerOrProviderOrChainID | number | SignerOrProvider |
layer | 2 | 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
Parameter | Type |
---|---|
chain | L1Network | L2Network |
Returns
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
Parameter | Type |
---|---|
chain | L1Network | L2Network |
Returns
chain is L1Network