Options
All
  • Public
  • Public/Protected
  • All
Menu

Class DatabaseAPI

Hierarchy

  • DatabaseAPI

Index

Constructors

constructor

Properties

Readonly client

client: Client

Methods

call

  • call(method: string, params?: any[] | {}): Promise<any>
  • Convenience for calling database_api.

    Parameters

    • method: string
    • Optional params: any[] | {}

    Returns Promise<any>

getConfig

  • Return server config.

    Returns Promise<RpcNodeConfig>

getListAccounts

  • getListAccounts(start: string | string[], limit: number, order: "by_name" | "by_proxy" | "by_next_vesting_withdrawal", delayed_votes_active?: boolean): Promise<{ accounts: Account[] }>
  • Return a list of accounts.

    Parameters

    • start: string | string[]

      String or array for pagination

    • limit: number

      Number of results, max 1000

    • order: "by_name" | "by_proxy" | "by_next_vesting_withdrawal"

      by_next_vesting_withdrawal: in this case start is a date eg: ["1970-01-01T00:00:00", ""]

    • Default value delayed_votes_active: boolean = true

      Default true (optional)

    Returns Promise<{ accounts: Account[] }>

getListWitnessVotes

  • getListWitnessVotes(start: [string | null, string | null], limit: number, order: "by_account_witness" | "by_witness_account"): Promise<{ votes: WitnessVotes[] }>
  • Returns a list of witness votes.

    example

    Voters of a witness

    const accounts = await client.database.getListWitnessVotes(['nalexadre', null], 10, 'by_witness_account')

    Parameters

    • start: [string | null, string | null]

      Depends on order (see below)

    • limit: number

      Number of results, max 1000

    • order: "by_account_witness" | "by_witness_account"

      by_account_witness: start is an array of two values: account, witness | by_witness_account: start is an array of two values: witness, account

    Returns Promise<{ votes: WitnessVotes[] }>

getVersion

  • getVersion(): Promise<object>
  • return rpc node version

    Returns Promise<object>

Generated using TypeDoc