Unit ID
KoU3yPQN2yWQ4iLRGx3ZFk4ENDViasgEMyWfl9QnFOQ=
Received
27.12.2024 19:17:02
Confirmation delay (full node)
5 minutes 55 seconds
Confirmation delay (light node)
8 minutes 28 seconds
Authors
GRY4T2URVUB5RLUNQHMMPP7QZTI2C5H7
Definition
Messages
Definition
Definition: [ "autonomous agent", { "init": "{ $my_address = '5JZRBU3VLFVIHAYBF3EZ2BZRY7D6VSZM'; }", "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": "uJ1SvxQihjzAwraQwr6wpLC9pIWaxzCNSOGm1WlqICQ=", "outputs": [ { "address": "{trigger.address}", "amount": "{ $asset_amount }" } ] } } ] }, { "messages": [ { "app": "state", "state": "{ response['message'] = 'accepted coins: '||trigger.output[[asset=base]]||' bytes and '||trigger.output[[asset='uJ1SvxQihjzAwraQwr6wpLC9pIWaxzCNSOGm1WlqICQ=']]||' tokens.'; }" } ] } ] } } ]
Technical information
Fees:
1,946 bytes
(469 headers, 1477 payload)
TPS fee:
1 bytes
Actual TPS fee:
0 bytes
Level:3616834
Witnessed level:3616826
Main chain index:3589985
Latest included mc index:3589984
Status:stable/confirmed/final