TokenAccount
object type
A TokenAccount — **the ONE-per-GROUP token wallet / platform billing unit**. The wallet is a group-scoped singleton enforced by the tokenAccountSingleton uniq marker minted IN the create txn. **Wallet existence IS the metering arm**: no wallet ⇒ the group is unbilled (the dvlp posture); opening one arms the rater. balance = Σ TokenEntry amounts exactly, cached in the same transaction as every ledger append — signed. The auto-top-off block is config this slice (the firing engine + stored-method custody = the rater leg, deferral 5); its budget cap is a lazy month-keyed counter. Platform billing is USD-only. NOT searchable (platform-internal — never merchant search content). Template class A16_BILLING (platform billing ≠ floor work — owner/manager/assoc_mgr; hand-derived v23).
Fields
| Field | Type | Notes |
|---|---|---|
id | ID ID! | The record’s id — a UUID the platform assigned when the record was created; every reference to this record uses it. |
sysId | String String! | The human-readable id, shaped like TA-… — stable for the record’s life. |
type | String String! | The kind of record — always TokenAccount here. |
caption | String String! | The record’s display name — what people see it called. |
status | String String! | The record’s current state — one of active, inactive or doomed. |
parentId | ID ID! | The parent org group; for a TokenAccount parentId === rootId. |
rootId | ID ID! | The id of your organization group — every record of yours carries the same one. |
createdAt | String String! | When the record was created, as a UTC timestamp. |
updatedAt | String String! | When the record last changed, as a UTC timestamp. |
revisionNum | Int Int! | How many times this record has been edited; the first save is 0. |
revision | ID ID! | The id of the record’s current edit — send it back with a change so an edit made in the meantime is refused instead of overwritten. |
refCaptions | RefCaption [RefCaption!]! | The captions of the records this one refers to, composed for you — one row per referenced id; see RefCaption. |
balance | Int Int! | The cached token balance = Σ TokenEntry amounts exactly — signed. Never caller-writable — moves only with ledger appends. |
lowBalanceThreshold | Int | The low-balance warning threshold (tokens) — absent ⇒ the warning arm is unarmed (the eventDate optional-arm class). The warning ladder is events + readable state now. |
dailyBurnThresholdKernels | Int | The daily-burn alert threshold in kernels/day. Absent ⇒ unarmed. Owner-set like lowBalanceThreshold; day rows over it read as breaches on the costs face. |
autoTopOff | AutoTopOffConfig | The auto-top-off block — absent ⇒ never fires. Config this slice; the firing engine + stored-method custody ride the rater leg. Cap reached ⇒ stop + warn. |
autoTopOffMonth | String | The auto-top-off cap window's yyyy-mm month key — server-stamped at fire time. |
autoTopOffSpentUsdCents | Int | The month's cumulative auto-top-off spend — server-stamped at fire; compared against the cap before each fire. |
autoTopOffDay | String | The auto-top-off DAY window's yyyy-mm-dd key. |
autoTopOffSpentDayUsdCents | Int | The DAY's cumulative auto-top-off spend. |
autoTopOffPendingMethod | String | Which stored card the in-flight top-off charged — primary | backup. |
autoTopOffPrimaryFailedDay | String | The UTC day the primary card last webhook-failed a top-off. |
autoTopOffBackupFailedDay | String | The backup twin — both stamps reading today = the cards-failing emergency (nothing fires; the loud lane speaks each tick). |
backupBillingMethod | BillingMethodFacts | The backup method's readable facts. The charger's top-off falls back to it when the primary declines; stamped by attachTokenAccountBackupBillingMethod, removed whole by its detach. |
burn7dKernels | Int | Computed at read: the group's total kernel consumption over the last 7 UTC days, summed off the rater's total day lanes (the usageReport engine — exact integers). 0 on a quiet week; null only on the filtered listing lane (vitals ride the plain reads). |
runwayDays | Float | Computed at read: the balance scaled to kernels (balance is whole internal tokens — ×1,000,000) ÷ the 7-day daily kernel burn — how many days the balance lasts at the current rate. Null when the burn is 0 (no rate exists to project) or on the filtered listing lane. |
microTokenCarry | Int | The sub-token usage accrual in µtokens, 0…999,999. Server-stamped — no face carries it; absent = 0. Read-exposed for transparency. |
lowBalanceSince | String | When the current low-balance episode began. The readable half of the warning ladder — the at.billing.token_account.low_balance.v1 event is its evented twin. |
billingMethod | BillingMethodFacts | The stored off-session method's readable facts. Present ⟺ custody is armed (the charger's top-off + base-fee arms both require it); stamped by attachTokenAccountBillingMethod, removed whole by detach. |
autoTopOffPendingPurchaseId | ID | The in-flight auto-top-off TokenPurchase. Absent = no fire in flight. |
topOffCappedSince | String | When the current capped episode began. Absent/null = not capped. |
baseFeePaidMonth | String | The latest UTC yyyy-mm period the base fee settled for. Absent = never collected. |
includedMonth | String | The live included-allowance month, UTC yyyy-mm. Server-stamped by the base-fee settle; absent/null = no allowance ever minted, or the plain-read vitals lane was skipped (the burn7dKernels listing-lane class). |
includedGranted | Int | What the live allowance month minted. Present ⟺ includedMonth is. |
includedRemaining | Int | What the live allowance month has NOT yet drawn. The banked balance = balance − this figure while the month lives. Present ⟺ includedMonth is. |
affiliateCreditCents | Int | Your group’s spendable referral-earnings credit: Σ your AffiliateAccrual entries exactly. When it covers your monthly base fee the cycle credit-settles automatically (no card charge — bill-netting first, the ruled settlement order). Absent/null = never earned a cent, or the filtered listing lane (the burn7dKernels class). |
frozenKernels | Int | Σ kernels in transfer-FROZEN blocks: your true spendable room = balance − this figure (the exhaustion gate reads it; the transfer face’s pre-submit warning derives from it). Absent/null = nothing frozen, or the filtered listing lane. |
storageSnapshotDay | String | The latest UTC yyyy-mm-dd day a storage snapshot emitted for this wallet. Absent = never snapshotted. |
currency | String String! | Platform billing currency — 'USD' by law. |