| 1 | [ |
| 2 | "autonomous agent", |
| 3 | { |
| 4 | "bounce_fees": { |
| 5 | "base": 10000 |
| 6 | }, |
| 7 | "messages": [ |
| 8 | { |
| 9 | "app": "payment", |
| 10 | "payload": { |
| 11 | "asset": "base", |
| 12 | "outputs": [ |
| 13 | { |
| 14 | "address": "{trigger.address}", |
| 15 | "amount": "{trigger.output[[asset=base]] - 1000}" |
| 16 | } |
| 17 | ] |
| 18 | } |
| 19 | }, |
| 20 | { |
| 21 | "app": "state", |
| 22 | "state": "{ |
| 23 | $hash_and_percentage = "hash="||"123"||" %="||"45"; |
| 24 | $separator_pos=index_of($hash_and_percentage, " %="); |
| 25 | $hash = substring($hash_and_percentage, 0, $separator_pos); |
| 26 | $percentage = json_parse(substring($hash_and_percentage, $separator_pos + 3)); |
| 27 | $heritage_value = round(100000 * $percentage /100); |
| 28 | response['percentage'] = $percentage; |
| 29 | response['hash'] = $hash; |
| 30 | response['heritage_value'] = $heritage_value; |
| 31 | |
| 32 | }" |
| 33 | } |
| 34 | ] |
| 35 | } |
| 36 | ] |