Unit ID
c/GgFATKFjwJdk311gCx8GSIroYaHQkeyQrPgujm8m8=
Received
29.10.2020 18:33:19
Confirmation delay (full node)
3 minutes 48 seconds
Confirmation delay (light node)
5 minutes 47 seconds
Messages
Definition
Definition: [ "autonomous agent", { "init": "{\r \r $nom_AA = 'Transfers';\r $versio = '2';\r \r $AA_PF = trigger.data.AA_PF;\r $adr__ = trigger.initial_address;\r $args = trigger.data;\r \r // Moneda operativa inter-AAs\r $guspires = var[ $AA_PF ][ 'guspires' ];\r \r \r // ............................................ Adreces i Constants\r \r $AA_Activacions = var[ $AA_PF ][ '_AA_Activacions' ];\r $AA_Cicles = var[ $AA_PF ][ '_AA_Cicles' ];\r \r \r // ............................................ Variables Operatives\r \r $receptora = $args.receptora;\r $qt = $args.qt ;\r \r \r // ............................................ Comprovacions, Variables i Valors Condicionats\r \r if ( !! $args.iniTEST ) {\r $emissora = 'TEST';\r $accio = 'Transfers';\r \r } else {\r // Comprovacions diferents en funció de l'origen de la requesta\r if ( !! $args.accio ) {\r $accio = $args.accio;\r $emissora = $args.emissora;\r \r // Comprova q l'adreça de l'AA actuant és un agent autònom\r if ( ! is_aa( trigger.address ) ) { bounce ( $nom_AA || ': no AA' ); }\r \r // Comprova q l'adreça de l'AA actuant és operativa\r $adr_AA = var[ $AA_PF ][ '_AA_' || $args.accio ];\r if ( trigger.address != $adr_AA ) { bounce ( $nom_AA || ': AA no autoritzat' ); }\r \r } else { \r $accio = 'Transfers';\r $emissora = $adr__;\r \r // Comprova q adr receptora registrada com a activa\r $adr_recep_activa = var[ $AA_Activacions ][ 'activacio_' || $receptora ];\r if ( ! $adr_recep_activa ) { bounce ( $nom_AA || ': Adreça receptora no activa' ); }\r }\r \r // Comprova q saldo és suficient\r $saldo__ = var[ 'saldo_' || $emissora ];\r //if ( $saldo__ < $qt ) { bounce ( $nom_AA || ': Saldo insuficient' ); }\r if ( $saldo__ < $qt ) { bounce ( $nom_AA || ': Saldo insuficient: ' || $saldo__ || ' qt :' || $qt ); } //***saldo visible només per als TESTS\r }\r \r }", "messages": [ { "app": "data", "payload": { "AA_PF": "{ $AA_PF }", "accio": "{ $accio }" } }, { "app": "payment", "payload": { "asset": "{ $guspires }", "outputs": [ { "address": "{ $AA_Cicles }", "amount": "{ 500 }" } ] } }, { "app": "state", "state": "{\r if ( ! var[ 'ordinal' ]) { $ordinal = 1; } \r else { $ordinal = var[ 'ordinal' ] + 1; }\r var[ 'ordinal' ] = $ordinal;\r \r if ( !! $args.iniTEST ) {\r var[ 'saldo_' || $receptora ] = $qt ;\r } else {\r var[ 'saldo_' || $emissora ] -= $qt ;\r var[ 'saldo_' || $receptora ] += $qt ; \r }\r var[ 'total_' || $accio ] += $qt ;\r var[ 'total_' || $accio || '_de_' || $emissora ] += $qt ;\r var[ 'total_' || $accio || '_a_' || $receptora ] += $qt ;\r var[ 'total_' || $accio || '_de_' || $emissora || '_a_' || $receptora ] += $qt ;\r \r }" } ] } ]
Technical information
Fees:
3,619 bytes
(452 headers, 3167 payload)
Level:1715026
Witnessed level:1715019
Main chain index:1707479
Latest included mc index:1707478
Status:stable/confirmed/final