Loyalty
Loyalty tracks what a player has contributed to their faction over a period, and what that has accumulated. Capability-only entry.
import { getLoyaltyEpoch, getLoyaltyContributionsByProfile,} from '@aephia/atlas-kit/loyalty';Epochs bound everything
Section titled “Epochs bound everything”A loyalty epoch is a window. Contributions belong to one, and reading a contribution without knowing its epoch tells you less than it looks like it does.
const epochs = await getLoyaltyEpochsByFaction(ctx, factionId);const contributions = await getLoyaltyContributionsByProfile( ctx, profileAddress,);Lifecycle is projected
Section titled “Lifecycle is projected”An epoch’s state — upcoming, running, concluded — is derived deterministically from the epoch’s own timing rather than read from a status field. The SDK computes it so that every consumer computes it the same way, rather than each application inventing slightly different boundary handling.
ATLAS banks
Section titled “ATLAS banks”Accumulated rewards sit in a bank:
const bank = await maybeGetLoyaltyAtlasBank(ctx, profileAddress, factionId);maybe because a profile that has never contributed has no bank. Absence is an
answer.
Gotchas
Section titled “Gotchas”Contributions are per epoch. Summing across epochs is your job, and whether that sum is meaningful depends on what you are asking.
Amounts are bigint. ATLAS values in particular are large.
A concluded epoch still reads. Its data does not disappear when it ends. Check the projected lifecycle rather than assuming a readable epoch is the current one.