interbtc-api

@interlay/interbtc-api / Exports / SystemAPI

Interface: SystemAPI

Implemented by

Table of contents

Methods

Methods

getBlockHash

getBlockHash(blockNumber): Promise<BlockHash>

Parameters

Name Type Description
blockNumber number The block number to get the hash for

Returns

Promise<BlockHash>

The block hash for the given block number

Defined in

src/parachain/system.ts:43


getCurrentActiveBlockNumber

getCurrentActiveBlockNumber(atBlock?): Promise<number>

Parameters

Name Type
atBlock? BlockHash

Returns

Promise<number>

The current active block number being processed.

Defined in

src/parachain/system.ts:18


getCurrentBlockNumber

getCurrentBlockNumber(): Promise<number>

Returns

Promise<number>

The current block number being processed.

Defined in

src/parachain/system.ts:13


getFutureBlockNumber

getFutureBlockNumber(secondsFromNow): Promise<number>

Get number of block that will added in amount of seconds from now.

Parameters

Name Type Description
secondsFromNow number Amount of seconds in the future.

Returns

Promise<number>

Number of block added in future.

Note

Based on approximate block time of 12 seconds.

Defined in

src/parachain/system.ts:53


setCode

setCode(code): ExtrinsicData

Parameters

Name Type Description
code string Hex-encoded wasm blob

Returns

ExtrinsicData

A submittable extrinsic and an event that is emitted when extrinsic is submitted.

Remarks

Upgrades runtime using sudoUncheckedWeight

Defined in

src/parachain/system.ts:37


subscribeToCurrentBlockHeads

subscribeToCurrentBlockHeads(callback): Promise<() => void>

On every new parachain block, call the callback function with the new block header

Parameters

Name Type Description
callback (blockHeader: Header) => void Function to be called with every new unfinalized block header

Returns

Promise<() => void>

Defined in

src/parachain/system.ts:30


subscribeToFinalizedBlockHeads

subscribeToFinalizedBlockHeads(callback): Promise<() => void>

On every new parachain block, call the callback function with the new block header

Parameters

Name Type Description
callback (blockHeader: Header) => void Function to be called with every new block header

Returns

Promise<() => void>

Defined in

src/parachain/system.ts:24