@interlay/interbtc-api / Exports / DefaultSystemAPI
• new DefaultSystemAPI(api
): DefaultSystemAPI
Name | Type |
---|---|
api |
ApiPromise |
• Private
api: ApiPromise
▸ getBlockHash(blockNumber
): Promise
<BlockHash
>
Name | Type | Description |
---|---|---|
blockNumber |
number |
The block number to get the hash for |
Promise
<BlockHash
>
The block hash for the given block number
▸ getCurrentActiveBlockNumber(atBlock?
): Promise
<number
>
Name | Type |
---|---|
atBlock? |
BlockHash |
Promise
<number
>
The current active block number being processed.
SystemAPI.getCurrentActiveBlockNumber
▸ getCurrentBlockNumber(): Promise
<number
>
Promise
<number
>
The current block number being processed.
SystemAPI.getCurrentBlockNumber
▸ getFutureBlockNumber(secondsFromNow
): Promise
<number
>
Get number of block that will added in amount of seconds from now.
Name | Type | Description |
---|---|---|
secondsFromNow |
number |
Amount of seconds in the future. |
Promise
<number
>
Number of block added in future.
Note
Based on approximate block time of 12 seconds.
SystemAPI.getFutureBlockNumber
▸ setCode(code
): ExtrinsicData
Name | Type | Description |
---|---|---|
code |
string |
Hex-encoded wasm blob |
A submittable extrinsic and an event that is emitted when extrinsic is submitted.
Remarks
Upgrades runtime using sudoUncheckedWeight
▸ subscribeToCurrentBlockHeads(callback
): Promise
<() => void
>
On every new parachain block, call the callback function with the new block header
Name | Type | Description |
---|---|---|
callback |
(blockHeader : Header ) => void |
Function to be called with every new unfinalized block header |
Promise
<() => void
>
SystemAPI.subscribeToCurrentBlockHeads
▸ subscribeToFinalizedBlockHeads(callback
): Promise
<() => void
>
On every new parachain block, call the callback function with the new block header
Name | Type | Description |
---|---|---|
callback |
(blockHeader : Header ) => void |
Function to be called with every new block header |
Promise
<() => void
>
SystemAPI.subscribeToFinalizedBlockHeads