|
| 1 | +# Contracts by tags endpoint |
| 2 | + |
| 3 | +Method: `GET` |
| 4 | + |
| 5 | +`/gateway/contracts-by-tags?tags=<tags>&owner=<owner>&srcId=<srcId>limit=<limit>&page=<page>&testnet<testnet>` - lists all the contracts that contain indicated tags, additionally - owner or source transaction id can be passed to narrow the search |
| 6 | + |
| 7 | +Parameters: |
| 8 | + |
| 9 | +1. `tags` - list of tags, maximum 5 tags with different names can be passed, for each of these tags - up to 5 values can be assigned, example list: `tags=[{"name":"Contract-Src","values":["rbAQI1R9m5eWwExR5fiAgepQvyuUpUf1-DbGAEETmXc","2j7rlIzlt4WQFIfDPomvu4dq7tZ8mJKPTsrY3xwtong","-TBbRLWsP8wAlj8y5bh7RHRdwGJ7kT9urFvEbn1UomQ"]},{"name":"Content-Type","values":["application/json"]}]` |
| 10 | +2. `owner` [optional] - only contracts which were deployed by this owner will be listed |
| 11 | +3. `srcId` [optional] - only contracts which were deployed based on this source transaction will be listed |
| 12 | +4. `limit` [optional] - limits records to specific number |
| 13 | +5. `page` [optional] - lists contracts for specific page number |
| 14 | + |
| 15 | +Examples: |
| 16 | + |
| 17 | +`https://gw.warp.cc/gateway/contracts-by-tags?tags=[{"name":"Contract-Src","values":["2nFNFs9YWIfj2k3BV2IR3XkC_F4V4gZiRDj60HilZzU","L2k7QI2kg-aSwXg7owgzV9gqXoG0jjRsWJ9Nm4RImrE","WnxZnhLclP_4B1yZpGDVAgtNuJV2klzY-B_-Io0QMTg"]},{"name":"Content-Type","values":["application/json"]}]` |
| 18 | + |
| 19 | +Response: |
| 20 | + |
| 21 | +```json |
| 22 | +{ |
| 23 | + "paging": { |
| 24 | + "total": 3, |
| 25 | + "limit": 100, |
| 26 | + "items": 3, |
| 27 | + "page": 1, |
| 28 | + "pages": 1 |
| 29 | + }, |
| 30 | + "contracts": [ |
| 31 | + { |
| 32 | + "contract": "TZk31WrAGpjIUAWb8y6rU8FIAVRoEr7qcOz5uqsIda0", |
| 33 | + "srctxid": "2nFNFs9YWIfj2k3BV2IR3XkC_F4V4gZiRDj60HilZzU", |
| 34 | + "owner": "33F0QHcb22W7LwWR1iRC8Az1ntZG09XQ03YWuw2ABqA", |
| 35 | + "testnet": null, |
| 36 | + "contracttx": { |
| 37 | + "tags": [ |
| 38 | + { |
| 39 | + "name": "App-Name", |
| 40 | + "value": "SmartWeaveContract" |
| 41 | + }, |
| 42 | + { |
| 43 | + "name": "App-Version", |
| 44 | + "value": "0.3.0" |
| 45 | + }, |
| 46 | + { |
| 47 | + "name": "Contract-Src", |
| 48 | + "value": "2nFNFs9YWIfj2k3BV2IR3XkC_F4V4gZiRDj60HilZzU" |
| 49 | + }, |
| 50 | + { |
| 51 | + "name": "SDK", |
| 52 | + "value": "Warp" |
| 53 | + }, |
| 54 | + { |
| 55 | + "name": "Nonce", |
| 56 | + "value": "1679856025700" |
| 57 | + }, |
| 58 | + { |
| 59 | + "name": "Content-Type", |
| 60 | + "value": "application/json" |
| 61 | + }, |
| 62 | + { |
| 63 | + "name": "Contract-Manifest", |
| 64 | + "value": "{\"evaluationOptions\":{\"useConstructor\":true}}" |
| 65 | + } |
| 66 | + ] |
| 67 | + }, |
| 68 | + "synctimestamp": null, |
| 69 | + "total": "3" |
| 70 | + }, |
| 71 | + { |
| 72 | + "contract": "F6M_D4d3bdKreFv-Q1FxlgcRwVYb0yPXZzb1wvwCbB8", |
| 73 | + "srctxid": "WnxZnhLclP_4B1yZpGDVAgtNuJV2klzY-B_-Io0QMTg", |
| 74 | + "owner": "jnioZFibZSCcV8o-HkBXYPYEYNib4tqfexP0kCBXX_M", |
| 75 | + "testnet": null, |
| 76 | + "contracttx": { |
| 77 | + "tags": [ |
| 78 | + { |
| 79 | + "name": "App-Name", |
| 80 | + "value": "SmartWeaveContract" |
| 81 | + }, |
| 82 | + { |
| 83 | + "name": "App-Version", |
| 84 | + "value": "0.3.0" |
| 85 | + }, |
| 86 | + { |
| 87 | + "name": "Contract-Src", |
| 88 | + "value": "WnxZnhLclP_4B1yZpGDVAgtNuJV2klzY-B_-Io0QMTg" |
| 89 | + }, |
| 90 | + { |
| 91 | + "name": "SDK", |
| 92 | + "value": "Warp" |
| 93 | + }, |
| 94 | + { |
| 95 | + "name": "Nonce", |
| 96 | + "value": "1699634605917" |
| 97 | + }, |
| 98 | + { |
| 99 | + "name": "Content-Type", |
| 100 | + "value": "application/json" |
| 101 | + }, |
| 102 | + { |
| 103 | + "name": "Contract-Manifest", |
| 104 | + "value": "{\"evaluationOptions\":{\"useKVStorage\":true}}" |
| 105 | + } |
| 106 | + ] |
| 107 | + }, |
| 108 | + "synctimestamp": "1699634606419", |
| 109 | + "total": "3" |
| 110 | + }, |
| 111 | + { |
| 112 | + "contract": "n5hE54enkEAyzyEOP0tbolCTuT47piSa-tX5TvF4dCE", |
| 113 | + "srctxid": "L2k7QI2kg-aSwXg7owgzV9gqXoG0jjRsWJ9Nm4RImrE", |
| 114 | + "owner": "0xc84f421658dabC69Ee0440649f2f17b98D284CCC", |
| 115 | + "testnet": null, |
| 116 | + "contracttx": { |
| 117 | + "tags": [ |
| 118 | + { |
| 119 | + "name": "App-Name", |
| 120 | + "value": "SmartWeaveContract" |
| 121 | + }, |
| 122 | + { |
| 123 | + "name": "App-Version", |
| 124 | + "value": "0.3.0" |
| 125 | + }, |
| 126 | + { |
| 127 | + "name": "Contract-Src", |
| 128 | + "value": "L2k7QI2kg-aSwXg7owgzV9gqXoG0jjRsWJ9Nm4RImrE" |
| 129 | + }, |
| 130 | + { |
| 131 | + "name": "SDK", |
| 132 | + "value": "Warp" |
| 133 | + }, |
| 134 | + { |
| 135 | + "name": "Nonce", |
| 136 | + "value": "1692188736414" |
| 137 | + }, |
| 138 | + { |
| 139 | + "name": "Content-Type", |
| 140 | + "value": "application/json" |
| 141 | + } |
| 142 | + ] |
| 143 | + }, |
| 144 | + "synctimestamp": "1692188737275", |
| 145 | + "total": "3" |
| 146 | + } |
| 147 | + ] |
| 148 | +} |
| 149 | +``` |
0 commit comments