Skip to content

Commit 395b5d6

Browse files
authored
feat: add tokenMap to schema (#420)
* init * add more detail to tokenMap schema * bump pkg version
1 parent abe195a commit 395b5d6

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"url": "https://uniswap.org"
77
},
88
"description": "📚 The Token Lists specification",
9-
"version": "1.0.0-beta.31",
9+
"version": "1.0.0-beta.32",
1010
"license": "MIT",
1111
"main": "dist/index.js",
1212
"typings": "dist/index.d.ts",

src/tokenlist.schema.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,30 @@
325325
"minItems": 1,
326326
"maxItems": 10000
327327
},
328+
"tokenMap": {
329+
"type": "object",
330+
"description": "A mapping of key 'chainId_tokenAddress' to its corresponding token object",
331+
"minProperties": 1,
332+
"maxProperties": 10000,
333+
"propertyNames": {
334+
"type": "string"
335+
},
336+
"additionalProperties": {
337+
"$ref": "#/definitions/TokenInfo"
338+
},
339+
"examples": [
340+
{
341+
"4_0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984": {
342+
"name": "Uniswap",
343+
"address": "0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984",
344+
"symbol": "UNI",
345+
"decimals": 18,
346+
"chainId": 4,
347+
"logoURI": "ipfs://QmXttGpZrECX5qCyXbBQiqgQNytVGeZW5Anewvh2jc4psg"
348+
}
349+
}
350+
]
351+
},
328352
"keywords": {
329353
"type": "array",
330354
"description": "Keywords associated with the contents of the list; may be used in list discoverability",

0 commit comments

Comments
 (0)