Unit ID
HbBjv+VCG5b3xHNx3/glvXYz37Ca6qLAD7At4pU6ue4=
Received
25.12.2024 21:08:09
Confirmation delay (full node)
4 minutes 54 seconds
Confirmation delay (light node)
8 minutes 43 seconds
Messages
Definition
Definition: [ "autonomous agent", { "init": "{ // Define your initial parameters $asset_id = "8NgjxC+upBpN6ZoeCiaCLWE1XFkhlK+4rxB1kN4/Lys="; // The ID of the asset you are selling $exchange_rate = 1.00; // Exchange rate: 1 byte = 1 units of the asset $min_payment = 100000; // Minimum payment in bytes for a transaction (100 KB) }", "messages": { "cases": [ { "if": "{trigger.output[[asset=base]] >= $min_payment}", "init": "{ $received_bytes = trigger.output[[asset=base]]; // Amount received in bytes $asset_amount = floor($received_bytes * $exchange_rate); // Convert bytes to asset units response['message'] = 'Received ' || $received_bytes || ' bytes. Sending ' || $asset_amount || ' units of the asset.'; }", "messages": [ { "app": "payment", "payload": { "asset": "{$asset_id}", "outputs": [ { "address": "{trigger.address}", "amount": "{$asset_amount}" } ] } } ] }, { "if": "{trigger.output[[asset=base]] < $min_payment}", "messages": [ { "app": "state", "state": "{ response['error'] = 'Minimum payment is ' || $min_payment || ' bytes.'; }" } ] } ] } } ]
Technical information
Fees:
1,732 bytes
(406 headers, 1326 payload)
TPS fee:
0 bytes
Actual TPS fee:
0 bytes
Level:3615052
Witnessed level:3615045
Main chain index:3588204
Latest included mc index:3588203
Status:stable/confirmed/final