| 1 | [ |
| 2 | "autonomous agent", |
| 3 | { |
| 4 | "init": "{ |
| 5 | $nom_AA = 'Emissions'; |
| 6 | |
| 7 | |
| 8 | $_Registre = trigger.data._Registre; |
| 9 | $unitat = trigger.output[[ asset != base ]].asset; |
| 10 | $qt = trigger.output[[ asset = $unitat ]]; |
| 11 | |
| 12 | |
| 13 | |
| 14 | $__dada = $refdada => |
| 15 | data_feed[[ oracles = $_Registre, feed_name = $refdada, ifnone = '' ]]; |
| 16 | |
| 17 | |
| 18 | $_Portal = trigger.address; |
| 19 | if ( $_Portal != trigger.address ) bounce ( 'Portal no reconegut' ); |
| 20 | |
| 21 | $args = trigger.data; |
| 22 | $proces = $args.proces; |
| 23 | }", |
| 24 | "messages": { |
| 25 | "cases": [ |
| 26 | { |
| 27 | "if": "{ $proces == "emissio" }", |
| 28 | "messages": [ |
| 29 | { |
| 30 | "app": "payment", |
| 31 | "payload": { |
| 32 | "asset": "{ $args.idgeto }", |
| 33 | "outputs": [ |
| 34 | { |
| 35 | "address": "{ $args._FOP }", |
| 36 | "amount": "{ $args.total_emissio }" |
| 37 | } |
| 38 | ] |
| 39 | } |
| 40 | } |
| 41 | ] |
| 42 | }, |
| 43 | { |
| 44 | "if": "{ $proces == 'configuracio' }", |
| 45 | "messages": [ |
| 46 | { |
| 47 | "app": "state", |
| 48 | "state": "{ |
| 49 | $refgeto = $args.refgeto; |
| 50 | $resp_unit = $args.resp_unit; |
| 51 | var[ 'refgeto_' || $resp_unit ] = $refgeto; |
| 52 | var[ $refgeto || '_id' ] = $resp_unit; |
| 53 | response[ 'Ref' ] = $refgeto; |
| 54 | response[ 'Id' ] = $resp_unit; |
| 55 | response[ 'Qt' ] = $qt; |
| 56 | response[ 'Unitat ' ] = $unitat; |
| 57 | }" |
| 58 | } |
| 59 | ] |
| 60 | } |
| 61 | ] |
| 62 | } |
| 63 | } |
| 64 | ] |