Options
All
  • Public
  • Public/Protected
  • All
Menu

Class EthApiClient

Ethereum api client that implements IsingleApiFullClient

Hierarchy

  • EthApiClient

Implements

Index

Constructors

constructor

Properties

config

config: IEthConfig

symbol

symbol: string = "ETH"

tokenSupport

tokenSupport: boolean = true

Methods

buildTransaction

  • buildTransaction(from: string, to: string, value: BigNumber, options: object): Promise<EthUnsignedTx>

getAccountTokenBalance

  • getAccountTokenBalance(contractAddress: string, address: string): Promise<BigNumber>

getAccountTokenTransferHistory

  • getAccountTokenTransferHistory(address: string, symbolAddress: string, page?: number, size?: number, timestamp?: number): any

getAccountTokens

  • getAccountTokens(address: string): never

getBalance

  • getBalance(address: string): any

getBlockByNumber

  • getBlockByNumber(blockNumber: string): any

getBlockNumber

  • getBlockNumber(): any

getNetwork

  • getNetwork(): "mainnet" | "ropsten"

getTokenDetail

  • getTokenDetail(contractAddress: string): Promise<Token>

getTokenIconUrl

  • getTokenIconUrl(tokenSymbol: string, contractAddress: string): any

getTopTokens

  • getTopTokens(topN?: number): Promise<Array<Token>>

getTransactionExplorerUrl

  • getTransactionExplorerUrl(hash: any): any

getTransactionStatus

  • getTransactionStatus(hash: string): Promise<any>

getTransactionsByAddress

  • getTransactionsByAddress(address: string, page: number, size: number, timestamp?: number): any
  • Get transactions by the given address

    Parameters

    • address: string

      account address

    • page: number

      page number

    • size: number

      page size

    • Optional timestamp: number

      earlier than this timestamp

    Returns any

    array of object structure which contains:

    • hash: string, with prefix 0x
    • timestamp: milli-seconds from 1970
    • from: sender
    • to: receiver
    • value: transfer amount
    • status: 'CONFIRMED' or 'FAILED'
    • blockNumber: hex string
    • fee: integer

sameAddress

  • sameAddress(address1: string, address2: string): boolean

searchTokens

  • searchTokens(keyword: string): Promise<Array<Token>>

sendTransaction

updateConfiguration