Skip to content

Network

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/providers/network.d.ts:27

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

new Network(name, chainId): Network;

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/providers/network.d.ts:32

Creates a new Network for %%name%% and %%chainId%%.

ParameterType
namestring
chainIdBigNumberish

Network

get chainId(): bigint;

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/providers/network.d.ts:48

The network chain ID.

bigint

set chainId(value): void;

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/providers/network.d.ts:49

ParameterType
valueBigNumberish

void


get name(): string;

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/providers/network.d.ts:43

The network common name.

This is the canonical name, as networks migh have multiple names.

string

set name(value): void;

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/providers/network.d.ts:44

ParameterType
valuestring

void


get plugins(): NetworkPlugin[];

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/providers/network.d.ts:61

Returns the list of plugins currently attached to this Network.

NetworkPlugin[]

attachPlugin(plugin): this;

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/providers/network.d.ts:66

Attach a new %%plugin%% to this Network. The network name must be unique, excluding any fragment.

ParameterType
pluginNetworkPlugin

this


clone(): Network;

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/providers/network.d.ts:81

Create a copy of this Network.

Network


computeIntrinsicGas(tx): number;

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/providers/network.d.ts:88

Compute the intrinsic gas required for a transaction.

A GasCostPlugin can be attached to override the default values.

ParameterType
txTransactionLike

number


getPlugin<T>(name): null | T;

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/providers/network.d.ts:72

Return the plugin, if any, matching %%name%% exactly. Plugins with fragments will not be returned unless %%name%% includes a fragment.

Type ParameterDefault type
T extends NetworkPluginNetworkPlugin
ParameterType
namestring

null | T


getPlugins<T>(basename): T[];

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/providers/network.d.ts:77

Gets a list of all plugins that match %%name%%, with otr without a fragment.

Type ParameterDefault type
T extends NetworkPluginNetworkPlugin
ParameterType
basenamestring

T[]


matches(other): boolean;

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/providers/network.d.ts:57

Returns true if %%other%% matches this network. Any chain ID must match, and if no chain ID is present, the name must match.

This method does not currently check for additional properties, such as ENS address or plug-in compatibility.

ParameterType
otherNetworkish

boolean


toJSON(): any;

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/providers/network.d.ts:36

Returns a JSON-compatible representation of a Network.

any


static from(network?): Network;

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/providers/network.d.ts:92

Returns a new Network for the %%network%% name or chainId.

ParameterType
network?Networkish

Network


static register(nameOrChainId, networkFunc): void;

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/providers/network.d.ts:97

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

ParameterType
nameOrChainIdstring | number | bigint
networkFunc() => Network

void