crafting
Interfaces
Section titled “Interfaces”CraftingCargoInventory
Section titled “CraftingCargoInventory”Defined in: packages/sage/src/crafting/index.ts:77
A registry-resolved nested crafting CargoPod.
Example
Section titled “Example”declare const inventory: CraftingCargoInventory;console.log(inventory.items);Properties
Section titled “Properties”readonly items: readonly CraftingCargoItem[];Defined in: packages/sage/src/crafting/index.ts:80
sequenceId
Section titled “sequenceId”readonly sequenceId: number;Defined in: packages/sage/src/crafting/index.ts:78
usedStorageUnitsRaw
Section titled “usedStorageUnitsRaw”readonly usedStorageUnitsRaw: bigint;Defined in: packages/sage/src/crafting/index.ts:79
CraftingCargoItem
Section titled “CraftingCargoItem”Defined in: packages/sage/src/crafting/index.ts:66
A registry-resolved cargo amount used by a Recipe or Crafting Process.
Example
Section titled “Example”declare const item: CraftingCargoItem;console.log(item.name, item.quantityRaw);Extends
Section titled “Extends”Properties
Section titled “Properties”categoryId
Section titled “categoryId”readonly categoryId: number;Defined in: packages/sage/src/registry/index.ts:105
Inherited from
Section titled “Inherited from”CargoDefinitionSummary.categoryId
readonly id: number;Defined in: packages/sage/src/registry/index.ts:106
Inherited from
Section titled “Inherited from”readonly mint: Address;Defined in: packages/sage/src/registry/index.ts:107
Inherited from
Section titled “Inherited from”readonly name: string;Defined in: packages/sage/src/registry/index.ts:108
Inherited from
Section titled “Inherited from”quantityRaw
Section titled “quantityRaw”readonly quantityRaw: bigint;Defined in: packages/sage/src/crafting/index.ts:67
storageCost
Section titled “storageCost”readonly storageCost: number;Defined in: packages/sage/src/registry/index.ts:109
Inherited from
Section titled “Inherited from”CargoDefinitionSummary.storageCost
CraftingDefinitionCargoItem
Section titled “CraftingDefinitionCargoItem”Defined in: packages/sage/src/crafting/index.ts:184
One resolved cargo quantity used by a Hab building definition.
Example
Section titled “Example”declare const item: CraftingDefinitionCargoItem;console.log(item.quantityRaw);Extends
Section titled “Extends”Properties
Section titled “Properties”categoryId
Section titled “categoryId”readonly categoryId: number;Defined in: packages/sage/src/registry/index.ts:105
Inherited from
Section titled “Inherited from”CargoDefinitionSummary.categoryId
readonly id: number;Defined in: packages/sage/src/registry/index.ts:106
Inherited from
Section titled “Inherited from”readonly mint: Address;Defined in: packages/sage/src/registry/index.ts:107
Inherited from
Section titled “Inherited from”readonly name: string;Defined in: packages/sage/src/registry/index.ts:108
Inherited from
Section titled “Inherited from”quantityRaw
Section titled “quantityRaw”readonly quantityRaw: bigint;Defined in: packages/sage/src/crafting/index.ts:185
storageCost
Section titled “storageCost”readonly storageCost: number;Defined in: packages/sage/src/registry/index.ts:109
Inherited from
Section titled “Inherited from”CargoDefinitionSummary.storageCost
CraftingHabBuilding
Section titled “CraftingHabBuilding”Defined in: packages/sage/src/crafting/index.ts:195
A resolved Crafting Hab building definition and placed quantity.
Example
Section titled “Example”declare const building: CraftingHabBuilding;console.log(building.definition.name, building.quantity);Properties
Section titled “Properties”definition
Section titled “definition”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:197
constructionCost
Section titled “constructionCost”readonly constructionCost: readonly CraftingDefinitionCargoItem[];constructionDurationSeconds
Section titled “constructionDurationSeconds”readonly constructionDurationSeconds: bigint;crewSlots
Section titled “crewSlots”readonly crewSlots: number;hubValue
Section titled “hubValue”readonly hubValue: number;readonly id: number;jobCapacity
Section titled “jobCapacity”readonly jobCapacity: number;minimumTier
Section titled “minimumTier”readonly minimumTier: "one" | "two" | "three" | "four" | "five";modifiers
Section titled “modifiers”readonly modifiers: CraftingModifierData;readonly name: string;neededCrew
Section titled “neededCrew”readonly neededCrew: number;netRates
Section titled “netRates”readonly netRates: readonly CargoDefinitionSummary & { unitsPerSecond: number; unitsPerSecondRaw: bigint;}[];providedTagIds
Section titled “providedTagIds”readonly providedTagIds: readonly number[];refunds
Section titled “refunds”readonly refunds: readonly CraftingDefinitionCargoItem[];requiredTagIds
Section titled “requiredTagIds”readonly requiredTagIds: readonly number[];researchRequirementIds
Section titled “researchRequirementIds”readonly researchRequirementIds: readonly number[];resourceCapacityRaw
Section titled “resourceCapacityRaw”readonly resourceCapacityRaw: bigint;readonly slots: number;unlockedRecipes
Section titled “unlockedRecipes”readonly unlockedRecipes: readonly EntityRef<"recipe">[];xpValue
Section titled “xpValue”readonly xpValue: { raw: bigint; value: number;};xpValue.raw
Section titled “xpValue.raw”readonly raw: bigint;xpValue.value
Section titled “xpValue.value”readonly value: number;quantity
Section titled “quantity”readonly quantity: number;Defined in: packages/sage/src/crafting/index.ts:196
CraftingHabDefinitionSummary
Section titled “CraftingHabDefinitionSummary”Defined in: packages/sage/src/crafting/index.ts:159
A resolved Crafting Hab definition from the Game registry.
Example
Section titled “Example”declare const definition: CraftingHabDefinitionSummary;console.log(definition.name, definition.placementCargo.name);Properties
Section titled “Properties”evictionGracePeriodSeconds
Section titled “evictionGracePeriodSeconds”readonly evictionGracePeriodSeconds: bigint;Defined in: packages/sage/src/crafting/index.ts:172
hubValue
Section titled “hubValue”readonly hubValue: number;Defined in: packages/sage/src/crafting/index.ts:169
readonly id: number;Defined in: packages/sage/src/crafting/index.ts:160
readonly name: string;Defined in: packages/sage/src/crafting/index.ts:161
placementCargo
Section titled “placementCargo”readonly placementCargo: CargoDefinitionSummary;Defined in: packages/sage/src/crafting/index.ts:174
placementFeeMultiplier
Section titled “placementFeeMultiplier”readonly placementFeeMultiplier: { raw: bigint; value: number;};Defined in: packages/sage/src/crafting/index.ts:165
readonly raw: bigint;readonly value: number;providedTagIds
Section titled “providedTagIds”readonly providedTagIds: readonly number[];Defined in: packages/sage/src/crafting/index.ts:171
rentMultiplier
Section titled “rentMultiplier”readonly rentMultiplier: { raw: bigint; value: number;};Defined in: packages/sage/src/crafting/index.ts:164
readonly raw: bigint;readonly value: number;requiredTagIds
Section titled “requiredTagIds”readonly requiredTagIds: readonly number[];Defined in: packages/sage/src/crafting/index.ts:170
respawnDurationSeconds
Section titled “respawnDurationSeconds”readonly respawnDurationSeconds: bigint;Defined in: packages/sage/src/crafting/index.ts:173
readonly slots: number;Defined in: packages/sage/src/crafting/index.ts:163
readonly tier: "one" | "two" | "three" | "four" | "five";Defined in: packages/sage/src/crafting/index.ts:162
CraftingHabSnapshot
Section titled “CraftingHabSnapshot”Defined in: packages/sage/src/crafting/index.ts:230
Immutable translated Crafting Hab infrastructure and production state.
Example
Section titled “Example”declare const hab: CraftingHabSnapshot;console.log(hab.definition.name, hab.production.inventory.items);Extends
Section titled “Extends”Omit<CraftingHabAccountData, |"buildings"|"game"|"ownerProfile"|"production"|"system"|"unlockedRecipeIds">
Extended by
Section titled “Extended by”Properties
Section titled “Properties”address
Section titled “address”readonly address: Address;Defined in: packages/sage/src/crafting/index.ts:240
availableJobSlots
Section titled “availableJobSlots”readonly availableJobSlots: number;Defined in: packages/sage/src/crafting/index.ts:246
buildingDefinitionSequenceId
Section titled “buildingDefinitionSequenceId”readonly buildingDefinitionSequenceId: number;Defined in: packages/sage/src/internal/c4/crafting.ts:207
Inherited from
Section titled “Inherited from”Omit.buildingDefinitionSequenceIdbuildings
Section titled “buildings”readonly buildings: readonly CraftingHabBuilding[];Defined in: packages/sage/src/crafting/index.ts:245
constructionProgressAtUnixSeconds
Section titled “constructionProgressAtUnixSeconds”readonly constructionProgressAtUnixSeconds: bigint;Defined in: packages/sage/src/internal/c4/crafting.ts:211
Inherited from
Section titled “Inherited from”Omit.constructionProgressAtUnixSecondsconstructionRemainingSeconds
Section titled “constructionRemainingSeconds”readonly constructionRemainingSeconds: bigint;Defined in: packages/sage/src/internal/c4/crafting.ts:210
Inherited from
Section titled “Inherited from”Omit.constructionRemainingSecondsdefinition
Section titled “definition”readonly definition: CraftingHabDefinitionSummary;Defined in: packages/sage/src/crafting/index.ts:244
definitionId
Section titled “definitionId”readonly definitionId: number;Defined in: packages/sage/src/internal/c4/crafting.ts:205
Inherited from
Section titled “Inherited from”Omit.definitionIddefinitionSequenceId
Section titled “definitionSequenceId”readonly definitionSequenceId: number;Defined in: packages/sage/src/internal/c4/crafting.ts:206
Inherited from
Section titled “Inherited from”Omit.definitionSequenceIdreadonly game: EntityRef<"game">;Defined in: packages/sage/src/crafting/index.ts:241
jobCapacity
Section titled “jobCapacity”readonly jobCapacity: number;Defined in: packages/sage/src/internal/c4/crafting.ts:214
Inherited from
Section titled “Inherited from”Omit.jobCapacityjobsRunning
Section titled “jobsRunning”readonly jobsRunning: number;Defined in: packages/sage/src/internal/c4/crafting.ts:215
Inherited from
Section titled “Inherited from”Omit.jobsRunningreadonly kind: "craftingHabInstance";Defined in: packages/sage/src/crafting/index.ts:239
lastRentAtUnixSeconds
Section titled “lastRentAtUnixSeconds”readonly lastRentAtUnixSeconds: bigint;Defined in: packages/sage/src/internal/c4/crafting.ts:209
Inherited from
Section titled “Inherited from”Omit.lastRentAtUnixSecondsmodifiers
Section titled “modifiers”readonly modifiers: CraftingModifierData;Defined in: packages/sage/src/internal/c4/crafting.ts:216
Inherited from
Section titled “Inherited from”Omit.modifiersneededCrew
Section titled “neededCrew”readonly neededCrew: number;Defined in: packages/sage/src/internal/c4/crafting.ts:213
Inherited from
Section titled “Inherited from”Omit.neededCrewownerProfile
Section titled “ownerProfile”readonly ownerProfile: EntityRef<"profile">;Defined in: packages/sage/src/crafting/index.ts:242
production
Section titled “production”readonly production: { inventory: CraftingCargoInventory; lastTickAtUnixSeconds: bigint; netRates: readonly CargoDefinitionSummary & { unitsPerSecond: number; unitsPerSecondRaw: bigint; }[]; resourceCapacityRaw: bigint;};Defined in: packages/sage/src/crafting/index.ts:248
inventory
Section titled “inventory”readonly inventory: CraftingCargoInventory;lastTickAtUnixSeconds
Section titled “lastTickAtUnixSeconds”readonly lastTickAtUnixSeconds: bigint;netRates
Section titled “netRates”readonly netRates: readonly CargoDefinitionSummary & { unitsPerSecond: number; unitsPerSecondRaw: bigint;}[];resourceCapacityRaw
Section titled “resourceCapacityRaw”readonly resourceCapacityRaw: bigint;rentBalanceRaw
Section titled “rentBalanceRaw”readonly rentBalanceRaw: bigint;Defined in: packages/sage/src/internal/c4/crafting.ts:212
Inherited from
Section titled “Inherited from”Omit.rentBalanceRawreadonly state: CraftingHabStateData;Defined in: packages/sage/src/internal/c4/crafting.ts:219
Inherited from
Section titled “Inherited from”Omit.statesystem
Section titled “system”readonly system: EntityRef<"starSystem">;Defined in: packages/sage/src/crafting/index.ts:243
systemSequenceId
Section titled “systemSequenceId”readonly systemSequenceId: bigint;Defined in: packages/sage/src/internal/c4/crafting.ts:208
Inherited from
Section titled “Inherited from”Omit.systemSequenceIdunlockedRecipes
Section titled “unlockedRecipes”readonly unlockedRecipes: readonly EntityRef<"recipe">[];Defined in: packages/sage/src/crafting/index.ts:247
version
Section titled “version”readonly version: number;Defined in: packages/sage/src/internal/c4/crafting.ts:201
Inherited from
Section titled “Inherited from”Omit.versionMethods
Section titled “Methods”toJSON()
Section titled “toJSON()”toJSON(): unknown;Defined in: packages/sage/src/crafting/index.ts:257
Returns
Section titled “Returns”unknown
CraftingProcessSnapshot
Section titled “CraftingProcessSnapshot”Defined in: packages/sage/src/crafting/index.ts:267
Immutable translated Crafting Process with resolved Recipe and inputs.
Example
Section titled “Example”declare const process: CraftingProcessSnapshot;console.log(process.recipe.name, process.numCrew);Extends
Section titled “Extends”Omit<CraftingProcessAccountData, |"craftingHab"|"inputs"|"profile"|"recipe"|"starbasePlayer"|"system">
Extended by
Section titled “Extended by”Properties
Section titled “Properties”address
Section titled “address”readonly address: Address;Defined in: packages/sage/src/crafting/index.ts:272
craftingHab
Section titled “craftingHab”readonly craftingHab: EntityRef<"craftingHabInstance">;Defined in: packages/sage/src/crafting/index.ts:277
endsAtUnixSeconds
Section titled “endsAtUnixSeconds”readonly endsAtUnixSeconds: bigint;Defined in: packages/sage/src/internal/c4/crafting.ts:239
Inherited from
Section titled “Inherited from”Omit.endsAtUnixSecondsfeeEscrowAtlas
Section titled “feeEscrowAtlas”readonly feeEscrowAtlas: number;Defined in: packages/sage/src/crafting/index.ts:279
feeEscrowRaw
Section titled “feeEscrowRaw”readonly feeEscrowRaw: bigint;Defined in: packages/sage/src/internal/c4/crafting.ts:240
Inherited from
Section titled “Inherited from”Omit.feeEscrowRawinputs
Section titled “inputs”readonly inputs: CraftingCargoInventory;Defined in: packages/sage/src/crafting/index.ts:278
readonly kind: "craftingProcess";Defined in: packages/sage/src/crafting/index.ts:271
numCrew
Section titled “numCrew”readonly numCrew: number;Defined in: packages/sage/src/internal/c4/crafting.ts:237
Inherited from
Section titled “Inherited from”Omit.numCrewprofile
Section titled “profile”readonly profile: EntityRef<"profile">;Defined in: packages/sage/src/crafting/index.ts:274
quantityRaw
Section titled “quantityRaw”readonly quantityRaw: bigint;Defined in: packages/sage/src/internal/c4/crafting.ts:236
Inherited from
Section titled “Inherited from”Omit.quantityRawrecipe
Section titled “recipe”readonly recipe: RecipeSnapshot;Defined in: packages/sage/src/crafting/index.ts:273
starbasePlayer
Section titled “starbasePlayer”readonly starbasePlayer: EntityRef<"starbasePlayer">;Defined in: packages/sage/src/crafting/index.ts:276
starbaseSequenceId
Section titled “starbaseSequenceId”readonly starbaseSequenceId: bigint;Defined in: packages/sage/src/internal/c4/crafting.ts:234
Inherited from
Section titled “Inherited from”Omit.starbaseSequenceIdstartsAtUnixSeconds
Section titled “startsAtUnixSeconds”readonly startsAtUnixSeconds: bigint;Defined in: packages/sage/src/internal/c4/crafting.ts:238
Inherited from
Section titled “Inherited from”Omit.startsAtUnixSecondssystem
Section titled “system”readonly system: EntityRef<"starSystem">;Defined in: packages/sage/src/crafting/index.ts:275
version
Section titled “version”readonly version: number;Defined in: packages/sage/src/internal/c4/crafting.ts:229
Inherited from
Section titled “Inherited from”Omit.versionMethods
Section titled “Methods”toJSON()
Section titled “toJSON()”toJSON(): unknown;Defined in: packages/sage/src/crafting/index.ts:280
Returns
Section titled “Returns”unknown
RecipeSnapshot
Section titled “RecipeSnapshot”Defined in: packages/sage/src/crafting/index.ts:90
Immutable translated Recipe definition.
Example
Section titled “Example”declare const recipe: RecipeSnapshot;console.log(recipe.ingredients, recipe.outputs);Extends
Section titled “Extends”Omit<RecipeAccountData,"game"|"id"|"inputs"|"outputs">
Extended by
Section titled “Extended by”Properties
Section titled “Properties”address
Section titled “address”readonly address: Address;Defined in: packages/sage/src/crafting/index.ts:95
craftingDurationSeconds
Section titled “craftingDurationSeconds”readonly craftingDurationSeconds: bigint;Defined in: packages/sage/src/internal/c4/crafting.ts:145
Inherited from
Section titled “Inherited from”Omit.craftingDurationSecondsreadonly fee: { amountAtlas: number; amountRaw: bigint; recipient: "atlas" | "dao-atlas";};Defined in: packages/sage/src/internal/c4/crafting.ts:149
amountAtlas
Section titled “amountAtlas”readonly amountAtlas: number;amountRaw
Section titled “amountRaw”readonly amountRaw: bigint;recipient
Section titled “recipient”readonly recipient: "atlas" | "dao-atlas";Inherited from
Section titled “Inherited from”Omit.feereadonly game: EntityRef<"game">;Defined in: packages/sage/src/crafting/index.ts:96
habRequired
Section titled “habRequired”readonly habRequired: boolean;Defined in: packages/sage/src/internal/c4/crafting.ts:154
Inherited from
Section titled “Inherited from”Omit.habRequiredreadonly id: number;Defined in: packages/sage/src/crafting/index.ts:97
ingredients
Section titled “ingredients”readonly ingredients: readonly CraftingCargoItem[];Defined in: packages/sage/src/crafting/index.ts:98
readonly kind: "recipe";Defined in: packages/sage/src/crafting/index.ts:94
minimumDurationSeconds
Section titled “minimumDurationSeconds”readonly minimumDurationSeconds: bigint;Defined in: packages/sage/src/internal/c4/crafting.ts:146
Inherited from
Section titled “Inherited from”Omit.minimumDurationSecondsminimumStarbaseLevel
Section titled “minimumStarbaseLevel”readonly minimumStarbaseLevel: | "level-0" | "level-1" | "level-2" | "level-3" | "level-4" | "level-5" | "css";Defined in: packages/sage/src/internal/c4/crafting.ts:158
Inherited from
Section titled “Inherited from”Omit.minimumStarbaseLevelmodifierBounds
Section titled “modifierBounds”readonly modifierBounds: { crewCount: CraftingModifierBoundsData; efficiency: CraftingModifierBoundsData; fee: CraftingModifierBoundsData; speed: CraftingModifierBoundsData;};Defined in: packages/sage/src/internal/c4/crafting.ts:166
crewCount
Section titled “crewCount”readonly crewCount: CraftingModifierBoundsData;efficiency
Section titled “efficiency”readonly efficiency: CraftingModifierBoundsData;readonly fee: CraftingModifierBoundsData;readonly speed: CraftingModifierBoundsData;Inherited from
Section titled “Inherited from”Omit.modifierBoundsreadonly name: string;Defined in: packages/sage/src/internal/c4/crafting.ts:147
Inherited from
Section titled “Inherited from”Omit.nameoutputs
Section titled “outputs”readonly outputs: readonly CraftingCargoItem[];Defined in: packages/sage/src/crafting/index.ts:99
researchRequirementIds
Section titled “researchRequirementIds”readonly researchRequirementIds: readonly number[];Defined in: packages/sage/src/internal/c4/crafting.ts:172
Inherited from
Section titled “Inherited from”Omit.researchRequirementIdsstatus
Section titled “status”readonly status: "active" | "deactivated";Defined in: packages/sage/src/internal/c4/crafting.ts:148
Inherited from
Section titled “Inherited from”Omit.statususageCountRaw
Section titled “usageCountRaw”readonly usageCountRaw: bigint;Defined in: packages/sage/src/internal/c4/crafting.ts:155
Inherited from
Section titled “Inherited from”Omit.usageCountRawusageLimitRaw
Section titled “usageLimitRaw”readonly usageLimitRaw: bigint;Defined in: packages/sage/src/internal/c4/crafting.ts:156
Inherited from
Section titled “Inherited from”Omit.usageLimitRawversion
Section titled “version”readonly version: number;Defined in: packages/sage/src/internal/c4/crafting.ts:142
Inherited from
Section titled “Inherited from”Omit.versionxpValueRaw
Section titled “xpValueRaw”readonly xpValueRaw: bigint;Defined in: packages/sage/src/internal/c4/crafting.ts:157
Inherited from
Section titled “Inherited from”Omit.xpValueRawMethods
Section titled “Methods”toJSON()
Section titled “toJSON()”toJSON(): unknown;Defined in: packages/sage/src/crafting/index.ts:100
Returns
Section titled “Returns”unknown
Type Aliases
Section titled “Type Aliases”CraftingDiscoveryOptions
Section titled “CraftingDiscoveryOptions”type CraftingDiscoveryOptions = Omit<DiscoveryRequest, "filters" | "strategy">;Defined in: packages/sage/src/crafting/index.ts:54
Options supported by targeted crafting discovery.
Example
Section titled “Example”const options: CraftingDiscoveryOptions = { commitment: 'confirmed' };CraftingHabDefinition
Section titled “CraftingHabDefinition”type CraftingHabDefinition = GameCraftingHabDefinitionData;Defined in: packages/sage/src/crafting/index.ts:117
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.
Example
Section titled “Example”declare const definition: CraftingHabDefinition;console.log(definition.name, definition.cargoId, definition.rentMultiplier.raw);CraftingProcessState
Section titled “CraftingProcessState”type CraftingProcessState = InternalCraftingProcessState;Defined in: packages/sage/src/crafting/index.ts:289
Pure lifecycle projection for one Crafting Process at a given Unix time.
Example
Section titled “Example”const state: CraftingProcessState = { kind: 'scheduled' };HabBuildingDefinition
Section titled “HabBuildingDefinition”type HabBuildingDefinition = GameHabBuildingDefinitionData;Defined in: packages/sage/src/crafting/index.ts:987
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.
Example
Section titled “Example”declare const definition: HabBuildingDefinition;console.log(definition.modifiers.speed.value, definition.unlockedRecipeIds);Functions
Section titled “Functions”deriveCraftingProcessState()
Section titled “deriveCraftingProcessState()”function deriveCraftingProcessState(process, atUnixSeconds): InternalCraftingProcessState;Defined in: packages/sage/src/crafting/index.ts:967
Derives the scheduled, active, or complete state at a Unix timestamp.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
process | Pick<CraftingProcessSnapshot, "startsAtUnixSeconds" | "endsAtUnixSeconds"> |
atUnixSeconds | bigint |
Returns
Section titled “Returns”InternalCraftingProcessState
Example
Section titled “Example”declare const process: CraftingProcessSnapshot;const state = deriveCraftingProcessState(process, 1_700_000_000n);getCraftingHab()
Section titled “getCraftingHab()”function getCraftingHab( context, address,options?): Promise<CraftingHabSnapshot>;Defined in: packages/sage/src/crafting/index.ts:718
Reads a required Crafting Hab by its signer-created account address.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
context | SageContext |
address | Address |
options? | ReadOptions |
Returns
Section titled “Returns”Promise<CraftingHabSnapshot>
Example
Section titled “Example”declare const ctx: SageContext;declare const address: Address;const hab = await getCraftingHab(ctx, address);getCraftingHabDefinition()
Section titled “getCraftingHabDefinition()”function getCraftingHabDefinition(context, id): Promise<GameCraftingHabDefinitionData>;Defined in: packages/sage/src/crafting/index.ts:128
Loads one Crafting Hab container definition by its Game table id. The catalog loads lazily without fetching a placed Hab or its placement cargo.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
context | SageContext |
id | number |
Returns
Section titled “Returns”Promise<GameCraftingHabDefinitionData>
Example
Section titled “Example”declare const ctx: SageContext;const definition = await getCraftingHabDefinition(ctx, 7);console.log(definition.slots, definition.respawnDurationSeconds);getCraftingHabsByCharacter()
Section titled “getCraftingHabsByCharacter()”function getCraftingHabsByCharacter( context, character,options?): Promise<readonly CraftingHabSnapshot[]>;Defined in: packages/sage/src/crafting/index.ts:906
Discovers Crafting Habs for the Profile stored by one Character.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
context | SageContext |
character | Address |
options? | CraftingDiscoveryOptions |
Returns
Section titled “Returns”Promise<readonly CraftingHabSnapshot[]>
Example
Section titled “Example”declare const ctx: SageContext;declare const character: Address;const habs = await getCraftingHabsByCharacter(ctx, character);getCraftingHabsByProfile()
Section titled “getCraftingHabsByProfile()”function getCraftingHabsByProfile( context, profile,options?): Promise<readonly CraftingHabSnapshot[]>;Defined in: packages/sage/src/crafting/index.ts:805
Discovers Crafting Habs owned by one Player Profile.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
context | SageContext |
profile | Address |
options? | CraftingDiscoveryOptions |
Returns
Section titled “Returns”Promise<readonly CraftingHabSnapshot[]>
Example
Section titled “Example”declare const ctx: SageContext;declare const profile: Address;const habs = await getCraftingHabsByProfile(ctx, profile);getCraftingHabsByStarbasePlayer()
Section titled “getCraftingHabsByStarbasePlayer()”function getCraftingHabsByStarbasePlayer( context, player,options?): Promise<readonly CraftingHabSnapshot[]>;Defined in: packages/sage/src/crafting/index.ts:855
Discovers Crafting Habs for the Profile and System stored by a StarbasePlayer.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
context | SageContext |
player | Address |
options? | CraftingDiscoveryOptions |
Returns
Section titled “Returns”Promise<readonly CraftingHabSnapshot[]>
Example
Section titled “Example”declare const ctx: SageContext;declare const player: Address;const habs = await getCraftingHabsByStarbasePlayer(ctx, player);getCraftingProcess()
Section titled “getCraftingProcess()”function getCraftingProcess( context, address,options?): Promise<CraftingProcessSnapshot>;Defined in: packages/sage/src/crafting/index.ts:760
Reads a required Crafting Process by its signer-created account address.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
context | SageContext |
address | Address |
options? | ReadOptions |
Returns
Section titled “Returns”Promise<CraftingProcessSnapshot>
Example
Section titled “Example”declare const ctx: SageContext;declare const address: Address;const process = await getCraftingProcess(ctx, address);getCraftingProcessesByCharacter()
Section titled “getCraftingProcessesByCharacter()”function getCraftingProcessesByCharacter( context, character,options?): Promise<readonly CraftingProcessSnapshot[]>;Defined in: packages/sage/src/crafting/index.ts:935
Discovers Crafting Processes for the Profile stored by one Character.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
context | SageContext |
character | Address |
options? | CraftingDiscoveryOptions |
Returns
Section titled “Returns”Promise<readonly CraftingProcessSnapshot[]>
Example
Section titled “Example”declare const ctx: SageContext;declare const character: Address;const processes = await getCraftingProcessesByCharacter(ctx, character);getCraftingProcessesByProfile()
Section titled “getCraftingProcessesByProfile()”function getCraftingProcessesByProfile( context, profile,options?): Promise<readonly CraftingProcessSnapshot[]>;Defined in: packages/sage/src/crafting/index.ts:831
Discovers Crafting Processes belonging to one Player Profile.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
context | SageContext |
profile | Address |
options? | CraftingDiscoveryOptions |
Returns
Section titled “Returns”Promise<readonly CraftingProcessSnapshot[]>
Example
Section titled “Example”declare const ctx: SageContext;declare const profile: Address;const processes = await getCraftingProcessesByProfile(ctx, profile);getCraftingProcessesByStarbasePlayer()
Section titled “getCraftingProcessesByStarbasePlayer()”function getCraftingProcessesByStarbasePlayer( context, player,options?): Promise<readonly CraftingProcessSnapshot[]>;Defined in: packages/sage/src/crafting/index.ts:882
Discovers Crafting Processes linked to one StarbasePlayer.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
context | SageContext |
player | Address |
options? | CraftingDiscoveryOptions |
Returns
Section titled “Returns”Promise<readonly CraftingProcessSnapshot[]>
Example
Section titled “Example”declare const ctx: SageContext;declare const player: Address;const processes = await getCraftingProcessesByStarbasePlayer(ctx, player);getHabBuildingDefinition()
Section titled “getHabBuildingDefinition()”function getHabBuildingDefinition(context, id): Promise<GameHabBuildingDefinitionData>;Defined in: packages/sage/src/crafting/index.ts:998
Loads one Hab building definition without fetching a placed Crafting Hab. The returned definition reflects the loaded section, not proven-current chain state.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
context | SageContext |
id | number |
Returns
Section titled “Returns”Promise<GameHabBuildingDefinitionData>
Example
Section titled “Example”declare const ctx: SageContext;const building = await getHabBuildingDefinition(ctx, 7);console.log(building.jobCapacity, building.constructionDurationSeconds);getRecipe()
Section titled “getRecipe()”function getRecipe( context, address,options?): Promise<RecipeSnapshot>;Defined in: packages/sage/src/crafting/index.ts:654
Reads a required Recipe by its derived account address.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
context | SageContext |
address | Address |
options? | ReadOptions |
Returns
Section titled “Returns”Promise<RecipeSnapshot>
Example
Section titled “Example”declare const ctx: SageContext;declare const address: Address;const recipe = await getRecipe(ctx, address);getRecipeById()
Section titled “getRecipeById()”function getRecipeById( context, recipeId,options?): Promise<RecipeSnapshot>;Defined in: packages/sage/src/crafting/index.ts:697
Derives and reads one Recipe from the configured Game and recipe id.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
context | SageContext |
recipeId | number |
options? | ReadOptions |
Returns
Section titled “Returns”Promise<RecipeSnapshot>
Example
Section titled “Example”declare const ctx: SageContext;const recipe = await getRecipeById(ctx, 7);listCraftingHabDefinitions()
Section titled “listCraftingHabDefinitions()”function listCraftingHabDefinitions(context): Promise<readonly GameCraftingHabDefinitionData[]>;Defined in: packages/sage/src/crafting/index.ts:146
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.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
context | SageContext |
Returns
Section titled “Returns”Promise<readonly GameCraftingHabDefinitionData[]>
Example
Section titled “Example”declare const ctx: SageContext;const definitions = await listCraftingHabDefinitions(ctx);console.log(definitions.map(definition => definition.name));listHabBuildingDefinitions()
Section titled “listHabBuildingDefinitions()”function listHabBuildingDefinitions(context): Promise<readonly GameHabBuildingDefinitionData[]>;Defined in: packages/sage/src/crafting/index.ts:1016
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.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
context | SageContext |
Returns
Section titled “Returns”Promise<readonly GameHabBuildingDefinitionData[]>
Example
Section titled “Example”declare const ctx: SageContext;const buildings = await listHabBuildingDefinitions(ctx);console.log(buildings.map(building => building.name));maybeGetCraftingHab()
Section titled “maybeGetCraftingHab()”function maybeGetCraftingHab( context, address, options?): Promise< | CraftingHabSnapshot| undefined>;Defined in: packages/sage/src/crafting/index.ts:738
Reads an optional Crafting Hab by address.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
context | SageContext |
address | Address |
options? | ReadOptions |
Returns
Section titled “Returns”Promise<
| CraftingHabSnapshot
| undefined>
Example
Section titled “Example”declare const ctx: SageContext;declare const address: Address;const hab = await maybeGetCraftingHab(ctx, address);maybeGetCraftingProcess()
Section titled “maybeGetCraftingProcess()”function maybeGetCraftingProcess( context, address, options?): Promise< | CraftingProcessSnapshot| undefined>;Defined in: packages/sage/src/crafting/index.ts:781
Reads an optional Crafting Process by address.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
context | SageContext |
address | Address |
options? | ReadOptions |
Returns
Section titled “Returns”Promise<
| CraftingProcessSnapshot
| undefined>
Example
Section titled “Example”declare const ctx: SageContext;declare const address: Address;const process = await maybeGetCraftingProcess(ctx, address);maybeGetRecipe()
Section titled “maybeGetRecipe()”function maybeGetRecipe( context, address,options?): Promise<RecipeSnapshot | undefined>;Defined in: packages/sage/src/crafting/index.ts:674
Reads an optional Recipe by address.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
context | SageContext |
address | Address |
options? | ReadOptions |
Returns
Section titled “Returns”Promise<RecipeSnapshot | undefined>
Example
Section titled “Example”declare const ctx: SageContext;declare const address: Address;const recipe = await maybeGetRecipe(ctx, address);