Lisk Elements API Client: Delegates Resource

This is a resource for interacting with the delegates endpoint provided by the Lisk public API. Each of the following methods can be accessed via the delegates property of an APIClient instance.

get

This searches for a specified delegate in the system.

Syntax

get([options])

Parameters

options: Please see the options in the following link: Core API documentation.

Return value

Promise: Resolves to an API response object.

Examples

client.delegates.get({ username: 'oliver' })
    .then(res => {
        console.log(res.data);
    })

getStandby

This calls get with the default parameters in order to retrieve the delegates from rank 102 onwards.

Syntax

getStandby([options])

Parameters

options: Please see the options in the following link: Core API documentation.

Return value

Promise: Resolves to an API response object.

Examples

client.delegates.getStandby()
    .then(res => {
        console.log(res.data);
    })

getForgers

This returns a list of the next forgers in this delegate round.

Syntax

getForgers([options])

Parameters

options: Please see the options in the following link: Core API documentation.

Return value

Promise: Resolves to an API response object.

Examples

client.delegates.getForgers()
    .then(res => {
        console.log(res.data);
    })

getForgingStatistics

By viewing an existing delegate address and the desired unix timestamps, it is possible to acquire their forging statistics within the specified timespan. If no timestamps are provided, it will use the timestamps from the Lisk epoch to the current date.

Syntax

getForgingStatistics(address, [options])

Parameters

address: Address of the delegate to query.

options: Please see the options in the following link: Core API documentation.

Return value

Promise: Resolves to an API response object.

Examples

client.delegates.getForgingStatistics('15434119221255134066L')
    .then(res => {
        console.log(res.data);
    })