ZN62SKSAZMZAZE2GCXG54C72GOP5FT4U
[
"autonomous agent",
{
"doc_url": "https://oswap-frontend.herokuapp.com/factory.json",
"init": "{
$base = 'BFAD7DHH63RBMKX32H7DINGXFOCZHE5K';
$assetA = trigger.data.assetA;
$assetB = trigger.data.assetB;
}",
"messages": {
"cases": [
{
"if": "{trigger.data.create AND $assetA AND $assetB AND trigger.output[[asset=base]] == 1e4}",
"init": "{
$order = number_from_seed($assetA) > number_from_seed($assetB);
$asset0 = $order ? $assetA : $assetB;
$asset1 = $order ? $assetB : $assetA;
if (var['all_pairs.' || $asset0 || '_' || $asset1]) bounce('pair exists');
if ($asset0 == $asset1) bounce('identical asset');
if (
!asset[$asset0].exists
OR asset[$asset0].is_private
OR !asset[$asset0].is_transferrable
OR asset[$asset0].fixed_denominations
OR !asset[$asset1].exists
OR asset[$asset1].is_private
OR !asset[$asset1].is_transferrable
OR asset[$asset1].fixed_denominations
)
bounce('invalid asset');
}",
"messages": [
{
"app": "definition",
"payload": {
"definition": [
"autonomous agent",
{
"base_aa": "{$base}",
"params": {
"factory": "{this_address}",
"asset0": "{$asset0}",
"asset1": "{$asset1}"
}
}
]
}
},
{
"app": "state",
"state": "{
$address = unit[response_unit].messages[[.app='definition']].payload.address;
var['all_pairs.' || $asset0 || '_' || $asset1] = $address;
var['all_pairs.' || $asset1 || '_' || $asset0] = $address;
var['get_pair.' || $address] = $asset0 || '_' || $asset1;
var['pair_count'] += 1;
response['type'] = 'create';
}"
}
]
},
{
"if": "{trigger.data.finalize AND var['get_pair.' || trigger.address]}",
"messages": [
{
"app": "state",
"state": "{
var['assets.' || trigger.address] = trigger.unit;
response['type'] = 'finalize';
}"
}
]
}
]
}
}
]
- MCI: 1298622
- Not bounced
- Response: {
"responseVars": {
"type": "finalize"
},
"info": "no messages after filtering"
}
- MCI: 1298621
- Not bounced
- Response: {
"responseVars": {
"type": "finalize"
},
"info": "no messages after filtering"
}
- MCI: 1298620
- Not bounced
- Response: {
"responseVars": {
"type": "finalize"
},
"info": "no messages after filtering"
}
- MCI: 1298557
- Not bounced
- Response unit:
- Response: {
"responseVars": {
"type": "create"
}
}
- MCI: 1298555
- Not bounced
- Response unit:
- Response: {
"responseVars": {
"type": "create"
}
}
- MCI: 1298554
- Not bounced
- Response unit:
- Response: {
"responseVars": {
"type": "create"
}
}
Show transactions in assets:
No transactions found, it may be worth changing the filter
Unit ID
Date
From
Direction
To
Amount
11.04.2020 14:33:49
in
ZN62SKSAZMZAZE2GCXG54C72GOP5FT4U
11.04.2020 14:33:33
in
ZN62SKSAZMZAZE2GCXG54C72GOP5FT4U
11.04.2020 14:33:07
in
ZN62SKSAZMZAZE2GCXG54C72GOP5FT4U
11.04.2020 13:39:30
ZN62SKSAZMZAZE2GCXG54C72GOP5FT4U
out
ZN62SKSAZMZAZE2GCXG54C72GOP5FT4U
11.04.2020 13:38:39
ZN62SKSAZMZAZE2GCXG54C72GOP5FT4U
out
ZN62SKSAZMZAZE2GCXG54C72GOP5FT4U