Skip to content

Claim stakes

A claim stake is a player’s claim on a celestial body, producing resources over time rather than in a single action.

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);

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.

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.

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.

  • claim-stakes — every export in this entry
  • world — the bodies stakes are placed on
  • crafting — the other capability with non-derivable instances