Skip to content
Next — unreleased

Defined in: packages/sage/src/crafting/index.ts:79

A registry-resolved nested crafting CargoPod.

declare const inventory: CraftingCargoInventory;
console.log(inventory.items);

readonly items: readonly CraftingCargoItem[];

Defined in: packages/sage/src/crafting/index.ts:82

readonly sequenceId: number;

Defined in: packages/sage/src/crafting/index.ts:80

readonly usedStorageUnitsRaw: bigint;

Defined in: packages/sage/src/crafting/index.ts:81


Defined in: packages/sage/src/crafting/index.ts:68

A registry-resolved cargo amount used by a Recipe or Crafting Process.

declare const item: CraftingCargoItem;
console.log(item.name, item.quantityRaw);

readonly categoryId: number;

Defined in: packages/sage/src/registry/index.ts:119

CargoDefinitionSummary.categoryId

readonly id: number;

Defined in: packages/sage/src/registry/index.ts:120

CargoDefinitionSummary.id

readonly mint: Address;

Defined in: packages/sage/src/registry/index.ts:121

CargoDefinitionSummary.mint

readonly name: string;

Defined in: packages/sage/src/registry/index.ts:122

CargoDefinitionSummary.name

readonly quantityRaw: bigint;

Defined in: packages/sage/src/crafting/index.ts:69

readonly storageCost: number;

Defined in: packages/sage/src/registry/index.ts:127

Encoded storage cost with 8 fractional bits: 256 means one whole storage unit. For a nonnegative bigint quantity, use (quantity * BigInt(storageCost) + 255n) / 256n. Round each transfer row up before summing; Fleet capacities and pod usage are whole units.

CargoDefinitionSummary.storageCost


Defined in: packages/sage/src/crafting/index.ts:193

One resolved cargo quantity used by a Hab building definition.

declare const item: CraftingDefinitionCargoItem;
console.log(item.quantityRaw);

readonly categoryId: number;

Defined in: packages/sage/src/registry/index.ts:119

CargoDefinitionSummary.categoryId

readonly id: number;

Defined in: packages/sage/src/registry/index.ts:120

CargoDefinitionSummary.id

readonly mint: Address;

Defined in: packages/sage/src/registry/index.ts:121

CargoDefinitionSummary.mint

readonly name: string;

Defined in: packages/sage/src/registry/index.ts:122

CargoDefinitionSummary.name

readonly quantityRaw: bigint;

Defined in: packages/sage/src/crafting/index.ts:194

readonly storageCost: number;

Defined in: packages/sage/src/registry/index.ts:127

Encoded storage cost with 8 fractional bits: 256 means one whole storage unit. For a nonnegative bigint quantity, use (quantity * BigInt(storageCost) + 255n) / 256n. Round each transfer row up before summing; Fleet capacities and pod usage are whole units.

CargoDefinitionSummary.storageCost


Defined in: packages/sage/src/crafting/index.ts:204

A resolved Crafting Hab building definition and placed quantity.

declare const building: CraftingHabBuilding;
console.log(building.definition.name, building.quantity);

readonly definition: {
constructionCost: readonly CraftingDefinitionCargoItem[];
constructionDurationSeconds: bigint;
crewSlots: number;
hubValue: number;
id: number;
jobCapacity: number;
minimumTier: "one" | "two" | "three" | "four" | "five";
modifiers: CraftingModifierData;
name: string;
neededCrew: number;
netRates: readonly CargoDefinitionSummary & {
unitsPerSecond: number;
unitsPerSecondRaw: bigint;
}[];
providedTagIds: readonly number[];
refunds: readonly CraftingDefinitionCargoItem[];
requiredTagIds: readonly number[];
researchRequirementIds: readonly number[];
resourceCapacityRaw: bigint;
slots: number;
unlockedRecipes: readonly EntityRef<"recipe">[];
xpValue: {
raw: bigint;
value: number;
};
};

Defined in: packages/sage/src/crafting/index.ts:206

readonly constructionCost: readonly CraftingDefinitionCargoItem[];
readonly constructionDurationSeconds: bigint;
readonly crewSlots: number;
readonly hubValue: number;
readonly id: number;
readonly jobCapacity: number;
readonly minimumTier: "one" | "two" | "three" | "four" | "five";
readonly modifiers: CraftingModifierData;
readonly name: string;
readonly neededCrew: number;
readonly netRates: readonly CargoDefinitionSummary & {
unitsPerSecond: number;
unitsPerSecondRaw: bigint;
}[];
readonly providedTagIds: readonly number[];
readonly refunds: readonly CraftingDefinitionCargoItem[];
readonly requiredTagIds: readonly number[];
readonly researchRequirementIds: readonly number[];
readonly resourceCapacityRaw: bigint;
readonly slots: number;
readonly unlockedRecipes: readonly EntityRef<"recipe">[];
readonly xpValue: {
raw: bigint;
value: number;
};
readonly raw: bigint;
readonly value: number;

readonly quantity: number;

Defined in: packages/sage/src/crafting/index.ts:205


Defined in: packages/sage/src/crafting/index.ts:168

A resolved Crafting Hab definition from the Game registry.

declare const definition: CraftingHabDefinitionSummary;
console.log(definition.name, definition.placementCargo.name);

readonly evictionGracePeriodSeconds: bigint;

Defined in: packages/sage/src/crafting/index.ts:181

readonly hubValue: number;

Defined in: packages/sage/src/crafting/index.ts:178

readonly id: number;

Defined in: packages/sage/src/crafting/index.ts:169

readonly name: string;

Defined in: packages/sage/src/crafting/index.ts:170

readonly placementCargo: CargoDefinitionSummary;

Defined in: packages/sage/src/crafting/index.ts:183

readonly placementFeeMultiplier: {
raw: bigint;
value: number;
};

Defined in: packages/sage/src/crafting/index.ts:174

readonly raw: bigint;
readonly value: number;

readonly providedTagIds: readonly number[];

Defined in: packages/sage/src/crafting/index.ts:180

readonly rentMultiplier: {
raw: bigint;
value: number;
};

Defined in: packages/sage/src/crafting/index.ts:173

readonly raw: bigint;
readonly value: number;

readonly requiredTagIds: readonly number[];

Defined in: packages/sage/src/crafting/index.ts:179

readonly respawnDurationSeconds: bigint;

Defined in: packages/sage/src/crafting/index.ts:182

readonly slots: number;

Defined in: packages/sage/src/crafting/index.ts:172

readonly tier: "one" | "two" | "three" | "four" | "five";

Defined in: packages/sage/src/crafting/index.ts:171


Defined in: packages/sage/src/crafting/index.ts:239

Immutable translated Crafting Hab infrastructure and production state.

declare const hab: CraftingHabSnapshot;
console.log(hab.definition.name, hab.production.inventory.items);
  • Omit<CraftingHabAccountData, | "buildings" | "game" | "ownerProfile" | "production" | "system" | "unlockedRecipeIds">

readonly address: Address;

Defined in: packages/sage/src/crafting/index.ts:249

readonly availableJobSlots: number;

Defined in: packages/sage/src/crafting/index.ts:255

readonly buildingDefinitionSequenceId: number;

Defined in: packages/sage/src/internal/c4/crafting.ts:165

Omit.buildingDefinitionSequenceId

readonly buildings: readonly CraftingHabBuilding[];

Defined in: packages/sage/src/crafting/index.ts:254

readonly constructionProgressAtUnixSeconds: bigint;

Defined in: packages/sage/src/internal/c4/crafting.ts:169

Omit.constructionProgressAtUnixSeconds

readonly constructionRemainingSeconds: bigint;

Defined in: packages/sage/src/internal/c4/crafting.ts:168

Omit.constructionRemainingSeconds

readonly definition: CraftingHabDefinitionSummary;

Defined in: packages/sage/src/crafting/index.ts:253

readonly definitionId: number;

Defined in: packages/sage/src/internal/c4/crafting.ts:163

Omit.definitionId

readonly definitionSequenceId: number;

Defined in: packages/sage/src/internal/c4/crafting.ts:164

Omit.definitionSequenceId

readonly game: EntityRef<"game">;

Defined in: packages/sage/src/crafting/index.ts:250

readonly jobCapacity: number;

Defined in: packages/sage/src/internal/c4/crafting.ts:174

Omit.jobCapacity

readonly jobsRunning: number;

Defined in: packages/sage/src/internal/c4/crafting.ts:175

Omit.jobsRunning

readonly kind: "craftingHabInstance";

Defined in: packages/sage/src/crafting/index.ts:248

readonly lastRentAtUnixSeconds: bigint;

Defined in: packages/sage/src/internal/c4/crafting.ts:167

Omit.lastRentAtUnixSeconds

readonly modifiers: CraftingModifierData;

Defined in: packages/sage/src/internal/c4/crafting.ts:176

Omit.modifiers

readonly neededCrew: number;

Defined in: packages/sage/src/internal/c4/crafting.ts:173

Crew the Hab reserved, on a version-1 instance. A version-0 instance stores an unverified nominal value instead.

Omit.neededCrew

readonly ownerProfile: EntityRef<"profile">;

Defined in: packages/sage/src/crafting/index.ts:251

readonly production: {
inventory: CraftingCargoInventory;
lastTickAtUnixSeconds: bigint;
netRates: readonly CargoDefinitionSummary & {
unitsPerSecond: number;
unitsPerSecondRaw: bigint;
}[];
resourceCapacityRaw: bigint;
};

Defined in: packages/sage/src/crafting/index.ts:257

readonly inventory: CraftingCargoInventory;
readonly lastTickAtUnixSeconds: bigint;
readonly netRates: readonly CargoDefinitionSummary & {
unitsPerSecond: number;
unitsPerSecondRaw: bigint;
}[];
readonly resourceCapacityRaw: bigint;

readonly rentBalanceRaw: bigint;

Defined in: packages/sage/src/internal/c4/crafting.ts:170

Omit.rentBalanceRaw

readonly state: CraftingHabStateData;

Defined in: packages/sage/src/internal/c4/crafting.ts:179

Omit.state

readonly system: EntityRef<"starSystem">;

Defined in: packages/sage/src/crafting/index.ts:252

readonly systemSequenceId: bigint;

Defined in: packages/sage/src/internal/c4/crafting.ts:166

Omit.systemSequenceId

readonly unlockedRecipes: readonly EntityRef<"recipe">[];

Defined in: packages/sage/src/crafting/index.ts:256

readonly version: number;

Defined in: packages/sage/src/internal/c4/crafting.ts:159

Omit.version

toJSON(): unknown;

Defined in: packages/sage/src/crafting/index.ts:266

unknown


Defined in: packages/sage/src/crafting/index.ts:276

Immutable translated Crafting Process with resolved Recipe and inputs.

declare const process: CraftingProcessSnapshot;
console.log(process.recipe.name, process.numCrew);
  • Omit<CraftingProcessAccountData, | "craftingHab" | "inputs" | "profile" | "recipe" | "starbasePlayer" | "system">

readonly address: Address;

Defined in: packages/sage/src/crafting/index.ts:281

readonly optional craftingHab?: EntityRef<"craftingHabInstance">;

Defined in: packages/sage/src/crafting/index.ts:287

The Process Hab, or absent when crafting without a Hab.

readonly endsAtUnixSeconds: bigint;

Defined in: packages/sage/src/internal/c4/crafting.ts:199

Omit.endsAtUnixSeconds

readonly feeEscrowAtlas: number;

Defined in: packages/sage/src/crafting/index.ts:289

readonly feeEscrowRaw: bigint;

Defined in: packages/sage/src/internal/c4/crafting.ts:200

Omit.feeEscrowRaw

readonly optional feeGovernance?: Address;

Defined in: packages/sage/src/internal/c4/crafting.ts:204

Captured governance address, if present; never inferred from the current Recipe.

Omit.feeGovernance

readonly optional feeRecipient?: "atlas" | "dao-atlas";

Defined in: packages/sage/src/internal/c4/crafting.ts:202

Captured original recipe destination; absent on legacy version 0 processes.

Omit.feeRecipient

readonly optional feeSnapshot?: {
craftingFeeBasisPoints: number;
localMarketFeeBasisPoints: number;
localTreasuryShareBasisPoints: number;
};

Defined in: packages/sage/src/internal/c4/crafting.ts:206

Captured routing rates; absent on legacy version 0 processes.

readonly craftingFeeBasisPoints: number;
readonly localMarketFeeBasisPoints: number;
readonly localTreasuryShareBasisPoints: number;
Omit.feeSnapshot

readonly inputs: CraftingCargoInventory;

Defined in: packages/sage/src/crafting/index.ts:288

readonly kind: "craftingProcess";

Defined in: packages/sage/src/crafting/index.ts:280

readonly numCrew: number;

Defined in: packages/sage/src/internal/c4/crafting.ts:197

Omit.numCrew

readonly profile: EntityRef<"profile">;

Defined in: packages/sage/src/crafting/index.ts:283

readonly quantityRaw: bigint;

Defined in: packages/sage/src/internal/c4/crafting.ts:196

Omit.quantityRaw

readonly recipe: RecipeSnapshot;

Defined in: packages/sage/src/crafting/index.ts:282

readonly starbasePlayer: EntityRef<"starbasePlayer">;

Defined in: packages/sage/src/crafting/index.ts:285

readonly starbaseSequenceId: bigint;

Defined in: packages/sage/src/internal/c4/crafting.ts:194

Omit.starbaseSequenceId

readonly startsAtUnixSeconds: bigint;

Defined in: packages/sage/src/internal/c4/crafting.ts:198

Omit.startsAtUnixSeconds

readonly system: EntityRef<"starSystem">;

Defined in: packages/sage/src/crafting/index.ts:284

readonly version: number;

Defined in: packages/sage/src/internal/c4/crafting.ts:189

Omit.version

toJSON(): unknown;

Defined in: packages/sage/src/crafting/index.ts:290

unknown


Defined in: packages/sage/src/crafting/index.ts:99

Immutable translated Recipe definition.

usageCountRaw and usageLimitRaw are the stored u64 counters: how many Crafting Processes have been started from the Recipe and its maximum. A start consumes one use whatever its quantity, and is possible only while the count is below the limit, so a stored limit of 0n is never usable. Every Recipe observed on z.ink PTR stores 9007199254740991 (2^53 - 1) as its limit; see docs/evidence/crafting-zero-usage-limit.md.

declare const recipe: RecipeSnapshot;
console.log(recipe.ingredients, recipe.outputs);
  • Omit<RecipeAccountData, "game" | "id" | "inputs" | "outputs">

readonly address: Address;

Defined in: packages/sage/src/crafting/index.ts:104

readonly craftingDurationSeconds: bigint;

Defined in: packages/sage/src/internal/c4/crafting.ts:103

Omit.craftingDurationSeconds

readonly fee: {
amountAtlas: number;
amountRaw: bigint;
recipient: "atlas" | "dao-atlas";
};

Defined in: packages/sage/src/internal/c4/crafting.ts:107

readonly amountAtlas: number;
readonly amountRaw: bigint;
readonly recipient: "atlas" | "dao-atlas";
Omit.fee

readonly game: EntityRef<"game">;

Defined in: packages/sage/src/crafting/index.ts:105

readonly habRequired: boolean;

Defined in: packages/sage/src/internal/c4/crafting.ts:112

Omit.habRequired

readonly id: number;

Defined in: packages/sage/src/crafting/index.ts:106

readonly ingredients: readonly CraftingCargoItem[];

Defined in: packages/sage/src/crafting/index.ts:107

readonly kind: "recipe";

Defined in: packages/sage/src/crafting/index.ts:103

readonly minimumDurationSeconds: bigint;

Defined in: packages/sage/src/internal/c4/crafting.ts:104

Omit.minimumDurationSeconds

readonly minimumStarbaseLevel:
| "level-0"
| "level-1"
| "level-2"
| "level-3"
| "level-4"
| "level-5"
| "css";

Defined in: packages/sage/src/internal/c4/crafting.ts:116

Omit.minimumStarbaseLevel

readonly modifierBounds: {
crewCount: CraftingModifierBoundsData;
efficiency: CraftingModifierBoundsData;
fee: CraftingModifierBoundsData;
speed: CraftingModifierBoundsData;
};

Defined in: packages/sage/src/internal/c4/crafting.ts:124

readonly crewCount: CraftingModifierBoundsData;
readonly efficiency: CraftingModifierBoundsData;
readonly fee: CraftingModifierBoundsData;
readonly speed: CraftingModifierBoundsData;
Omit.modifierBounds

readonly name: string;

Defined in: packages/sage/src/internal/c4/crafting.ts:105

Omit.name

readonly outputs: readonly CraftingCargoItem[];

Defined in: packages/sage/src/crafting/index.ts:108

readonly researchRequirementIds: readonly number[];

Defined in: packages/sage/src/internal/c4/crafting.ts:130

Omit.researchRequirementIds

readonly status: "active" | "deactivated";

Defined in: packages/sage/src/internal/c4/crafting.ts:106

Omit.status

readonly usageCountRaw: bigint;

Defined in: packages/sage/src/internal/c4/crafting.ts:113

Omit.usageCountRaw

readonly usageLimitRaw: bigint;

Defined in: packages/sage/src/internal/c4/crafting.ts:114

Omit.usageLimitRaw

readonly version: number;

Defined in: packages/sage/src/internal/c4/crafting.ts:100

Omit.version

readonly xpValueRaw: bigint;

Defined in: packages/sage/src/internal/c4/crafting.ts:115

Omit.xpValueRaw

toJSON(): unknown;

Defined in: packages/sage/src/crafting/index.ts:109

unknown

type CraftingDiscoveryOptions = Omit<DiscoveryRequest, "filters" | "strategy">;

Defined in: packages/sage/src/crafting/index.ts:56

Options supported by targeted crafting discovery.

const options: CraftingDiscoveryOptions = { commitment: 'confirmed' };

type CraftingHabDefinition = GameCraftingHabDefinitionData;

Defined in: packages/sage/src/crafting/index.ts:126

Immutable Crafting Hab container definition from the loaded Game catalog.

Unlike a placed Hab’s CraftingHabDefinitionSummary, this independent definition keeps its placement cargoId without resolving cargo. Multipliers retain dimensionless exact raw bigint and ergonomic values. Global eviction and respawn durations remain exact seconds. JSON serializes bigint as decimal strings; the loaded catalog does not assert current chain freshness.

declare const definition: CraftingHabDefinition;
console.log(definition.name, definition.cargoId, definition.rentMultiplier.raw);

type CraftingProcessState =
| {
kind: "scheduled";
}
| {
kind: "in-progress";
remainingSeconds: bigint;
}
| {
kind: "complete";
};

Defined in: packages/sage/src/crafting/index.ts:299

Pure lifecycle projection for one Crafting Process at a given Unix time.

const state: CraftingProcessState = { kind: 'scheduled' };

type HabBuildingDefinition = GameHabBuildingDefinitionData;

Defined in: packages/sage/src/crafting/index.ts:1030

Immutable Hab building definition from the loaded Game catalog. Keeps the existing Hab-specific modifiers, job capacity and unlocked recipes; this is configuration, not the output of a placed building. Fixed-point values retain exact raw bigint, and JSON serializes bigint as decimal strings.

declare const definition: HabBuildingDefinition;
console.log(definition.modifiers.speed.value, definition.unlockedRecipeIds);

function deriveCraftingProcessState(process, atUnixSeconds): CraftingProcessState;

Defined in: packages/sage/src/crafting/index.ts:1010

Derives the scheduled, active, or complete state at a Unix timestamp.

ParameterType
processPick<CraftingProcessSnapshot, "startsAtUnixSeconds" | "endsAtUnixSeconds">
atUnixSecondsbigint

CraftingProcessState

declare const process: CraftingProcessSnapshot;
const state = deriveCraftingProcessState(process, 1_700_000_000n);

function getCraftingHab(
context,
address,
options?): Promise<CraftingHabSnapshot>;

Defined in: packages/sage/src/crafting/index.ts:783

Reads a required Crafting Hab by its signer-created account address.

ParameterType
contextSageContext
addressAddress
options?ReadOptions

Promise<CraftingHabSnapshot>

declare const ctx: SageContext;
declare const address: Address;
const hab = await getCraftingHab(ctx, address);

function getCraftingHabDefinition(context, id): Promise<GameCraftingHabDefinitionData>;

Defined in: packages/sage/src/crafting/index.ts:137

Loads one Crafting Hab container definition by its Game table id. The catalog loads lazily without fetching a placed Hab or its placement cargo.

ParameterType
contextSageContext
idnumber

Promise<GameCraftingHabDefinitionData>

declare const ctx: SageContext;
const definition = await getCraftingHabDefinition(ctx, 7);
console.log(definition.slots, definition.respawnDurationSeconds);

function getCraftingHabsByCharacter(
context,
character,
options?): Promise<readonly CraftingHabSnapshot[]>;

Defined in: packages/sage/src/crafting/index.ts:971

Discovers Crafting Habs for the Profile stored by one Character.

ParameterType
contextSageContext
characterAddress
options?CraftingDiscoveryOptions

Promise<readonly CraftingHabSnapshot[]>

declare const ctx: SageContext;
declare const character: Address;
const habs = await getCraftingHabsByCharacter(ctx, character);

function getCraftingHabsByProfile(
context,
profile,
options?): Promise<readonly CraftingHabSnapshot[]>;

Defined in: packages/sage/src/crafting/index.ts:870

Discovers Crafting Habs owned by one Player Profile.

ParameterType
contextSageContext
profileAddress
options?CraftingDiscoveryOptions

Promise<readonly CraftingHabSnapshot[]>

declare const ctx: SageContext;
declare const profile: Address;
const habs = await getCraftingHabsByProfile(ctx, profile);

function getCraftingHabsByStarbasePlayer(
context,
player,
options?): Promise<readonly CraftingHabSnapshot[]>;

Defined in: packages/sage/src/crafting/index.ts:920

Discovers Crafting Habs for the Profile and System stored by a StarbasePlayer.

ParameterType
contextSageContext
playerAddress
options?CraftingDiscoveryOptions

Promise<readonly CraftingHabSnapshot[]>

declare const ctx: SageContext;
declare const player: Address;
const habs = await getCraftingHabsByStarbasePlayer(ctx, player);

function getCraftingProcess(
context,
address,
options?): Promise<CraftingProcessSnapshot>;

Defined in: packages/sage/src/crafting/index.ts:825

Reads a required Crafting Process by its signer-created account address.

ParameterType
contextSageContext
addressAddress
options?ReadOptions

Promise<CraftingProcessSnapshot>

declare const ctx: SageContext;
declare const address: Address;
const process = await getCraftingProcess(ctx, address);

function getCraftingProcessesByCharacter(
context,
character,
options?): Promise<readonly CraftingProcessSnapshot[]>;

Defined in: packages/sage/src/crafting/index.ts:991

Discovers Crafting Processes for the Profile stored by one Character.

ParameterType
contextSageContext
characterAddress
options?CraftingDiscoveryOptions

Promise<readonly CraftingProcessSnapshot[]>

declare const ctx: SageContext;
declare const character: Address;
const processes = await getCraftingProcessesByCharacter(ctx, character);

function getCraftingProcessesByProfile(
context,
profile,
options?): Promise<readonly CraftingProcessSnapshot[]>;

Defined in: packages/sage/src/crafting/index.ts:896

Discovers Crafting Processes belonging to one Player Profile.

ParameterType
contextSageContext
profileAddress
options?CraftingDiscoveryOptions

Promise<readonly CraftingProcessSnapshot[]>

declare const ctx: SageContext;
declare const profile: Address;
const processes = await getCraftingProcessesByProfile(ctx, profile);

function getCraftingProcessesByStarbasePlayer(
context,
player,
options?): Promise<readonly CraftingProcessSnapshot[]>;

Defined in: packages/sage/src/crafting/index.ts:947

Discovers Crafting Processes linked to one StarbasePlayer.

ParameterType
contextSageContext
playerAddress
options?CraftingDiscoveryOptions

Promise<readonly CraftingProcessSnapshot[]>

declare const ctx: SageContext;
declare const player: Address;
const processes = await getCraftingProcessesByStarbasePlayer(ctx, player);

function getHabBuildingDefinition(context, id): Promise<GameHabBuildingDefinitionData>;

Defined in: packages/sage/src/crafting/index.ts:1041

Loads one Hab building definition without fetching a placed Crafting Hab. The returned definition reflects the loaded section, not proven-current chain state.

ParameterType
contextSageContext
idnumber

Promise<GameHabBuildingDefinitionData>

declare const ctx: SageContext;
const building = await getHabBuildingDefinition(ctx, 7);
console.log(building.jobCapacity, building.constructionDurationSeconds);

function getRecipe(
context,
address,
options?): Promise<RecipeSnapshot>;

Defined in: packages/sage/src/crafting/index.ts:719

Reads a required Recipe by its derived account address.

ParameterType
contextSageContext
addressAddress
options?ReadOptions

Promise<RecipeSnapshot>

declare const ctx: SageContext;
declare const address: Address;
const recipe = await getRecipe(ctx, address);

function getRecipeById(
context,
recipeId,
options?): Promise<RecipeSnapshot>;

Defined in: packages/sage/src/crafting/index.ts:762

Derives and reads one Recipe from the configured Game and recipe id.

ParameterType
contextSageContext
recipeIdnumber
options?ReadOptions

Promise<RecipeSnapshot>

declare const ctx: SageContext;
const recipe = await getRecipeById(ctx, 7);

function listCraftingHabDefinitions(context): Promise<readonly GameCraftingHabDefinitionData[]>;

Defined in: packages/sage/src/crafting/index.ts:155

Lists the loaded Crafting Hab containers as immutable canonical definitions. The array is retained per section generation and shares by-id lookup objects. Refresh replaces both together; previously returned arrays remain immutable snapshots. This catalog carries no proof of latest chain state or sort order.

ParameterType
contextSageContext

Promise<readonly GameCraftingHabDefinitionData[]>

declare const ctx: SageContext;
const definitions = await listCraftingHabDefinitions(ctx);
console.log(definitions.map(definition => definition.name));

function listHabBuildingDefinitions(context): Promise<readonly GameHabBuildingDefinitionData[]>;

Defined in: packages/sage/src/crafting/index.ts:1059

Lists the loaded Hab building catalog as immutable canonical definitions. Shares objects with by-id lookups and retains the array for its section generation. Refresh replaces both together; older returned arrays remain immutable snapshots. No sort order or latest-chain freshness is promised.

ParameterType
contextSageContext

Promise<readonly GameHabBuildingDefinitionData[]>

declare const ctx: SageContext;
const buildings = await listHabBuildingDefinitions(ctx);
console.log(buildings.map(building => building.name));

function listRecipes(context, options?): Promise<readonly RecipeSnapshot[]>;

Defined in: packages/sage/src/crafting/index.ts:688

Discovers every Recipe reported for the configured Game, active or deactivated. Returns frozen snapshots sorted by numeric id; reported failures reject the entire catalog. Each completed call reconsults discovery (a configured indexer takes precedence), but cargo definitions may be reused by the context registry. no-store prevents discovered Recipe cache writes, not registry retention. Recipe commitment applies to discovery and direct candidate validation; cargo resolution uses the context commitment. Read metadata is provenance, not an atomic-slot or provider-completeness guarantee.

ParameterType
contextSageContext
options?CraftingDiscoveryOptions

Promise<readonly RecipeSnapshot[]>

declare const ctx: SageContext;
const recipes = await listRecipes(ctx, { policy: 'no-store' });
console.log(recipes.map(recipe => recipe.name));

function maybeGetCraftingHab(
context,
address,
options?): Promise<
| CraftingHabSnapshot
| undefined>;

Defined in: packages/sage/src/crafting/index.ts:803

Reads an optional Crafting Hab by address.

ParameterType
contextSageContext
addressAddress
options?ReadOptions

Promise< | CraftingHabSnapshot | undefined>

declare const ctx: SageContext;
declare const address: Address;
const hab = await maybeGetCraftingHab(ctx, address);

function maybeGetCraftingProcess(
context,
address,
options?): Promise<
| CraftingProcessSnapshot
| undefined>;

Defined in: packages/sage/src/crafting/index.ts:846

Reads an optional Crafting Process by address.

ParameterType
contextSageContext
addressAddress
options?ReadOptions

Promise< | CraftingProcessSnapshot | undefined>

declare const ctx: SageContext;
declare const address: Address;
const process = await maybeGetCraftingProcess(ctx, address);

function maybeGetRecipe(
context,
address,
options?): Promise<RecipeSnapshot | undefined>;

Defined in: packages/sage/src/crafting/index.ts:739

Reads an optional Recipe by address.

ParameterType
contextSageContext
addressAddress
options?ReadOptions

Promise<RecipeSnapshot | undefined>

declare const ctx: SageContext;
declare const address: Address;
const recipe = await maybeGetRecipe(ctx, address);