[
"autonomous agent",
{
"bounce_fees": {
"base": 10000
},
"messages": {
"cases": [
{
"if": "{trigger.data.type == 'add_me' AND trigger.data.pubkey_unit}",
"messages": [
{
"app": "payment",
"payload": {
"asset": "base",
"outputs": [
{
"address": "
VTBMHHTE4JMUSMUEAC5N2ZFEN2GH3GC6",
"amount": "{trigger.output[[asset=base]] - 5000}"
}
]
}
},
{
"app": "state",
"state": "{
if (exists(var['pk_' || trigger.address])) {
bounce('already init');
}
$pubkey_unit = trigger.data.pubkey_unit;
$pubkey = unit[$pubkey_unit].messages[[.app='data']][0].payload.pubkey;
if(!exists($pubkey)) {
bounce('Pubkey by unit not found');
}
var['pk_' || trigger.address] = $pubkey_unit;
response['added'] = trigger.address;
}"
}
]
}
]
}
}
]