Options
All
  • Public
  • Public/Protected
  • All
Menu

Class DatabaseAPI

Hierarchy

  • DatabaseAPI

Index

Constructors

constructor

Properties

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>

getAccountHistory

  • getAccountHistory(account: string, from: number, limit: number, operation_bitmask?: [number, number]): Promise<[[number, AppliedOperation]]>
  • Returns one or more account history objects for account operations

    example

    const op = dhive.utils.operationOrders const operationsBitmask = dhive.utils.makeBitMaskFilter([ op.transfer, op.transfer_to_vesting, op.withdraw_vesting, op.interest, op.liquidity_reward, op.transfer_to_savings, op.transfer_from_savings, op.escrow_transfer, op.cancel_transfer_from_savings, op.escrow_approve, op.escrow_dispute, op.escrow_release, op.fill_convert_request, op.fill_order, op.claim_reward_balance, ])

    Parameters

    • account: string

      The account to fetch

    • from: number

      The starting index

    • limit: number

      The maximum number of results to return

    • Optional operation_bitmask: [number, number]

    Returns Promise<[[number, AppliedOperation]]>

getAccounts

  • Return array of account info objects for the usernames passed.

    Parameters

    • usernames: string[]

      The accounts to fetch.

    Returns Promise<ExtendedAccount[]>

getBlock

  • Return block blockNum.

    Parameters

    • blockNum: number

    Returns Promise<SignedBlock>

getBlockHeader

  • getBlockHeader(blockNum: number): Promise<BlockHeader>
  • Return header for blockNum.

    Parameters

    • blockNum: number

    Returns Promise<BlockHeader>

getChainProperties

  • Return median chain properties decided by witness.

    Returns Promise<ChainProperties>

getConfig

  • getConfig(): Promise<{}>

getCurrentMedianHistoryPrice

  • getCurrentMedianHistoryPrice(): Promise<Price>
  • Return median price in HBD for 1 HIVE as reported by the witnesses.

    Returns Promise<Price>

getDiscussions

  • Return array of discussions (a.k.a. posts).

    Parameters

    • by: DiscussionQueryCategory

      The type of sorting for the discussions, valid options are: active blog cashout children comments created feed hot promoted trending votes. Note that for blog and feed the tag is set to a username.

    • query: DisqussionQuery

    Returns Promise<Discussion[]>

getDynamicGlobalProperties

getOperations

  • getOperations(blockNum: number, onlyVirtual?: boolean): Promise<AppliedOperation[]>
  • Return all applied operations in blockNum.

    Parameters

    • blockNum: number
    • Default value onlyVirtual: boolean = false

    Returns Promise<AppliedOperation[]>

getState

  • getState(path: string): Promise<any>
  • Return all of the state required for a particular url path.

    Parameters

    • path: string

      Path component of url conforming to condenser's scheme e.g. @almost-digital or trending/travel

    Returns Promise<any>

getTransaction

  • Returns the details of a transaction based on a transaction id.

    Parameters

    • txId: string

    Returns Promise<SignedTransaction>

getVersion

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

    Returns Promise<object>

getVestingDelegations

  • getVestingDelegations(account: string, from?: string, limit?: number): Promise<VestingDelegation[]>
  • Get list of delegations made by account.

    Parameters

    • account: string

      Account delegating

    • Default value from: string = ""

      Delegatee start offset, used for paging.

    • Default value limit: number = 1000

      Number of results, max 1000.

    Returns Promise<VestingDelegation[]>

verifyAuthority

  • Verify signed transaction.

    Parameters

    Returns Promise<boolean>

Generated using TypeDoc