[
"autonomous agent",
{
"bounce_fees": {
"base": 10000
},
"init": "{
$how_to = "All data fields must be filled, I need: 'amount', 'destination_address' and 'hash_of_secret' and optionally 'owner', 'asset_id', 'duration_in_hours' and 'optional_base_AA'.";
$base_AA = trigger.data.optional_base_AA otherwise "
JH3LOA27OOP443BAGJYBHONKCK6NPLAB";
$owner = trigger.data.owner otherwise trigger.address;
$amount = trigger.data.amount;
$asset = trigger.data.asset_id otherwise "base";
$destination = trigger.data.destination_address;
$duration = trigger.data.duration_in_hours otherwise 1;
$hash = trigger.data.hash_of_secret;
}",
"messages": {
"cases": [
{
"if": "{ !!$amount and !!$destination and !!$hash }",
"messages": [
{
"app": "definition",
"payload": {
"definition": [
"autonomous agent",
{
"base_aa": "{$base_AA}",
"params": {
"asset_id": "{$asset}",
"amount": "{$amount}",
"destination_address": "{$destination}",
"duration_in_hours": "{$duration}",
"hash_of_secret": "{$hash}",
"owner": "{$owner}"
}
}
]
}
},
{
"app": "state",
"state": "{
response['message'] = "A lock box as been created for '"||$destination||"'by the following unit: "||response_unit;
}"
}
]
},
{
"messages": [
{
"app": "state",
"state": "{bounce($how_to);}"
}
]
}
]
}
}
]