[
"autonomous agent",
{
"bounce_fees": {
"base": 11000
},
"init": "{
$oracle = "
F4KHJUCLJKY4JV7M5F754LAJX4EB7M4N";
$feed_name = "BBD";
$decimals = 8;
$rate = 1 - data_feed[[oracles=$oracle, feed_name=$feed_name, ifnone=0.49486499]];
}",
"messages": {
"cases": [
{
"if": "{trigger.data.define}",
"messages": [
{
"app": "asset",
"payload": {
"cap": "{trigger.data.cap otherwise ''}",
"is_private": false,
"is_transferrable": true,
"auto_destroy": "{!!trigger.data.auto_destroy}",
"fixed_denominations": false,
"issued_by_definer_only": "{!!trigger.data.issued_by_definer_only}",
"cosigned_by_definer": false,
"spender_attested": "{!!trigger.data.attestor1}",
"attestors": [
"{trigger.data.attestor1 otherwise ''}",
"{trigger.data.attestor2 otherwise ''}",
"{trigger.data.attestor3 otherwise ''}"
]
}
},
{
"app": "state",
"state": "{ var[response_unit] = trigger.address; }"
}
]
},
{
"if": "{trigger.output[[asset='vqivtXemkpj6aCrOZNvQUfl8SaDj4VQu+2JqTw/iJpc=']] > 100}",
"init": "{ $asset_amount = round(trigger.output[[asset='vqivtXemkpj6aCrOZNvQUfl8SaDj4VQu+2JqTw/iJpc=']] / $rate );
response['message'] = 'exchanged '||trigger.output[[asset='vqivtXemkpj6aCrOZNvQUfl8SaDj4VQu+2JqTw/iJpc=']].amount || trigger.output[[asset='vqivtXemkpj6aCrOZNvQUfl8SaDj4VQu+2JqTw/iJpc=']].asset || ' for '||$asset_amount||' asset.'; }",
"messages": [
{
"app": "payment",
"payload": {
"asset": "x+iLTe8/dIc9f/usw66cgQhwdOBtv/+uf7QoNAC1p18=",
"outputs": [
{
"address": "{trigger.address}",
"amount": "{ $asset_amount }"
}
]
}
}
]
}
]
}
}
]