For the best viewing experience, please turn your phone to portrait mode.

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

Searches for a specified delegate in the system.

Syntax

get([options])

Parameters

options: See options in the 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

Calls get with default parameters to retrieve delegates from rank 102 onwards.

Syntax

getStandby([options])

Parameters

options: See options in the Core API documentation.

Return value

Promise: Resolves to an API response object.

Examples

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

getForgers

Returns a list of the next forgers in this delegate round.

Syntax

getForgers([options])

Parameters

options: See options in the Core API documentation.

Return value

Promise: Resolves to an API response object.

Examples

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

getForgingStatistics

By passing an existing delegate address and the desired unix timestamps, you can get its forging statistics within the specified timespan. If no timestamps are provided, it will use the timestamps from Lisk epoch to current date.

Syntax

getForgingStatistics(address, [options])

Parameters

address: Address of the delegate to query.

options: See options in the Core API documentation.

Return value

Promise: Resolves to an API response object.

Examples

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

What's next?
Node Resource