Skip to main content
After this page, you can follow a rule payment from the activity feed to the chain, explain each status and reason to the user, and check the payment on chain yourself. The engine decides when a rule fires. This page describes what you can observe, not how the engine decides.

Sequence

The owner signs nothing when a rule fires. Anafi submits the transaction and pays the chain gas. Anafi can delay a payment; it can never read, redirect or create one.

The transaction on chain

Each payment is one call to redeemAsEngine on the adapter of the account: AnafiDelegationAdapterSafe or AnafiDelegationAdapterERC20Allow. See Redeem for the payload, the digest, the gas terms and each check. A redeem transaction has one of three outcomes. You see the outcome in the receipt: When a payment to the receiver of the gas charge or a refund to the account fails, the adapter keeps the amount as a gas credit, which its payee can claim with claimGasCredit(token, to). See Redeem for each check and each error.

Fee legs

When fees are on and the account has no sponsor, the legs of a payment include the Anafi fee: a transfer of the fee token to the fee treasury. GET /api/fees (fetchFeeTerms) names the treasury, the rate in basis points and the floor per token. The gas charge goes to the receiver that the gas terms name, the same treasury. On chain, you see these as Transfer events in the same transaction. In the activity row, fee lists the fee legs of a landed payment and gasCharge the gas charge. See Fees.

Nonce and deadline

Each payment carries a firing nonce and a deadline, validUntil. Read whether a nonce is spent with usedNonces(nonce) on the Safe adapter or isNonceUsed(nonce) on the ERC20Allow adapter. See Redeem for the rules of the nonce and the deadline. The deadline bounds the time at which a signed payment can land. It does not set the time at which a rule fires.

The activity feed

getActivity(account) reads GET /api/wallets/{account}/activity and returns ActivityItem[], newest first. The route needs no sign-in, so it shows only identity and status. The request times out after 10 seconds. Poll it, for example every few seconds while a payment is open. See Activity and fees for each field.

Status

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 value that is not in this table is unknown to your app. Show it as open, and do not treat it as final.

Wait reasons

Failure reasons

An unknown failureReason reads as other.

Check a payment on chain

Do not trust the feed alone for money that matters. Read the receipt of txHash and look for:
  • the EngineRedeemed event of the adapter of the account (the legs succeeded), or EngineRedeemFailed;
  • the GasCharged event, with the token and the charge;
  • the Transfer events of the payment and of the fee legs.

Example