Skip to content

Latest commit

 

History

History
44 lines (25 loc) · 1.25 KB

createCustomCommon.md

File metadata and controls

44 lines (25 loc) · 1.25 KB

@ethereumjs/common


@ethereumjs/common / createCustomCommon

Function: createCustomCommon()

createCustomCommon(partialConfig, baseChain, opts): Common

Defined in: constructors.ts:22

Creates a Common object for a custom chain, based on a standard one.

It uses all the Chain parameters from the baseChain option except the ones overridden in a provided chainParamsOrName dictionary. Some usage example:

import { createCustomCommon, Mainnet } from '@ethereumjs/common'

createCustomCommon({chainId: 123}, Mainnet)
``

@param partialConfig Custom parameter dict
@param baseChain `ChainConfig` chain configuration taken as a base chain, e.g. `Mainnet` (exported at root level)
@param opts Custom chain options to set various {@link BaseOpts}

## Parameters

### partialConfig

`Partial`\<[`ChainConfig`](../interfaces/ChainConfig.md)\>

### baseChain

[`ChainConfig`](../interfaces/ChainConfig.md)

### opts

[`BaseOpts`](../interfaces/BaseOpts.md) = `{}`

## Returns

[`Common`](../classes/Common.md)