Home Reference Source
public class | source

BlockService

Extends:

packages/core/src/service/baseService.js~BaseService → BlockService

Service for block operations

Method Summary

Public Methods
public

getBlockByHeight(height: number, includeTransactions: boolean): Promise

Get a block by given height

public

getBlockById(id: string, includeTransactions: boolean): Promise

Get a block by given id

public

getBlockByTimestamp(timestamp: number, includeTransactions: boolean): Promise

Get a block by given timestamp

public

Get a block ID given a block height

Public Methods

public getBlockByHeight(height: number, includeTransactions: boolean): Promise source

Get a block by given height

Params:

NameTypeAttributeDescription
height number
includeTransactions boolean

Return:

Promise

public getBlockById(id: string, includeTransactions: boolean): Promise source

Get a block by given id

Params:

NameTypeAttributeDescription
id string
includeTransactions boolean

Return:

Promise

public getBlockByTimestamp(timestamp: number, includeTransactions: boolean): Promise source

Get a block by given timestamp

Params:

NameTypeAttributeDescription
timestamp number
includeTransactions boolean

Return:

Promise

public getBlockId(height: number): Promise source

Get a block ID given a block height

Params:

NameTypeAttributeDescription
height number

Return:

Promise