| 1 | [ |
| 2 | "autonomous agent", |
| 3 | { |
| 4 | "messages": [ |
| 5 | { |
| 6 | "init": "{ |
| 7 | $origin = definition[trigger.address][1].base_aa otherwise trigger.address; |
| 8 | $asset = trigger.unit; |
| 9 | $asset_symbol = trigger.data.asset_symbol; |
| 10 | $oracle = trigger.data.oracle; |
| 11 | if (!$oracle) |
| 12 | bounce("no oracle in data"); |
| 13 | if (!$asset_symbol) |
| 14 | bounce("no asset symbol"); |
| 15 | if(contains($asset_symbol,"|")) |
| 16 | bounce("symbol cannot contain '|'"); |
| 17 | }", |
| 18 | "app": "state", |
| 19 | "state": "{ |
| 20 | var['s2a_' || $asset_symbol || '|' || $origin || '|' || $oracle] = $asset; |
| 21 | var['a2s_' || $asset || '|' || $origin || '|' || $oracle] = $asset_symbol; |
| 22 | }" |
| 23 | } |
| 24 | ] |
| 25 | } |
| 26 | ] |