// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { AttributionSource } from "./AttributionSource"; import type { BigUintDec } from "./BigUintDec"; import type { BlockEvent } from "./BlockEvent"; import type { BlockExtrinsic } from "./BlockExtrinsic"; import type { ChainId } from "./ChainId"; import type { MinerId } from "./MinerId"; /** * One block, as completely as it can still be described. * * Assembled from two sources that know different things, because neither is * sufficient on its own: * * - The **node** holds the block itself — parent, body, and whether this hash * still holds its height. It forgets: `blocks-pruning` defaults to * `archive-canonical`, so a non-canonical body goes once finality passes it, * and difficulty is a state read behind a 256-block window. * - The **observer** holds what the node never had — when we first saw the * block, whether that sighting was at the tip — and what it has since * forgotten, the difficulty recorded while the state still existed. * * Every field the pair cannot supply is `None` rather than a substituted * plausible value. A block page that quietly filled in the current difficulty * for one it could not look up would be the same lie the ingest path was fixed * to stop telling. */ export type BlockDetail = { /** * Which chain. */ chain: ChainId, /** * Block number. */ height: number, /** * This block's hash — the identity the page is addressed by, so that a * link keeps meaning the same block after the height has moved on. */ hash: string, /** * Parent hash, from the header. */ parent_hash: string | null, /** * Author's reward preimage from the `pow_` PreRuntime digest. */ miner: MinerId | null, /** * What to call the author: a telemetry node name, or the abbreviated * preimage. `None` where the author could not be decoded at all. */ display: string | null, /** * Whether `display` is an inferred name or the preimage. */ attribution: AttributionSource | null, /** * How much of the attribution vote window agrees, 0.0–1.0. */ confidence: number | null, /** * Expected hashes to win this block: the difficulty in force at its * parent, which is the figure the miner actually had to meet. */ difficulty: BigUintDec | null, /** * The author's own timestamp, from the block's `Timestamp::set` inherent. */ authored_at: string | null, /** * When this observer first saw the block. `None` for a block it never saw * at all — an orphan on a fork it missed, or history before it started. */ observed_at: string | null, /** * Whether `observed_at` was a tip sighting. When false, the difference * between the timestamps measures when the observer got round to looking * and nothing about the network, so the UI must not read it as propagation. */ at_tip: boolean | null, /** * Seconds between this block's timestamp and its parent's — how long this * block took to find, against the chain's target. */ seconds_since_parent: number | null, /** * Extrinsics in the body, inherents included. `None` once the body has * been pruned. */ extrinsics: number | null, /** * The block's events, in the order they fired. * * Grouped by a reader rather than here: `phase` says whether an event * belongs to an extrinsic or to the block itself, and `extrinsic_index` * says which extrinsic. A block's opening distribution can arrive entirely * in `Initialization`, owned by no extrinsic at all — which is exactly * what block 1 on this chain does, and what a page showing only extrinsics * misses. */ events: Array, /** * The extrinsics themselves, decoded, in body order. * * From this observer's index rather than from the node, which is why they * survive the node forgetting the block: the count above comes from the * body and goes with it, these do not. Empty for a block the index has not * reached — the backfill works outward from the tip — which is a different * thing from a block with no extrinsics, and the page says so. */ body: Array, /** * Whether this hash is the one that currently holds this height. */ canonical: boolean, /** * The hash that currently holds this height. Equal to `hash` when * canonical; on an orphan page it is the link to the block that won. */ canonical_hash: string | null, /** * Other hashes this observer has recorded at this height — the losing * sides of past reorgs. Navigable, which is the whole reason the * displacement is written down. */ also_seen: Array, /** * False when the node could not be reached or no longer holds the block, * so everything here came from what the observer had already recorded. * The UI owes the reader that distinction rather than showing gaps. */ from_node: boolean, };