Documentation / @etherfold/core / parseStreamSeed
Function: parseStreamSeed() ​
parseStreamSeed(
text):StreamSeed
Defined in: packages/core/src/stream/seed.ts:335
Read a seed back, refusing anything that is not one.
It THROWS, exactly as parseStreamFixture does, and the loader CATCHES: ADR-0064's refusal vocabulary carries unreadable-format as data, so the conversion happens at the one place that owns the refusal type rather than being spread across a reader that has to return two shapes. A truncated file, a fixture handed to the wrong reader and a future format all arrive at the same refusal, which is right -- each of them is a document this build cannot read.
The checks are deliberately shallow. Whether the events are ORDERED, whether each block carries one hash, whether they sit inside the claimed coverage and whether the capture was taken far enough below the head are ADMISSION checks that run before the first write (ADR-0065); making them parse errors would turn a refusal a client can explain into an exception it cannot.
Shallow does NOT mean untyped, though, and the three NUMBERS are checked here for a reason worth stating: an admission check compares them arithmetically, and a missing one arrives as undefined rather than as a refusal. The capture-depth check is the sharp case -- chainHeadAtCapture - coverage.toBlock < finality on an absent head is NaN < finality, which is FALSE, so a seed carrying no observed head would be ADMITTED by the very check written to refuse it. A comparison that silently passes is the one failure a shallow reader must not hand downstream, so the fields an admission check does arithmetic on are typed at the door. 0 is a legal block number, so this is a typeof test and never a truthiness one.
Parameters ​
text ​
string