Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Contract

A contract deployed on a blockchain.

Hierarchy

  • Contract

Index

Constructors

Properties

Methods

Constructors

constructor

Properties

address

address: Address

Address of the contract on the blockchain.

Private blockchain

blockchain: Blockchain

Blockchain on which the contract is located.

Private instance

instance: ContractInstance

Methods

call

  • call<T>(methodName: string, ...params: Array<any>): Promise<T>
  • Call a contract method.

    Type parameters

    • T

    Parameters

    • methodName: string

      Name of method to call.

    • Rest ...params: Array<any>

      Arguments to pass to method.

    Returns Promise<T>

    Result of call.

mutate

  • mutate(methodName: string, ...params: Array<any>): Promise<void>
  • Call a contract method that mutates the contract's state (sends a transaction to the blockchain) and wait until that transaction gets mined.

    throws

    Error when the transaction does not get mined within 60 seconds.

    Parameters

    • methodName: string

      Name of method to call.

    • Rest ...params: Array<any>

      Arguments to pass to method.

    Returns Promise<void>

Generated using TypeDoc