IIX4PVJ57IYN6MMFE33XY3EOBSLCDRN5
[
"autonomous agent",
{
"init": "{
$nom_AA = 'Validacions';
$darrera_versio = '0000000000';
//$_Portal_original = '0000000000';
$_Portal_original = trigger.address; //Hauria de ser fix amb adr darrer Portal
$_Portal_actual = var[ 'nou_portal' ] otherwise $_Portal_original;
if ( $_Portal_actual != trigger.address )
{
$_Portal = substring( var[ $_Portal_actual ][ 'versions' ], 0, 32 );
if( $_Portal != trigger.address )
{ bounce ( 'Portal no reconegut' ); }
} else {
$_Portal = $_Portal_actual;
}
// Principals
$args = trigger.data;
$adr__ = trigger.initial_address;
$_unitat = trigger.output[[ asset != base ]].asset;
$qt = 10; // Pendent de definició!!!
$proces = $args.proces;
$idprop = $args.idprop;
$generics = var[ $_Portal ][ 'generics' ];
$entitats = var[ $_Portal ][ 'entitats' ];
$versions_portal = var[ $_Portal ][ 'versions' ] otherwise $_Portal;
$versions_validacions = var[ $_Portal ][ 'versions_validacions' ] otherwise this_address;
// Funcions
// Si no s'ha lliurat l'argument especificat bota l'accés
$__arg = $arg =>
$args[ $arg ] otherwise
bounce( "Cal proporcionar el valor de: " || $arg );
$__dada = $refval => {
data_feed[[ oracles = $versions_validacions, feed_name = $refval, ifnone = false ]]
};
$__dada_proposta = $refval => {
data_feed[[ oracles = $versions_portal, feed_name = $refval, ifnone = false ]]
};
// Comprovacions
// La proposta encara no pot estar validada
if ( $__dada_proposta( 'validacio_' || $idprop ) )
{ bounce( 'Ja validada' ); }
// La proposta ha d'existir
if ( ! $__dada_proposta( $idprop ) )
{ bounce( 'No hi ha cap proposta amb aquesta id' ); }
// Processos
// Temporalment, per als TESTS!!!...............................
if ( $proces == 'validacio_directa_TEST' ) {
$validacio_aprovada = true;
}
}",
"messages": [
{
"if": "{ $validacio_aprovada }",
"app": "data_feed",
"payload": {
"{ 'validacio_' || $idprop }": "{ timestamp }"
}
},
{
"app": "state",
"state": "{
response[ 'Procés' ] = $proces;
response[ 'Proposta' ] = $idprop;
// -- Nou Portal
if ( $_Portal != $_Portal_actual ) {
var[ 'anterior_portal' ] = var[ 'nou_portal' ];
var[ 'nou_portal' ] = $_Portal;
response[ 'Nou portal' ] = $_Portal;
}
}"
}
]
}
]
Show transactions in assets:
No transactions found, it may be worth changing the filter
Unit ID
Date
From
Direction
To
Amount