Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface BlockApi

Block API

Hierarchy

  • BlockApi

Index

Properties

getBlockByHeight

getBlockByHeight: function

Get a block by given height

param

The block height

param

true, if transactions shall be included

returns

The Block

Type declaration

    • (height: number, includeTransactions: boolean): Promise<Block>
    • Parameters

      • height: number
      • includeTransactions: boolean

      Returns Promise<Block>

getBlockById

getBlockById: function

Get a block by given id

param

The block id

param

true, if transactions shall be included

returns

The Block

Type declaration

    • (block: string, includeTransactions: boolean): Promise<Block>
    • Parameters

      • block: string
      • includeTransactions: boolean

      Returns Promise<Block>

getBlockByTimestamp

getBlockByTimestamp: function

Get a block from a given timestamp

param

The timestamp in seconds since genesis block

param

true, if transactions shall be included

returns

The Block

Type declaration

    • (timestamp: number, includeTransactions: boolean): Promise<Block>
    • Parameters

      • timestamp: number
      • includeTransactions: boolean

      Returns Promise<Block>

getBlockId

getBlockId: function

Get a block id by given height

param

The block height

returns

The Block Id

Type declaration

    • (height: number): Promise<BlockId>
    • Parameters

      • height: number

      Returns Promise<BlockId>

getBlocks

getBlocks: function

Get blocks from the blockchain in reverse block height order.

param

first block to retrieve (optional, default is zero or the last block on the blockchain)

param

the last block to retrieve (optional, default is firstIndex + 99)

param

true, if transactions shall be included

returns

the array of blocks retrieved

Type declaration

    • (firstIndex?: number, lastIndex?: number, includeTransactions?: boolean): Promise<BlockList>
    • Parameters

      • Optional firstIndex: number
      • Optional lastIndex: number
      • Optional includeTransactions: boolean

      Returns Promise<BlockList>