pet.trezy.collectCoins
Details · procedure
| Kind | procedure |
|---|---|
| Authority | trezy.pet |
| Indexed |
Procedure
procedure · POSTInput
application/jsonminimum: 1
Output
application/jsonbalance
integercollected
integererror
stringPresent instead of collected/lastUpdated/balance when the claim was refused for an expected reason. A stable machine code the client branches on — add codes, never rename them. Its presence is why nothing here is `required`: a refusal carries none of the three, and requiring even one would fail response validation and turn the refusal back into a 500.
knownValues: invalid-amount | insufficient-accrual | wallet-unsigned | wallet-invalid
lastUpdated
string · datetimeTHE ACCRUAL ANCHOR, NOT A WRITE TIME. Income is measured FROM this moment, so it is where the next payout starts rather than when this record was last saved. The two usually coincide, because a settle banks everything and moves the anchor to now — but a PARTIAL collect advances it only as far as the coins actually taken, leaving it EARLIER than the write that produced it. Reading it as "when the wallet was last written" has already cost this project one wrong diagnosis. It is deliberately NOT renamed: it sits inside the signed payload, so changing it would invalidate every wallet attestation ever issued and require rewriting records in players' repos. This is the anchor AFTER the collect — where the next window starts.
message
stringA sentence to show the player, accompanying `error`. Free to reword; do not branch on it.
Similar lexicons
semantic matchLexicons whose schemas describe something close to this one. Check them before publishing a new one that overlaps.
-
pet.trezy.getWallet
queryOne pet's share of what has accrued since the wallet's anchor.
-
pet.trezy.wallet
record