world
Interfaces
Section titled “Interfaces”AsteroidSnapshot
Section titled “AsteroidSnapshot”Defined in: packages/sage/src/world/index.ts:222
Immutable Asteroid projection over a CelestialBody account.
Example
Section titled “Example”declare const asteroid: AsteroidSnapshot;console.log(asteroid.details.resources);Extends
Section titled “Extends”Omit<AsteroidAccountData,"system">
Properties
Section titled “Properties”address
Section titled “address”readonly address: Address;Defined in: packages/sage/src/world/index.ts:223
details
Section titled “details”readonly details: WorldAsteroidData;Defined in: packages/sage/src/internal/c4/world.ts:438
Inherited from
Section titled “Inherited from”Omit.detailsreadonly game: Address;Defined in: packages/sage/src/internal/c4/world.ts:424
Inherited from
Section titled “Inherited from”Omit.gamereadonly id: number;Defined in: packages/sage/src/internal/c4/world.ts:422
Inherited from
Section titled “Inherited from”Omit.idreadonly kind: "asteroid";Defined in: packages/sage/src/internal/c4/world.ts:437
Inherited from
Section titled “Inherited from”Omit.kindlastSyncAtUnixSeconds
Section titled “lastSyncAtUnixSeconds”readonly lastSyncAtUnixSeconds: bigint;Defined in: packages/sage/src/internal/c4/world.ts:427
Inherited from
Section titled “Inherited from”Omit.lastSyncAtUnixSecondsreadonly name: string;Defined in: packages/sage/src/internal/c4/world.ts:423
Inherited from
Section titled “Inherited from”Omit.namesystem
Section titled “system”readonly system: EntityRef<"starSystem">;Defined in: packages/sage/src/world/index.ts:224
systemSequenceId
Section titled “systemSequenceId”readonly systemSequenceId: bigint;Defined in: packages/sage/src/internal/c4/world.ts:426
Inherited from
Section titled “Inherited from”Omit.systemSequenceIdversion
Section titled “version”readonly version: number;Defined in: packages/sage/src/internal/c4/world.ts:421
Inherited from
Section titled “Inherited from”Omit.versionMethods
Section titled “Methods”toJSON()
Section titled “toJSON()”toJSON(): unknown;Defined in: packages/sage/src/world/index.ts:225
Returns
Section titled “Returns”unknown
PlanetClaimStakePlotDefinition
Section titled “PlanetClaimStakePlotDefinition”Defined in: packages/sage/src/world/planet-claim-stake-plots.ts:115
One Claim Stake definition of a tier and whether the Planet suits it.
requiredTagsProvided is true when the Planet provides every tag the
definition requires. It is not a complete eligibility verdict: permissions,
rent, faction rules and concurrent placements remain chain-authoritative.
Example
Section titled “Example”declare const entry: PlanetClaimStakePlotDefinition;console.log(entry.definition.name, entry.requiredTagsProvided);Properties
Section titled “Properties”definition
Section titled “definition”readonly definition: GameClaimStakeDefinitionData;Defined in: packages/sage/src/world/planet-claim-stake-plots.ts:116
requiredTagsProvided
Section titled “requiredTagsProvided”readonly requiredTagsProvided: boolean;Defined in: packages/sage/src/world/planet-claim-stake-plots.ts:117
PlanetClaimStakePlotRow
Section titled “PlanetClaimStakePlotRow”Defined in: packages/sage/src/world/planet-claim-stake-plots.ts:95
One plot row of a Planet: the Claim Stakes placed at one Starbase level.
The program records placed stakes per Starbase level row, not per Claim
Stake definition. occupied counts every stake in the row, of every tier
and including deactivated stakes that still hold their plot. chronology is
the stored placement order the program uses to index the row’s stakes.
Example
Section titled “Example”declare const row: PlanetClaimStakePlotRow;console.log(row.level, row.occupied);Properties
Section titled “Properties”chronology
Section titled “chronology”readonly chronology: readonly Address[];Defined in: packages/sage/src/world/planet-claim-stake-plots.ts:100
readonly level: WorldStarbaseLevel;Defined in: packages/sage/src/world/planet-claim-stake-plots.ts:96
levelIndex
Section titled “levelIndex”readonly levelIndex: number;Defined in: packages/sage/src/world/planet-claim-stake-plots.ts:97
occupied
Section titled “occupied”readonly occupied: number;Defined in: packages/sage/src/world/planet-claim-stake-plots.ts:98
structures
Section titled “structures”readonly structures: readonly PlanetClaimStakePlotStructure[];Defined in: packages/sage/src/world/planet-claim-stake-plots.ts:99
PlanetClaimStakePlotsSnapshot
Section titled “PlanetClaimStakePlotsSnapshot”Defined in: packages/sage/src/world/planet-claim-stake-plots.ts:165
Immutable Claim Stake plot availability of one Planet.
rows always holds the seven plot rows in Starbase level order, and tiers
the five Claim Stake tiers in order. starbaseLevel and
starbaseLevelIndex come from the Planet’s StarSystem and are absent when
that System has no Starbase. Read metadata reports the older of the Planet
and StarSystem observations.
Example
Section titled “Example”declare const plots: PlanetClaimStakePlotsSnapshot;const open = plots.tiers.filter((tier) => (tier.available ?? 0) > 0);console.log(plots.name, open.map((tier) => tier.tier));Properties
Section titled “Properties”address
Section titled “address”readonly address: Address;Defined in: packages/sage/src/world/planet-claim-stake-plots.ts:167
bodyId
Section titled “bodyId”readonly bodyId: number;Defined in: packages/sage/src/world/planet-claim-stake-plots.ts:168
readonly game: Address;Defined in: packages/sage/src/world/planet-claim-stake-plots.ts:170
readonly kind: "planetClaimStakePlots";Defined in: packages/sage/src/world/planet-claim-stake-plots.ts:166
readonly name: string;Defined in: packages/sage/src/world/planet-claim-stake-plots.ts:169
providedTags
Section titled “providedTags”readonly providedTags: readonly number[];Defined in: packages/sage/src/world/planet-claim-stake-plots.ts:174
readonly rows: readonly PlanetClaimStakePlotRow[];Defined in: packages/sage/src/world/planet-claim-stake-plots.ts:175
starbaseLevel?
Section titled “starbaseLevel?”readonly optional starbaseLevel?: WorldStarbaseLevel;Defined in: packages/sage/src/world/planet-claim-stake-plots.ts:172
starbaseLevelIndex?
Section titled “starbaseLevelIndex?”readonly optional starbaseLevelIndex?: number;Defined in: packages/sage/src/world/planet-claim-stake-plots.ts:173
system
Section titled “system”readonly system: EntityRef<"starSystem">;Defined in: packages/sage/src/world/planet-claim-stake-plots.ts:171
readonly tiers: readonly PlanetClaimStakePlotTier[];Defined in: packages/sage/src/world/planet-claim-stake-plots.ts:176
Methods
Section titled “Methods”toJSON()
Section titled “toJSON()”toJSON(): unknown;Defined in: packages/sage/src/world/planet-claim-stake-plots.ts:177
Returns
Section titled “Returns”unknown
PlanetClaimStakePlotStructure
Section titled “PlanetClaimStakePlotStructure”Defined in: packages/sage/src/world/planet-claim-stake-plots.ts:76
One Claim Stake structure recorded on a Planet plot.
active is true while the stored deactivation time is zero. A deactivated
structure still occupies its plot until the program removes it from the
Planet.
Example
Section titled “Example”declare const structure: PlanetClaimStakePlotStructure;console.log(structure.address, structure.active);Properties
Section titled “Properties”active
Section titled “active”readonly active: boolean;Defined in: packages/sage/src/world/planet-claim-stake-plots.ts:79
address
Section titled “address”readonly address: Address;Defined in: packages/sage/src/world/planet-claim-stake-plots.ts:77
deactivationTimeUnixSeconds
Section titled “deactivationTimeUnixSeconds”readonly deactivationTimeUnixSeconds: bigint;Defined in: packages/sage/src/world/planet-claim-stake-plots.ts:78
PlanetClaimStakePlotTier
Section titled “PlanetClaimStakePlotTier”Defined in: packages/sage/src/world/planet-claim-stake-plots.ts:139
Plot limits and availability for one Claim Stake tier on a Planet.
plotLimitByLevel, baseRentRateByLevel and basePlacementFeeByLevel
list the stored cell of every plot row in starbaseLevelIndex order.
A row’s limit caps the stakes of all tiers in that row: placing a stake of
this tier needs a row whose occupied count is below this tier’s limit.
The program uses the first such row from level-0 up to the System’s
Starbase level; placementLevel names it. available sums the free plots
of this tier over those rows. Both are absent when the System has no
Starbase. Tiers share rows, so availability across tiers does not add up.
Definition multipliers and the exact rent and fee settlement remain
program-authoritative.
Example
Section titled “Example”declare const tier: PlanetClaimStakePlotTier;console.log(tier.tier, tier.available, tier.placementLevel);Properties
Section titled “Properties”available?
Section titled “available?”readonly optional available?: number;Defined in: packages/sage/src/world/planet-claim-stake-plots.ts:145
basePlacementFeeByLevel
Section titled “basePlacementFeeByLevel”readonly basePlacementFeeByLevel: readonly WorldFixedValue[];Defined in: packages/sage/src/world/planet-claim-stake-plots.ts:144
baseRentRateByLevel
Section titled “baseRentRateByLevel”readonly baseRentRateByLevel: readonly WorldFixedValue[];Defined in: packages/sage/src/world/planet-claim-stake-plots.ts:143
definitions
Section titled “definitions”readonly definitions: readonly PlanetClaimStakePlotDefinition[];Defined in: packages/sage/src/world/planet-claim-stake-plots.ts:147
placementLevel?
Section titled “placementLevel?”readonly optional placementLevel?: WorldStarbaseLevel;Defined in: packages/sage/src/world/planet-claim-stake-plots.ts:146
plotLimitByLevel
Section titled “plotLimitByLevel”readonly plotLimitByLevel: readonly number[];Defined in: packages/sage/src/world/planet-claim-stake-plots.ts:142
readonly tier: ClaimStakeTier;Defined in: packages/sage/src/world/planet-claim-stake-plots.ts:140
tierIndex
Section titled “tierIndex”readonly tierIndex: number;Defined in: packages/sage/src/world/planet-claim-stake-plots.ts:141
PlanetResourceItem
Section titled “PlanetResourceItem”Defined in: packages/sage/src/world/index.ts:190
One registry-resolved resource row observed in a Planet account.
Example
Section titled “Example”declare const resource: PlanetResourceItem;console.log(resource.cargo.name, resource.richness.value);Properties
Section titled “Properties”readonly cargo: CargoDefinitionSummary;Defined in: packages/sage/src/world/index.ts:191
richness
Section titled “richness”readonly richness: WorldFixedValue;Defined in: packages/sage/src/world/index.ts:192
PlanetResourcesSnapshot
Section titled “PlanetResourcesSnapshot”Defined in: packages/sage/src/world/index.ts:202
Immutable Planet resource observation with registry-resolved cargo definitions.
Example
Section titled “Example”declare const resources: PlanetResourcesSnapshot;console.log(resources.name, resources.resources);Properties
Section titled “Properties”address
Section titled “address”readonly address: Address;Defined in: packages/sage/src/world/index.ts:204
bodyId
Section titled “bodyId”readonly bodyId: number;Defined in: packages/sage/src/world/index.ts:205
readonly game: Address;Defined in: packages/sage/src/world/index.ts:207
readonly kind: "planetResources";Defined in: packages/sage/src/world/index.ts:203
lastSyncedAtUnixSeconds
Section titled “lastSyncedAtUnixSeconds”readonly lastSyncedAtUnixSeconds: bigint;Defined in: packages/sage/src/world/index.ts:210
readonly name: string;Defined in: packages/sage/src/world/index.ts:206
resources
Section titled “resources”readonly resources: readonly PlanetResourceItem[];Defined in: packages/sage/src/world/index.ts:211
system
Section titled “system”readonly system: EntityRef<"starSystem">;Defined in: packages/sage/src/world/index.ts:208
systemSequenceId
Section titled “systemSequenceId”readonly systemSequenceId: bigint;Defined in: packages/sage/src/world/index.ts:209
Methods
Section titled “Methods”toJSON()
Section titled “toJSON()”toJSON(): unknown;Defined in: packages/sage/src/world/index.ts:212
Returns
Section titled “Returns”unknown
PlanetSnapshot
Section titled “PlanetSnapshot”Defined in: packages/sage/src/world/index.ts:177
Immutable Planet projection over a CelestialBody account.
Planet richness gameplay use: unverified. Version-matched program evidence
does not establish a consuming activity or formula for the decoded richness
values in details.resources. They are distinct from Asteroid richness used
by Fleet mining and from separately decoded Claim Stake building
resourceExtraction rates.
Example
Section titled “Example”declare const planet: PlanetSnapshot;console.log(planet.details.resources);Extends
Section titled “Extends”Omit<PlanetAccountData,"system">
Properties
Section titled “Properties”address
Section titled “address”readonly address: Address;Defined in: packages/sage/src/world/index.ts:178
details
Section titled “details”readonly details: WorldPlanetData;Defined in: packages/sage/src/internal/c4/world.ts:434
Inherited from
Section titled “Inherited from”Omit.detailsreadonly game: Address;Defined in: packages/sage/src/internal/c4/world.ts:424
Inherited from
Section titled “Inherited from”Omit.gamereadonly id: number;Defined in: packages/sage/src/internal/c4/world.ts:422
Inherited from
Section titled “Inherited from”Omit.idreadonly kind: "planet";Defined in: packages/sage/src/internal/c4/world.ts:433
Inherited from
Section titled “Inherited from”Omit.kindlastSyncAtUnixSeconds
Section titled “lastSyncAtUnixSeconds”readonly lastSyncAtUnixSeconds: bigint;Defined in: packages/sage/src/internal/c4/world.ts:427
Inherited from
Section titled “Inherited from”Omit.lastSyncAtUnixSecondsreadonly name: string;Defined in: packages/sage/src/internal/c4/world.ts:423
Inherited from
Section titled “Inherited from”Omit.namesystem
Section titled “system”readonly system: EntityRef<"starSystem">;Defined in: packages/sage/src/world/index.ts:179
systemSequenceId
Section titled “systemSequenceId”readonly systemSequenceId: bigint;Defined in: packages/sage/src/internal/c4/world.ts:426
Inherited from
Section titled “Inherited from”Omit.systemSequenceIdversion
Section titled “version”readonly version: number;Defined in: packages/sage/src/internal/c4/world.ts:421
Inherited from
Section titled “Inherited from”Omit.versionMethods
Section titled “Methods”toJSON()
Section titled “toJSON()”toJSON(): unknown;Defined in: packages/sage/src/world/index.ts:180
Returns
Section titled “Returns”unknown
ResolvedStarbaseUpgradeMaterial
Section titled “ResolvedStarbaseUpgradeMaterial”Defined in: packages/sage/src/world/starbase-status.ts:178
One upgrade material with its registry-resolved cargo definition.
Example
Section titled “Example”declare const material: ResolvedStarbaseUpgradeMaterial;console.log(material.cargo.name, material.remaining);Extends
Section titled “Extends”Properties
Section titled “Properties”readonly cargo: CargoDefinitionSummary;Defined in: packages/sage/src/world/starbase-status.ts:179
cargoId
Section titled “cargoId”readonly cargoId: number;Defined in: packages/sage/src/world/starbase-status.ts:66
Inherited from
Section titled “Inherited from”StarbaseUpgradeMaterial.cargoId
complete
Section titled “complete”readonly complete: boolean;Defined in: packages/sage/src/world/starbase-status.ts:70
Inherited from
Section titled “Inherited from”StarbaseUpgradeMaterial.complete
readonly crew: number;Defined in: packages/sage/src/world/starbase-status.ts:71
Inherited from
Section titled “Inherited from”deposited
Section titled “deposited”readonly deposited: bigint;Defined in: packages/sage/src/world/starbase-status.ts:68
Inherited from
Section titled “Inherited from”StarbaseUpgradeMaterial.deposited
durationSeconds
Section titled “durationSeconds”readonly durationSeconds: number;Defined in: packages/sage/src/world/starbase-status.ts:72
Inherited from
Section titled “Inherited from”StarbaseUpgradeMaterial.durationSeconds
needed
Section titled “needed”readonly needed: bigint;Defined in: packages/sage/src/world/starbase-status.ts:67
Inherited from
Section titled “Inherited from”StarbaseUpgradeMaterial.needed
remaining
Section titled “remaining”readonly remaining: bigint;Defined in: packages/sage/src/world/starbase-status.ts:69
Inherited from
Section titled “Inherited from”StarbaseUpgradeMaterial.remaining
ResolvedStarbaseUpgradeProgress
Section titled “ResolvedStarbaseUpgradeProgress”Defined in: packages/sage/src/world/starbase-status.ts:190
Upgrade progress whose materials carry resolved cargo definitions.
Example
Section titled “Example”declare const upgrade: ResolvedStarbaseUpgradeProgress;console.log(upgrade.materials.map((material) => material.cargo.name));Extends
Section titled “Extends”Omit<StarbaseUpgradeProgress,"materials">
Properties
Section titled “Properties”complete
Section titled “complete”readonly complete: boolean;Defined in: packages/sage/src/world/starbase-status.ts:90
Inherited from
Section titled “Inherited from”StarbaseUpgradeProgress.complete
materials
Section titled “materials”readonly materials: readonly ResolvedStarbaseUpgradeMaterial[];Defined in: packages/sage/src/world/starbase-status.ts:194
toLevel
Section titled “toLevel”readonly toLevel: WorldStarbaseLevel;Defined in: packages/sage/src/world/starbase-status.ts:89
Inherited from
Section titled “Inherited from”StarbaseUpgradeProgress.toLevel
StarbasePoints
Section titled “StarbasePoints”Defined in: packages/sage/src/world/starbase-status.ts:119
Hull and shield points of a shared Starbase, with its level maximums.
pendingHullPoints is the repair reservoir: hull points already paid for
that regenerate into hullPoints over time. Hull plus pending never exceeds
the maximum.
Example
Section titled “Example”declare const points: StarbasePoints;console.log(points.hullPoints / points.maxHullPoints);Properties
Section titled “Properties”hullPoints
Section titled “hullPoints”readonly hullPoints: number;Defined in: packages/sage/src/world/starbase-status.ts:120
maxHullPoints
Section titled “maxHullPoints”readonly maxHullPoints: number;Defined in: packages/sage/src/world/starbase-status.ts:122
maxShieldPoints
Section titled “maxShieldPoints”readonly maxShieldPoints: number;Defined in: packages/sage/src/world/starbase-status.ts:124
pendingHullPoints
Section titled “pendingHullPoints”readonly pendingHullPoints: number;Defined in: packages/sage/src/world/starbase-status.ts:121
shieldPoints
Section titled “shieldPoints”readonly shieldPoints: number;Defined in: packages/sage/src/world/starbase-status.ts:123
StarbaseServiceAvailability
Section titled “StarbaseServiceAvailability”Defined in: packages/sage/src/world/starbase-status.ts:102
Whether one Starbase service is enabled at the current level.
Example
Section titled “Example”declare const service: StarbaseServiceAvailability;if (service.available) console.log('enabled since', service.enabledFromLevel);Properties
Section titled “Properties”available
Section titled “available”readonly available: boolean;Defined in: packages/sage/src/world/starbase-status.ts:104
enabledFromLevel
Section titled “enabledFromLevel”readonly enabledFromLevel: WorldStarbaseLevel;Defined in: packages/sage/src/world/starbase-status.ts:103
StarbaseStatus
Section titled “StarbaseStatus”Defined in: packages/sage/src/world/starbase-status.ts:143
Derived status of the shared Starbase nested in one StarSystem.
current pairs the stored hull and shield points with the maximums the
current level configures. The program writes these points only when combat
or a repair touches the Starbase and regenerates them on read in between, so
stored values can lag far behind: use projectStarbasePoints for the
points at a given moment. timing values are raw Unix seconds, as on the
Fleet combat status. upgrade is absent once the Starbase has reached its
maximum level.
Example
Section titled “Example”declare const status: StarbaseStatus;console.log(status.level, status.current.hullPoints, status.current.maxHullPoints);Properties
Section titled “Properties”atMaxLevel
Section titled “atMaxLevel”readonly atMaxLevel: boolean;Defined in: packages/sage/src/world/starbase-status.ts:150
current
Section titled “current”readonly current: StarbasePoints;Defined in: packages/sage/src/world/starbase-status.ts:154
Stored points, as last written; see projectStarbasePoints.
readonly kind: "starbaseStatus";Defined in: packages/sage/src/world/starbase-status.ts:144
readonly level: WorldStarbaseLevel;Defined in: packages/sage/src/world/starbase-status.ts:146
levelIndex
Section titled “levelIndex”readonly levelIndex: number;Defined in: packages/sage/src/world/starbase-status.ts:148
Ordinal from starbaseLevelIndex; the Central Space Station is 6.
levelInfo
Section titled “levelInfo”readonly levelInfo: WorldStarbaseLevelInfoData;Defined in: packages/sage/src/world/starbase-status.ts:152
Configured values for the current level, copied from the level table.
maxLevel
Section titled “maxLevel”readonly maxLevel: WorldStarbaseLevel;Defined in: packages/sage/src/world/starbase-status.ts:149
readonly owner: WorldFaction;Defined in: packages/sage/src/world/starbase-status.ts:145
services
Section titled “services”readonly services: { localMarket: StarbaseServiceAvailability; repair: StarbaseServiceAvailability;};Defined in: packages/sage/src/world/starbase-status.ts:162
localMarket
Section titled “localMarket”readonly localMarket: StarbaseServiceAvailability;repair
Section titled “repair”readonly repair: StarbaseServiceAvailability;timing
Section titled “timing”readonly timing: { builtOrDestroyedAtUnixSeconds: bigint; lastCombatUpdateAtUnixSeconds: bigint; shieldBreakDelayEndsAtUnixSeconds: bigint;};Defined in: packages/sage/src/world/starbase-status.ts:155
builtOrDestroyedAtUnixSeconds
Section titled “builtOrDestroyedAtUnixSeconds”readonly builtOrDestroyedAtUnixSeconds: bigint;When the Starbase was last built or destroyed.
lastCombatUpdateAtUnixSeconds
Section titled “lastCombatUpdateAtUnixSeconds”readonly lastCombatUpdateAtUnixSeconds: bigint;shieldBreakDelayEndsAtUnixSeconds
Section titled “shieldBreakDelayEndsAtUnixSeconds”readonly shieldBreakDelayEndsAtUnixSeconds: bigint;When shield points may resume regenerating after reaching zero.
upgrade?
Section titled “upgrade?”readonly optional upgrade?: StarbaseUpgradeProgress;Defined in: packages/sage/src/world/starbase-status.ts:166
Methods
Section titled “Methods”toJSON()
Section titled “toJSON()”toJSON(): unknown;Defined in: packages/sage/src/world/starbase-status.ts:167
Returns
Section titled “Returns”unknown
StarbaseStatusSnapshot
Section titled “StarbaseStatusSnapshot”Defined in: packages/sage/src/world/starbase-status.ts:208
Immutable shared Starbase status read for one StarSystem.
address is the StarSystem address: the nested Starbase has no account of
its own. Read metadata comes from the StarSystem observation.
Example
Section titled “Example”declare const status: StarbaseStatusSnapshot;console.log(status.systemName, status.upgrade?.materials[0]?.cargo.name);Extends
Section titled “Extends”Omit<StarbaseStatus,"upgrade">
Properties
Section titled “Properties”address
Section titled “address”readonly address: Address;Defined in: packages/sage/src/world/starbase-status.ts:212
atMaxLevel
Section titled “atMaxLevel”readonly atMaxLevel: boolean;Defined in: packages/sage/src/world/starbase-status.ts:150
Inherited from
Section titled “Inherited from”current
Section titled “current”readonly current: StarbasePoints;Defined in: packages/sage/src/world/starbase-status.ts:154
Stored points, as last written; see projectStarbasePoints.
Inherited from
Section titled “Inherited from”readonly kind: "starbaseStatus";Defined in: packages/sage/src/world/starbase-status.ts:144
Inherited from
Section titled “Inherited from”readonly level: WorldStarbaseLevel;Defined in: packages/sage/src/world/starbase-status.ts:146
Inherited from
Section titled “Inherited from”levelIndex
Section titled “levelIndex”readonly levelIndex: number;Defined in: packages/sage/src/world/starbase-status.ts:148
Ordinal from starbaseLevelIndex; the Central Space Station is 6.
Inherited from
Section titled “Inherited from”levelInfo
Section titled “levelInfo”readonly levelInfo: WorldStarbaseLevelInfoData;Defined in: packages/sage/src/world/starbase-status.ts:152
Configured values for the current level, copied from the level table.
Inherited from
Section titled “Inherited from”maxLevel
Section titled “maxLevel”readonly maxLevel: WorldStarbaseLevel;Defined in: packages/sage/src/world/starbase-status.ts:149
Inherited from
Section titled “Inherited from”readonly owner: WorldFaction;Defined in: packages/sage/src/world/starbase-status.ts:145
Inherited from
Section titled “Inherited from”services
Section titled “services”readonly services: { localMarket: StarbaseServiceAvailability; repair: StarbaseServiceAvailability;};Defined in: packages/sage/src/world/starbase-status.ts:162
localMarket
Section titled “localMarket”readonly localMarket: StarbaseServiceAvailability;repair
Section titled “repair”readonly repair: StarbaseServiceAvailability;Inherited from
Section titled “Inherited from”system
Section titled “system”readonly system: EntityRef<"starSystem">;Defined in: packages/sage/src/world/starbase-status.ts:213
systemName
Section titled “systemName”readonly systemName: string;Defined in: packages/sage/src/world/starbase-status.ts:214
timing
Section titled “timing”readonly timing: { builtOrDestroyedAtUnixSeconds: bigint; lastCombatUpdateAtUnixSeconds: bigint; shieldBreakDelayEndsAtUnixSeconds: bigint;};Defined in: packages/sage/src/world/starbase-status.ts:155
builtOrDestroyedAtUnixSeconds
Section titled “builtOrDestroyedAtUnixSeconds”readonly builtOrDestroyedAtUnixSeconds: bigint;When the Starbase was last built or destroyed.
lastCombatUpdateAtUnixSeconds
Section titled “lastCombatUpdateAtUnixSeconds”readonly lastCombatUpdateAtUnixSeconds: bigint;shieldBreakDelayEndsAtUnixSeconds
Section titled “shieldBreakDelayEndsAtUnixSeconds”readonly shieldBreakDelayEndsAtUnixSeconds: bigint;When shield points may resume regenerating after reaching zero.
Inherited from
Section titled “Inherited from”upgrade?
Section titled “upgrade?”readonly optional upgrade?: ResolvedStarbaseUpgradeProgress;Defined in: packages/sage/src/world/starbase-status.ts:215
Methods
Section titled “Methods”toJSON()
Section titled “toJSON()”toJSON(): unknown;Defined in: packages/sage/src/world/starbase-status.ts:167
Returns
Section titled “Returns”unknown
Inherited from
Section titled “Inherited from”StarbaseUpgradeMaterial
Section titled “StarbaseUpgradeMaterial”Defined in: packages/sage/src/world/starbase-status.ts:65
One material a shared Starbase needs before it can reach its next level.
needed, deposited and remaining are raw cargo units. complete is true
once deposited has reached needed. crew and durationSeconds describe
one contribution of this material: a Starbase Player installs it through its
own StarbaseUpgradeProcess, which the starbases entry reads separately.
Example
Section titled “Example”declare const material: StarbaseUpgradeMaterial;console.log(material.cargoId, material.remaining);Extended by
Section titled “Extended by”Properties
Section titled “Properties”cargoId
Section titled “cargoId”readonly cargoId: number;Defined in: packages/sage/src/world/starbase-status.ts:66
complete
Section titled “complete”readonly complete: boolean;Defined in: packages/sage/src/world/starbase-status.ts:70
readonly crew: number;Defined in: packages/sage/src/world/starbase-status.ts:71
deposited
Section titled “deposited”readonly deposited: bigint;Defined in: packages/sage/src/world/starbase-status.ts:68
durationSeconds
Section titled “durationSeconds”readonly durationSeconds: number;Defined in: packages/sage/src/world/starbase-status.ts:72
needed
Section titled “needed”readonly needed: bigint;Defined in: packages/sage/src/world/starbase-status.ts:67
remaining
Section titled “remaining”readonly remaining: bigint;Defined in: packages/sage/src/world/starbase-status.ts:69
StarbaseUpgradeProgress
Section titled “StarbaseUpgradeProgress”Defined in: packages/sage/src/world/starbase-status.ts:88
Shared progress of a Starbase toward its next level.
complete is true when every listed material is fully deposited. The pinned
contract states that the Starbase should then change level and reset the
deposits; the program applies that change, the SDK only reports the stored
state.
Example
Section titled “Example”declare const upgrade: StarbaseUpgradeProgress;console.log(upgrade.toLevel, upgrade.complete);Properties
Section titled “Properties”complete
Section titled “complete”readonly complete: boolean;Defined in: packages/sage/src/world/starbase-status.ts:90
materials
Section titled “materials”readonly materials: readonly StarbaseUpgradeMaterial[];Defined in: packages/sage/src/world/starbase-status.ts:91
toLevel
Section titled “toLevel”readonly toLevel: WorldStarbaseLevel;Defined in: packages/sage/src/world/starbase-status.ts:89
StarSystemAccountData
Section titled “StarSystemAccountData”Defined in: packages/sage/src/internal/c4/world.ts:297
SDK-owned decoded StarSystem data.
Example
Section titled “Example”declare const system: StarSystemAccountData;console.log(system.coordinates);Extended by
Section titled “Extended by”Properties
Section titled “Properties”celestialBodyAddresses
Section titled “celestialBodyAddresses”readonly celestialBodyAddresses: readonly Address[];Defined in: packages/sage/src/internal/c4/world.ts:308
connections
Section titled “connections”readonly connections: readonly WorldConnectionData[];Defined in: packages/sage/src/internal/c4/world.ts:307
coordinates
Section titled “coordinates”readonly coordinates: WorldCoordinates;Defined in: packages/sage/src/internal/c4/world.ts:303
coordinatesRaw
Section titled “coordinatesRaw”readonly coordinatesRaw: { x: bigint; y: bigint;};Defined in: packages/sage/src/internal/c4/world.ts:305
Exact stored I8F56 coordinates for movement arithmetic.
readonly x: bigint;readonly y: bigint;readonly game: Address;Defined in: packages/sage/src/internal/c4/world.ts:299
readonly name: string;Defined in: packages/sage/src/internal/c4/world.ts:301
regionId?
Section titled “regionId?”readonly optional regionId?: number;Defined in: packages/sage/src/internal/c4/world.ts:302
sequenceId
Section titled “sequenceId”readonly sequenceId: bigint;Defined in: packages/sage/src/internal/c4/world.ts:306
starbase?
Section titled “starbase?”readonly optional starbase?: WorldStarbaseData;Defined in: packages/sage/src/internal/c4/world.ts:309
systemId
Section titled “systemId”readonly systemId: number;Defined in: packages/sage/src/internal/c4/world.ts:300
version
Section titled “version”readonly version: number;Defined in: packages/sage/src/internal/c4/world.ts:298
StarSystemSnapshot
Section titled “StarSystemSnapshot”Defined in: packages/sage/src/world/index.ts:134
Immutable, translated StarSystem snapshot including nested shared Starbase data.
Example
Section titled “Example”declare const system: StarSystemSnapshot;console.log(system.name, system.coordinates);Extends
Section titled “Extends”Extended by
Section titled “Extended by”Properties
Section titled “Properties”address
Section titled “address”readonly address: Address;Defined in: packages/sage/src/world/index.ts:136
celestialBodyAddresses
Section titled “celestialBodyAddresses”readonly celestialBodyAddresses: readonly Address[];Defined in: packages/sage/src/internal/c4/world.ts:308
Inherited from
Section titled “Inherited from”StarSystemAccountData.celestialBodyAddresses
connections
Section titled “connections”readonly connections: readonly WorldConnectionData[];Defined in: packages/sage/src/internal/c4/world.ts:307
Inherited from
Section titled “Inherited from”StarSystemAccountData.connections
coordinates
Section titled “coordinates”readonly coordinates: WorldCoordinates;Defined in: packages/sage/src/internal/c4/world.ts:303
Inherited from
Section titled “Inherited from”StarSystemAccountData.coordinates
coordinatesRaw
Section titled “coordinatesRaw”readonly coordinatesRaw: { x: bigint; y: bigint;};Defined in: packages/sage/src/internal/c4/world.ts:305
Exact stored I8F56 coordinates for movement arithmetic.
readonly x: bigint;readonly y: bigint;Inherited from
Section titled “Inherited from”StarSystemAccountData.coordinatesRaw
readonly game: Address;Defined in: packages/sage/src/internal/c4/world.ts:299
Inherited from
Section titled “Inherited from”readonly kind: "starSystem";Defined in: packages/sage/src/world/index.ts:135
readonly name: string;Defined in: packages/sage/src/internal/c4/world.ts:301
Inherited from
Section titled “Inherited from”regionId?
Section titled “regionId?”readonly optional regionId?: number;Defined in: packages/sage/src/internal/c4/world.ts:302
Inherited from
Section titled “Inherited from”StarSystemAccountData.regionId
sequenceId
Section titled “sequenceId”readonly sequenceId: bigint;Defined in: packages/sage/src/internal/c4/world.ts:306
Inherited from
Section titled “Inherited from”StarSystemAccountData.sequenceId
starbase?
Section titled “starbase?”readonly optional starbase?: WorldStarbaseData;Defined in: packages/sage/src/internal/c4/world.ts:309
Inherited from
Section titled “Inherited from”StarSystemAccountData.starbase
systemId
Section titled “systemId”readonly systemId: number;Defined in: packages/sage/src/internal/c4/world.ts:300
Inherited from
Section titled “Inherited from”StarSystemAccountData.systemId
version
Section titled “version”readonly version: number;Defined in: packages/sage/src/internal/c4/world.ts:298
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”toJSON()
Section titled “toJSON()”toJSON(): unknown;Defined in: packages/sage/src/world/index.ts:137
Returns
Section titled “Returns”unknown
StarSystemSubscriptionObserver
Section titled “StarSystemSubscriptionObserver”Defined in: packages/sage/src/world/index.ts:151
Observer for live, validated StarSystem snapshots.
Example
Section titled “Example”const observer: StarSystemSubscriptionObserver = { onSnapshot: system => console.log(system.starbase?.hp), onError: error => console.error(error.code), onDiagnostic: event => console.debug(event.kind, event.coalescedCount),};Properties
Section titled “Properties”onDiagnostic?
Section titled “onDiagnostic?”readonly optional onDiagnostic?: (event) => void;Defined in: packages/sage/src/world/index.ts:154
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
event | SubscriptionDiagnosticEvent |
Returns
Section titled “Returns”void
onError
Section titled “onError”readonly onError: (error) => void | Promise<void>;Defined in: packages/sage/src/world/index.ts:153
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
error | SageSdkError |
Returns
Section titled “Returns”void | Promise<void>
onSnapshot
Section titled “onSnapshot”readonly onSnapshot: (system) => void | Promise<void>;Defined in: packages/sage/src/world/index.ts:152
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
system | StarSystemSnapshot |
Returns
Section titled “Returns”void | Promise<void>
WorldAsteroidData
Section titled “WorldAsteroidData”Defined in: packages/sage/src/internal/c4/world.ts:416
Fully translated Asteroid projection data.
Example
Section titled “Example”declare const asteroid: WorldAsteroidData;console.log(asteroid.resources);Properties
Section titled “Properties”resources
Section titled “resources”readonly resources: readonly WorldAsteroidResourceData[];Defined in: packages/sage/src/internal/c4/world.ts:417
WorldAsteroidResourceData
Section titled “WorldAsteroidResourceData”Defined in: packages/sage/src/internal/c4/world.ts:402
One translated Asteroid resource state.
Example
Section titled “Example”declare const resource: WorldAsteroidResourceData;console.log(resource.amountMined);Properties
Section titled “Properties”amountMined
Section titled “amountMined”readonly amountMined: bigint;Defined in: packages/sage/src/internal/c4/world.ts:405
cargoId
Section titled “cargoId”readonly cargoId: number;Defined in: packages/sage/src/internal/c4/world.ts:403
miners
Section titled “miners”readonly miners: bigint;Defined in: packages/sage/src/internal/c4/world.ts:406
richness
Section titled “richness”readonly richness: WorldFixedValue;Defined in: packages/sage/src/internal/c4/world.ts:404
WorldClaimStakeGroupData
Section titled “WorldClaimStakeGroupData”Defined in: packages/sage/src/internal/c4/world.ts:337
One translated nested Claim Stake structure group.
Example
Section titled “Example”declare const group: WorldClaimStakeGroupData;console.log(group.structures);Properties
Section titled “Properties”chronoAddresses
Section titled “chronoAddresses”readonly chronoAddresses: readonly Address[];Defined in: packages/sage/src/internal/c4/world.ts:340
readonly key: number;Defined in: packages/sage/src/internal/c4/world.ts:338
offset
Section titled “offset”readonly offset: number;Defined in: packages/sage/src/internal/c4/world.ts:339
structures
Section titled “structures”readonly structures: readonly WorldStructureData[];Defined in: packages/sage/src/internal/c4/world.ts:341
WorldConnectionCosts
Section titled “WorldConnectionCosts”Defined in: packages/sage/src/internal/c4/world.ts:143
Unit-explicit warp-lane costs for one connected system.
Example
Section titled “Example”declare const costs: WorldConnectionCosts;console.log(costs.level1Atlas);Properties
Section titled “Properties”cssAtlas
Section titled “cssAtlas”readonly cssAtlas: number;Defined in: packages/sage/src/internal/c4/world.ts:155
cssRaw
Section titled “cssRaw”readonly cssRaw: bigint;Defined in: packages/sage/src/internal/c4/world.ts:154
level1Atlas
Section titled “level1Atlas”readonly level1Atlas: number;Defined in: packages/sage/src/internal/c4/world.ts:145
level1Raw
Section titled “level1Raw”readonly level1Raw: bigint;Defined in: packages/sage/src/internal/c4/world.ts:144
level2Atlas
Section titled “level2Atlas”readonly level2Atlas: number;Defined in: packages/sage/src/internal/c4/world.ts:147
level2Raw
Section titled “level2Raw”readonly level2Raw: bigint;Defined in: packages/sage/src/internal/c4/world.ts:146
level3Atlas
Section titled “level3Atlas”readonly level3Atlas: number;Defined in: packages/sage/src/internal/c4/world.ts:149
level3Raw
Section titled “level3Raw”readonly level3Raw: bigint;Defined in: packages/sage/src/internal/c4/world.ts:148
level4Atlas
Section titled “level4Atlas”readonly level4Atlas: number;Defined in: packages/sage/src/internal/c4/world.ts:151
level4Raw
Section titled “level4Raw”readonly level4Raw: bigint;Defined in: packages/sage/src/internal/c4/world.ts:150
level5Atlas
Section titled “level5Atlas”readonly level5Atlas: number;Defined in: packages/sage/src/internal/c4/world.ts:153
level5Raw
Section titled “level5Raw”readonly level5Raw: bigint;Defined in: packages/sage/src/internal/c4/world.ts:152
WorldConnectionData
Section titled “WorldConnectionData”Defined in: packages/sage/src/internal/c4/world.ts:165
One StarSystem connection keyed by the connected system id.
Example
Section titled “Example”declare const connection: WorldConnectionData;console.log(connection.systemId);Properties
Section titled “Properties”readonly costs: WorldConnectionCosts;Defined in: packages/sage/src/internal/c4/world.ts:167
systemId
Section titled “systemId”readonly systemId: number;Defined in: packages/sage/src/internal/c4/world.ts:166
WorldCraftingHabData
Section titled “WorldCraftingHabData”Defined in: packages/sage/src/internal/c4/world.ts:251
One nested Crafting Hab group retained as shared Starbase data.
Example
Section titled “Example”declare const hab: WorldCraftingHabData;console.log(hab.structures);Properties
Section titled “Properties”chronoAddresses
Section titled “chronoAddresses”readonly chronoAddresses: readonly Address[];Defined in: packages/sage/src/internal/c4/world.ts:254
readonly key: number;Defined in: packages/sage/src/internal/c4/world.ts:252
offset
Section titled “offset”readonly offset: number;Defined in: packages/sage/src/internal/c4/world.ts:253
structures
Section titled “structures”readonly structures: readonly WorldStructureData[];Defined in: packages/sage/src/internal/c4/world.ts:255
WorldFixedValue
Section titled “WorldFixedValue”Defined in: packages/sage/src/internal/c4/world.ts:103
A translated fixed-point world value retaining its exact source integer.
Example
Section titled “Example”const value: WorldFixedValue = { raw: 65_536n, value: 1 };Properties
Section titled “Properties”readonly raw: bigint;Defined in: packages/sage/src/internal/c4/world.ts:104
readonly value: number;Defined in: packages/sage/src/internal/c4/world.ts:105
WorldPlanetData
Section titled “WorldPlanetData”Defined in: packages/sage/src/internal/c4/world.ts:366
Fully translated Planet projection data.
Example
Section titled “Example”declare const planet: WorldPlanetData;console.log(planet.resources);Properties
Section titled “Properties”baseClaimStakePlacementFee
Section titled “baseClaimStakePlacementFee”readonly baseClaimStakePlacementFee: readonly readonly WorldFixedValue[][];Defined in: packages/sage/src/internal/c4/world.ts:385
Base placement fee per plot, indexed like claimStakePlots.
baseClaimStakeRentRate
Section titled “baseClaimStakeRentRate”readonly baseClaimStakeRentRate: readonly readonly WorldFixedValue[][];Defined in: packages/sage/src/internal/c4/world.ts:383
Base rent rate per plot, indexed like claimStakePlots.
claimedPlots
Section titled “claimedPlots”readonly claimedPlots: readonly WorldClaimStakeGroupData[];Defined in: packages/sage/src/internal/c4/world.ts:392
Placed Claim Stake groups keyed by plot row, the Starbase level index
that also indexes claimStakePlots. Each group lists the stakes of every
tier placed in that row and their placement chronology.
claimedPlotsUnsizedLength
Section titled “claimedPlotsUnsizedLength”readonly claimedPlotsUnsizedLength: number;Defined in: packages/sage/src/internal/c4/world.ts:388
claimStakePlots
Section titled “claimStakePlots”readonly claimStakePlots: readonly readonly number[][];Defined in: packages/sage/src/internal/c4/world.ts:381
Plot counts indexed [starbaseLevelIndex][claimStakeTierIndex]: seven
Starbase level rows (level-0 .. level-5, css) and five Claim Stake
tier columns (one .. five).
providedTags
Section titled “providedTags”readonly providedTags: readonly number[];Defined in: packages/sage/src/internal/c4/world.ts:387
resources
Section titled “resources”readonly resources: readonly WorldPlanetResourceData[];Defined in: packages/sage/src/internal/c4/world.ts:386
subtype?
Section titled “subtype?”readonly optional subtype?: WorldPlanetSubtype;Defined in: packages/sage/src/internal/c4/world.ts:377
Category from the current C4 numeric tag mapping. Undefined when absent, conflicting, or tagged as an asteroid; raw providedTags remain available. Unrelated tags do not suppress a recognized category. Shares the body’s account observation and cache; no separate definition read is performed.
Example
Section titled “Example”declare const planet: WorldPlanetData;console.log(planet.subtype ?? 'unknown');WorldPlanetResourceData
Section titled “WorldPlanetResourceData”Defined in: packages/sage/src/internal/c4/world.ts:325
One translated Planet resource richness value.
Planet richness gameplay use: unverified. Version-matched program evidence
does not establish a consuming activity or formula for this decoded Planet
account value. It is distinct from Asteroid richness used by Fleet mining
and from separately decoded Claim Stake building resourceExtraction rates.
Example
Section titled “Example”declare const resource: WorldPlanetResourceData;console.log(resource.richness.value);Properties
Section titled “Properties”cargoId
Section titled “cargoId”readonly cargoId: number;Defined in: packages/sage/src/internal/c4/world.ts:326
richness
Section titled “richness”readonly richness: WorldFixedValue;Defined in: packages/sage/src/internal/c4/world.ts:327
WorldStarbaseData
Section titled “WorldStarbaseData”Defined in: packages/sage/src/internal/c4/world.ts:265
Fully translated nested shared Starbase data.
Example
Section titled “Example”declare const starbase: WorldStarbaseData;console.log(starbase.owner, starbase.level);Properties
Section titled “Properties”baseCraftingHabPlacementFee
Section titled “baseCraftingHabPlacementFee”readonly baseCraftingHabPlacementFee: readonly readonly WorldFixedValue[][];Defined in: packages/sage/src/internal/c4/world.ts:278
baseCraftingHabRentRate
Section titled “baseCraftingHabRentRate”readonly baseCraftingHabRentRate: readonly readonly WorldFixedValue[][];Defined in: packages/sage/src/internal/c4/world.ts:277
buildingTags
Section titled “buildingTags”readonly buildingTags: readonly number[];Defined in: packages/sage/src/internal/c4/world.ts:281
builtDestroyedAtUnixSeconds
Section titled “builtDestroyedAtUnixSeconds”readonly builtDestroyedAtUnixSeconds: bigint;Defined in: packages/sage/src/internal/c4/world.ts:275
craftingHabPlots
Section titled “craftingHabPlots”readonly craftingHabPlots: readonly readonly number[][];Defined in: packages/sage/src/internal/c4/world.ts:276
craftingHabs
Section titled “craftingHabs”readonly craftingHabs: readonly WorldCraftingHabData[];Defined in: packages/sage/src/internal/c4/world.ts:287
craftingHabsUnsizedLength
Section titled “craftingHabsUnsizedLength”readonly craftingHabsUnsizedLength: number;Defined in: packages/sage/src/internal/c4/world.ts:286
readonly hp: number;Defined in: packages/sage/src/internal/c4/world.ts:270
lastCombatUpdateUnixSeconds
Section titled “lastCombatUpdateUnixSeconds”readonly lastCombatUpdateUnixSeconds: bigint;Defined in: packages/sage/src/internal/c4/world.ts:274
readonly level: WorldStarbaseLevel;Defined in: packages/sage/src/internal/c4/world.ts:267
localMarketEnableLevel
Section titled “localMarketEnableLevel”readonly localMarketEnableLevel: WorldStarbaseLevel;Defined in: packages/sage/src/internal/c4/world.ts:268
locationTags
Section titled “locationTags”readonly locationTags: readonly number[];Defined in: packages/sage/src/internal/c4/world.ts:280
maxLevel
Section titled “maxLevel”readonly maxLevel: WorldStarbaseMaxLevelData;Defined in: packages/sage/src/internal/c4/world.ts:279
readonly owner: WorldFaction;Defined in: packages/sage/src/internal/c4/world.ts:266
pendingHp
Section titled “pendingHp”readonly pendingHp: number;Defined in: packages/sage/src/internal/c4/world.ts:271
repairEnableLevel
Section titled “repairEnableLevel”readonly repairEnableLevel: WorldStarbaseLevel;Defined in: packages/sage/src/internal/c4/world.ts:269
shieldBreakDelayExpiresAtUnixSeconds
Section titled “shieldBreakDelayExpiresAtUnixSeconds”readonly shieldBreakDelayExpiresAtUnixSeconds: bigint;Defined in: packages/sage/src/internal/c4/world.ts:273
readonly sp: number;Defined in: packages/sage/src/internal/c4/world.ts:272
validRecipeIds
Section titled “validRecipeIds”readonly validRecipeIds: readonly number[];Defined in: packages/sage/src/internal/c4/world.ts:285
Recipe ids stored for this Starbase. Starting a crafting batch does not check this list: an empty list, as at Central Space Stations, restricts nothing, and a listed id grants nothing a Recipe does not already allow.
WorldStarbaseLevelData
Section titled “WorldStarbaseLevelData”Defined in: packages/sage/src/internal/c4/world.ts:214
One translated level inside the Starbase maximum-level union.
Example
Section titled “Example”declare const level: WorldStarbaseLevelData;console.log(level.upgrades);Properties
Section titled “Properties”readonly info: WorldStarbaseLevelInfoData;Defined in: packages/sage/src/internal/c4/world.ts:216
readonly level: WorldStarbaseLevel;Defined in: packages/sage/src/internal/c4/world.ts:215
upgrades
Section titled “upgrades”readonly upgrades: readonly WorldStarbaseUpgradeData[];Defined in: packages/sage/src/internal/c4/world.ts:217
WorldStarbaseLevelInfoData
Section titled “WorldStarbaseLevelInfoData”Defined in: packages/sage/src/internal/c4/world.ts:177
Fully translated combat/economy values for one Starbase level.
Example
Section titled “Example”declare const info: WorldStarbaseLevelInfoData;console.log(info.repairFeeAtlas);Properties
Section titled “Properties”damagePerRound
Section titled “damagePerRound”readonly damagePerRound: number;Defined in: packages/sage/src/internal/c4/world.ts:189
readonly hp: number;Defined in: packages/sage/src/internal/c4/world.ts:178
repairAbility
Section titled “repairAbility”readonly repairAbility: WorldFixedValue;Defined in: packages/sage/src/internal/c4/world.ts:184
repairCost
Section titled “repairCost”readonly repairCost: WorldFixedValue;Defined in: packages/sage/src/internal/c4/world.ts:186
repairEfficiency
Section titled “repairEfficiency”readonly repairEfficiency: WorldFixedValue;Defined in: packages/sage/src/internal/c4/world.ts:185
repairFeeAtlas
Section titled “repairFeeAtlas”readonly repairFeeAtlas: number;Defined in: packages/sage/src/internal/c4/world.ts:188
repairFeeRaw
Section titled “repairFeeRaw”readonly repairFeeRaw: bigint;Defined in: packages/sage/src/internal/c4/world.ts:187
repairRate
Section titled “repairRate”readonly repairRate: WorldFixedValue;Defined in: packages/sage/src/internal/c4/world.ts:183
shieldBreakDelaySeconds
Section titled “shieldBreakDelaySeconds”readonly shieldBreakDelaySeconds: number;Defined in: packages/sage/src/internal/c4/world.ts:181
shieldRechargeRate
Section titled “shieldRechargeRate”readonly shieldRechargeRate: WorldFixedValue;Defined in: packages/sage/src/internal/c4/world.ts:182
readonly sp: number;Defined in: packages/sage/src/internal/c4/world.ts:179
readonly xp: WorldFixedValue;Defined in: packages/sage/src/internal/c4/world.ts:180
WorldStarbaseMaxLevelData
Section titled “WorldStarbaseMaxLevelData”Defined in: packages/sage/src/internal/c4/world.ts:227
Plain replacement for the generated StarbaseMaxLevel union.
Example
Section titled “Example”declare const maximum: WorldStarbaseMaxLevelData;console.log(maximum.kind);Properties
Section titled “Properties”readonly kind: WorldStarbaseLevel;Defined in: packages/sage/src/internal/c4/world.ts:228
levels
Section titled “levels”readonly levels: readonly WorldStarbaseLevelData[];Defined in: packages/sage/src/internal/c4/world.ts:229
WorldStarbaseUpgradeData
Section titled “WorldStarbaseUpgradeData”Defined in: packages/sage/src/internal/c4/world.ts:199
One cargo deposit requirement for an intermediate Starbase level.
Example
Section titled “Example”declare const upgrade: WorldStarbaseUpgradeData;console.log(upgrade.cargoId);Properties
Section titled “Properties”cargoId
Section titled “cargoId”readonly cargoId: number;Defined in: packages/sage/src/internal/c4/world.ts:200
readonly crew: number;Defined in: packages/sage/src/internal/c4/world.ts:203
deposited
Section titled “deposited”readonly deposited: bigint;Defined in: packages/sage/src/internal/c4/world.ts:202
durationSeconds
Section titled “durationSeconds”readonly durationSeconds: number;Defined in: packages/sage/src/internal/c4/world.ts:204
needed
Section titled “needed”readonly needed: bigint;Defined in: packages/sage/src/internal/c4/world.ts:201
WorldStructureData
Section titled “WorldStructureData”Defined in: packages/sage/src/internal/c4/world.ts:239
One nested shared structure value from Starbase crafting-hab data.
Example
Section titled “Example”declare const structure: WorldStructureData;console.log(structure.address);Properties
Section titled “Properties”address
Section titled “address”readonly address: Address;Defined in: packages/sage/src/internal/c4/world.ts:240
deactivationTimeUnixSeconds
Section titled “deactivationTimeUnixSeconds”readonly deactivationTimeUnixSeconds: bigint;Defined in: packages/sage/src/internal/c4/world.ts:241
Type Aliases
Section titled “Type Aliases”CelestialBodyDiscoveryOptions
Section titled “CelestialBodyDiscoveryOptions”type CelestialBodyDiscoveryOptions = Omit<DiscoveryRequest, "filters" | "strategy">;Defined in: packages/sage/src/world/index.ts:122
Options for discovering Celestial Bodies across the configured Game.
Example
Section titled “Example”const options: CelestialBodyDiscoveryOptions = { commitment: 'confirmed' };CelestialBodySnapshot
Section titled “CelestialBodySnapshot”type CelestialBodySnapshot = | PlanetSnapshot | AsteroidSnapshot;Defined in: packages/sage/src/world/index.ts:235
A translated CelestialBody snapshot projected as a Planet or Asteroid.
Example
Section titled “Example”declare const body: CelestialBodySnapshot;if (body.kind === 'planet') console.log(body.details.claimStakePlots);ClaimStakeTier
Section titled “ClaimStakeTier”type ClaimStakeTier = C4ClaimStakeTier;Defined in: packages/sage/src/world/planet-claim-stake-plots.ts:38
Claim Stake tier label, the column axis of Planet plot tables.
Example
Section titled “Example”const tier: ClaimStakeTier = 'two';StarSystemDiscoveryOptions
Section titled “StarSystemDiscoveryOptions”type StarSystemDiscoveryOptions = Omit<DiscoveryRequest, "filters" | "strategy"> & { regionId?: number;};Defined in: packages/sage/src/world/index.ts:108
Options supported by galaxy-scale StarSystem discovery.
Type Declaration
Section titled “Type Declaration”regionId?
Section titled “regionId?”readonly optional regionId?: number;Limits discovery to StarSystems whose fixed-width region field contains this unsigned 16-bit id.
Example
Section titled “Example”const options: StarSystemDiscoveryOptions = { commitment: 'confirmed', regionId: 3,};StarSystemStreamOptions
Section titled “StarSystemStreamOptions”type StarSystemStreamOptions = SubscriptionOptions & { regionId?: number;};Defined in: packages/sage/src/world/index.ts:516
Options for streaming every StarSystem of the configured Game.
Type Declaration
Section titled “Type Declaration”regionId?
Section titled “regionId?”readonly optional regionId?: number;Limits the stream to StarSystems whose fixed-width region field contains this unsigned 16-bit id.
Example
Section titled “Example”const options: StarSystemStreamOptions = { commitment: 'confirmed', regionId: 3 };WorldFaction
Section titled “WorldFaction”type WorldFaction = "unaligned" | "mud" | "oni" | "ustur";Defined in: packages/sage/src/internal/c4/world.ts:125
Human-readable faction labels used by shared Starbase data.
Example
Section titled “Example”const faction: WorldFaction = 'mud';WorldPlanetSubtype
Section titled “WorldPlanetSubtype”type WorldPlanetSubtype = | "terrestrial" | "volcanic" | "barren" | "gas-giant" | "ice-giant" | "dark" | "oceanic";Defined in: packages/sage/src/internal/c4/world.ts:350
Planet category interpreted from on-chain building tags using the verified C4 mapping.
Example
Section titled “Example”const subtype: WorldPlanetSubtype = 'ice-giant';WorldStarbaseLevel
Section titled “WorldStarbaseLevel”type WorldStarbaseLevel = | "level-0" | "level-1" | "level-2" | "level-3" | "level-4" | "level-5" | "css";Defined in: packages/sage/src/internal/c4/world.ts:133
Human-readable Starbase level labels.
Example
Section titled “Example”const level: WorldStarbaseLevel = 'level-1';Functions
Section titled “Functions”claimStakeTierIndex()
Section titled “claimStakeTierIndex()”function claimStakeTierIndex(tier): number;Defined in: packages/sage/src/world/planet-claim-stake-plots.ts:60
Returns the zero-based column index of a Claim Stake tier.
Planet plot, base rent and base placement-fee tables are indexed
[starbaseLevelIndex][claimStakeTierIndex]: seven Starbase level rows and
five tier columns.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
tier | ClaimStakeTier |
Returns
Section titled “Returns”number
Example
Section titled “Example”declare const planet: PlanetSnapshot;const level1TierTwo = planet.details.claimStakePlots[1]![claimStakeTierIndex('two')];deriveStarbaseStatus()
Section titled “deriveStarbaseStatus()”function deriveStarbaseStatus(starbase): StarbaseStatus;Defined in: packages/sage/src/world/starbase-status.ts:294
Derives the status of a shared Starbase from already-loaded StarSystem data.
This is pure and network-free: it needs neither the context nor the Game
definitions registry, so galaxy-map readers can call it on every System they
already hold. The result is a new deeply frozen value; the input is left
untouched. Materials carry numeric cargo ids; use getStarbaseStatus when
you want them resolved to cargo definitions.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
starbase | WorldStarbaseData |
Returns
Section titled “Returns”Example
Section titled “Example”declare const system: StarSystemSnapshot;if (system.starbase !== undefined) { const status = deriveStarbaseStatus(system.starbase); console.log(status.level, status.upgrade?.toLevel);}distanceBetweenStarSystems()
Section titled “distanceBetweenStarSystems()”function distanceBetweenStarSystems(from, to): number;Defined in: packages/sage/src/world/index.ts:928
Returns Euclidean distance between two SAGE coordinates.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
from | WorldCoordinates |
to | WorldCoordinates |
Returns
Section titled “Returns”number
Example
Section titled “Example”const distance = distanceBetweenStarSystems({ x: 0, y: 0 }, { x: 3, y: 4 });findCelestialBodyPda()
Section titled “findCelestialBodyPda()”function findCelestialBodyPda( programs, game,bodyId): Promise<Address>;Defined in: packages/sage/src/world/index.ts:436
Derives the CelestialBody PDA for a Game and numeric body id.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
programs | SageProgramAddresses |
game | Address |
bodyId | number |
Returns
Section titled “Returns”Promise<Address>
Example
Section titled “Example”declare const ctx: SageContext;declare const game: Address;const address = await findCelestialBodyPda(ctx.programs, game, 11);findStarSystemPda()
Section titled “findStarSystemPda()”function findStarSystemPda( programs, game,systemId): Promise<Address>;Defined in: packages/sage/src/world/index.ts:420
Derives the StarSystem PDA for a Game and numeric system id.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
programs | SageProgramAddresses |
game | Address |
systemId | number |
Returns
Section titled “Returns”Promise<Address>
Example
Section titled “Example”declare const ctx: SageContext;declare const game: Address;const address = await findStarSystemPda(ctx.programs, game, 1);getAllCelestialBodies()
Section titled “getAllCelestialBodies()”function getAllCelestialBodies(ctx, options?): Promise<readonly CelestialBodySnapshot[]>;Defined in: packages/sage/src/world/index.ts:822
Discovers every Celestial Body for the configured Game without system fan-out.
Uses one discovery response, with configured indexer precedence and otherwise targeted program-account filters. The context’s maxDiscoveryResults rejects an oversized response. Results reuse the address-keyed account cache; no Game definitions are loaded. Resource values are observations, not static catalogs.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
ctx | SageContext |
options | CelestialBodyDiscoveryOptions |
Returns
Section titled “Returns”Promise<readonly CelestialBodySnapshot[]>
Example
Section titled “Example”declare const ctx: SageContext;const bodies = await getAllCelestialBodies(ctx);console.log(bodies.map(body => body.name));getAsteroids()
Section titled “getAsteroids()”function getAsteroids( ctx, systemAddress,options?): Promise<readonly AsteroidSnapshot[]>;Defined in: packages/sage/src/world/index.ts:907
Returns only Asteroid projections in one StarSystem.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
ctx | SageContext |
systemAddress | Address |
options? | ReadOptions |
Returns
Section titled “Returns”Promise<readonly AsteroidSnapshot[]>
Example
Section titled “Example”declare const ctx: SageContext;declare const systemAddress: Address;const asteroids = await getAsteroids(ctx, systemAddress);getCelestialBodies()
Section titled “getCelestialBodies()”function getCelestialBodies( ctx, systemAddress,options?): Promise<readonly CelestialBodySnapshot[]>;Defined in: packages/sage/src/world/index.ts:846
Traverses a StarSystem’s stored CelestialBody addresses with explicit reads.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
ctx | SageContext |
systemAddress | Address |
options? | ReadOptions |
Returns
Section titled “Returns”Promise<readonly CelestialBodySnapshot[]>
Example
Section titled “Example”declare const ctx: SageContext;declare const systemAddress: Address;const bodies = await getCelestialBodies(ctx, systemAddress);getCelestialBody()
Section titled “getCelestialBody()”function getCelestialBody( ctx, address,options?): Promise<CelestialBodySnapshot>;Defined in: packages/sage/src/world/index.ts:680
Reads a required CelestialBody by account address.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
ctx | SageContext |
address | Address |
options? | ReadOptions |
Returns
Section titled “Returns”Promise<CelestialBodySnapshot>
Example
Section titled “Example”declare const ctx: SageContext;declare const address: Address;const body = await getCelestialBody(ctx, address);getCelestialBodyById()
Section titled “getCelestialBodyById()”function getCelestialBodyById( ctx, bodyId,options?): Promise<CelestialBodySnapshot>;Defined in: packages/sage/src/world/index.ts:788
Derives and reads a CelestialBody by its Game-scoped numeric id.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
ctx | SageContext |
bodyId | number |
options? | ReadOptions |
Returns
Section titled “Returns”Promise<CelestialBodySnapshot>
Example
Section titled “Example”declare const ctx: SageContext;const body = await getCelestialBodyById(ctx, 11);getCelestialBodyCoordinates()
Section titled “getCelestialBodyCoordinates()”function getCelestialBodyCoordinates( ctx, bodyAddress,options?): Promise<WorldCoordinates>;Defined in: packages/sage/src/world/index.ts:943
Resolves a CelestialBody’s stored StarSystem relation to its coordinates.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
ctx | SageContext |
bodyAddress | Address |
options? | ReadOptions |
Returns
Section titled “Returns”Promise<WorldCoordinates>
Example
Section titled “Example”declare const ctx: SageContext;declare const bodyAddress: Address;const coordinates = await getCelestialBodyCoordinates(ctx, bodyAddress);getPlanetClaimStakePlots()
Section titled “getPlanetClaimStakePlots()”function getPlanetClaimStakePlots( ctx, planet,options?): Promise<PlanetClaimStakePlotsSnapshot>;Defined in: packages/sage/src/world/index.ts:739
Reads one Planet and its StarSystem, then summarizes Claim Stake plot occupancy per Starbase level row and availability for every tier.
The Planet and System stay on the shared account cache; Claim Stake definitions load lazily through the registry. The program records stakes per Starbase level row, and every tier shares a row’s occupancy, so availability is per tier across the rows up to the System’s Starbase level, matching the placement planner’s check. A Planet whose System has no Starbase still lists its rows and plot limits by level, but no availability. An Asteroid address is rejected: only Planets carry Claim Stake plots.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
ctx | SageContext |
planet | Address |
options? | ReadOptions |
Returns
Section titled “Returns”Promise<PlanetClaimStakePlotsSnapshot>
Example
Section titled “Example”declare const ctx: SageContext;declare const planet: Address;const plots = await getPlanetClaimStakePlots(ctx, planet);for (const tier of plots.tiers) { console.log(tier.tier, tier.available, tier.placementLevel);}getPlanetResources()
Section titled “getPlanetResources()”function getPlanetResources( context, planet,options?): Promise<PlanetResourcesSnapshot>;Defined in: packages/sage/src/world/index.ts:706
Reads one Planet resource observation and resolves every cargo definition.
The Planet stays on the shared CelestialBody account cache. Cargo definitions load lazily through the registry and do not imply that the body and catalog were observed atomically. Unknown cargo ids reject the whole read.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
context | SageContext |
planet | Address |
options? | ReadOptions |
Returns
Section titled “Returns”Promise<PlanetResourcesSnapshot>
Example
Section titled “Example”declare const ctx: SageContext;declare const planet: Address;const snapshot = await getPlanetResources(ctx, planet);console.log(snapshot.resources[0]?.cargo.name);getPlanets()
Section titled “getPlanets()”function getPlanets( ctx, systemAddress,options?): Promise<readonly PlanetSnapshot[]>;Defined in: packages/sage/src/world/index.ts:884
Returns only Planet projections in one StarSystem.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
ctx | SageContext |
systemAddress | Address |
options? | ReadOptions |
Returns
Section titled “Returns”Promise<readonly PlanetSnapshot[]>
Example
Section titled “Example”declare const ctx: SageContext;declare const systemAddress: Address;const planets = await getPlanets(ctx, systemAddress);getStarbaseStatus()
Section titled “getStarbaseStatus()”function getStarbaseStatus( ctx, system, options?): Promise< | StarbaseStatusSnapshot| undefined>;Defined in: packages/sage/src/world/index.ts:586
Reads one StarSystem and derives the status of its shared Starbase.
Returns undefined when the System exists but has no Starbase; a missing
System account still throws. The StarSystem stays on the shared account
cache. Upgrade materials resolve lazily through the definitions registry,
so a Starbase at its maximum level never loads the Game definitions.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
ctx | SageContext |
system | Address |
options? | ReadOptions |
Returns
Section titled “Returns”Promise<
| StarbaseStatusSnapshot
| undefined>
Example
Section titled “Example”declare const ctx: SageContext;declare const system: Address;const status = await getStarbaseStatus(ctx, system);console.log(status?.level, status?.current.hullPoints);getStarSystem()
Section titled “getStarSystem()”function getStarSystem( ctx, address,options?): Promise<StarSystemSnapshot>;Defined in: packages/sage/src/world/index.ts:452
Reads a required StarSystem by account address.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
ctx | SageContext |
address | Address |
options? | ReadOptions |
Returns
Section titled “Returns”Promise<StarSystemSnapshot>
Example
Section titled “Example”declare const ctx: SageContext;declare const address: Address;const system = await getStarSystem(ctx, address);getStarSystemById()
Section titled “getStarSystemById()”function getStarSystemById( ctx, systemId,options?): Promise<StarSystemSnapshot>;Defined in: packages/sage/src/world/index.ts:628
Derives and reads a StarSystem by its Game-scoped numeric id.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
ctx | SageContext |
systemId | number |
options? | ReadOptions |
Returns
Section titled “Returns”Promise<StarSystemSnapshot>
Example
Section titled “Example”declare const ctx: SageContext;const system = await getStarSystemById(ctx, 1);getStarSystems()
Section titled “getStarSystems()”function getStarSystems(ctx, options?): Promise<readonly StarSystemSnapshot[]>;Defined in: packages/sage/src/world/index.ts:654
Discovers StarSystems for the configured Game with stable targeted filters.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
ctx | SageContext |
options | StarSystemDiscoveryOptions |
Returns
Section titled “Returns”Promise<readonly StarSystemSnapshot[]>
Example
Section titled “Example”declare const ctx: SageContext;const systems = await getStarSystems(ctx, { regionId: 3 });maybeGetCelestialBody()
Section titled “maybeGetCelestialBody()”function maybeGetCelestialBody( ctx, address, options?): Promise< | CelestialBodySnapshot| undefined>;Defined in: packages/sage/src/world/index.ts:765
Reads an optional CelestialBody by account address.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
ctx | SageContext |
address | Address |
options? | ReadOptions |
Returns
Section titled “Returns”Promise<
| CelestialBodySnapshot
| undefined>
Example
Section titled “Example”declare const ctx: SageContext;declare const address: Address;const body = await maybeGetCelestialBody(ctx, address);maybeGetStarSystem()
Section titled “maybeGetStarSystem()”function maybeGetStarSystem( ctx, address, options?): Promise< | StarSystemSnapshot| undefined>;Defined in: packages/sage/src/world/index.ts:605
Reads an optional StarSystem by account address.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
ctx | SageContext |
address | Address |
options? | ReadOptions |
Returns
Section titled “Returns”Promise<
| StarSystemSnapshot
| undefined>
Example
Section titled “Example”declare const ctx: SageContext;declare const address: Address;const system = await maybeGetStarSystem(ctx, address);projectStarbasePoints()
Section titled “projectStarbasePoints()”function projectStarbasePoints(status, atUnixSeconds): StarbasePoints;Defined in: packages/sage/src/world/starbase-status.ts:419
Projects a shared Starbase’s hull and shield points to one moment.
Between combat and repairs the program regenerates both on read, from the stored points and the last combat update:
- Hull: pending repair points flow into the hull at the level’s
repairRateper second, never past the maximum. A full hull holds no pending points. - Shield: once the shield break delay has ended, the shield recharges at
the level’s
shieldRechargeRateper second from the later of the last combat update and the end of the delay, never past the maximum.
Results are the whole points the program would store if it settled at
atUnixSeconds; combat itself uses the unrounded values, less than one point
higher. This is pure and network-free, so a map can project every Starbase
it already holds on each frame. A moment at or before the last combat
update adds no regeneration.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
status | Pick<StarbaseStatus, "current" | "levelInfo" | "timing"> |
atUnixSeconds | bigint |
Returns
Section titled “Returns”Example
Section titled “Example”declare const status: StarbaseStatus;const now = BigInt(Math.floor(Date.now() / 1000));const points = projectStarbasePoints(status, now);console.log(points.hullPoints, points.shieldPoints);starbaseLevelIndex()
Section titled “starbaseLevelIndex()”function starbaseLevelIndex(level): number;Defined in: packages/sage/src/world/starbase-status.ts:48
Returns the zero-based ordinal of a Starbase level label.
Levels level-0 through level-5 map to 0 through 5 and the Central Space
Station (css) ranks above them as 6. This is the row index used by Planet
Claim Stake plot tables and Starbase Crafting Hab plot tables, and the order
used to compare a Starbase level with a service enable level.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
level | WorldStarbaseLevel |
Returns
Section titled “Returns”number
Example
Section titled “Example”const unlocked = starbaseLevelIndex('level-3') >= starbaseLevelIndex('level-2');watchStarSystem()
Section titled “watchStarSystem()”function watchStarSystem( ctx, address, observer,options?): Promise<SageSubscription>;Defined in: packages/sage/src/world/index.ts:487
Watches one StarSystem, and the shared Starbase nested in it, through its context-owned WebSocket subscription.
Registration emits the current validated StarSystem first, then only
selected slot/commitment advances, coalescing changes while the observer is
busy and re-reading after a reconnect. Snapshots match getStarSystem
reads; derive Starbase status from each with deriveStarbaseStatus and
projectStarbasePoints. Unsubscribe explicitly or dispose the context.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
ctx | SageContext |
address | Address |
observer | StarSystemSubscriptionObserver |
options? | ReadAccountOptions |
Returns
Section titled “Returns”Promise<SageSubscription>
Example
Section titled “Example”declare const ctx: SageContext;declare const systemAddress: Address;const subscription = await watchStarSystem(ctx, systemAddress, { onSnapshot: system => { if (system.starbase !== undefined) console.log(deriveStarbaseStatus(system.starbase).level); }, onError: error => console.error(error.code),});await subscription.unsubscribe();watchStarSystems()
Section titled “watchStarSystems()”function watchStarSystems( ctx, observer,options?): Promise<SageSubscription>;Defined in: packages/sage/src/world/index.ts:546
Streams every StarSystem of the configured Game, and the shared Starbases nested in them, over one program subscription.
Registration subscribes first, then discovers the matching StarSystems with
the same targeted RPC filters as getStarSystems and emits each one. After
that only StarSystems the program writes are emitted, so a galaxy map no
longer re-reads every system on a timer. Delivery coalesces per StarSystem
while the observer is busy. A reconnect re-runs the discovery, which is a
galaxy-scale read; a StarSystem it no longer finds is reported through
onError as ACCOUNT_NOT_FOUND. Requires a subscription provider with
subscribeProgram. Unsubscribe explicitly or dispose the context.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
ctx | SageContext |
observer | StarSystemSubscriptionObserver |
options | StarSystemStreamOptions |
Returns
Section titled “Returns”Promise<SageSubscription>
Example
Section titled “Example”declare const ctx: SageContext;const systems = new Map<Address, StarSystemSnapshot>();const subscription = await watchStarSystems(ctx, { onSnapshot: system => { systems.set(system.address, system); }, onError: error => console.error(error.code, error.address),});await subscription.unsubscribe();References
Section titled “References”WorldCoordinates
Section titled “WorldCoordinates”Re-exports WorldCoordinates