KAI Chain

constructor

Params

Return

Return a KAIChain instance .

Methods

getBlockNumber

Get current block number

Params

None

Return

Current block number

isValidator

Check if an address is a validator or not

Params

Return

True if given address is address of validator, otherwise false.

getValidators

Get list of current validators

Params

Return

List of current validators

getBlockByBlockNumber

Get block by number

Params

Return

Block object

getBlockByHash

Get block by number

Params

Return

Block object

getBlockHeaderByBlockNumber

Params

Return

Block header object

getBlockHeaderByHash

Params

Return

Block header object

newFilter

Create a new filter to watch for smart contract's events

Params

Return

Fitler ID

newBlockFilter

Create a new filter to watch for new block

Params

None

Return

Filter ID

uninstallFilter

Uninstalls a filter with given id. Should always be called when watch is no longer needed.

Params

Return

True if the filter was successfully uninstalled, otherwise false.

getFilterChanges

Polling method for a filter, which returns an array of logs which occurred since last poll.

Params

Return

An array of logs which occurred since last poll.

For filters created with kai_newBlockFilter the return are block hashes, e.g ["0x3454645634534..."]

For filters created with kai_newFilter, return array of Log

getFilterLogs

Returns an array of all logs matching filter with given id.

Params

Return

See getFilterChanges

getLogs

Returns an array of all logs matching a given filter object.

Params

Return

Array of Log

getGasPrice

Get optimized gas price

Params

None

Return

Optimized gas price in HYDRO

Static method

KAIFromHydro

Convert Hydro to KAI

Params

Return

Value in KAI

HydroFromKAI

Convert KAI to Hydro

Params

Return

Value in Hydro

Last updated