CQS7JN2YS52K5GND6XARRFIMXKH6VGTV
[
"autonomous agent",
{
"init": "{
$nom_AA = 'Portal';
$versio = '0.5';
$AUT_0 = 'C4KIJSUWVM7BGWTLXKX3K4PNRXV7OY4W';
$adr__ = trigger.address;
$args = trigger.data;
$__bota = $txt => bounce ( $nom_AA || ' >>> ' || $txt );
$__autoritzada = ( $x ) => {
$aut = var[ '_AUT_' || $x ];
$aut AND $aut == $adr__
};
if ( ! $args ) { $__bota( ': Cal proporcionar-ne els arguments' ); }
if ( !! $args.ref ) {
if ( ! $args.val )
{ $__bota( ': Cal proporcionar el valor de "val"' ); }
if ( $adr__ != $AUT_0
AND ! $__autoritzada( 'A' )
AND ! $__autoritzada( 'B' )
AND ! $__autoritzada( 'C' )
) { $__bota( 'No autoritzada' ); }
}
// Si existeix una var d'estat amb un valor diferent, es tracta com a proposta
// Es tracta com a confirmació si ja ha estat desada abans com a proposta
// per un AUT diferent a l'actuant i ha transcorregut el lapse de temps establert
if ( !! $args.ref ) {
if ( !! var[ $args.ref ] AND var[ $args.ref ] != $args.val AND $adr__ != $AUT_0 ) {
$proposta = var[ 'proposta_' || $args.ref ];
if ( !! $proposta AND $proposta.val == $args.val ) {
if ( $proposta.proposant == $adr__ )
{ $__bota( 'Ja hi consta la teva proposta' ); }
if ( timestamp - $proposta.temps > var[ 'lapse_confirmacio' ] )
{ $__bota( 'Encara no es pot confirmar la proposta' ); }
$acc = 'confirmacio';
} else { $acc = 'modificacio'; }
} else { $acc = 'inicialitzacio'; }
} else { $acc = 'acces'; }
$args._Operatius = var[ '_Operatius' ];
$args._Getons = var[ '_Getons' ];
$args._FRO = var[ '_FRO' ];
$args._FOP = var[ '_FOP' ];
$args._FDIP = var[ '_FDIP' ];
$args.id_Estels = var[ 'id_Estels' ];
$args.interval_Cicles = var[ 'interval_Cicles' ];
$args.geto = trigger.output[[ asset != base ]].asset;
$args.qt = trigger.output[[ asset = $args.geto ]];
}",
"messages": [
{
"app": "data",
"payload": "{ $args }"
},
{
"if": "{ $acc == 'acces' }",
"app": "payment",
"payload": {
"asset": "{ $args.geto }",
"outputs": [
{
"address": "{ var[ '_AA_Acces' ] }",
"amount": "{ $args.qt }"
}
]
}
},
{
"if": "{ $acc != 'acces' }",
"app": "state",
"state": "{
if ( $acc == 'inicialitzacio' OR $acc == 'confirmacio' ) {
var[ $args.ref ] = $args.val;
response[ 'ref' ] = $args.ref;
response[ 'val' ] = $args.val;
}
if ( $acc == 'modificacio' ) {
var[ 'proposta_' || $args.ref ] =
{
val: $args.val,
proposant: $adr__,
temps: timestamp,
};
response[ 'proposta ref' ] = $args.ref;
response[ 'proposta val' ] = $args.val;
response[ 'data mínima per a la confirmació'] =
timestamp_to_string( timestamp + var[ 'lapse_confirmacio' ] , 'datetime' );
}
response[ 'acc' ] = $acc;
}"
}
]
}
]
- MCI: 1769223
- Not bounced
- Response unit:
- Response: {
"responseVars": {
"ref": "_FDIP",
"val": "5ZDQQ5ADCG7ETR74VSHJEAGIERBHE3K4",
"acc": "inicialitzacio"
}
}
- MCI: 1769220
- Not bounced
- Response unit:
- Response: {
"responseVars": {
"ref": "_FOP",
"val": "BXYGHGW5K62P32UHHBNVFN4NPOJZAPNY",
"acc": "inicialitzacio"
}
}
- MCI: 1769207
- Not bounced
- Response unit:
- Response: {
"responseVars": {
"ref": "_FRO",
"val": "K5XXDVOHMEW45LSGTXGU5DK3VG75ZSHV",
"acc": "inicialitzacio"
}
}
- MCI: 1769200
- Not bounced
- Response unit:
- Response: {
"responseVars": {
"ref": "lapse_confirmacio",
"val": 500,
"acc": "inicialitzacio"
}
}
- MCI: 1769156
- Not bounced
- Response unit:
- Response: {
"responseVars": {
"ref": "id_Estels",
"val": "yfIMR3MMcTWchE7BaPFoohOpbe8H71vNrIRESmPPzCw=",
"acc": "inicialitzacio"
}
}
- MCI: 1769135
- Not bounced
- Response unit:
- Response: {
"responseVars": {
"ref": "Interval_Cicles",
"val": 1000,
"acc": "inicialitzacio"
}
}
Show transactions in assets:
No transactions found, it may be worth changing the filter
Unit ID
Date
From
Direction
To
Amount
26.11.2020 09:57:26
CQS7JN2YS52K5GND6XARRFIMXKH6VGTV
out
CQS7JN2YS52K5GND6XARRFIMXKH6VGTV
26.11.2020 09:57:26
in
CQS7JN2YS52K5GND6XARRFIMXKH6VGTV
26.11.2020 09:57:26
in
CQS7JN2YS52K5GND6XARRFIMXKH6VGTV
26.11.2020 09:56:52
CQS7JN2YS52K5GND6XARRFIMXKH6VGTV
out
CQS7JN2YS52K5GND6XARRFIMXKH6VGTV
26.11.2020 09:56:52
in
CQS7JN2YS52K5GND6XARRFIMXKH6VGTV
26.11.2020 09:56:52
in
CQS7JN2YS52K5GND6XARRFIMXKH6VGTV
26.11.2020 09:52:14
CQS7JN2YS52K5GND6XARRFIMXKH6VGTV
out
CQS7JN2YS52K5GND6XARRFIMXKH6VGTV