rewards
Interfaces
Section titled “Interfaces”AtlasRewardConfigSnapshot
Section titled “AtlasRewardConfigSnapshot”Defined in: packages/sage/src/rewards/index.ts:86
Cargo-resolved immutable ATLAS reward configuration version.
Example
Section titled “Example”declare const config: AtlasRewardConfigSnapshot;console.log(config.configVersion, config.status);Properties
Section titled “Properties”activeMedallion
Section titled “activeMedallion”readonly activeMedallion: | { buyerPriceAtlasRaw: bigint; cargo: CargoDefinitionSummary; generation: number;} | undefined;Defined in: packages/sage/src/rewards/index.ts:109
address
Section titled “address”readonly address: Address;Defined in: packages/sage/src/rewards/index.ts:88
atlasBankInactivityExpirySeconds
Section titled “atlasBankInactivityExpirySeconds”readonly atlasBankInactivityExpirySeconds: bigint;Defined in: packages/sage/src/rewards/index.ts:99
readonly bump: number;Defined in: packages/sage/src/rewards/index.ts:90
claimSettlementWindowSeconds
Section titled “claimSettlementWindowSeconds”readonly claimSettlementWindowSeconds: number;Defined in: packages/sage/src/rewards/index.ts:98
configVersion
Section titled “configVersion”readonly configVersion: number;Defined in: packages/sage/src/rewards/index.ts:93
createdAtUnixSeconds
Section titled “createdAtUnixSeconds”readonly createdAtUnixSeconds: bigint;Defined in: packages/sage/src/rewards/index.ts:95
effectiveEpoch
Section titled “effectiveEpoch”readonly effectiveEpoch: bigint;Defined in: packages/sage/src/rewards/index.ts:94
epochLengthSeconds
Section titled “epochLengthSeconds”readonly epochLengthSeconds: number;Defined in: packages/sage/src/rewards/index.ts:97
factionPoolLeverRaw
Section titled “factionPoolLeverRaw”readonly factionPoolLeverRaw: bigint;Defined in: packages/sage/src/rewards/index.ts:101
readonly game: EntityRef<"game">;Defined in: packages/sage/src/rewards/index.ts:92
readonly kind: "atlasRewardConfig";Defined in: packages/sage/src/rewards/index.ts:87
kingSystemCurveRaw
Section titled “kingSystemCurveRaw”readonly kingSystemCurveRaw: readonly readonly bigint[][];Defined in: packages/sage/src/rewards/index.ts:102
lossModelTargetBps
Section titled “lossModelTargetBps”readonly lossModelTargetBps: readonly number[];Defined in: packages/sage/src/rewards/index.ts:107
medallionBuybackCapPerEpochRaw
Section titled “medallionBuybackCapPerEpochRaw”readonly medallionBuybackCapPerEpochRaw: bigint;Defined in: packages/sage/src/rewards/index.ts:116
pveLpRateBps
Section titled “pveLpRateBps”readonly pveLpRateBps: number;Defined in: packages/sage/src/rewards/index.ts:103
pvpMedallionRateBps
Section titled “pvpMedallionRateBps”readonly pvpMedallionRateBps: number;Defined in: packages/sage/src/rewards/index.ts:104
repairKitLpRateRaw
Section titled “repairKitLpRateRaw”readonly repairKitLpRateRaw: bigint;Defined in: packages/sage/src/rewards/index.ts:106
rewardLootReclaimSeconds
Section titled “rewardLootReclaimSeconds”readonly rewardLootReclaimSeconds: bigint;Defined in: packages/sage/src/rewards/index.ts:100
rewardReserveLowBalanceThresholdRaw
Section titled “rewardReserveLowBalanceThresholdRaw”readonly rewardReserveLowBalanceThresholdRaw: bigint;Defined in: packages/sage/src/rewards/index.ts:117
salvageEntries
Section titled “salvageEntries”readonly salvageEntries: readonly { cargo: CargoDefinitionSummary; referenceValueAtlasRaw: bigint; weight: number;}[];Defined in: packages/sage/src/rewards/index.ts:122
salvageEvRateBps
Section titled “salvageEvRateBps”readonly salvageEvRateBps: number;Defined in: packages/sage/src/rewards/index.ts:105
sourceFlags
Section titled “sourceFlags”readonly sourceFlags: number;Defined in: packages/sage/src/rewards/index.ts:96
starbaseDestructionMedallionsRaw
Section titled “starbaseDestructionMedallionsRaw”readonly starbaseDestructionMedallionsRaw: readonly bigint[];Defined in: packages/sage/src/rewards/index.ts:108
status
Section titled “status”readonly status: "enabled" | "disabled";Defined in: packages/sage/src/rewards/index.ts:91
upgradeLpRates
Section titled “upgradeLpRates”readonly upgradeLpRates: readonly { cargo: CargoDefinitionSummary; lpPerRawUnit: bigint;}[];Defined in: packages/sage/src/rewards/index.ts:118
version
Section titled “version”readonly version: number;Defined in: packages/sage/src/rewards/index.ts:89
Methods
Section titled “Methods”toJSON()
Section titled “toJSON()”toJSON(): unknown;Defined in: packages/sage/src/rewards/index.ts:127
Returns
Section titled “Returns”unknown
AtlasRewardRegistrySnapshot
Section titled “AtlasRewardRegistrySnapshot”Defined in: packages/sage/src/rewards/index.ts:61
Immutable per-Game ATLAS reward registry and epoch selector.
Example
Section titled “Example”declare const registry: AtlasRewardRegistrySnapshot;console.log(registry.currentEpoch, registry.activeConfigVersion);Properties
Section titled “Properties”activeConfigVersion
Section titled “activeConfigVersion”readonly activeConfigVersion: number;Defined in: packages/sage/src/rewards/index.ts:71
address
Section titled “address”readonly address: Address;Defined in: packages/sage/src/rewards/index.ts:63
readonly bump: number;Defined in: packages/sage/src/rewards/index.ts:65
currentEpoch
Section titled “currentEpoch”readonly currentEpoch: bigint;Defined in: packages/sage/src/rewards/index.ts:67
currentEpochEndsAtUnixSeconds
Section titled “currentEpochEndsAtUnixSeconds”readonly currentEpochEndsAtUnixSeconds: bigint;Defined in: packages/sage/src/rewards/index.ts:69
currentEpochStartedAtUnixSeconds
Section titled “currentEpochStartedAtUnixSeconds”readonly currentEpochStartedAtUnixSeconds: bigint;Defined in: packages/sage/src/rewards/index.ts:68
readonly game: EntityRef<"game">;Defined in: packages/sage/src/rewards/index.ts:66
initialEpochOffsetSeconds
Section titled “initialEpochOffsetSeconds”readonly initialEpochOffsetSeconds: bigint;Defined in: packages/sage/src/rewards/index.ts:70
readonly kind: "atlasRewardRegistry";Defined in: packages/sage/src/rewards/index.ts:62
latestConfigVersion
Section titled “latestConfigVersion”readonly latestConfigVersion: number;Defined in: packages/sage/src/rewards/index.ts:75
pendingConfig
Section titled “pendingConfig”readonly pendingConfig: | { configVersion: number; effectiveEpoch: bigint;} | undefined;Defined in: packages/sage/src/rewards/index.ts:72
version
Section titled “version”readonly version: number;Defined in: packages/sage/src/rewards/index.ts:64
Methods
Section titled “Methods”toJSON()
Section titled “toJSON()”toJSON(): unknown;Defined in: packages/sage/src/rewards/index.ts:76
Returns
Section titled “Returns”unknown
AtlasRewardStateSnapshot
Section titled “AtlasRewardStateSnapshot”Defined in: packages/sage/src/rewards/index.ts:160
Combined active/pending reward configuration and treasury state.
Member snapshots retain their independent read metadata. The composite’s metadata reports the earliest member slot so callers can inspect slot skew.
Example
Section titled “Example”declare const state: AtlasRewardStateSnapshot;console.log(state.registry.currentEpoch, state.activeConfig.status);Properties
Section titled “Properties”activeConfig
Section titled “activeConfig”readonly activeConfig: AtlasRewardConfigSnapshot;Defined in: packages/sage/src/rewards/index.ts:163
readonly kind: "atlasRewardState";Defined in: packages/sage/src/rewards/index.ts:161
pendingConfig
Section titled “pendingConfig”readonly pendingConfig: | AtlasRewardConfigSnapshot | undefined;Defined in: packages/sage/src/rewards/index.ts:164
registry
Section titled “registry”readonly registry: AtlasRewardRegistrySnapshot;Defined in: packages/sage/src/rewards/index.ts:162
treasury
Section titled “treasury”readonly treasury: AtlasRewardTreasurySnapshot;Defined in: packages/sage/src/rewards/index.ts:165
Methods
Section titled “Methods”toJSON()
Section titled “toJSON()”toJSON(): unknown;Defined in: packages/sage/src/rewards/index.ts:166
Returns
Section titled “Returns”unknown
AtlasRewardTreasurySnapshot
Section titled “AtlasRewardTreasurySnapshot”Defined in: packages/sage/src/rewards/index.ts:137
Cargo-resolved finite ATLAS reward reserve.
Example
Section titled “Example”declare const treasury: AtlasRewardTreasurySnapshot;console.log(treasury.reserves.length);Properties
Section titled “Properties”address
Section titled “address”readonly address: Address;Defined in: packages/sage/src/rewards/index.ts:139
readonly bump: number;Defined in: packages/sage/src/rewards/index.ts:141
readonly game: EntityRef<"game">;Defined in: packages/sage/src/rewards/index.ts:142
readonly kind: "atlasRewardTreasury";Defined in: packages/sage/src/rewards/index.ts:138
reserves
Section titled “reserves”readonly reserves: readonly { cargo: CargoDefinitionSummary; quantityRaw: bigint;}[];Defined in: packages/sage/src/rewards/index.ts:143
version
Section titled “version”readonly version: number;Defined in: packages/sage/src/rewards/index.ts:140
Methods
Section titled “Methods”toJSON()
Section titled “toJSON()”toJSON(): unknown;Defined in: packages/sage/src/rewards/index.ts:147
Returns
Section titled “Returns”unknown
RewardCommitmentSnapshot
Section titled “RewardCommitmentSnapshot”Defined in: packages/sage/src/rewards/index.ts:186
Reward commitment carried by Loot, linked to combat through a typed reference.
Example
Section titled “Example”declare const commitment: RewardCommitmentSnapshot;console.log(commitment.loot.address, commitment.configVersion);Properties
Section titled “Properties”committedAtUnixSeconds
Section titled “committedAtUnixSeconds”readonly committedAtUnixSeconds: bigint;Defined in: packages/sage/src/rewards/index.ts:195
configVersion
Section titled “configVersion”readonly configVersion: number;Defined in: packages/sage/src/rewards/index.ts:193
readonly game: EntityRef<"game">;Defined in: packages/sage/src/rewards/index.ts:189
readonly kind: "rewardCommitment";Defined in: packages/sage/src/rewards/index.ts:187
readonly legs: readonly LootRewardLeg[];Defined in: packages/sage/src/rewards/index.ts:196
readonly loot: EntityRef<"loot">;Defined in: packages/sage/src/rewards/index.ts:188
profile
Section titled “profile”readonly profile: EntityRef<"profile">;Defined in: packages/sage/src/rewards/index.ts:190
rawStatus?
Section titled “rawStatus?”readonly optional rawStatus?: number;Defined in: packages/sage/src/rewards/index.ts:192
readonly slot: bigint;Defined in: packages/sage/src/rewards/index.ts:194
status
Section titled “status”readonly status: "resolved" | "unknown" | "committed";Defined in: packages/sage/src/rewards/index.ts:191
Methods
Section titled “Methods”toJSON()
Section titled “toJSON()”toJSON(): unknown;Defined in: packages/sage/src/rewards/index.ts:197
Returns
Section titled “Returns”unknown
Type Aliases
Section titled “Type Aliases”RewardCommitmentDiscoveryOptions
Section titled “RewardCommitmentDiscoveryOptions”type RewardCommitmentDiscoveryOptions = Omit<DiscoveryRequest, "filters" | "strategy">;Defined in: packages/sage/src/rewards/index.ts:49
Options supported by reward-bearing Loot discovery.
Example
Section titled “Example”const options: RewardCommitmentDiscoveryOptions = { commitment: 'confirmed' };Functions
Section titled “Functions”getAtlasRewardConfig()
Section titled “getAtlasRewardConfig()”function getAtlasRewardConfig( context, configVersion,options?): Promise<AtlasRewardConfigSnapshot>;Defined in: packages/sage/src/rewards/index.ts:370
Derives and reads one immutable ATLAS reward config version.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
context | SageContext |
configVersion | number |
options? | ReadOptions |
Returns
Section titled “Returns”Promise<AtlasRewardConfigSnapshot>
Example
Section titled “Example”declare const ctx: SageContext;const config = await getAtlasRewardConfig(ctx, 9);getAtlasRewardRegistry()
Section titled “getAtlasRewardRegistry()”function getAtlasRewardRegistry(context, options?): Promise<AtlasRewardRegistrySnapshot>;Defined in: packages/sage/src/rewards/index.ts:283
Derives and reads the configured Game’s ATLAS reward registry.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
context | SageContext |
options? | ReadOptions |
Returns
Section titled “Returns”Promise<AtlasRewardRegistrySnapshot>
Example
Section titled “Example”declare const ctx: SageContext;const registry = await getAtlasRewardRegistry(ctx);getAtlasRewardState()
Section titled “getAtlasRewardState()”function getAtlasRewardState(context, options?): Promise<AtlasRewardStateSnapshot>;Defined in: packages/sage/src/rewards/index.ts:473
Reads combined active/pending config, epoch registry, and treasury state.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
context | SageContext |
options? | ReadOptions |
Returns
Section titled “Returns”Promise<AtlasRewardStateSnapshot>
Example
Section titled “Example”declare const ctx: SageContext;const state = await getAtlasRewardState(ctx);getAtlasRewardTreasury()
Section titled “getAtlasRewardTreasury()”function getAtlasRewardTreasury(context, options?): Promise<AtlasRewardTreasurySnapshot>;Defined in: packages/sage/src/rewards/index.ts:430
Derives and reads the configured Game’s finite reward treasury.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
context | SageContext |
options? | ReadOptions |
Returns
Section titled “Returns”Promise<AtlasRewardTreasurySnapshot>
Example
Section titled “Example”declare const ctx: SageContext;const treasury = await getAtlasRewardTreasury(ctx);getRewardCommitmentsByProfile()
Section titled “getRewardCommitmentsByProfile()”function getRewardCommitmentsByProfile( context, profile,options?): Promise<readonly RewardCommitmentSnapshot[]>;Defined in: packages/sage/src/rewards/index.ts:611
Discovers reward-bearing Loot for one Profile and returns combat-boundary refs.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
context | SageContext |
profile | Address |
options? | RewardCommitmentDiscoveryOptions |
Returns
Section titled “Returns”Promise<readonly RewardCommitmentSnapshot[]>
Example
Section titled “Example”declare const ctx: SageContext;declare const profile: Address;const commitments = await getRewardCommitmentsByProfile(ctx, profile);maybeGetRewardCommitment()
Section titled “maybeGetRewardCommitment()”function maybeGetRewardCommitment( context, loot, options?): Promise< | RewardCommitmentSnapshot| undefined>;Defined in: packages/sage/src/rewards/index.ts:587
Reads an optional reward commitment from one Loot account.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
context | SageContext |
loot | Address |
options? | ReadOptions |
Returns
Section titled “Returns”Promise<
| RewardCommitmentSnapshot
| undefined>
Example
Section titled “Example”declare const ctx: SageContext;declare const loot: Address;const commitment = await maybeGetRewardCommitment(ctx, loot);selectAtlasRewardConfigVersion()
Section titled “selectAtlasRewardConfigVersion()”function selectAtlasRewardConfigVersion(registry, epoch): number;Defined in: packages/sage/src/rewards/index.ts:456
Selects the config version effective for an epoch, including the pending boundary.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
registry | AtlasRewardRegistrySnapshot |
epoch | bigint |
Returns
Section titled “Returns”number
Example
Section titled “Example”declare const registry: AtlasRewardRegistrySnapshot;const version = selectAtlasRewardConfigVersion(registry, 20_670n);References
Section titled “References”LootRewardLeg
Section titled “LootRewardLeg”Re-exports LootRewardLeg