Claim stakes
A claim stake is a player’s claim on a celestial body, producing resources over time rather than in a single action.
Reading them
Section titled “Reading them”By owner, which is the usual direction:
const stakes = await character.claimStakes.all();Or by the body, when you want to know who holds a particular place:
const stakes = await sage.claimStakes.byBody(bodyAddress);Lifecycle is a state, not a flag
Section titled “Lifecycle is a state, not a flag”A stake’s state.kind is one of design, active, or deactivated. Those are
genuinely different situations rather than degrees of the same one:
if (stake.state.kind === 'active') { // Producing. Other kinds are not.}Reading a stake and assuming it is producing is the mistake this shape exists to prevent.
Instances have no derivable address
Section titled “Instances have no derivable address”Like crafting processes, claim stake instances cannot be computed from the
character and the body — the address is assigned at creation. That is why the
reads are byCharacter and byBody rather than a derivation, and why finding
one you have no reference to needs discovery.
Gotchas
Section titled “Gotchas”A stake in design is not yet producing. It exists, it is yours, and it
yields nothing. Filter on state before summing output.
Capacity and yield come from definitions. What a stake produces depends on the body and the Game account’s rules, not on fields stored in the stake account alone.
A body can hold stakes from several players. byBody returns an array for
that reason.
Reference
Section titled “Reference”claim-stakes— every export in this entryworld— the bodies stakes are placed oncrafting— the other capability with non-derivable instances