HH7N5BQL44ZUP22WNTZCRWL4JEWKPRNU
[
"autonomous agent",
{
"init": "{
$_Registre = '6UDN6TJX7AM3CTT6RSBVWW6K57WAKX4U';
$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' );
if ( $_Portal != trigger.address
AND $__dada( '_Accions' ) != trigger.address
AND $__dada( '_Emissions' ) != trigger.address
AND $__dada( '_Getons' ) != trigger.address )
bounce( 'Accés interdit' );
$sentit = $args.sentit;
$geto = $args.geto;
$total_entrades = $__dada( 'total_entrades_' || $geto ) otherwise 0;
$total_sortides = $__dada( 'total_sortides_' || $geto ) otherwise 0;
$es_provisio = $_Portal == trigger.address;
$idgeto = $__dada( $geto || '_id' ) otherwise '';
$id_estels = $__dada( 'Estels' );
if ( ! $es_provisio ) {
$estat_geto = $__dada( $geto || '_estat' ) otherwise '';
if( $estat_geto != 'operatiu' ) bounce( 'Getó no operatiu' );
$registre = {};
$dades = {};
if ( $sentit == 'entrada' ) {
$qt_entrada = 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' ] = $args.rebedora;
$dades[ 'total_sortides_' || $geto ] = $nou_total_sortides;
$dades[ 'ordinal_sortida_' || $geto ] = $ord_sortida;
}
$registre.dades = $dades;
$registre.geto = $geto;
}
}",
"messages": [
{
"if": "{ ! $es_provisio }",
"app": "data",
"payload": "{ $registre }"
},
{
"if": "{ ! $es_provisio }",
"app": "payment",
"payload": {
"asset": "base",
"outputs": [
{
"address": "{ $_Registre }",
"amount": "{ $__dada( 'Provisio' ) }"
}
]
}
},
{
"if": "{ ! $es_provisio AND $sentit == 'sortida' }",
"app": "payment",
"payload": {
"asset": "{ $idgeto }",
"outputs": [
{
"address": "{ $rebedora }",
"amount": "{ $qt_sortida }"
}
]
}
},
{
"app": "state",
"state": "{
if ( ! $es_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: 2961407
- Not bounced
- Response unit:
- Response: {
"responseVars": {
"sortida_6": "20 Geto_A a RTCLYRF52I3ZEESWXGKZAK2DA43MRTQ4",
"Total sortides en Geto_A": -1220
}
}
- MCI: 2961407
- Not bounced
- Response: {
"info": "no messages after filtering"
}
- MCI: 2960194
- Not bounced
- Response unit:
- Response: {
"responseVars": {
"entrada_Geto_A_13": "1 Geto_A de RTCLYRF52I3ZEESWXGKZAK2DA43MRTQ4",
"Total entrades en Geto_A": 1000491
}
}
- MCI: 2960194
- Not bounced
- Response: {
"info": "no messages after filtering"
}
- MCI: 2960164
- Not bounced
- Response unit:
- Response: {
"responseVars": {
"entrada_Geto_A_12": "20 Geto_A de QL4OWDKDPFTNHHIMV6WHN4TCDVJOORWU",
"Total entrades en Geto_A": 1000490
}
}
- MCI: 2960164
- Not bounced
- Response: {
"info": "no messages after filtering"
}
- MCI: 2960108
- Not bounced
- Response: {
"info": "no messages after filtering"
}
- MCI: 2959996
- Not bounced
- Response: {
"info": "no messages after filtering"
}
- MCI: 2959880
- Not bounced
- Response unit:
- Response: {
"responseVars": {
"entrada_Geto_A_11": "20 Geto_A de QL4OWDKDPFTNHHIMV6WHN4TCDVJOORWU",
"Total entrades en Geto_A": 1000470
}
}
- MCI: 2959880
- 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
09.02.2023 18:15:24
HH7N5BQL44ZUP22WNTZCRWL4JEWKPRNU
out
09.02.2023 18:15:24
HH7N5BQL44ZUP22WNTZCRWL4JEWKPRNU
out
09.02.2023 18:15:24
in
HH7N5BQL44ZUP22WNTZCRWL4JEWKPRNU
09.02.2023 18:15:24
in
HH7N5BQL44ZUP22WNTZCRWL4JEWKPRNU
09.02.2023 12:48:31
HH7N5BQL44ZUP22WNTZCRWL4JEWKPRNU
out
09.02.2023 12:48:31
in
HH7N5BQL44ZUP22WNTZCRWL4JEWKPRNU