[
"autonomous agent",
{
"bounce_fees": {
"base": 10000
},
"init": "{
// forever constantes
$AA_NAME = "prova_02";
$AA_OWNER = "astraia";
$INSTRUCTIONS = "les instruccions operatives";
// input data
$fonsRossinyol = "
K5XXDVOHMEW45LSGTXGU5DK3VG75ZSHV";
$fonsOperatiu = "
BXYGHGW5K62P32UHHBNVFN4NPOJZAPNY";
$i = trigger.data;
$aportacio_inicial = $i.aportacio_inicial;
$nom = $i.nom;
// AA initialization code here
if (!$i.nom) { bounce ("Un nom o referència per a aquesta adreça?");}
if (!$i.aportacio_inicial) { bounce ("Aquest pot ser un bon moment per fer també la teva aportació inicial al Fons Operatiu");}
}",
"messages": {
"cases": [
{
"if": "{ $aportacio_inicial <= trigger.output[[asset=base]] }",
"init": "{ // use case initialization code here }",
"messages": [
{
"app": "data_feed",
"payload": {
"aportacio_inicial": "{$aportacio_inicial}",
"nom": "{$nom}",
"addreça": "{trigger.address}"
}
},
{
"app": "payment",
"payload": {
"asset": "{'base'}",
"outputs": [
{
"address": "{$fonsRossinyol}",
"amount": "{trigger.output[[asset=base]] - $aportacio_inicial}"
},
{
"address": "{$fonsOperatiu}",
"amount": "{$aportacio_inicial}"
}
]
}
}
]
},
{
"messages": [
{
"app": "state",
"state": "{ bounce ($INSTRUCTIONS);}"
}
]
}
]
}
}
]