rewards
Interfaces
Section titled “Interfaces”AtlasRewardConfigSnapshot
Section titled “AtlasRewardConfigSnapshot”Defined in: packages/sage/src/rewards/index.ts:78
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:101
address
Section titled “address”readonly address: Address;Defined in: packages/sage/src/rewards/index.ts:80
atlasBankInactivityExpirySeconds
Section titled “atlasBankInactivityExpirySeconds”readonly atlasBankInactivityExpirySeconds: bigint;Defined in: packages/sage/src/rewards/index.ts:91
readonly bump: number;Defined in: packages/sage/src/rewards/index.ts:82
claimSettlementWindowSeconds
Section titled “claimSettlementWindowSeconds”readonly claimSettlementWindowSeconds: number;Defined in: packages/sage/src/rewards/index.ts:90
configVersion
Section titled “configVersion”readonly configVersion: number;Defined in: packages/sage/src/rewards/index.ts:85
createdAtUnixSeconds
Section titled “createdAtUnixSeconds”readonly createdAtUnixSeconds: bigint;Defined in: packages/sage/src/rewards/index.ts:87
effectiveEpoch
Section titled “effectiveEpoch”readonly effectiveEpoch: bigint;Defined in: packages/sage/src/rewards/index.ts:86
epochLengthSeconds
Section titled “epochLengthSeconds”readonly epochLengthSeconds: number;Defined in: packages/sage/src/rewards/index.ts:89
factionPoolLeverRaw
Section titled “factionPoolLeverRaw”readonly factionPoolLeverRaw: bigint;Defined in: packages/sage/src/rewards/index.ts:93
readonly game: EntityRef<"game">;Defined in: packages/sage/src/rewards/index.ts:84
readonly kind: "atlasRewardConfig";Defined in: packages/sage/src/rewards/index.ts:79
kingSystemCurveRaw
Section titled “kingSystemCurveRaw”readonly kingSystemCurveRaw: readonly readonly bigint[][];Defined in: packages/sage/src/rewards/index.ts:94
lossModelTargetBps
Section titled “lossModelTargetBps”readonly lossModelTargetBps: readonly number[];Defined in: packages/sage/src/rewards/index.ts:99
medallionBuybackCapPerEpochRaw
Section titled “medallionBuybackCapPerEpochRaw”readonly medallionBuybackCapPerEpochRaw: bigint;Defined in: packages/sage/src/rewards/index.ts:108
pveLpRateBps
Section titled “pveLpRateBps”readonly pveLpRateBps: number;Defined in: packages/sage/src/rewards/index.ts:95
pvpMedallionRateBps
Section titled “pvpMedallionRateBps”readonly pvpMedallionRateBps: number;Defined in: packages/sage/src/rewards/index.ts:96
repairKitLpRateRaw
Section titled “repairKitLpRateRaw”readonly repairKitLpRateRaw: bigint;Defined in: packages/sage/src/rewards/index.ts:98
rewardLootReclaimSeconds
Section titled “rewardLootReclaimSeconds”readonly rewardLootReclaimSeconds: bigint;Defined in: packages/sage/src/rewards/index.ts:92
rewardReserveLowBalanceThresholdRaw
Section titled “rewardReserveLowBalanceThresholdRaw”readonly rewardReserveLowBalanceThresholdRaw: bigint;Defined in: packages/sage/src/rewards/index.ts:109
salvageEntries
Section titled “salvageEntries”readonly salvageEntries: readonly { cargo: CargoDefinitionSummary; referenceValueAtlasRaw: bigint; weight: number;}[];Defined in: packages/sage/src/rewards/index.ts:114
salvageEvRateBps
Section titled “salvageEvRateBps”readonly salvageEvRateBps: number;Defined in: packages/sage/src/rewards/index.ts:97
sourceFlags
Section titled “sourceFlags”readonly sourceFlags: number;Defined in: packages/sage/src/rewards/index.ts:88
starbaseDestructionMedallionsRaw
Section titled “starbaseDestructionMedallionsRaw”readonly starbaseDestructionMedallionsRaw: readonly bigint[];Defined in: packages/sage/src/rewards/index.ts:100
status
Section titled “status”readonly status: "enabled" | "disabled";Defined in: packages/sage/src/rewards/index.ts:83
upgradeLpRates
Section titled “upgradeLpRates”readonly upgradeLpRates: readonly { cargo: CargoDefinitionSummary; lpPerRawUnit: bigint;}[];Defined in: packages/sage/src/rewards/index.ts:110
version
Section titled “version”readonly version: number;Defined in: packages/sage/src/rewards/index.ts:81
Methods
Section titled “Methods”toJSON()
Section titled “toJSON()”toJSON(): unknown;Defined in: packages/sage/src/rewards/index.ts:119
Returns
Section titled “Returns”unknown
AtlasRewardRegistrySnapshot
Section titled “AtlasRewardRegistrySnapshot”Defined in: packages/sage/src/rewards/index.ts:53
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:63
address
Section titled “address”readonly address: Address;Defined in: packages/sage/src/rewards/index.ts:55
readonly bump: number;Defined in: packages/sage/src/rewards/index.ts:57
currentEpoch
Section titled “currentEpoch”readonly currentEpoch: bigint;Defined in: packages/sage/src/rewards/index.ts:59
currentEpochEndsAtUnixSeconds
Section titled “currentEpochEndsAtUnixSeconds”readonly currentEpochEndsAtUnixSeconds: bigint;Defined in: packages/sage/src/rewards/index.ts:61
currentEpochStartedAtUnixSeconds
Section titled “currentEpochStartedAtUnixSeconds”readonly currentEpochStartedAtUnixSeconds: bigint;Defined in: packages/sage/src/rewards/index.ts:60
readonly game: EntityRef<"game">;Defined in: packages/sage/src/rewards/index.ts:58
initialEpochOffsetSeconds
Section titled “initialEpochOffsetSeconds”readonly initialEpochOffsetSeconds: bigint;Defined in: packages/sage/src/rewards/index.ts:62
readonly kind: "atlasRewardRegistry";Defined in: packages/sage/src/rewards/index.ts:54
latestConfigVersion
Section titled “latestConfigVersion”readonly latestConfigVersion: number;Defined in: packages/sage/src/rewards/index.ts:67
pendingConfig
Section titled “pendingConfig”readonly pendingConfig: | { configVersion: number; effectiveEpoch: bigint;} | undefined;Defined in: packages/sage/src/rewards/index.ts:64
version
Section titled “version”readonly version: number;Defined in: packages/sage/src/rewards/index.ts:56
Methods
Section titled “Methods”toJSON()
Section titled “toJSON()”toJSON(): unknown;Defined in: packages/sage/src/rewards/index.ts:68
Returns
Section titled “Returns”unknown
AtlasRewardStateSnapshot
Section titled “AtlasRewardStateSnapshot”Defined in: packages/sage/src/rewards/index.ts:152
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:155
readonly kind: "atlasRewardState";Defined in: packages/sage/src/rewards/index.ts:153
pendingConfig
Section titled “pendingConfig”readonly pendingConfig: | AtlasRewardConfigSnapshot | undefined;Defined in: packages/sage/src/rewards/index.ts:156
registry
Section titled “registry”readonly registry: AtlasRewardRegistrySnapshot;Defined in: packages/sage/src/rewards/index.ts:154
treasury
Section titled “treasury”readonly treasury: AtlasRewardTreasurySnapshot;Defined in: packages/sage/src/rewards/index.ts:157
Methods
Section titled “Methods”toJSON()
Section titled “toJSON()”toJSON(): unknown;Defined in: packages/sage/src/rewards/index.ts:158
Returns
Section titled “Returns”unknown
AtlasRewardTreasurySnapshot
Section titled “AtlasRewardTreasurySnapshot”Defined in: packages/sage/src/rewards/index.ts:129
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:131
readonly bump: number;Defined in: packages/sage/src/rewards/index.ts:133
readonly game: EntityRef<"game">;Defined in: packages/sage/src/rewards/index.ts:134
readonly kind: "atlasRewardTreasury";Defined in: packages/sage/src/rewards/index.ts:130
reserves
Section titled “reserves”readonly reserves: readonly { cargo: CargoDefinitionSummary; quantityRaw: bigint;}[];Defined in: packages/sage/src/rewards/index.ts:135
version
Section titled “version”readonly version: number;Defined in: packages/sage/src/rewards/index.ts:132
Methods
Section titled “Methods”toJSON()
Section titled “toJSON()”toJSON(): unknown;Defined in: packages/sage/src/rewards/index.ts:139
Returns
Section titled “Returns”unknown
RewardCommitmentSnapshot
Section titled “RewardCommitmentSnapshot”Defined in: packages/sage/src/rewards/index.ts:168
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:177
configVersion
Section titled “configVersion”readonly configVersion: number;Defined in: packages/sage/src/rewards/index.ts:175
readonly game: EntityRef<"game">;Defined in: packages/sage/src/rewards/index.ts:171
readonly kind: "rewardCommitment";Defined in: packages/sage/src/rewards/index.ts:169
readonly legs: readonly { medallionsRaw: bigint; recipient: EntityRef<"profile">; salvageTargetValueAtlasRaw: bigint;}[];Defined in: packages/sage/src/rewards/index.ts:178
readonly loot: EntityRef<"loot">;Defined in: packages/sage/src/rewards/index.ts:170
profile
Section titled “profile”readonly profile: EntityRef<"profile">;Defined in: packages/sage/src/rewards/index.ts:172
rawStatus?
Section titled “rawStatus?”readonly optional rawStatus?: number;Defined in: packages/sage/src/rewards/index.ts:174
readonly slot: bigint;Defined in: packages/sage/src/rewards/index.ts:176
status
Section titled “status”readonly status: "resolved" | "committed" | "unknown";Defined in: packages/sage/src/rewards/index.ts:173
Methods
Section titled “Methods”toJSON()
Section titled “toJSON()”toJSON(): unknown;Defined in: packages/sage/src/rewards/index.ts:183
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:41
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:368
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:281
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:471
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:428
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:613
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:589
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:454
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);