MSQA2ECW7VRKRHWNPFZI5T33NZIBSS6M
[
"autonomous agent",
{
"init": "{
$_Registre = 'MGIC6DY2L6I4F5MEB3LSBGUCSTNLIJTV';
$geto = 'Testets';
$id_geto = 'mXJmtZtH+svDfDdm4lYw5FqSD8elgLJg2DtqCq7GWm8=';
$adr__ = trigger.initial_address;
$args = trigger.data;
$unitat = trigger.output[[ asset != base ]].asset;
// Retorna el valor d'una entrada del _Registre
$__dada = $refdada =>
data_feed [[
oracles = $_Registre,
feed_name = $refdada,
ifnone = 0
]];
// $_Portal = $__dada( '_Portal' );
$_Portal = trigger.address; // * només x tests
if ( $_Portal != trigger.address
AND $__dada( '_Accions' ) != trigger.address
AND $__dada( '_Getons' ) != trigger.address )
bounce( 'Accés interdit' );
$sentit = $args.sentit;
$total_entrades = $__dada( 'total_entrades_' || $geto ) otherwise 0;
$total_sortides = $__dada( 'total_sortides_' || $geto ) otherwise 0;
$provisio = $unitat == 'none';
$idgeto_registrada = $__dada( $geto || '_id' ) otherwise '';
$id_estels = $__dada( 'Estels' );
if( $idgeto_registrada != $id_geto )
bounce( 'La id registrada no coincideix' );
if ( ! $provisio ) {
if( $unitat != $idgeto_registrada AND $unitat != $id_estels )
bounce( 'Unitat desconeguda' );
$estat_geto = $__dada( $geto || '_estat' ) otherwise '';
if( $estat_geto != 'operatiu' )
bounce( 'Getó no operatiu' );
$registre = {};
$dades = {};
if ( $sentit == 'entrada' ) {
$qt_entrada = $provisio ? 0 : trigger.output[[ asset = $unitat ]];
$nou_total_entrades = $total_entrades + $qt_entrada;
$ord_entrada_actual = $__dada( 'ordinal_entrada_' || $geto ) otherwise 0;
$ord_entrada = $ord_entrada_actual + 1;
$ref_entrada = 'entrada_' || $geto || '_' || $ord_entrada;
$dades[ $ref_entrada || '_data' ] = timestamp;
$dades[ $ref_entrada || '_qt' ] = $qt_entrada;
$dades[ $ref_entrada || '_emissora' ] = $args.emissora otherwise $adr__;
$dades[ 'total_entrades_' || $geto ] = $nou_total_entrades;
$dades[ 'ordinal_entrada_' || $geto ] = $ord_entrada;
}
if ( $sentit == 'sortida' ) {
$qt_sortida = $args.qt;
$rebedora = $args.rebedora;
$ord_sortida_actual = $__dada( 'ordinal_sortida_' || $geto ) otherwise 0;
$ord_sortida = $ord_sortida_actual + 1;
$ref_sortida = 'sortida_' || $ord_sortida;
$nou_total_sortides = $total_sortides - $qt_sortida;
$dades[ $ref_sortida || '_data' ] = timestamp;
$dades[ $ref_sortida || '_qt' ] = $qt_sortida;
$dades[ $ref_sortida || '_actuant' ] = $adr__;
$dades[ $ref_sortida || '_rebedora' ] = $rebedora;
$dades[ 'total_sortides_' || $geto ] = $nou_total_sortides;
$dades[ 'ordinal_sortida_' || $geto ] = $ord_sortida;
}
$registre.dades = $dades;
$registre.geto = $geto;
}
}",
"messages": [
{
"if": "{ ! $provisio }",
"app": "data",
"payload": "{ $registre }"
},
{
"if": "{ ! $provisio }",
"app": "payment",
"payload": {
"asset": "base",
"outputs": [
{
"address": "{ $_Registre }",
"amount": "{ $__dada( 'Provisio' ) }"
}
]
}
},
{
"if": "{ ! $provisio AND $sentit == 'sortida' }",
"app": "payment",
"payload": {
"asset": "{ $id_geto }",
"outputs": [
{
"address": "{ $rebedora }",
"amount": "{ $qt_sortida }"
}
]
}
},
{
"app": "state",
"state": "{
if ( ! $provisio ) {
if ( $sentit == 'entrada' ) {
response[ $ref_entrada ] =
$qt_entrada || ' ' || $geto || ' de ' || $adr__;
response[ 'Total entrades en ' || $geto ] = $nou_total_entrades;
}
if ( $sentit == 'sortida') {
response[ $ref_sortida ] =
$qt_sortida || ' ' || $geto || ' a ' || $rebedora;
response[ 'Total sortides en ' || $geto ] = $nou_total_sortides;
}
}
}"
}
]
}
]
- MCI: 2310545
- Not bounced
- Response unit:
- Response: {
"responseVars": {
"entrada_Testets_39": "30 Testets de FZBT6KSUFZHRQNZCYABDRZAMVIY6FUJP",
"Total entrades en Testets": 197018
}
}
- MCI: 2310545
- Not bounced
- Response: {
"info": "no messages after filtering"
}
- MCI: 2310143
- Not bounced
- Response unit:
- Response: {
"responseVars": {
"sortida_11": "110 Testets a FZBT6KSUFZHRQNZCYABDRZAMVIY6FUJP",
"Total sortides en Testets": -10535
}
}
- MCI: 2310143
- Not bounced
- Response: {
"info": "no messages after filtering"
}
- MCI: 2309955
- Not bounced
- Response: {
"info": "no messages after filtering"
}
- MCI: 2309955
- Not bounced
- Response unit:
- Response: {
"responseVars": {
"sortida_10": "100 Testets a FZBT6KSUFZHRQNZCYABDRZAMVIY6FUJP",
"Total sortides en Testets": -10425
}
}
- MCI: 2309909
- Not bounced
- Response: {
"info": "no messages after filtering"
}
- MCI: 2309909
- Not bounced
- Response unit:
- Response: {
"responseVars": {
"entrada_Testets_38": "30 Testets de FZBT6KSUFZHRQNZCYABDRZAMVIY6FUJP",
"Total entrades en Testets": 196988
}
}
- MCI: 2309884
- Not bounced
- Response unit:
- Response: {
"responseVars": {
"sortida_9": "125 Testets a JUSMFQHMBASVPCZTZW5ULYOWVK3DHJMK",
"Total sortides en Testets": -10325
}
}
- MCI: 2309864
- Not bounced
- Response: {
"info": "no messages after filtering"
}
Show transactions in assets:
No transactions found, it may be worth changing the filter
Unit ID
Date
From
Direction
To
Amount
13.09.2021 13:34:40
MSQA2ECW7VRKRHWNPFZI5T33NZIBSS6M
out
13.09.2021 13:34:40
in
MSQA2ECW7VRKRHWNPFZI5T33NZIBSS6M
13.09.2021 13:34:40
in
MSQA2ECW7VRKRHWNPFZI5T33NZIBSS6M
13.09.2021 11:30:13
MSQA2ECW7VRKRHWNPFZI5T33NZIBSS6M
out
13.09.2021 11:30:13
MSQA2ECW7VRKRHWNPFZI5T33NZIBSS6M
out
13.09.2021 11:30:13
in
MSQA2ECW7VRKRHWNPFZI5T33NZIBSS6M