IG6BSHVRYDECX5B6HGCH5A6EYUQ25ERP
[
"autonomous agent",
{
"bounce_fees": {
"base": 10000
},
"init": "{\r
\r
$nom_AA = 'Subscripcions';\r
$versio = '3';\r
\r
$AA_PF = trigger.data.AA_PF;\r
$adr__ = trigger.initial_address;\r
$args = trigger.data;\r
$qt = trigger.output[[asset=base]] - 10000; //bounce-fees \r
\r
$unitat = var[ $AA_PF ][ 'unitat' ];\r
$AA_Transfers = var[ $AA_PF ][ '_AA_Transfers' ];\r
$adr_FOP = var[ $AA_PF ][ '_FOP' ];\r
$import_subscripcio = var[ $AA_PF ][ 'Import_Subscripcio' ];\r
\r
// Comprova q adr no subscrita\r
$adr__subscrita = var[ 'subscripcio_' || $adr__ ];\r
if ( $adr__subscrita ) { bounce ( $nom_AA || ': Adreça ja subscrita' ); }\r
\r
// Comprova q la qt és superior a l'import de subscripció\r
if ( $import_subscripcio > $qt ) \r
{ bounce ( $nom_AA || ": L'import de la subscripció és de " || $import_subscripcio ); }\r
\r
}",
"messages": [
{
"app": "data",
"payload": {
"AA_PF": "{ $AA_PF }",
"emissora": "{ $adr__ }",
"receptora": "{ $adr_FOP }",
"accio": "{ $nom_AA }"
}
},
{
"app": "payment",
"payload": {
"asset": "{ $unitat }",
"outputs": [
{
"address": "{ $AA_Transfers }",
"amount": "{ $qt }"
}
]
}
},
{
"app": "state",
"state": "{\r
if ( ! var[ 'ordinal' ]) { $ordinal = 1; } \r
else { $ordinal = var[ 'ordinal' ] + 1; }\r
var[ 'ordinal' ] = $ordinal; \r
\r
var[ 'subscripcio_' || $adr__ ] = \r
{ \r
nom: $args.nom, \r
aFOP: $args.aFOP,\r
cicle: var[ $AA_Transfers ][ 'cicle_actual'],\r
ordinal: $ordinal,\r
};\r
\r
response[ 'Resultat: ' ] = "Subscripció #" || $ordinal || " amb nom: " || $args.nom || " de l'adr " || $adr__; \r
}"
}
]
}
]
- MCI: 1711875
- Not bounced
- Response unit:
- Response: {
"responseVars": {
"Resultat: ": "Subscripció #1 amb nom: Deri de l'adr GIIYFJXPZW3KH5MPQKRLZTWO4LIXX25R"
}
}
Show transactions in assets:
No transactions found, it may be worth changing the filter
Unit ID
Date
From
Direction
To
Amount
01.11.2020 18:46:00
IG6BSHVRYDECX5B6HGCH5A6EYUQ25ERP
out
01.11.2020 18:46:00
in
IG6BSHVRYDECX5B6HGCH5A6EYUQ25ERP