The feed
GET /api/wallets/:aa/activity returns the payment rows of one account on the network of the API host. In the SDK, call getActivity(aa). The SDK aborts the request after ACTIVITY_REQUEST_TIMEOUT_MS, 10000 milliseconds.
The route needs no authentication. Anyone who knows an account address can read its feed. A row tells only what the chain will show anyway: no rule text, no payee of a payment that did not land, and nothing about other accounts.
This route is on the Anafi API, so the CORS limit in the Introduction applies to a browser page.
A row appears when a rule fires and the engine signs a payment. An action that the engine refuses before it signs, for example an amount at or below the fee floor, makes no row.
The row
The SDK returns
gasCharge.amountRaw as a bigint. It sets a malformed fee or gasCharge to null and keeps the row. It throws on an unknown kind.
For the meaning of fee and gasCharge, see Fees.
Statuses
The SDK type
OutboxTaskStatus also has superseded. The Anafi API never lists a row with this status, because a newer row carries the same payment.
A row moves only forward: queued, then in_progress, then delivered, then a final status. A row can skip a step. A final status does not change.
Wait reasons
An open row can carry awaitReason. Anafi tries again while the reason holds. If the payment cannot land before its deadline, the row closes as failed with window_expired.
Treat an unknown
waitReason as a generic wait: “The payment waits. Anafi tries again.”
Failure reasons
Treat an unknown
failureReason as other.
A failed payment is not sent again. The rule fires again at its next trigger.
Identity and order
redemptionIdis the identity of a row. It is unique for each payment of the account, and it stays the same while the feed keeps the row. Use it as the key of the row in your view.redemptionIdtells nothing about the payment and nothing about other accounts. It is not the redeem digest and not a transaction hash.txHashcan change while a row is open, when Anafi sends a new transaction for the same payment. Do not use it as the key.- The feed returns rows newest first. The SDK does not sort them again.
- Anafi keeps a final row for a limited time only. Store the rows that you need for a record.
Keep the view current
- Poll
getActivityevery few seconds while a row is open. Poll less often when all rows are final. - Send one request at a time. Start the next poll only after the last one settles.
- Treat a failed request as a stale view, and show an error. Do not clear the rows that you already show.
- Merge rows by
redemptionId, and replace the old row with the new one. - On
landed, read the balances of the account again.