Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Blockchain

A connector used to access blockchains.

Hierarchy

  • Blockchain

Index

Methods

blockToTime

  • blockToTime(current: BigNumber, target: BigNumber): Moment
  • Convert a given block number in the future to a timestamp when it lands on the blockchain.

    Parameters

    • current: BigNumber

      Current block number.

    • target: BigNumber

      Block number in the future.

    Returns Moment

    Timestamp of target block number.

coinbase

  • Returns coinbase of the blockchain client.

    Returns Promise<Address>

    Coinbase address.

currentBlock

  • currentBlock(): Promise<BigNumber>
  • Returns current top block number on the blockchain.

    Returns Promise<BigNumber>

    Block number.

deploy

  • deploy(name: string, ...params: Array<any>): Promise<Contract>
  • Deploys a new contract on the blockchain.

    Parameters

    • name: string

      Name of contract on the metabackend.

    • Rest ...params: Array<any>

      Constructor parameters of the contract.

    Returns Promise<Contract>

    Newly deployed contract.

existing

  • Retrieves a handle to a contract at an address on the blockchain.

    Parameters

    • name: string

      Name of contract on the metabackend.

    • address: Address

      Address of contract on the blockchain.

    Returns Promise<Contract>

    Contract at this address.

waitTxMined

  • waitTxMined(hash: string): Promise<void>
  • Waits until a given transaction is mined, by hash.

    Parameters

    • hash: string

      Transaction hash for which to wait.

    Returns Promise<void>

Generated using TypeDoc