<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

### Table of Contents

-   [Common][1]
    -   [setChain][2]
    -   [setHardfork][3]
    -   [\_chooseHardfork][4]
    -   [\_getHardfork][5]
    -   [\_isSupportedHardfork][6]
    -   [param][7]
    -   [paramByBlock][8]
    -   [hardforkIsActiveOnBlock][9]
    -   [activeOnBlock][10]
    -   [hardforkGteHardfork][11]
    -   [gteHardfork][12]
    -   [hardforkIsActiveOnChain][13]
    -   [activeHardforks][14]
    -   [activeHardfork][15]
    -   [hardforkBlock][16]
    -   [isHardforkBlock][17]
    -   [consensus][18]
    -   [finality][19]
    -   [genesis][20]
    -   [hardforks][21]
    -   [bootstrapNodes][22]
    -   [hardfork][23]
    -   [chainId][24]
    -   [chainName][25]
    -   [networkId][26]

## Common

Common class to access chain and hardfork parameters

**Parameters**

-   `chain` **([String][27] \| [Number][28])** String ('mainnet') or Number (1) chain representation
-   `hardfork` **[String][27]** String identifier ('byzantium') for hardfork (optional)
-   `supportedHardforks` **[Array][29]** Limit parameter returns to the given hardforks (optional)

### setChain

Sets the chain

**Parameters**

-   `chain` **([String][27] \| [Number][28])** String ('mainnet') or Number (1) chain representation

### setHardfork

Sets the hardfork to get params for

**Parameters**

-   `hardfork` **[String][27]** String identifier ('byzantium')

### \_chooseHardfork

Internal helper function to choose between hardfork set and hardfork provided as param

**Parameters**

-   `hardfork` **[String][27]** Hardfork given to function as a parameter
-   `onlySupported`  

Returns **[String][27]** Hardfork chosen to be used

### \_getHardfork

Internal helper function, returns the params for the given hardfork for the chain set

**Parameters**

-   `hardfork` **[String][27]** Hardfork name

Returns **Dictionary** 

### \_isSupportedHardfork

Internal helper function to check if a hardfork is set to be supported by the library

**Parameters**

-   `hardfork` **[String][27]** Hardfork name

Returns **[Boolean][30]** True if hardfork is supported

### param

Returns the parameter corresponding to a hardfork

**Parameters**

-   `topic` **[String][27]** Parameter topic ('gasConfig', 'gasPrices', 'vm', 'pow', 'casper', 'sharding')
-   `name` **[String][27]** Parameter name (e.g. 'minGasLimit' for 'gasConfig' topic)
-   `hardfork` **[String][27]** Hardfork name, optional if hardfork set

### paramByBlock

Returns a parameter for the hardfork active on block number

**Parameters**

-   `topic` **[String][27]** Parameter topic
-   `name` **[String][27]** Parameter name
-   `blockNumber` **[Number][28]** Block number

### hardforkIsActiveOnBlock

Checks if set or provided hardfork is active on block number

**Parameters**

-   `hardfork` **[String][27]** Hardfork name or null (for HF set)
-   `blockNumber` **[Number][28]** 
-   `opts` **[Array][29]** 
    -   `opts.onlySupported` **Array.Boolean** optional, only allow supported HFs (default: false)

Returns **[Boolean][30]** 

### activeOnBlock

Alias to hardforkIsActiveOnBlock when hardfork is set

**Parameters**

-   `blockNumber` **[Number][28]** 
-   `opts` **[Array][29]** 
    -   `opts.onlySupported` **Array.Boolean** optional, only allow supported HFs (default: false)

Returns **[Boolean][30]** 

### hardforkGteHardfork

Sequence based check if given or set HF1 is greater than or equal HF2

**Parameters**

-   `hardfork1` **[String][27]** Hardfork name or null (if set)
-   `hardfork2` **[String][27]** Hardfork name
-   `opts` **[Array][29]** 
    -   `opts.onlyActive` **Array.Boolean** optional, only active HFs (default: false)
    -   `opts.onlySupported` **Array.Boolean** optional, only allow supported HFs (default: false)

Returns **[Boolean][30]** 

### gteHardfork

Alias to hardforkGteHardfork when hardfork is set

**Parameters**

-   `hardfork` **[String][27]** Hardfork name
-   `opts` **[Array][29]** 
    -   `opts.onlyActive` **Array.Boolean** optional, only active HFs (default: false)
    -   `opts.onlySupported` **Array.Boolean** optional, only allow supported HFs (default: false)

Returns **[Boolean][30]** 

### hardforkIsActiveOnChain

Checks if given or set hardfork is active on the chain

**Parameters**

-   `hardfork` **[String][27]** Hardfork name, optional if HF set
-   `opts` **[Array][29]** 
    -   `opts.onlySupported` **Array.Boolean** optional, only allow supported HFs (default: false)

Returns **[Boolean][30]** 

### activeHardforks

Returns the active hardfork switches for the current chain

**Parameters**

-   `blockNumber` **[Number][28]** up to block if provided, otherwise for the whole chain
-   `opts` **[Array][29]** 
    -   `opts.onlySupported` **Array.Boolean** optional, limit results to supported HFs (default: false)

Returns **[Array][29]** Array with hardfork arrays

### activeHardfork

Returns the latest active hardfork name for chain or block or throws if unavailable

**Parameters**

-   `blockNumber` **[Number][28]** up to block if provided, otherwise for the whole chain
-   `opts` **[Array][29]** 
    -   `opts.onlySupported` **Array.Boolean** optional, limit results to supported HFs (default: false)

Returns **[String][27]** Hardfork name

### hardforkBlock

Returns the hardfork change block for hardfork provided or set

**Parameters**

-   `hardfork` **[String][27]** Hardfork name, optional if HF set

Returns **[Number][28]** Block number

### isHardforkBlock

True if block number provided is the hardfork (given or set) change block of the current chain

**Parameters**

-   `blockNumber` **[Number][28]** Number of the block to check
-   `hardfork` **[String][27]** Hardfork name, optional if HF set

Returns **[Boolean][30]** 

### consensus

Provide the consensus type for the hardfork set or provided as param

**Parameters**

-   `hardfork` **[String][27]** Hardfork name, optional if hardfork set

Returns **[String][27]** Consensus type (e.g. 'pow', 'poa')

### finality

Provide the finality type for the hardfork set or provided as param

**Parameters**

-   `hardfork` **[String][27]** Hardfork name, optional if hardfork set

Returns **[String][27]** Finality type (e.g. 'pos', null of no finality)

### genesis

Returns the Genesis parameters of current chain

Returns **Dictionary** Genesis dict

### hardforks

Returns the hardforks for current chain

Returns **[Array][29]** Array with arrays of hardforks

### bootstrapNodes

Returns bootstrap nodes for the current chain

Returns **Dictionary** Dict with bootstrap nodes

### hardfork

Returns the hardfork set

Returns **[String][27]** Hardfork name

### chainId

Returns the Id of current chain

Returns **[Number][28]** chain Id

### chainName

Returns the name of current chain

Returns **[String][27]** chain name (lower case)

### networkId

Returns the Id of current network

Returns **[Number][28]** network Id

[1]: #common

[2]: #setchain

[3]: #sethardfork

[4]: #_choosehardfork

[5]: #_gethardfork

[6]: #_issupportedhardfork

[7]: #param

[8]: #parambyblock

[9]: #hardforkisactiveonblock

[10]: #activeonblock

[11]: #hardforkgtehardfork

[12]: #gtehardfork

[13]: #hardforkisactiveonchain

[14]: #activehardforks

[15]: #activehardfork

[16]: #hardforkblock

[17]: #ishardforkblock

[18]: #consensus

[19]: #finality

[20]: #genesis

[21]: #hardforks

[22]: #bootstrapnodes

[23]: #hardfork

[24]: #chainid

[25]: #chainname

[26]: #networkid

[27]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String

[28]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number

[29]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array

[30]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean
