Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AionApiClient

Aion api client that implement IsingleApiFullClient

Hierarchy

  • AionApiClient

Implements

Index

Constructors

constructor

Properties

config

config: IAionConfig

symbol

symbol: string = "AION"

tokenSupport

tokenSupport: boolean = true

Methods

buildTransaction

  • buildTransaction(from: string, to: string, value: BigNumber, options: object): Promise<AionUnsignedTx>
  • TODO: not general enough. Build transaction

    options parameters contains: gasLimit, gasPrice, isTokenTransfer, data(optional), contractAddr(optional), tokenDecimal(optional). if isTokenTransfer is true, transaction value is zero and transaction to is token contract creation address, to parameter is encoded in data.

    Parameters

    • from: string

      transaction sender

    • to: string

      amount receiver

    • value: BigNumber

      amount value

    • options: object

      extra parameters

    Returns Promise<AionUnsignedTx>

getAccountTokenBalance

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

getAccountTokenTransferHistory

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

getAccountTokens

  • getAccountTokens(address: string): Promise<object>

getBalance

  • getBalance(address: string): Promise<BigNumber>

getBlockByNumber

  • getBlockByNumber(blockNumber: string): any

getBlockNumber

  • getBlockNumber(): any

getNetwork

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

getTokenDetail

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

getTokenIconUrl

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

getTopTokens

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

getTransactionExplorerUrl

  • getTransactionExplorerUrl(hash: any): string

getTransactionStatus

  • getTransactionStatus(hash: string): any

getTransactionsByAddress

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

    Parameters

    • address: string

      account address

    • page: number

      page number

    • size: number

      page size

    Returns any

    map of object structure which contains: key is hash 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