actions list of a rule. Its type field selects one of five types:
Each type accepts only its own fields. Another field is refused with
unknown field '<key>' in <type> action, for example unknown field 'slippage' in exchange action. An unknown type is refused with unknown action type '<value>'.
Where each action runs
A “no” in this table is a refusal at staging. The texts are on Validation.
How actions run
- The actions of one rule run in list order.
- Each action runs on its own. A failed action does not stop the next action of the same rule.
- One
send_batchis all or nothing. If one of its transfers fails, none of them happens. - Rules fire independently. The engine does not join two rules into one transaction.
- Rules with the same trigger fire in document order.
- An action of one rule does not fire another rule of the same account. The engine skips the transactions that it made for the account. See what does not count as a transfer.
send_one
Pays one address.
Rules:
valuemust be an amount of a token, ortrigger.valuein a transfer rule. A bare percent or number is refused, for examplesend_one value must be a token amount; got percentage.tomust be onglobal.recipient_allowlist, if the list is present.- Every token in
valuemust be onglobal.token_allowlist, if the list is present. - The stage refuses a
tothat is the account itself:rule '<rule>': This is your own Anafi account. Choose another destination. - The stage refuses the zero address:
rule '<rule>': This is the zero address. Funds sent there are lost. Choose another destination. - The value can be the native coin, such as
"1 POL", for asafe_moduleaccount. Anerc20_allowaccount can send only ERC-20 tokens.
send_batch
Pays a list of addresses in one transaction, all or nothing.
Each item of
recipients:
Rules:
- Each item has its own
value. There is no sharedvalueand nosharefield. To split an amount, write a percent oftrigger.valuein each item. - The language does not check that the percents add up to 100%. The rest stays in the account.
- The batch settles in one on-chain transaction. If the account does not hold enough for every item, or one transfer reverts, no item is paid.
- An empty list is refused with
send_batch recipients must not be empty. - The stage refuses more than 24 items:
rule '<rule>': send_batch has <count> recipients, but this chain's limit is 24. - Each
toand eachvaluefollows the rules ofsend_one.
exchange
Swaps one token for another. The bought tokens stay in the account.
Rules:
inandoutmust be different tokens. A swap of a token to itself is refused, for exampleexchange `in` and `out` are both USDC; a swap must name two different tokens.inmust be an amount of a token, ortrigger.valuein a transfer rule.- Both tokens must be on
global.token_allowlist, if the list is present. - Both tokens must have a contract on the network, or be the native coin. The token tables list them.
inmust not be zero."0 USDC"validates, and every fire refuses it.- There is no slippage field, no price field and no route field. The engine gets a price for each fire and sets the minimum output of the swap. The on-chain checks are on Swap executor.
- The swap runs as one on-chain transaction. Either the full swap happens, or nothing happens.
polygonandxlayerhave a swap venue.polygon-amoyhas none. The stage refuses everyexchangethere:rule '<rule>': network polygon-amoy has no swap aggregator, so an `exchange` could never execute here.- A
safe_moduleaccount can sell or buy the native coin. - An
erc20_allowaccount cannot sell or buy the native coin. It can sell only a token that the document names: a literal amount, ortrigger.valueunder a range. Its adapter must also run swaps. See account kind refusals.
notify
Sends an email to the inbox of the document.
Rules:
- Email is the only delivery. The engine accepts
pushandtelegram, ignores the value, and sends an email. Writechannel: email. - Another channel, such as
sms, is refused withunknown notify channel 'sms'. - The email goes to
global.notification_email. There is no per-action address. See notification_email. - Without
global.notification_email, the action fires and delivers nothing. The engine gives a warning for each such rule. - The engine sends
messageas written. It does not replace${...}or any other placeholder. notifymoves no funds. It is valid in each rule, on each network, for each account kind.
off_ramp
Pays euros to a bank account. The engine burns EURe from the account through Monerium, and Monerium pays the same amount in euros by SEPA transfer. No token goes to an on-chain address.
The
to mapping:
Write a person as
first_name and last_name, or a company as company_name. Never write both. No name may be blank.
The IBAN rules:
- Write it in canonical form: uppercase letters and digits, no spaces, for example
"DE89370400440532013000". - It has 15 to 34 characters: two letters, two check digits, then letters and digits.
- The check digits must be correct (ISO 13616, remainder 1 under modulo 97).
- The language does not check that the account exists.
valuemust be an amount ofEURe. Another token is refused withoff_ramp value must be an amount of EURe, the token its provider redeems; got amount of USDC.- A literal amount must name whole cents.
"1.005 EURe"is refused withoff_ramp value '1.005 EURe' names a fraction of a cent, which no bank transfer can carry. - An amount computed at the fire is rounded down to whole cents. An amount under one cent is not paid.
trigger.valuemust have the tokenEURe. Use a transfer trigger with anEURerange, such asvalue: "100.. EURe". Without a range,trigger.valueis refused withoff_ramp value must be an amount of EURe, the token its provider redeems; got polymorphic.- The IBAN must be on
global.iban_allowlist, if the list is present.
- Only on
polygon-amoy. Another network refuses it at staging:rule '<rule>': network <network> carries no fiat rail, so an off_ramp through monerium could never execute here. - Only for a
safe_moduleaccount. Anerc20_allowaccount refuses it:rule '<rule>' has an off_ramp, which the ERC20Allow leg does not serve. - The Safe must be linked to a Monerium account first.
- The Safe can keep a list of IBANs on chain, in the off-ramp policy of its fallback handler.
global.iban_allowlistis a different list, part of the rule document. The engine checks it at staging and again at the commit. Nothing keeps the two lists equal. See Off-ramp handler and Bank payouts.