| 1 | [ |
| 2 | "autonomous agent", |
| 3 | { |
| 4 | "getters": "{ |
| 5 | $fetchNFT = $asset => { |
| 6 | $unitInfo = unit[$asset]; |
| 7 | if ($unitInfo.sequence != "good") |
| 8 | bounce("Bad unit"); |
| 9 | $definedBy = $unitInfo.authors[0].authentifiers |
| 10 | ? $unitInfo.authors[0].address |
| 11 | : unit[$unitInfo.trigger_unit].authors[0].address; |
| 12 | $metadata = $unitInfo.messages[[.app='data']].payload; |
| 13 | $assetMetadata = $unitInfo.messages[[.app='asset']].payload; |
| 14 | return {asset: $assetMetadata, meta: $metadata}; |
| 15 | }; |
| 16 | }", |
| 17 | "messages": [ |
| 18 | { |
| 19 | "if": "{NOT var["a"]}", |
| 20 | "app": "data", |
| 21 | "payload": { |
| 22 | "name": "Untitled", |
| 23 | "author": "{trigger.address}", |
| 24 | "ipfs": "Qmmmsdmjsdjf", |
| 25 | "type": "IMG", |
| 26 | "decimals": 0 |
| 27 | } |
| 28 | }, |
| 29 | { |
| 30 | "app": "asset", |
| 31 | "payload": { |
| 32 | "cap": 1, |
| 33 | "is_private": false, |
| 34 | "is_transferrable": true, |
| 35 | "auto_destroy": false, |
| 36 | "fixed_denominations": false, |
| 37 | "issued_by_definer_only": true, |
| 38 | "cosigned_by_definer": false, |
| 39 | "spender_attested": false |
| 40 | } |
| 41 | }, |
| 42 | { |
| 43 | "if": "{var["a"]}", |
| 44 | "app": "data", |
| 45 | "payload": { |
| 46 | "nft": "{$fetchNFT(var["a"])}" |
| 47 | } |
| 48 | }, |
| 49 | { |
| 50 | "app": "state", |
| 51 | "state": "{ |
| 52 | var["a"] = response_unit; |
| 53 | }" |
| 54 | } |
| 55 | ] |
| 56 | } |
| 57 | ] |