FIXGTJQJOEJPNF36IIAFTV4YIM2IYGQ5
[
"autonomous agent",
{
"init": "{
$nom_AA = 'FOP';
$versio = '0.01';
//$_Registre = '5WVBJQHTEP54AEYUJGTQKWTXTXZSJQWA';
$_Registre = trigger.data._Registre; // * només x tests
// Retorna una dada del Registre
$__dada = $refdada =>
data_feed[[ oracles = $_Registre, feed_name = $refdada, ifnone = 0 ]];
$adr__ = trigger.address;
$args = trigger.data;
$proces = $args.proces;
// $_Portal = $__dada( '_Portal' );
$_Portal = trigger.address; // * només x tests
if ( $_Portal != trigger.address
AND $__dada( '_Accions' ) != trigger.address )
bounce( 'Accés interdit' );
$qt = $args.qt;
$unitat = $args.unitat == 'bytes' ? 'base' : $__dada( 'Estels' );
$emissora = $args.emissora;
$rebedora = $args.rebedora;
$sentit = $args.sentit;
$ord_moviment = $__dada( 'ordinal_' || $sentit ) + 1;
$ref_moviment = $sentit || '_' || $ord_moviment;
$total_entrades = $__dada( 'total_entrades' );
$total_sortides = $__dada( 'total_sortides' );
$registre = {};
$dades = {};
$dades[ $ref_moviment || '_data' ] = timestamp;
$dades[ $ref_moviment || '_qt' ] = $qt;
$dades[ $ref_moviment || '_unitat' ] = $unitat;
if ( $sentit == 'entrada' ) {
$nou_total_entrades = $total_entrades + $qt;
$dades[ $ref_moviment || '_emissora' ] = $emissora;
$dades[ 'total_entrades' ] = $nou_total_entrades;
}
if ( $sentit == 'sortida' ) {
$nou_total_sortides = $total_sortides + $qt;
$dades[ $ref_moviment || '_rebedora' ] = $rebedora;
$dades[ 'total_sortides' ] = $nou_total_sortides;
}
$dades[ 'ordinal_' || $sentit ] = $ord_moviment;
$registre.dades = $dades;
}",
"messages": [
{
"if": "{ $sentit == 'sortida' }",
"app": "payment",
"payload": {
"asset": "{ $unitat }",
"outputs": [
{
"address": "{ $rebedora }",
"amount": "{ $args.qt }"
}
]
}
},
{
"app": "data",
"payload": "{ $registre }"
},
{
"app": "payment",
"payload": {
"asset": "base",
"outputs": [
{
"address": "{ $_Registre }",
"amount": "{ $__dada( 'Provisio' ) }"
}
]
}
},
{
"app": "state",
"state": "{
response[ 'Ref moviment' ] = $ref_moviment;
response[ 'Unitat' ] = $unitat;
response[ 'Qt' ] = $qt;
response[ 'Total entrades' ] = $nou_total_entrades otherwise $total_entrades;
response[ 'Total sortides' ] = $nou_total_sortides otherwise $total_sortides;
if ( $sentit == 'entrada' ) response[ 'Emissora' ] = $emissora;
if ( $sentit == 'sortida' ) response[ 'Rebedora' ] = $rebedora;
}"
}
]
}
]
- MCI: 2057807
- Not bounced
- Response unit:
- Response: {
"responseVars": {
"Ref moviment": "sortida_1",
"Unitat": "XXPIjIRs9k3CBoTyiod2NdCGMK6YmryF+w9SR63yUGw=",
"Qt": 12,
"Total entrades": 200,
"Total sortides": 12,
"Rebedora": "4D7ENYYVGOUVP2SPJHSA6MXE7VLBPURJ"
}
}
- MCI: 2057761
- Not bounced
- Response unit:
- Response: {
"responseVars": {
"Ref moviment": "entrada_1",
"Unitat": "XXPIjIRs9k3CBoTyiod2NdCGMK6YmryF+w9SR63yUGw=",
"Qt": 200,
"Total entrades": 200,
"Total sortides": 0,
"Emissora": "XD7FVUM442NPIIMLRIT2FYWJEDQ4ILLJ"
}
}
Show transactions in assets:
No transactions found, it may be worth changing the filter
Unit ID
Date
From
Direction
To
Amount
07.07.2021 18:03:18
FIXGTJQJOEJPNF36IIAFTV4YIM2IYGQ5
out
07.07.2021 18:03:18
FIXGTJQJOEJPNF36IIAFTV4YIM2IYGQ5
out
07.07.2021 18:03:18
in
FIXGTJQJOEJPNF36IIAFTV4YIM2IYGQ5
07.07.2021 17:47:03
FIXGTJQJOEJPNF36IIAFTV4YIM2IYGQ5
out
07.07.2021 17:47:03
in
FIXGTJQJOEJPNF36IIAFTV4YIM2IYGQ5
07.07.2021 17:47:03
in
FIXGTJQJOEJPNF36IIAFTV4YIM2IYGQ5