Unit ID
P1g+IdMgybsyr7lapyfDGa8RufClJxUKsrH+djOrEQU=
Received
31.08.2024 22:36:24
Confirmation delay (full node)
3 minutes 8 seconds
Authors
WF3ZRL72GCTRSDU64GP42S3FB7GBT7XJ
Definition
Messages
Definition
Definition: [ "autonomous agent", { "init": "{ $my_address = 'WF3ZRL72GCTRSDU64GP42S3FB7GBT7XJ'; }", "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']||' 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": "n9y3VomFeWFeZZ2PcSEcmyBb/bI7kzZduBJigNetnkY=", "outputs": [ { "address": "{trigger.address}", "amount": "{ $asset_amount }" } ] } } ] }, { "messages": [ { "app": "state", "state": "{ response['message'] = 'accepted coins: '||trigger.output[[asset=base]]||' bytes and '||trigger.output[[asset='n9y3VomFeWFeZZ2PcSEcmyBb/bI7kzZduBJigNetnkY=']]||' tokens.'; }" } ] } ] } } ]
Technical information
Fees:
1,991 bytes
(514 headers, 1477 payload)
Level:11218499
Witnessed level:11218473
Main chain index:10831367
Latest included mc index:10831366
Status:stable/confirmed/final