[
"autonomous agent",
{
"init": "{
$aa_to_test = "
EFV5IYUSOYCGHH7QZNXO3ZVHCPUX7FO2";
$account_name = "account#1";
}",
"messages": {
"cases": [
{
"if": "{ trigger.data.c }",
"messages": [
{
"app": "data",
"payload": {
"create": "{$account_name}"
}
},
{
"app": "payment",
"payload": {
"asset": "{'base'}",
"outputs": [
{
"address": "{$aa_to_test}",
"amount": "{trigger.output[[asset=base]] - 999}"
}
]
}
}
]
},
{
"if": "{ trigger.data.a1 }",
"messages": [
{
"app": "data",
"payload": {
"add_party": "{"party1"}",
"account": "{$account_name}"
}
},
{
"app": "payment",
"payload": {
"asset": "{'base'}",
"outputs": [
{
"address": "{$aa_to_test}",
"amount": "{trigger.output[[asset=base]] - 1000}"
}
]
}
}
]
},
{
"if": "{ trigger.data.a2 }",
"messages": [
{
"app": "data",
"payload": {
"add_party": "{"party2"}",
"account": "{$account_name}"
}
},
{
"app": "payment",
"payload": {
"asset": "{'base'}",
"outputs": [
{
"address": "{$aa_to_test}",
"amount": "{trigger.output[[asset=base]] - 1000}"
}
]
}
}
]
},
{
"if": "{ trigger.data.f }",
"messages": [
{
"app": "data",
"payload": {
"finalize": "{$account_name}"
}
},
{
"app": "payment",
"payload": {
"asset": "{'base'}",
"outputs": [
{
"address": "{$aa_to_test}",
"amount": "{trigger.output[[asset=base]] - 1000}"
}
]
}
}
]
},
{
"if": "{ trigger.data.p }",
"messages": [
{
"app": "data",
"payload": {
"account": "{$account_name}",
"pay_to": "{trigger.address}",
"amount": "{22}"
}
},
{
"app": "payment",
"payload": {
"asset": "{'base'}",
"outputs": [
{
"address": "{$aa_to_test}",
"amount": "{trigger.output[[asset=base]] - 1000}"
}
]
}
}
]
},
{
"messages": [
{
"app": "state",
"state": "{
}"
}
]
}
]
}
}
]