@somnia-chain/markets-sdk / index / TailStatus
Interface: TailStatus
Defined in: packages/sdk/src/store.ts:99
Live-tail health snapshot — how current the store's getLive* reads are:
block coverage (snapshot/last/head), socket state, and active watch count.
Properties
healedGaps
healedGaps:
number
Defined in: packages/sdk/src/store.ts:101
Nonempty intervening ranges successfully recovered. Empty probes do not count.
lastDivergence
lastDivergence:
TailDivergence|null
Defined in: packages/sdk/src/store.ts:103
Last observed divergence, retained after later matching checks.
failure
failure:
TailFailure|null
Defined in: packages/sdk/src/store.ts:105
Background failure; cleared only after the failed work succeeds.
mode
mode:
TailMode
Defined in: packages/sdk/src/store.ts:107
Current data-source mode ("init" until the first watch is hydrated).
seedSource
seedSource:
SeedSource|null
Defined in: packages/sdk/src/store.ts:113
Where the most recent watch took its book seed: "indexer" for the
indexer snapshot (the default), "chain" for a seed: "chain" watch.
null in "init", before any watch has hydrated.
seedBlock
seedBlock:
number
Defined in: packages/sdk/src/store.ts:120
Block the seed was consistent to — the indexer snapshot block, or the
pinned block every chain-seed page was read at. 0 before any watch has
hydrated. Equal to TailStatus.snapshotBlock; this field names the
value, while seedSource names where it came from.
seedTruncated
seedTruncated:
boolean
Defined in: packages/sdk/src/store.ts:126
Whether the chain seed hit its page budget and read a SHALLOW book. Always false for an indexer seed. A truncated seed is a successful bounded read, not a failure — the book is real but incomplete at its deep end.
fillsLoaded
fillsLoaded:
boolean
Defined in: packages/sdk/src/store.ts:136
Whether fill history was loaded for the current scope.
A chain seed cannot reconstruct fills from before its block: the seam
backfills only snapshotBlock+1..head, and older fills live only in the
indexer. So false plus an empty getLiveFills means "never loaded",
while true plus an empty getLiveFills means "genuinely no fills in the
loaded range". Without this flag the two are indistinguishable.
snapshotBlock
snapshotBlock:
number
Defined in: packages/sdk/src/store.ts:146
Block the most recent watch seed was consistent to — a watch's seam covers snapshotBlock+1.. either way.
For an indexer-seeded watch this is the indexer snapshot block, unchanged. For a chain-seeded watch it is the block every drained page was pinned to, the same value TailStatus.seedBlock reports. Read TailStatus.seedSource to tell the two apart.
lastBlock
lastBlock:
number
Defined in: packages/sdk/src/store.ts:148
Highest applied event or sealed scope block; heads alone do not advance it.
headBlock
headBlock:
number
Defined in: packages/sdk/src/store.ts:150
Latest chain head observed over the WS
wsConnected
wsConnected:
boolean
Defined in: packages/sdk/src/store.ts:152
Whether the chain WS subscriptions are currently delivering
watchCount
watchCount:
number
Defined in: packages/sdk/src/store.ts:162
Active watch SCOPES: pools currently subscribed (including an all-markets watch's set), plus the perp plane as one if it is watched.
0 → the tail is idle and no socket is held for it, and that invariant is the point
of the field. The perp plane is counted precisely because it holds a socket while
subscribing no pool at all, so a pool-only count would report an idle tail that is
in fact streaming.