Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ZilliqaHelper

ZilliqaHelper

Helper class to communicate with zilliqa network.

Hierarchy

  • ZilliqaHelper

Index

Methods

Static callContract

  • callContract(contract: Contract, transition: string, args: any, version: number, amount: string, gasPrice: string, gasLimit: number): Promise<any>
  • callContract

    Calls zilliqa contract

    Parameters

    • contract: Contract
    • transition: string
    • args: any
    • version: number
    • amount: string
    • gasPrice: string
    • gasLimit: number

    Returns Promise<any>

    Zilliqa transaction

Static createAccount

  • createAccount

    Creates new account and returns account with corresponding mnemonic

    Returns [IZilliqaAccount, string]

    Account and mnemonic

Static deployContract

  • deployContract(client: Zilliqa, code: string, owner: string, version: number, gasPrice: string, gasLimit: number): Promise<any>
  • deployContract

    Deploys contract on zilliqa network

    Parameters

    • client: Zilliqa
    • code: string
    • owner: string
    • version: number
    • gasPrice: string
    • gasLimit: number

    Returns Promise<any>

    Zilliqa transaction

Static getBalance

  • getBalance(client: Zilliqa, address: string): Promise<any>
  • getBalance

    Get balance of providing address

    Parameters

    • client: Zilliqa
    • address: string

    Returns Promise<any>

    Balance

Static getContractAtAddress

  • getContractAtAddress(client: Zilliqa, address: string): Contract
  • getContractAtAddress

    Create contract instance at providing address

    Parameters

    • client: Zilliqa
    • address: string

    Returns Contract

    Zilliqa contract

Static getContractState

  • getContractState(contract: Contract): Promise<State>
  • getContractState

    Get state of providing zilliqa contract

    Parameters

    • contract: Contract

    Returns Promise<State>

    State of zilliqa contract

Static getMinimumGasPrice

  • getMinimumGasPrice(client: Zilliqa): Promise<string>
  • getMinimumGasPrice

    Get minimum gas price

    Parameters

    • client: Zilliqa

    Returns Promise<string>

    Gas price

Static getNetworkId

  • getNetworkId(client: Zilliqa): Promise<string>
  • getNetworkId

    Get network id

    Parameters

    • client: Zilliqa

    Returns Promise<string>

    Network id

Static getZilliqaVersion

  • getZilliqaVersion(chainID: number, msgVersion?: number): number
  • getZilliqaVersion

    Get zilliqa message version

    Parameters

    • chainID: number
    • Default value msgVersion: number = 1

    Returns number

    Zilliqa message version

Static importAccountFromMnemonic

  • importAccountFromMnemonic

    Import acccount from mnemonic words

    Parameters

    • mnemonic: string

    Returns IZilliqaAccount

    Account

Static importAccountFromPrivateKey

  • mnemonicToPrivateKey

    Transfer mnemonic words to private key

    Parameters

    • privateKey: string

    Returns IZilliqaAccount

    private key

Static mnemonicToPrivateKey

  • mnemonicToPrivateKey(mnemonic: string): string
  • mnemonicToPrivateKey

    Transfer mnemonic words to private key

    Parameters

    • mnemonic: string

    Returns string

    private key

Static sendToken

  • sendToken(client: Zilliqa, version: number, toAddr: string, amount: string, gasPrice: string, gasLimit: number): Promise<any>
  • sendToken

    Sends token

    Parameters

    • client: Zilliqa
    • version: number
    • toAddr: string
    • amount: string
    • gasPrice: string
    • gasLimit: number

    Returns Promise<any>

    Zilliqa transaction

Generated using TypeDoc