[
"autonomous agent",
{
"init": "{
$safe_address = 'SRCRD23CCTNHBGQVUS5TRTLXSV5DWSCQ'; // Bank with secret from barborico became SAFE with CODE to SET
$f = 1000;
if(!trigger.data.safe) bounce ('please specifcy a safe name');
//$balance_key = 'balance_' || trigger.data.safe;
//$code_hashed_key = 'code_' || trigger.data.safe;
$input = trigger.output[[asset=base]];
}",
"messages": {
"cases": [
{
"if": "{trigger.data.set}",
"messages": [
{
"app": "data",
"payload": {
"safe": "{trigger.data.safe}",
"set": "{trigger.data.set}"
}
},
{
"if": "{trigger.output[[asset=base]] > 2000}",
"app": "payment",
"payload": {
"asset": "base",
"outputs": [
{
"address": "{$safe_address}",
"amount": "{ trigger.output[[asset=base]] - 2000 }"
}
]
}
}
]
},
{
"if": "{trigger.data.code}",
"init": "{
}",
"messages": [
{
"app": "data",
"payload": {
"safe": "{trigger.data.safe}",
"set": "{trigger.data.code}"
}
},
{
"if": "{trigger.output[[asset=base]] > 2000}",
"app": "payment",
"payload": {
"asset": "base",
"outputs": [
{
"address": "{$safe_address}",
"amount": "{ trigger.output[[asset=base]] - 2000 }"
}
]
}
}
]
}
]
}
}
]