| 1 | [ |
| 2 | "autonomous agent", |
| 3 | { |
| 4 | "bounce_fees": { |
| 5 | "base": 10000 |
| 6 | }, |
| 7 | "init": "{ |
| 8 | $method = trigger.data["method"]; |
| 9 | }", |
| 10 | "getters": "{ |
| 11 | $profileOf = $address=>{ |
| 12 | $att = attestation[[attestors=this_address, address=$address, ifseveral='last', type="string"]].data; |
| 13 | $ret = ($att ? json_parse($att) : {}) || {address: $address}; |
| 14 | return $ret; |
| 15 | }; |
| 16 | }", |
| 17 | "messages": { |
| 18 | "cases": [ |
| 19 | { |
| 20 | "if": "{ |
| 21 | $method == "attest" |
| 22 | }", |
| 23 | "messages": [ |
| 24 | { |
| 25 | "app": "attestation", |
| 26 | "init": "{ |
| 27 | $profileString = json_stringify({foo: 'bar'}); |
| 28 | }", |
| 29 | "payload": "{ |
| 30 | { |
| 31 | address: trigger.address, |
| 32 | profile: { |
| 33 | data: $profileString |
| 34 | } |
| 35 | } |
| 36 | }" |
| 37 | } |
| 38 | ] |
| 39 | }, |
| 40 | { |
| 41 | "init": "{ |
| 42 | $profileObj = $profileOf(trigger.address); |
| 43 | response["debug"] = json_stringify($profileObj); |
| 44 | response["expected"] = json_stringify({foo: 'bar'}); |
| 45 | response["raw"] = attestation[[attestors=this_address, address=trigger.address, ifseveral='last', type="string"]].data; |
| 46 | }", |
| 47 | "messages": [ |
| 48 | { |
| 49 | "app": "state", |
| 50 | "state": "{ |
| 51 | var["debug"] = $profileObj; |
| 52 | }" |
| 53 | } |
| 54 | ] |
| 55 | } |
| 56 | ] |
| 57 | } |
| 58 | } |
| 59 | ] |