Skip to main content
A Network provides access to a chain’s properties and allows for plug-ins to extend functionality.

Constructors

new Network()

Creates a new Network for name and chainId.

Parameters

Returns

Network

Source

providers/network.ts:48

Accessors

chainId

The network chain ID.
Sets the network chain ID.

Parameters

Returns

bigint The network chain ID.

Source

providers/network.ts:87

name

The network common name. This is the canonical name, as networks might have multiple names.
Sets the network name.

Parameters

Returns

string The network name.

Source

providers/network.ts:69

Methods

clone()

Create a copy of this Network.

Returns

Network A new Network instance.

Source

providers/network.ts:153

toJSON()

Returns a JSON-compatible representation of a Network.

Returns

any The JSON representation of the network.

Source

providers/network.ts:58

from()

Returns a new Network for the network name or chainId.

Parameters

Returns

Network The Network instance.

Throws

If the network is invalid.

Source

providers/network.ts:165

register()

Register nameOrChainId with a function which returns an instance of a Network representing that chain.

Parameters

Returns

void

Throws

If a network is already registered for nameOrChainId.

Source

providers/network.ts:217