G75MNDSDSURLSAHY736B2DC6Q4T2UMQK
[
"autonomous agent",
{
"init": "{
$my_address = 'YY4O6WNC5UMU3UI4DAH3KXKM7OBSXCTI';
}",
"messages": {
"cases": [
{
"if": "{trigger.data.withdraw AND trigger.data.asset AND trigger.data.amount AND trigger.address == $my_address}",
"messages": [
{
"app": "payment",
"payload": {
"asset": "{trigger.data.asset}",
"outputs": [
{
"address": "{trigger.address}",
"amount": "{trigger.data.amount}"
}
]
}
}
]
},
{
"if": "{trigger.data.exchange_rate AND trigger.address == $my_address}",
"messages": [
{
"app": "state",
"state": "{ var['rate'] = trigger.data.exchange_rate; response['message'] = 'set exchange rate to'||var['rate']||'token/byte'; }"
}
]
},
{
"if": "{trigger.output[[asset=base]] > 100000}",
"init": "{ $bytes_amount = trigger.output[[asset=base]]; $asset_amount = round($bytes_amount * var['rate']); response['message'] = 'exchanged '||$bytes_amount||'bytes for'||$asset_amount||'asset'; }",
"messages": [
{
"app": "payment",
"payload": {
"asset": "L9AGxsgfrEAc9yQXq5nsKnTKJy5zOzjILTS82wEhIaw=",
"outputs": [
{
"address": "{trigger.address}",
"amount": "{ $asset_amount }"
}
]
}
}
]
},
{
"messages": [
{
"app": "state",
"state": "{ response['message'] = 'accepted coins: '||trigger.output[[asset=base]]||'bytes and'||trigger.output[[asset='L9AGxsgfrEAc9yQXq5nsKnTKJy5zOzjILTS82wEhIaw=']]||'token'; }"
}
]
}
]
}
}
]
Show transactions in assets:
No transactions found, it may be worth changing the filter
Unit ID
Date
From
Direction
To
Amount