UX3WYQA5YEFVMGH5YUAZ642B7CVLC36C
[
"autonomous agent",
{
"init": "{
$nom_AA = 'FOP';
$versio = '0.01';
//$_Registre = '5WVBJQHTEP54AEYUJGTQKWTXTXZSJQWA';
$_Registre = trigger.data._Registre; // * només x tests
$adr__ = trigger.initial_address;
$args = trigger.data;
$unitat_entrant = trigger.output[[ asset != base ]].asset;
// Retorna una dada 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 )
bounce( 'Accés interdit' );
$ref_asset =
$unitat_entrant == 'none' ?
'base' :
$unitat_entrant;
$unitat =
$unitat_entrant == 'none' ?
'Bytes' :
$unitat_entrant == $__dada( 'Estels' ) ?
'Estels' :
$__dada( 'geto_' || $unitat_entrant );
$sentit = $args.sentit;
$ord_moviment = $__dada( 'ordinal_' || $sentit ) + 1;
$ref_moviment = $sentit || '_' || $ord_moviment;
$unitat_entrada = $unitat;
$unitat_sortida = $args.unitat;
$total_entrades = $__dada( 'total_entrades_' || $unitat_entrada );
$total_sortides = $__dada( 'total_sortides_' || $unitat_sortida );
$registre = {};
$dades = {};
$dades[ $ref_moviment || '_data' ] = timestamp;
if ( $sentit == 'entrada' ) {
$qt = trigger.output[[ asset = $ref_asset ]];
$unitat_moviment = $unitat_entrada;
$nou_total_entrades = $total_entrades + $qt;
$dades[ $ref_moviment || '_emissora' ] = $adr__;
$dades[ 'total_entrades_' || $unitat_entrada ] = $nou_total_entrades;
}
if ( $sentit == 'sortida' ) {
$qt = $args.qt;
$rebedora = $args.rebedora;
$unitat_moviment = $unitat_sortida;
$nou_total_sortides = $total_sortides + $qt;
$dades[ $ref_moviment || '_actuant' ] = $adr__;
$dades[ $ref_moviment || '_rebedora' ] = $rebedora;
$dades[ 'total_sortides_' || $unitat_sortida ] = $nou_total_sortides;
}
$dades[ $ref_moviment || '_qt' ] = $qt;
$dades[ $ref_moviment || '_unitat' ] = $unitat_moviment;
$dades[ 'ordinal_' || $sentit ] = $ord_moviment;
$registre.dades = $dades;
}",
"messages": [
{
"if": "{ $sentit == 'sortida' }",
"app": "payment",
"payload": {
"asset": "{ $unitat_sortida }",
"outputs": [
{
"address": "{ $rebedora }",
"amount": "{ $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[ 'Qt' ] = $qt;
response[ 'Unitat' ] = $unitat_moviment;
if ( $sentit == 'entrada' )
response[ 'Emissora' ] = $adr__;
if ( $sentit == 'sortida' )
response[ 'Rebedora' ] = $rebedora;
response[ 'Total entrades en ' || $unitat_moviment ] =
$nou_total_entrades otherwise $total_entrades;
response[ 'Total sortides en ' || $unitat_moviment ] =
$nou_total_sortides otherwise $total_sortides;
response[ 'Romanent en ' || $unitat_moviment ] =
balance[ this_address ][ $ref_asset ];
}"
}
]
}
]
- MCI: 2069903
- Not bounced
- Response unit:
- Response: {
"responseVars": {
"Ref moviment": "entrada_11",
"Qt": 80,
"Unitat": "Estels",
"Emissora": "7ZUUJPR5UPEFPT6RBLIRCTZPELSRDBHF",
"Total entrades en Estels": 320,
"Total sortides en Estels": 0,
"Romanent en Estels": 320
}
}
- MCI: 2069832
- Not bounced
- Response unit:
- Response: {
"responseVars": {
"Ref moviment": "entrada_10",
"Qt": 20,
"Unitat": "Estels",
"Emissora": "FZBT6KSUFZHRQNZCYABDRZAMVIY6FUJP",
"Total entrades en Estels": 240,
"Total sortides en Estels": 0,
"Romanent en Estels": 240
}
}
- MCI: 2069453
- Not bounced
- Response unit:
- Response: {
"responseVars": {
"Ref moviment": "entrada_9",
"Qt": 20,
"Unitat": "Estels",
"Emissora": "7ZUUJPR5UPEFPT6RBLIRCTZPELSRDBHF",
"Total entrades en Estels": 220,
"Total sortides en Estels": 0,
"Romanent en Estels": 220
}
}
- MCI: 2068995
- Not bounced
- Response unit:
- Response: {
"responseVars": {
"Ref moviment": "entrada_8",
"Qt": 200,
"Unitat": "Estels",
"Emissora": "XD7FVUM442NPIIMLRIT2FYWJEDQ4ILLJ",
"Total entrades en Estels": 200,
"Total sortides en Estels": 0,
"Romanent en Estels": 200
}
}
- MCI: 2068960
- Not bounced
- Response unit:
- Response: {
"responseVars": {
"Ref moviment": "entrada_7",
"Qt": 20000,
"Unitat": "Bytes",
"Emissora": "XD7FVUM442NPIIMLRIT2FYWJEDQ4ILLJ",
"Total entrades en Bytes": 60000,
"Total sortides en Bytes": 0,
"Romanent en Bytes": 37078
}
}
- MCI: 2066029
- Not bounced
- Response unit:
- Response: {
"responseVars": {
"Ref moviment": "entrada_6",
"Qt": 20000,
"Unitat": "Bytes",
"Emissora": "XD7FVUM442NPIIMLRIT2FYWJEDQ4ILLJ",
"Total entrades en Bytes": 40000,
"Total sortides en Bytes": 0,
"Romanent en Bytes": 20000
}
}
Show transactions in assets:
No transactions found, it may be worth changing the filter
Unit ID
Date
From
Direction
To
Amount
11.07.2021 17:40:11
UX3WYQA5YEFVMGH5YUAZ642B7CVLC36C
out
11.07.2021 17:40:11
in
UX3WYQA5YEFVMGH5YUAZ642B7CVLC36C
11.07.2021 17:18:05
UX3WYQA5YEFVMGH5YUAZ642B7CVLC36C
out
11.07.2021 17:18:05
in
UX3WYQA5YEFVMGH5YUAZ642B7CVLC36C
11.07.2021 12:28:41
UX3WYQA5YEFVMGH5YUAZ642B7CVLC36C
out