Skip to content

Commit f2879ad

Browse files
author
sam
committed
0.1.0
0 parents  commit f2879ad

File tree

6 files changed

+347
-0
lines changed

6 files changed

+347
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.DS_Store
2+
node_modules

index.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/**
2+
* @tokenlists
3+
* @param TokenList
4+
* @returns types
5+
* @version 0.1.0
6+
*/
7+
import schema from "./token.d.ts";
8+
export namespace schema {}
9+
import TokenList from "./types.d.ts";
10+
export default TokenList

package.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "@types/tokenlist",
3+
"version": "1.0.0",
4+
"description": "",
5+
"main": "index.js",
6+
"types": "index.d.ts",
7+
"scripts": {
8+
"test": "echo \"Error: no test specified\" && exit 1"
9+
},
10+
"keywords": [],
11+
"author": "SEE CONTRIBUTORS",
12+
"license": "ISC",
13+
"dependencies": {
14+
"@uniswap/token-lists": "^1.0.0-beta.21"
15+
}
16+
}

token.d.ts

Lines changed: 255 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,255 @@
1+
/** Declaration file generated by dts-gen */
2+
3+
export const VersionUpgrade: {
4+
"0": string;
5+
"1": string;
6+
"2": string;
7+
"3": string;
8+
MAJOR: number;
9+
MINOR: number;
10+
NONE: number;
11+
PATCH: number;
12+
};
13+
14+
export const schema: {
15+
$id: string;
16+
$schema: string;
17+
additionalProperties: boolean;
18+
definitions: {
19+
ExtensionIdentifier: {
20+
description: string;
21+
examples: string[];
22+
maxLength: number;
23+
minLength: number;
24+
pattern: string;
25+
type: string;
26+
};
27+
ExtensionValue: {
28+
anyOf: {
29+
examples: string[];
30+
maxLength: number;
31+
minLength: number;
32+
type: string;
33+
}[];
34+
};
35+
TagDefinition: {
36+
additionalProperties: boolean;
37+
description: string;
38+
examples: {
39+
description: string;
40+
name: string;
41+
}[];
42+
properties: {
43+
description: {
44+
description: string;
45+
maxLength: number;
46+
minLength: number;
47+
pattern: string;
48+
type: string;
49+
};
50+
name: {
51+
description: string;
52+
maxLength: number;
53+
minLength: number;
54+
pattern: string;
55+
type: string;
56+
};
57+
};
58+
required: string[];
59+
type: string;
60+
};
61+
TagIdentifier: {
62+
description: string;
63+
examples: string[];
64+
maxLength: number;
65+
minLength: number;
66+
pattern: string;
67+
type: string;
68+
};
69+
TokenInfo: {
70+
additionalProperties: boolean;
71+
description: string;
72+
properties: {
73+
address: {
74+
description: string;
75+
examples: string[];
76+
pattern: string;
77+
type: string;
78+
};
79+
chainId: {
80+
description: string;
81+
examples: number[];
82+
minimum: number;
83+
type: string;
84+
};
85+
decimals: {
86+
description: string;
87+
examples: number[];
88+
maximum: number;
89+
minimum: number;
90+
type: string;
91+
};
92+
extensions: {
93+
additionalProperties: {
94+
$ref: string;
95+
};
96+
description: string;
97+
examples: {
98+
color: string;
99+
is_verified_by_me: boolean;
100+
}[];
101+
maxProperties: number;
102+
propertyNames: {
103+
$ref: string;
104+
};
105+
type: string;
106+
};
107+
logoURI: {
108+
description: string;
109+
examples: string[];
110+
format: string;
111+
type: string;
112+
};
113+
name: {
114+
description: string;
115+
examples: string[];
116+
maxLength: number;
117+
minLength: number;
118+
pattern: string;
119+
type: string;
120+
};
121+
symbol: {
122+
description: string;
123+
examples: string[];
124+
maxLength: number;
125+
minLength: number;
126+
pattern: string;
127+
type: string;
128+
};
129+
tags: {
130+
description: string;
131+
examples: string[];
132+
items: {
133+
$ref: string;
134+
};
135+
maxLength: number;
136+
type: string;
137+
};
138+
};
139+
required: string[];
140+
type: string;
141+
};
142+
Version: {
143+
additionalProperties: boolean;
144+
description: string;
145+
examples: {
146+
major: number;
147+
minor: number;
148+
patch: number;
149+
}[];
150+
properties: {
151+
major: {
152+
description: string;
153+
examples: number[];
154+
minimum: number;
155+
type: string;
156+
};
157+
minor: {
158+
description: string;
159+
examples: number[];
160+
minimum: number;
161+
type: string;
162+
};
163+
patch: {
164+
description: string;
165+
examples: number[];
166+
minimum: number;
167+
type: string;
168+
};
169+
};
170+
required: string[];
171+
type: string;
172+
};
173+
};
174+
description: string;
175+
properties: {
176+
keywords: {
177+
description: string;
178+
items: {
179+
description: string;
180+
examples: string[];
181+
maxLength: number;
182+
minLength: number;
183+
pattern: string;
184+
type: string;
185+
};
186+
maxItems: number;
187+
type: string;
188+
uniqueItems: boolean;
189+
};
190+
logoURI: {
191+
description: string;
192+
examples: string[];
193+
format: string;
194+
type: string;
195+
};
196+
name: {
197+
description: string;
198+
examples: string[];
199+
maxLength: number;
200+
minLength: number;
201+
pattern: string;
202+
type: string;
203+
};
204+
tags: {
205+
additionalProperties: {
206+
$ref: string;
207+
};
208+
description: string;
209+
examples: {
210+
stablecoin: {
211+
description: string;
212+
name: string;
213+
};
214+
}[];
215+
maxProperties: number;
216+
propertyNames: {
217+
$ref: string;
218+
};
219+
type: string;
220+
};
221+
timestamp: {
222+
description: string;
223+
format: string;
224+
type: string;
225+
};
226+
tokens: {
227+
description: string;
228+
items: {
229+
$ref: string;
230+
};
231+
maxItems: number;
232+
minItems: number;
233+
type: string;
234+
};
235+
version: {
236+
$ref: string;
237+
};
238+
};
239+
required: string[];
240+
title: string;
241+
type: string;
242+
};
243+
244+
export function diffTokenLists(base: any, update: any): any;
245+
246+
export function getVersionUpgrade(base: any, update: any): any;
247+
248+
export function isVersionUpdate(base: any, update: any): any;
249+
250+
export function minVersionBump(baseList: any, updatedList: any): any;
251+
252+
export function nextVersion(base: any, bump: any): any;
253+
254+
export function versionComparator(versionA: any, versionB: any): any;
255+

tokenlist.d.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
export interface TokenInfo {
2+
readonly chainId: number;
3+
readonly address: string;
4+
readonly name: string;
5+
readonly decimals: number;
6+
readonly symbol: string;
7+
readonly logoURI?: string;
8+
readonly tags?: string[];
9+
}
10+
11+
export interface Version {
12+
readonly major: number;
13+
readonly minor: number;
14+
readonly patch: number;
15+
}
16+
17+
export interface Tags {
18+
readonly [tagId: string]: {
19+
readonly name: string;
20+
readonly description: string;
21+
};
22+
}
23+
24+
export interface TokenList {
25+
readonly name: string;
26+
readonly timestamp: string;
27+
readonly version: Version;
28+
readonly tokens: TokenInfo[];
29+
readonly keywords?: string[];
30+
readonly tags?: Tags;
31+
readonly logoURI?: string;
32+
}

types.d.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
export interface TokenInfo {
2+
readonly chainId: number;
3+
readonly address: string;
4+
readonly name: string;
5+
readonly decimals: number;
6+
readonly symbol: string;
7+
readonly logoURI?: string;
8+
readonly tags?: string[];
9+
readonly extensions?: {
10+
readonly [key: string]: string | number | boolean | null;
11+
};
12+
}
13+
export interface Version {
14+
readonly major: number;
15+
readonly minor: number;
16+
readonly patch: number;
17+
}
18+
export interface Tags {
19+
readonly [tagId: string]: {
20+
readonly name: string;
21+
readonly description: string;
22+
};
23+
}
24+
export interface TokenList {
25+
readonly name: string;
26+
readonly timestamp: string;
27+
readonly version: Version;
28+
readonly tokens: TokenInfo[];
29+
readonly keywords?: string[];
30+
readonly tags?: Tags;
31+
readonly logoURI?: string;
32+
}

0 commit comments

Comments
 (0)