Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Chain

Chain class to access chain parameters

Hierarchy

  • Chain

Constructors

constructor

  • Parameters

    • chain: string | number | ChainParams

      String ('mainnet') or Number (1) or Dictionary with chain params

    Returns Chain

Properties

Private chainParams

chainParams: ChainParams

Accessors

bootstrapNodes

  • Returns bootstrap nodes for the current chain

    Returns BootstrapNode[]

    Dict with bootstrap nodes

chainId

  • Returns the Id of current chain

    Returns ChainId

    chain Id

gasCoin

  • get gasCoin(): number
  • Returns the Id of gasCoin for current network

    Returns number

    gasCoin Id

genesis

  • Returns the Genesis parameters of current chain

    Returns GenesisBlock

    Genesis dictionary

name

  • get name(): string
  • Returns the name of current chain

    Returns string

    chain name (lower case)

networkId

  • get networkId(): number
  • Returns the Id of current network

    Returns number

    network Id

urls

  • get urls(): object
  • Returns object

    • [k: string]: any

Methods

describe

  • describe(): Record<string, any>
  • Returns Record<string, any>

newJsonRpcConnection

  • Returns Connection

Static forCustomChain

  • forCustomChain(baseChain: string | number, userConfig: Partial<ChainParams>): Chain
  • Creates a Chain object for a custom chain, based on a standard one. It uses all the ChainParams params from [[baseChain]] except the ones overridden in [[userConfig]].

    Parameters

    • baseChain: string | number

      The name (mainnet) or id (1) of a standard chain used to base the custom chain params on.

    • userConfig: Partial<ChainParams>

      The custom parameters of the chain.

    Returns Chain

Static getBaseParams

  • Returns the ChainParams object represents given chain.

    Parameters

    • chain: string | number

    Returns ChainParams

Generated using TypeDoc