| 1 | [ |
| 2 | "autonomous agent", |
| 3 | { |
| 4 | "init": "{ |
| 5 | $name = 'test'; |
| 6 | $unlock_date = '2025-08-09'; |
| 7 | $owner = 'B74PLANYUJTAJS22KES5OZDTCY7ASU6P'; |
| 8 | }", |
| 9 | "messages": { |
| 10 | "cases": [ |
| 11 | { |
| 12 | "if": "{trigger.data.withdraw}", |
| 13 | "init": "{ |
| 14 | require(timestamp_to_string(timestamp, 'date') >= $unlock_date, "your balance unlocks on " || $unlock_date); |
| 15 | }", |
| 16 | "messages": [ |
| 17 | { |
| 18 | "app": "payment", |
| 19 | "payload": { |
| 20 | "asset": "{trigger.data.asset OTHERWISE 'base'}", |
| 21 | "outputs": [ |
| 22 | { |
| 23 | "address": "{$owner}", |
| 24 | "amount": "{trigger.data.amount}" |
| 25 | } |
| 26 | ] |
| 27 | } |
| 28 | }, |
| 29 | { |
| 30 | "app": "state", |
| 31 | "state": "{ |
| 32 | response['message'] = 'Withdrawn'; |
| 33 | }" |
| 34 | } |
| 35 | ] |
| 36 | }, |
| 37 | { |
| 38 | "messages": [ |
| 39 | { |
| 40 | "app": "state", |
| 41 | "state": "{ |
| 42 | response['message'] = 'Accepted deposit'; |
| 43 | }" |
| 44 | } |
| 45 | ] |
| 46 | } |
| 47 | ] |
| 48 | } |
| 49 | } |
| 50 | ] |