Class EvmWeb3Public

Class containing methods for calling contracts in order to obtain information from the blockchain. To send transaction or execute contract method use Web3Private.

Hierarchy

Constructors

Accessors

Methods

  • Get estimated gas of several contract method executions via rpc batch request.

    Returns

    List of contract execution estimated gases. If the execution of the method in the real blockchain would not be reverted, then the list item would be equal to the predicted gas limit. Else (if you have not enough balance, allowance ...) then the list item would be equal to null.

    Parameters

    • fromAddress: string

      Sender address.

    • callsData: BatchCall[]

      Transactions parameters.

    Returns Promise<(null | BigNumber)[]>

  • Calls pure method of smart-contract and returns its output value.

    Type Parameters

    Parameters

    • contractAddress: string

      Address of smart-contract which method is to be executed.

    • contractAbi: AbiItem[]

      Abi of smart-contract which method is to be executed.

    • methodName: string

      Called method name.

    • methodArguments: unknown[] = []

      Method arguments.

    • options: {
          from?: string;
          gas?: string;
          gasPrice?: string;
          value?: string;
      } = {}

      Transaction options.

      • Optional from?: string
      • Optional gas?: string
      • Optional gasPrice?: string
      • Optional value?: string

    Returns Promise<T>

  • Calls allowance method in token contract.

    Returns

    Token's amount, allowed to be spent.

    Parameters

    • tokenAddress: string

      Address of the smart-contract corresponding to the token.

    • ownerAddress: string

      Wallet address to spend from.

    • spenderAddress: string

      Wallet or contract address, allowed to spend.

    Returns Promise<BigNumber>

  • Predicts the volume of gas required to execute the contract method.

    Returns

    Estimated gas limit.

    Parameters

    • contractAbi: AbiItem[]

      Abi of smart-contract.

    • contractAddress: string

      Address of smart-contract.

    • methodName: string

      Method which execution gas limit is to be calculated.

    • methodArguments: unknown[]

      Arguments of the contract method.

    • fromAddress: string

      The address for which the gas calculation will be called.

    • Optional value: string | BigNumber

      The value transferred for the call “transaction” in wei.

    Returns Promise<null | BigNumber>

  • Parameters

    • fromAddress: string
    • toAddress: string
    • options: {
          data: string;
          from?: string;
          gas?: string;
          gasPrice?: string;
          value?: string;
      }
      • data: string
      • Optional from?: string
      • Optional gas?: string
      • Optional gasPrice?: string
      • Optional value?: string

    Returns Promise<null | BigNumber>

  • Parameters

    • contractAddress: string
    • contractAbi: AbiItem[]
    • eventName: string
    • options: {
          blocksAmount: number;
          toBlock: number | "latest";
      }
      • blocksAmount: number
      • toBlock: number | "latest"

    Returns Promise<EventData[]>

  • Will call smart contract method in the EVM without sending any transaction.

    Returns

    Transaction receipt.

    Parameters

    • contractAddress: string

      Contract address.

    • contractAbi: AbiItem[]

      Contract ABI.

    • methodName: string

      Method name.

    • methodArguments: unknown[]

      Method arguments.

    • options: {
          from: string;
          value: string;
      }

      Sender address and value.

      • from: string
      • value: string

    Returns Promise<TransactionReceipt>

Generated using TypeDoc