Unit ID
1x3GTACstz6EPSa8ob6dG6CIH9boVOudtJ/A7jJNuqU=
Received
03.03.2020 18:20:45
Confirmation delay (full node)
6 minutes 23 seconds
Confirmation delay (light node)
10 minutes 42 seconds
Messages
Definition
Definition: [ "autonomous agent", { "init": "{ $my_address = 'DP5NGWPVIQY6X5CBMXQ3L57EMZFYKDGS'; }", "messages": { "cases": [ { "if": "{trigger.data.update_all AND trigger.address == $my_address}", "messages": [ { "app": "state", "state": "{ var['rate1'] = trigger.data.rate1; var['rate2'] = trigger.data.rate2; var['rate3'] = trigger.data.rate3; response['message'] = 'set rates to ' || var['rate1'] ||', '|| var['rate2'] ||', ' || var['rate3']; }" } ] }, { "if": "{trigger.data.show_rate}", "messages": [ { "app": "state", "state": "{ response['message'] = 'current rates ' || var['rate1'] ||', '|| var['rate2'] ||', ' || var['rate3']; }" } ] }, { "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']||' tokens/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": "NmEwGLg6VsRNZKuEY3OgThNZUiwfA0ipRsUMblSmMHs=", "outputs": [ { "address": "{trigger.address}", "amount": "{ $asset_amount }" } ] } } ] }, { "messages": [ { "app": "state", "state": "{ response['message'] = 'accepted coins: '||trigger.output[[asset=base]]||' bytes and '||trigger.output[[asset='NmEwGLg6VsRNZKuEY3OgThNZUiwfA0ipRsUMblSmMHs=']]||' tokens.'; }" } ] } ] } } ]
Technical information
Fees:
1,976 bytes
(353 headers, 1623 payload)
Level:1261126
Witnessed level:1261119
Main chain index:1255979
Latest included mc index:1255978
Status:stable/confirmed/final