UNPKG

9.63 kBJSONView Raw
1{
2 "$schema": "http://json-schema.org/draft-07/schema#",
3 "$id": "https://uniswap.org/tokenlist.schema.json",
4 "title": "Uniswap Token List",
5 "description": "Schema for lists of tokens compatible with the Uniswap Interface",
6 "definitions": {
7 "Version": {
8 "type": "object",
9 "description": "The version of the list, used in change detection",
10 "examples": [
11 {
12 "major": 1,
13 "minor": 0,
14 "patch": 0
15 }
16 ],
17 "additionalProperties": false,
18 "properties": {
19 "major": {
20 "type": "integer",
21 "description": "The major version of the list. Must be incremented when tokens are removed from the list or token addresses are changed.",
22 "minimum": 0,
23 "examples": [
24 1,
25 2
26 ]
27 },
28 "minor": {
29 "type": "integer",
30 "description": "The minor version of the list. Must be incremented when tokens are added to the list.",
31 "minimum": 0,
32 "examples": [
33 0,
34 1
35 ]
36 },
37 "patch": {
38 "type": "integer",
39 "description": "The patch version of the list. Must be incremented for any changes to the list.",
40 "minimum": 0,
41 "examples": [
42 0,
43 1
44 ]
45 }
46 },
47 "required": [
48 "major",
49 "minor",
50 "patch"
51 ]
52 },
53 "TagIdentifier": {
54 "type": "string",
55 "description": "The unique identifier of a tag",
56 "minLength": 1,
57 "maxLength": 10,
58 "pattern": "^[\\w]+$",
59 "examples": [
60 "compound",
61 "stablecoin"
62 ]
63 },
64 "ExtensionIdentifier": {
65 "type": "string",
66 "description": "The name of a token extension property",
67 "minLength": 1,
68 "maxLength": 40,
69 "pattern": "^[\\w]+$",
70 "examples": [
71 "color",
72 "is_fee_on_transfer",
73 "aliases"
74 ]
75 },
76 "ExtensionMap": {
77 "type": "object",
78 "description": "An object containing any arbitrary or vendor-specific token metadata",
79 "maxProperties": 10,
80 "propertyNames": {
81 "$ref": "#/definitions/ExtensionIdentifier"
82 },
83 "additionalProperties": {
84 "$ref": "#/definitions/ExtensionValue"
85 },
86 "examples": [
87 {
88 "color": "#000000",
89 "is_verified_by_me": true
90 },
91 {
92 "x-bridged-addresses-by-chain": {
93 "1": {
94 "bridgeAddress": "0x4200000000000000000000000000000000000010",
95 "tokenAddress": "0x4200000000000000000000000000000000000010"
96 }
97 }
98 }
99 ]
100 },
101 "ExtensionPrimitiveValue": {
102 "anyOf": [
103 {
104 "type": "string",
105 "minLength": 1,
106 "maxLength": 42,
107 "examples": [
108 "#00000"
109 ]
110 },
111 {
112 "type": "boolean",
113 "examples": [
114 true
115 ]
116 },
117 {
118 "type": "number",
119 "examples": [
120 15
121 ]
122 },
123 {
124 "type": "null"
125 }
126 ]
127 },
128 "ExtensionValue": {
129 "anyOf": [
130 {
131 "$ref": "#/definitions/ExtensionPrimitiveValue"
132 },
133 {
134 "type": "object",
135 "maxProperties": 10,
136 "propertyNames": {
137 "$ref": "#/definitions/ExtensionIdentifier"
138 },
139 "additionalProperties": {
140 "$ref": "#/definitions/ExtensionValueInner0"
141 }
142 }
143 ]
144 },
145 "ExtensionValueInner0": {
146 "anyOf": [
147 {
148 "$ref": "#/definitions/ExtensionPrimitiveValue"
149 },
150 {
151 "type": "object",
152 "maxProperties": 10,
153 "propertyNames": {
154 "$ref": "#/definitions/ExtensionIdentifier"
155 },
156 "additionalProperties": {
157 "$ref": "#/definitions/ExtensionValueInner1"
158 }
159 }
160 ]
161 },
162 "ExtensionValueInner1": {
163 "anyOf": [
164 {
165 "$ref": "#/definitions/ExtensionPrimitiveValue"
166 }
167 ]
168 },
169 "TagDefinition": {
170 "type": "object",
171 "description": "Definition of a tag that can be associated with a token via its identifier",
172 "additionalProperties": false,
173 "properties": {
174 "name": {
175 "type": "string",
176 "description": "The name of the tag",
177 "pattern": "^[ \\w]+$",
178 "minLength": 1,
179 "maxLength": 20
180 },
181 "description": {
182 "type": "string",
183 "description": "A user-friendly description of the tag",
184 "pattern": "^[ \\w\\.,:]+$",
185 "minLength": 1,
186 "maxLength": 200
187 }
188 },
189 "required": [
190 "name",
191 "description"
192 ],
193 "examples": [
194 {
195 "name": "Stablecoin",
196 "description": "A token with value pegged to another asset"
197 }
198 ]
199 },
200 "TokenInfo": {
201 "type": "object",
202 "description": "Metadata for a single token in a token list",
203 "additionalProperties": false,
204 "properties": {
205 "chainId": {
206 "type": "integer",
207 "description": "The chain ID of the Ethereum network where this token is deployed",
208 "minimum": 1,
209 "examples": [
210 1,
211 42
212 ]
213 },
214 "address": {
215 "type": "string",
216 "description": "The checksummed address of the token on the specified chain ID",
217 "pattern": "^0x[a-fA-F0-9]{40}$",
218 "examples": [
219 "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
220 ]
221 },
222 "decimals": {
223 "type": "integer",
224 "description": "The number of decimals for the token balance",
225 "minimum": 0,
226 "maximum": 255,
227 "examples": [
228 18
229 ]
230 },
231 "name": {
232 "type": "string",
233 "description": "The name of the token",
234 "minLength": 1,
235 "maxLength": 40,
236 "pattern": "^[ \\w.'+\\-%/À-ÖØ-öø-ÿ:&\\[\\]\\(\\)]+$",
237 "examples": [
238 "USD Coin"
239 ]
240 },
241 "symbol": {
242 "type": "string",
243 "description": "The symbol for the token; must be alphanumeric",
244 "pattern": "^[a-zA-Z0-9+\\-%/$.]+$",
245 "minLength": 1,
246 "maxLength": 20,
247 "examples": [
248 "USDC"
249 ]
250 },
251 "logoURI": {
252 "type": "string",
253 "description": "A URI to the token logo asset; if not set, interface will attempt to find a logo based on the token address; suggest SVG or PNG of size 64x64",
254 "format": "uri",
255 "examples": [
256 "ipfs://QmXfzKRvjZz3u5JRgC4v5mGVbm9ahrUiB4DgzHBsnWbTMM"
257 ]
258 },
259 "tags": {
260 "type": "array",
261 "description": "An array of tag identifiers associated with the token; tags are defined at the list level",
262 "items": {
263 "$ref": "#/definitions/TagIdentifier"
264 },
265 "maxItems": 10,
266 "examples": [
267 "stablecoin",
268 "compound"
269 ]
270 },
271 "extensions": {
272 "$ref": "#/definitions/ExtensionMap"
273 }
274 },
275 "required": [
276 "chainId",
277 "address",
278 "decimals",
279 "name",
280 "symbol"
281 ]
282 }
283 },
284 "type": "object",
285 "additionalProperties": false,
286 "properties": {
287 "name": {
288 "type": "string",
289 "description": "The name of the token list",
290 "minLength": 1,
291 "maxLength": 30,
292 "pattern": "^[\\w ]+$",
293 "examples": [
294 "My Token List"
295 ]
296 },
297 "timestamp": {
298 "type": "string",
299 "format": "date-time",
300 "description": "The timestamp of this list version; i.e. when this immutable version of the list was created"
301 },
302 "version": {
303 "$ref": "#/definitions/Version"
304 },
305 "tokens": {
306 "type": "array",
307 "description": "The list of tokens included in the list",
308 "items": {
309 "$ref": "#/definitions/TokenInfo"
310 },
311 "minItems": 1,
312 "maxItems": 10000
313 },
314 "keywords": {
315 "type": "array",
316 "description": "Keywords associated with the contents of the list; may be used in list discoverability",
317 "items": {
318 "type": "string",
319 "description": "A keyword to describe the contents of the list",
320 "minLength": 1,
321 "maxLength": 20,
322 "pattern": "^[\\w ]+$",
323 "examples": [
324 "compound",
325 "lending",
326 "personal tokens"
327 ]
328 },
329 "maxItems": 20,
330 "uniqueItems": true
331 },
332 "tags": {
333 "type": "object",
334 "description": "A mapping of tag identifiers to their name and description",
335 "propertyNames": {
336 "$ref": "#/definitions/TagIdentifier"
337 },
338 "additionalProperties": {
339 "$ref": "#/definitions/TagDefinition"
340 },
341 "maxProperties": 20,
342 "examples": [
343 {
344 "stablecoin": {
345 "name": "Stablecoin",
346 "description": "A token with value pegged to another asset"
347 }
348 }
349 ]
350 },
351 "logoURI": {
352 "type": "string",
353 "description": "A URI for the logo of the token list; prefer SVG or PNG of size 256x256",
354 "format": "uri",
355 "examples": [
356 "ipfs://QmXfzKRvjZz3u5JRgC4v5mGVbm9ahrUiB4DgzHBsnWbTMM"
357 ]
358 }
359 },
360 "required": [
361 "name",
362 "timestamp",
363 "version",
364 "tokens"
365 ]
366}