Unit ID
k6COSdO+gsGcb9cu9GQIvfvuI2LPo17xof3E8ceTR/U=
Received
19.08.2019 09:13:10
Confirmation delay (full node)
4 minutes 21 seconds
Confirmation delay (light node)
6 minutes 25 seconds
Messages
Definition
Definition: [ "autonomous agent", { "init": "{ // AAthus2 $owner = "O7NYCFUL5XIJTYE3O4MKGMGMTN6ATQAJ"; //office_testnet_wallet $account = trigger.data.account otherwise trigger.data.ac otherwise bounce ("need account name"); // sha256()? $trigger = trigger.address; $pay_amount = trigger.data.amount otherwise trigger.data.am otherwise 0; $pay_address = trigger.data.address otherwise trigger.data.ad otherwise ""; $pay_id_received = trigger.data.pay_id otherwise trigger.data.pi otherwise ""; // use cases $setup = (trigger.data.a1) AND (trigger.data.a2); // minimum 2. $init_pay = ($pay_amount>0) AND ($pay_address !=""); $validate_pay = $pay_id_received != ""; }", "messages": { "cases": [ { "if": "{$setup}", "init": "{ if (var[$account]) bounce ("Account already exist!"); }", "messages": [ { "app": "state", "state": "{ var[$account] = trigger.output[[asset=base]]; var[$account||"_1"] = trigger.data.a1; var[$account||"_2"] = trigger.data.a2; response['message'] = 'Multi-sig account set for '||$account||'. '; }" } ] }, { "if": "{$init_pay}", "init": "{ if (!var[$account]) bounce ("Account do not exist!"); $pay_id_created = $account||'>'||$pay_address||': '||$pay_amount; $validator_num = ($trigger == var[$account||"_1"]) ? "2": "1"; $validator = $account||"_"||$validator_num; }", "messages": [ { "app": "data", "payload": { "pay_id": "{$pay_id_created}" } }, { "app": "payment", "payload": { "asset": "{$asset}", "outputs": [ { "address": "{var[$validator]}", "amount": 1000 } ] } }, { "app": "state", "state": "{ var[$pay_id_created||"_amount"] = $pay_amount; var[$pay_id_created||"_address"] = $pay_address; var[$pay_id_created||"_v"||$validator_num||"_required"] = true; response['message'] = 'Approval requested'; }" } ] }, { "if": "{$validate_pay}", "init": "{ if (var[$account]) bounce ("Account do not exist!"); $amount = var[$pay_id_received||"_amount"] otherwise 0; if ($amount == 0) bounce ("Payment ID do not exist!"); $address = var[$pay_id_received||"_address"] otherwise ""; $validator_num = ($trigger == var[$account||"_1"]) ? "1": "2"; $require = $pay_id_received||"_v"||$validator_num||"_required"; if (var[$require] != true) bounce ("Your validation is not required!"); }", "messages": [ { "app": "payment", "payload": { "asset": "{$asset}", "outputs": [ { "address": "{$address}", "amount": "{$amount}" } ] } }, { "app": "state", "state": "{ var[$address] = false; var[$amount] = false; var[$require] = false; response['message'] = 'Payment done'; }" } ] }, { "messages": [ { "app": "state", "state": "{ var[$account] += trigger.output[[asset=base]]; }" } ] } ] } } ]
Technical information
Fees:
2,945 bytes
(353 headers, 2592 payload)
Level:1009617
Witnessed level:1009610
Main chain index:1008435
Latest included mc index:1008434
Status:stable/confirmed/final