WYA62OCUJSY2ST5YTCLL67LETXXMRU2X
[
"autonomous agent",
{
"messages": {
"cases": [
{
"if": "{
$base_key = 'balance_'||trigger.address;
$secret_key = 'secret_'||trigger.address;
$secret = trigger.data.secret;
$total = var[$base_key]+trigger.output[[asset=base]]-600;
$secret AND var[$secret_key] AND sha256($secret) == var[$secret_key]
}",
"messages": [
{
"app": "payment",
"payload": {
"asset": "base",
"outputs": [
{
"address": "{trigger.address}",
"amount": "{$total}"
}
]
}
},
{
"app": "state",
"state": "{
var[$base_key] = 0;
var[$secret_key] = false;
response['message'] = 'withdrawn:' || $total|| ' bytes';
}"
}
]
},
{
"if": "{trigger.data.set_secret}",
"messages": [
{
"app": "state",
"state": "{
$base_key = 'balance_'||trigger.address;
$secret_key = 'secret_'||trigger.address;
var[$secret_key]=trigger.data.set_secret;
if(!var[$base_key])
var[$base_key] = 0;
var[$base_key] = var[$base_key] + trigger.output[[asset=base]];
response['sec'] = 'secret setted ok';
response['message'] = 'accepted:' || trigger.output[[asset=base]] || ' bytes' ;
}"
}
]
},
{
"messages": [
{
"app": "state",
"state": "{
$base_key = 'balance_'||trigger.address;
if(!var[$base_key])
var[$base_key] = 0;
var[$base_key] = var[$base_key] + trigger.output[[asset=base]];
response['message'] = 'accepted:' || trigger.output[[asset=base]] || ' bytes' ;
}"
}
]
}
]
}
}
]
- MCI: 970999
- Not bounced
- Response unit:
- Response: {
"responseVars": {
"message": "withdrawn:303409 bytes"
}
}
- MCI: 970974
- Bounced
- Response: {
"error": "not enough funds for 304071 bytes"
}
- MCI: 970945
- Not bounced
- Response: {
"responseVars": {
"sec": "secret setted ok",
"message": "accepted:10000 bytes"
},
"error": "no messages after filtering"
}
- MCI: 970916
- Not bounced
- Response: {
"responseVars": {
"sec": "secret setted ok",
"message": "accepted:10000 bytes"
},
"error": "no messages after filtering"
}
- MCI: 970906
- Not bounced
- Response: {
"responseVars": {
"sec": "secret setted ok",
"message": "accepted:10000 bytes"
},
"error": "no messages after filtering"
}
- MCI: 970879
- Not bounced
- Response: {
"responseVars": {
"message": "accepted:264009 bytes"
},
"error": "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
28.07.2019 03:40:00
WYA62OCUJSY2ST5YTCLL67LETXXMRU2X
out
28.07.2019 03:40:00
in
WYA62OCUJSY2ST5YTCLL67LETXXMRU2X
28.07.2019 03:33:23
in
WYA62OCUJSY2ST5YTCLL67LETXXMRU2X
28.07.2019 03:24:37
in
WYA62OCUJSY2ST5YTCLL67LETXXMRU2X
28.07.2019 03:12:51
in
WYA62OCUJSY2ST5YTCLL67LETXXMRU2X