Receipts
Signed, public proof of what happened when a rule fired, and who did it.
When a worker fires a rule, it writes a trg.receipt entity. The worker's wallet is the receipt's
$creator, recorded by Arkiv itself, so a receipt cannot claim to come from a worker that did not
write it.
| Field | Meaning |
|---|---|
rule | The rule's key |
rulecreator | Who made the rule, so apps can list receipts for their own rules |
action | The action that ran |
status | ok, failed or skipped |
deadline | The block the rule was due at |
firedat | The block the worker fired it at |
reason (payload) | Why it fired: "target expired", "block reached", "target is about to expire", or why it was skipped |
result (payload) | code (webhook HTTP status), messageId (Telegram), newExpiresAt (extend), error, latencyMs, attempts |
firedat - deadline is how late it fired, in blocks.
Statuses
- ok: the action succeeded.
- failed: the action ran out of attempts or time;
result.errorsays why. The rule counts as failed. - skipped: the rule was correctly not acted on, for example its target was deleted before it expired.
Lifetime
Receipts live 30 days. After that they drop out of queries, but the transactions that wrote them stay in the chain's history.
Reading them
listReceipts({ creator }), listReceipts({ rule }), getRule(key).receipts, or live with
watch({ onReceipt }). Anyone can read anyone's receipts.