title | description | keywords | sidebar_position | ||||
---|---|---|---|---|---|---|---|
ConfirmedBlockHeightExists |
Assertion whether a specified block number is confirmed. |
|
3 |
import Finality from "./_finality.mdx";
Assertion whether a block with the specified blockNumber
is confirmed with additional data to compute the block production rate within a given time window.
Network Type | Supported Chains |
---|---|
Mainnet | BTC (Bitcoin), DOGE (Dogecoin), XRP (XRP Ledger) |
Testnet | testBTC (Bitcoin Testnet v3), testDOGE , testXRP |
Field | Solidity Type | Description |
---|---|---|
blockNumber |
uint64 |
The block number to confirm. |
queryWindow |
uint64 |
The time period (in seconds) to calculate the block production rate. |
Field | Solidity Type | Description |
---|---|---|
blockTimestamp |
uint64 |
The timestamp of the block at blockNumber . |
numberOfConfirmations |
uint64 |
The required number of confirmations for the block to be considered confirmed (chain-specific). |
lowestQueryWindowBlockNumber |
uint64 |
The block number of the latest block with a timestamp strictly less than blockTimestamp - queryWindow . |
lowestQueryWindowBlockTimestamp |
uint64 |
The timestamp of the block at lowestQueryWindowBlockNumber . |
- The function checks if the block with
blockNumber
is confirmed by at least the requirednumberOfConfirmations
for the specified chain.- If the block does not meet this requirement, the request is rejected.
- A block at the tip of the chain has exactly 1 confirmation.
- The lowestQueryWindowBlock` is identified, and its block number and timestamp are extracted.
- The required confirmations are defined based on chain-specific finality.
- The returned
timestamp
is:mediantime
for Bitcoin and Dogecoin.close_time
for XRPL.
:::note[Lowest used timestamp]
For the lowestUsedTimestamp
parameter, the value of lowestQueryWindowBlockTimestamp
is used.
:::
For the complete interface definition, see IConfirmedBlockHeightExists
.