Unit ID
g5+6dMhQ30ZL3mWGQP7bzvXUlii1yrH8pmRxJOcxiPE=
Received
27.12.2024 07:55:12
Confirmation delay (full node)
5 minutes 32 seconds
Confirmation delay (light node)
9 minutes 7 seconds
Messages
Definition
Definition: [ "autonomous agent", { "init": "{ // Define your initial parameters $asset_id = "uJ1SvxQihjzAwraQwr6wpLC9pIWaxzCNSOGm1WlqICQ="; // The ID of the asset you are selling $exchange_rate = 30; // Exchange rate: 30 byte = 1 units of the asset $min_payment = 30; // Minimum payment in bytes for a transaction (30 bytes) }", "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,729 bytes
(406 headers, 1323 payload)
TPS fee:
0 bytes
Actual TPS fee:
0 bytes
Level:3616418
Witnessed level:3616411
Main chain index:3589569
Latest included mc index:3589568
Status:stable/confirmed/final