5VPXTFPZUH4TSHWHW7F62L4CA4I5ZWBV
[
"autonomous agent",
{
"doc_url": "https://oswap-frontend.herokuapp.com/oscript/factory.json",
"init": "{
$exchange_template = 'DCPKU52INWLB65YMRCBWKCGPMTVZK3AZ';
}",
"messages": {
"cases": [
{
"if": "{trigger.data.createExchange AND trigger.data.asset}",
"init": "{
$asset = trigger.data.asset;
if (
!asset[$asset].exists
OR asset[$asset].is_private
OR !asset[$asset].is_transferrable
OR asset[$asset].fixed_denominations
)
bounce("INVALID_ASSET");
if (var['asset_to_exchange.' || $asset])
bounce("DUPLICATE_EXCHANGE");
}",
"messages": [
{
"app": "definition",
"payload": {
"definition": [
"autonomous agent",
{
"base_aa": "{$exchange_template}",
"params": {
"asset": "{$asset}"
}
}
]
}
},
{
"app": "state",
"state": "{
$exchange = unit[response_unit].messages[[.app='definition']].payload.address;
$asset_id = var['asset_count'] + 1;
var['asset_to_exchange.' || $asset] = $exchange;
var['exchange_to_asset.' || $exchange] = $asset;
var['asset_count'] = $asset_id;
var['id_to_asset.' || $asset_id] = $asset;
response['asset'] = $asset;
response['exchange'] = $exchange;
}"
}
]
}
]
}
}
]
- MCI: 1252260
- Not bounced
- Response unit:
- Response: {
"responseVars": {
"asset": "WhsD5Y/1NeKROgQojGwfe9EBC7NH4KnAk4CorCrVRhs=",
"exchange": "5VXMJMJ3DT2AVGWXUBA2N7LUBLGXDNIT"
}
}
Show transactions in assets:
No transactions found, it may be worth changing the filter
Unit ID
Date
From
Direction
To
Amount
28.02.2020 09:17:57
5VPXTFPZUH4TSHWHW7F62L4CA4I5ZWBV
out
5VPXTFPZUH4TSHWHW7F62L4CA4I5ZWBV
28.02.2020 09:17:57
in
5VPXTFPZUH4TSHWHW7F62L4CA4I5ZWBV