@yodlpay/tokenlists 0.1.46

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 ...
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # Tokenlists
2
+
3
+ Lists of supported chains, tokens, routers for the Web3 Payment Network.
package/dist/abis.d.ts ADDED
@@ -0,0 +1,45 @@
1
+ export declare const HIRO_ROUTER_ABIS: {
2
+ [key: string]: any;
3
+ };
4
+ export declare const CURVE_ROUTER_ABI: ({
5
+ name: string;
6
+ inputs: {
7
+ name: string;
8
+ type: string;
9
+ indexed: boolean;
10
+ }[];
11
+ anonymous: boolean;
12
+ type: string;
13
+ stateMutability?: undefined;
14
+ outputs?: undefined;
15
+ } | {
16
+ stateMutability: string;
17
+ type: string;
18
+ inputs: {
19
+ name: string;
20
+ type: string;
21
+ }[];
22
+ outputs: never[];
23
+ name?: undefined;
24
+ anonymous?: undefined;
25
+ } | {
26
+ stateMutability: string;
27
+ type: string;
28
+ name?: undefined;
29
+ inputs?: undefined;
30
+ anonymous?: undefined;
31
+ outputs?: undefined;
32
+ } | {
33
+ stateMutability: string;
34
+ type: string;
35
+ name: string;
36
+ inputs: {
37
+ name: string;
38
+ type: string;
39
+ }[];
40
+ outputs: {
41
+ name: string;
42
+ type: string;
43
+ }[];
44
+ anonymous?: undefined;
45
+ })[];
@@ -0,0 +1,192 @@
1
+ {
2
+ "name": "Default",
3
+ "logoUri": "",
4
+ "keywords": [],
5
+ "version": {
6
+ "major": 0,
7
+ "minor": 0,
8
+ "patch": 1
9
+ },
10
+ "chains": [
11
+ {
12
+ "chainName": "Ethereum",
13
+ "shortName": "eth",
14
+ "testnet": false,
15
+ "chainId": 1,
16
+ "logoUri": "https://raw.githubusercontent.com/yodlpay/tokenlists/main/logos/chains/1/logo.svg",
17
+ "rpcUrls": [
18
+ "https://rpc.ankr.com/eth"
19
+ ],
20
+ "wrappedNativeToken": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
21
+ "explorerUrl": "https://etherscan.io",
22
+ "timestamp": "2022-12-29T18:52:20+00:00",
23
+ "feeTreasury": "0x9C48d180e4eEE0dA2A899EE1E4c533cA5e92db77",
24
+ "priceFeeds": {
25
+ "AUD": "0x77f9710e7d0a19669a13c055f62cd80d313df022",
26
+ "CAD": "0xa34317db73e77d453b1b8d04550c44d10e981c8e",
27
+ "CHF": "0x449d117117838ffa61263b61da6301aa2a88b13a",
28
+ "EUR": "0xb49f677943bc038e9857d61e7d053caa2c1734c1",
29
+ "ETH": "0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419",
30
+ "GBP": "0x5c0ab2d9b5a7ed9f470386e82bb36a3613cdd4b5",
31
+ "JPY": "0xbce206cae7f0ec07b545edde332a47c2f75bbeb3",
32
+ "CNY": "0xef8a4af35cd47424672e3c590abd37fbb7a7759a",
33
+ "KRW": "0x01435677fb11763550905594a16b645847c1d0f3",
34
+ "NZD": "0x3977cfc9e4f29c184d4675f4eb8e0013236e5f3e",
35
+ "SGD": "0xe25277ff4bbf9081c75ab0eb13b4a13a721f3e13",
36
+ "TRY": "0xb09fc5fd3f11cf9eb5e1c5dba43114e3c9f477b5"
37
+ },
38
+ "curveRouterAddress": "0x99a58482BD75cbab83b27EC03CA68fF489b5788f"
39
+ },
40
+ {
41
+ "chainName": "Ethereum Goerli",
42
+ "shortName": "gor",
43
+ "testnet": true,
44
+ "chainId": 5,
45
+ "logoUri": "https://raw.githubusercontent.com/yodlpay/tokenlists/main/logos/chains/5/logo.svg",
46
+ "rpcUrls": [
47
+ "https://rpc.ankr.com/eth_goerli"
48
+ ],
49
+ "wrappedNativeToken": "0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6",
50
+ "explorerUrl": "https://goerli.etherscan.io",
51
+ "timestamp": "2022-12-28T14:10:09+00:00",
52
+ "feeTreasury": "0x3E8A61F0532BA2b58660606d61110cC9E90c4D29",
53
+ "priceFeeds": {
54
+ "CZK": "0xAE45DCb3eB59E27f05C170752B218C6174394Df8",
55
+ "JPY": "0x295b398c95cEB896aFA18F25d0c6431Fd17b1431"
56
+ }
57
+ },
58
+ {
59
+ "chainName": "Arbitrum One",
60
+ "shortName": "arb1",
61
+ "testnet": false,
62
+ "chainId": 42161,
63
+ "logoUri": "https://raw.githubusercontent.com/yodlpay/tokenlists/main/logos/chains/42161/logo.svg",
64
+ "rpcUrls": [
65
+ "https://rpc.ankr.com/arbitrum"
66
+ ],
67
+ "wrappedNativeToken": "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",
68
+ "explorerUrl": "https://arbiscan.io",
69
+ "timestamp": "2023-01-13T14:52:05+00:00",
70
+ "feeTreasury": "0x5f0947253a8218894af13438ac2e2e0ced30d234",
71
+ "priceFeeds": {
72
+ "AUD": "0x9854e9a850e7c354c1de177ea953a6b1fba8fc22",
73
+ "CNY": "0xcc3370bde6afe51e1205a5038947b9836371eccb",
74
+ "EUR": "0xa14d53bc1f1c0f31b4aa3bd109344e5009051a84",
75
+ "ETH": "0x639Fe6ab55C921f74e7fac1ee960C0B6293ba612",
76
+ "CAD": "0xf6da27749484843c4f02f5ad1378cee723dd61d4",
77
+ "CHF": "0xe32AccC8c4eC03F6E75bd3621BfC9Fbb234E1FC3",
78
+ "GBP": "0x9c4424fd84c6661f97d8d6b3fc3c1aac2bedd137",
79
+ "JPY": "0x3dd6e51cb9cae717d5a8778cf79a04029f9cfdf8",
80
+ "KRW": "0x85bb02e0ae286600d1c68bb6ce22cc998d411916",
81
+ "SEK": "0xde89a55d04ded40a410877ab87d4f567ee66a1f0",
82
+ "SGD": "0xf0d38324d1f86a176ac727a4b0c43c9f9d9c5eb1"
83
+ },
84
+ "curveRouterAddress": "0x4c2af2df2a7e567b5155879720619ea06c5bb15d"
85
+ },
86
+ {
87
+ "chainName": "Optimism",
88
+ "shortName": "oeth",
89
+ "testnet": false,
90
+ "chainId": 10,
91
+ "logoUri": "https://raw.githubusercontent.com/yodlpay/tokenlists/main/logos/chains/10/logo.svg",
92
+ "rpcUrls": [
93
+ "https://mainnet.optimism.io"
94
+ ],
95
+ "wrappedNativeToken": "0x4200000000000000000000000000000000000006",
96
+ "explorerUrl": "https://optimistic.etherscan.io",
97
+ "timestamp": "2023-02-27T14:52:05+00:00",
98
+ "feeTreasury": "0x5f0947253a8218894af13438ac2e2e0ced30d234",
99
+ "priceFeeds": {
100
+ "AUD": "0x39be70e93d2d285c9e71be7f70fc5a45a7777b14",
101
+ "EUR": "0x3626369857a10ccc6cc3a6e4f5c2f5984a519f20",
102
+ "ETH": "0x13e3Ee699D1909E989722E753853AE30b17e08c5",
103
+ "GBP": "0x540d48c01f946e729174517e013ad0bdae5f08c0",
104
+ "JPY": "0x536944c3a71feb7c1e5c66ee37d1a148d8d8f619",
105
+ "INR": "0x5535e67d8f99c8ebe961e1fc1f6ddae96fec82c9"
106
+ },
107
+ "curveRouterAddress": "0x89287c32c2cac1c76227f6d300b2dbbab6b75c08"
108
+ },
109
+ {
110
+ "chainName": "Avalanche",
111
+ "shortName": "avax",
112
+ "testnet": false,
113
+ "chainId": 43114,
114
+ "logoUri": "https://raw.githubusercontent.com/yodlpay/tokenlists/main/logos/chains/43113/logo.svg",
115
+ "rpcUrls": [
116
+ "https://api.avax.network/ext/bc/C/rpc"
117
+ ],
118
+ "wrappedNativeToken": "0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB",
119
+ "explorerUrl": "https://snowtrace.io",
120
+ "timestamp": "2023-01-13T14:52:05+00:00",
121
+ "feeTreasury": "0x25e22F3ceE59F34622f7DC9a2078B85f17BfBe95",
122
+ "priceFeeds": {
123
+ "AVAX": "0x0A77230d17318075983913bC2145DB16C7366156",
124
+ "BRL": "0x609dddb75518aa4af84ac228b62261ae68e52989",
125
+ "CHF": "0x3b37950485b450edf90cbb85d0cd27308af4ab9a",
126
+ "EUR": "0x192f2dba961bb0277520c082d6bfa87d5961333e",
127
+ "JPY": "0xf8b283ad4d969ecfd70005714dd5910160565b94",
128
+ "TRY": "0xa61bf273688ea095b5e4c11f1af5e763f7aeee91"
129
+ }
130
+ },
131
+ {
132
+ "chainName": "Gnosis",
133
+ "shortName": "gno",
134
+ "testnet": false,
135
+ "chainId": 100,
136
+ "logoUri": "https://raw.githubusercontent.com/yodlpay/tokenlists/main/logos/chains/100/logo.svg",
137
+ "rpcUrls": [
138
+ "https://rpc.gnosis.gateway.fm"
139
+ ],
140
+ "wrappedNativeToken": "0xe91d153e0b41518a2ce8dd3d7944fa863463a97d",
141
+ "explorerUrl": "https://gnosisscan.io",
142
+ "timestamp": "2023-07-27T14:52:05+00:00",
143
+ "feeTreasury": "0x775aaf73a50C25eEBd308BBb9C34C73D081B423b",
144
+ "priceFeeds": {
145
+ "CHF": "0xFb00261Af80ADb1629D3869E377ae1EEC7bE659F",
146
+ "DAI": "0x678df3415fc31947dA4324eC63212874be5a82f8",
147
+ "EUR": "0xab70BCB260073d036d1660201e9d5405F5829b7a",
148
+ "GNO": "0x22441d81416430A54336aB28765abd31a792Ad37",
149
+ "JPY": "0x2AfB993C670C01e9dA1550c58e8039C1D8b8A317"
150
+ },
151
+ "curveRouterAddress": "0xe6358f6a45b502477e83cc1cda759f540e4459ee"
152
+ },
153
+ {
154
+ "chainName": "Polygon",
155
+ "shortName": "matic",
156
+ "testnet": false,
157
+ "chainId": 137,
158
+ "logoUri": "https://raw.githubusercontent.com/yodlpay/tokenlists/main/logos/chains/137/logo.svg",
159
+ "rpcUrls": [
160
+ "https://polygon-rpc.com"
161
+ ],
162
+ "wrappedNativeToken": "0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270",
163
+ "explorerUrl": "https://polygonscan.com",
164
+ "timestamp": "2023-09-07T00:00:00+00:00",
165
+ "feeTreasury": "0x5f0947253a8218894af13438ac2e2E0CeD30d234",
166
+ "priceFeeds": {
167
+ "AED": "0x3fd911749Fce21a38704B76FFaBcB6BeF2567F2E",
168
+ "AUD": "0x062Df9C4efd2030e243ffCc398b652e8b8F95C6f",
169
+ "CAD": "0xACA44ABb8B04D07D883202F99FA5E3c53ed57Fb5",
170
+ "CHF": "0xc76f762CedF0F78a439727861628E0fdfE1e70c2",
171
+ "CNY": "0x04bB437Aa63E098236FA47365f0268547f6EAB32",
172
+ "EUR": "0x73366Fe0AA0Ded304479862808e02506FE556a98",
173
+ "GBP": "0x099a2540848573e94fb1Ca0Fa420b00acbBc845a",
174
+ "HKD": "0x82d43B72573f902F960126a19581BcBbA5b014F5",
175
+ "ILS": "0x8d5eB34C509261533235b91350d359EdcB969D33",
176
+ "INR": "0xDA0F8Df6F5dB15b346f4B8D1156722027E194E60",
177
+ "JPY": "0xD647a6fC9BC6402301583C91decC5989d8Bc382D",
178
+ "KRW": "0x24B820870F726dA9B0D83B0B28a93885061dbF50",
179
+ "MATIC": "0xAB594600376Ec9fD91F8e885dADF0CE036862dE0",
180
+ "MXN": "0x171b16562EA3476F5C61d1b8dad031DbA0768545",
181
+ "NZD": "0xa302a0B8a499fD0f00449df0a490DedE21105955",
182
+ "PHP": "0x218231089Bebb2A31970c3b77E96eCfb3BA006D1",
183
+ "PLN": "0xB34BCE11040702f71c11529D00179B2959BcE6C0",
184
+ "SEK": "0xbd92B4919ae82be8473859295dEF0e778A626302",
185
+ "SGD": "0x8CE3cAc0E6635ce04783709ca3CC4F5fc5304299",
186
+ "THB": "0x5164Ad28fb12a5e55946090Ec3eE1B748AFb3785",
187
+ "TRY": "0xd78325DcA0F90F0FFe53cCeA1B02Bb12E1bf8FdB"
188
+ },
189
+ "curveRouterAddress": "0x2a426b3Bb4fa87488387545f15D01d81352732F9"
190
+ }
191
+ ]
192
+ }
@@ -0,0 +1,30 @@
1
+ import { TokenInfo } from "./types";
2
+ export declare type TokenInfoChangeKey = Exclude<keyof TokenInfo, "address" | "chainId">;
3
+ export declare type TokenInfoChanges = Array<TokenInfoChangeKey>;
4
+ /**
5
+ * Differences between a base list and an updated list.
6
+ */
7
+ export interface TokenListDiff {
8
+ /**
9
+ * Tokens from updated with chainId/address not present in base list
10
+ */
11
+ readonly added: TokenInfo[];
12
+ /**
13
+ * Tokens from base with chainId/address not present in the updated list
14
+ */
15
+ readonly removed: TokenInfo[];
16
+ /**
17
+ * The token info that changed
18
+ */
19
+ readonly changed: {
20
+ [chainId: number]: {
21
+ [address: string]: TokenInfoChanges;
22
+ };
23
+ };
24
+ }
25
+ /**
26
+ * Computes the diff of a token list where the first argument is the base and the second argument is the updated list.
27
+ * @param base base list
28
+ * @param update updated list
29
+ */
30
+ export declare function diffTokenLists(base: TokenInfo[], update: TokenInfo[]): TokenListDiff;
@@ -0,0 +1,17 @@
1
+ import { Version } from "./types";
2
+ /**
3
+ * Enum describing types of version differences
4
+ */
5
+ export declare enum VersionUpgrade {
6
+ NONE = 0,
7
+ PATCH = 1,
8
+ MINOR = 2,
9
+ MAJOR = 3
10
+ }
11
+ /**
12
+ * Return the upgrade type from the base version to the update version.
13
+ * Note that downgrades and equivalent versions are both treated as `NONE`.
14
+ * @param base base list
15
+ * @param update update to the list
16
+ */
17
+ export declare function getVersionUpgrade(base: Version, update: Version): VersionUpgrade;
@@ -0,0 +1,23 @@
1
+ import tokenlist from './tokenlist-v1.json';
2
+ import chainlist from './chainlist-v1.json';
3
+ import routerlist from './routerlist-v1.json';
4
+ import tokenschema from './tokenlist-v1.json';
5
+ import { ChainInfo, RouterInfo, TokenInfo, TestnetFaucetInfo } from './types';
6
+ export * from './abis';
7
+ export * from './types';
8
+ export * from './isVersionUpdate';
9
+ export * from './getVersionUpgrade';
10
+ export * from './diffTokenLists';
11
+ export * from './minVersionBump';
12
+ export * from './nextVersion';
13
+ export * from './versionComparator';
14
+ export { tokenschema, tokenlist, chainlist, routerlist };
15
+ export declare function getChain(chainId: number): ChainInfo;
16
+ export declare function getTokenByAddress(tokenAddress: string, chainId?: number): TokenInfo | null;
17
+ export declare function getTokenBySymbol(tokenSymbol: string, chainId?: number): TokenInfo | null;
18
+ export declare function getTokens(chainId: number): TokenInfo[];
19
+ export declare function getFaucetAddress(tokenInfo: TokenInfo): TestnetFaucetInfo;
20
+ export declare function getRouters(chainId: number): RouterInfo[];
21
+ export declare function getRouter(chainId: number, version: string): RouterInfo;
22
+ export declare function getLatestRouter(chainId: number): RouterInfo;
23
+ export declare function getShortNames(): string[];
package/dist/index.js ADDED
@@ -0,0 +1,8 @@
1
+
2
+ 'use strict'
3
+
4
+ if (process.env.NODE_ENV === 'production') {
5
+ module.exports = require('./tokenlists.cjs.production.min.js')
6
+ } else {
7
+ module.exports = require('./tokenlists.cjs.development.js')
8
+ }
@@ -0,0 +1,5 @@
1
+ import { Version } from './types';
2
+ /**
3
+ * Returns true if versionB is an update over versionA
4
+ */
5
+ export declare function isVersionUpdate(base: Version, update: Version): boolean;
@@ -0,0 +1,8 @@
1
+ import { VersionUpgrade } from "./getVersionUpgrade";
2
+ import { TokenInfo } from "./types";
3
+ /**
4
+ * Returns the minimum version bump for the given list
5
+ * @param baseList the base list of tokens
6
+ * @param updatedList the updated list of tokens
7
+ */
8
+ export declare function minVersionBump(baseList: TokenInfo[], updatedList: TokenInfo[]): VersionUpgrade;
@@ -0,0 +1,8 @@
1
+ import { VersionUpgrade } from "./getVersionUpgrade";
2
+ import { Version } from "./types";
3
+ /**
4
+ * Returns the next version of the list given a base version and the upgrade type
5
+ * @param base current version
6
+ * @param bump the upgrade type
7
+ */
8
+ export declare function nextVersion(base: Version, bump: VersionUpgrade): Version;
@@ -0,0 +1,82 @@
1
+ {
2
+ "name": "Default",
3
+ "logoUri": "",
4
+ "keywords": [],
5
+ "version": {
6
+ "major": 0,
7
+ "minor": 0,
8
+ "patch": 1
9
+ },
10
+ "routers": [
11
+ {
12
+ "chainId": 1,
13
+ "address": "0x4cafd841df0df6da5739f729491887d64ad2794c",
14
+ "timestamp": "2022-12-30T00:00:00+00:00",
15
+ "version": "0.1",
16
+ "fee": "0.002"
17
+ },
18
+ {
19
+ "chainId": 1,
20
+ "address": "0x061888246A29fEB9bb3f168CD8589B3Cf4115668",
21
+ "timestamp": "2023-09-01T00:00:00+00:00",
22
+ "version": "0.2",
23
+ "fee": "0.002"
24
+ },
25
+ {
26
+ "chainId": 5,
27
+ "address": "0x8412D3c11aa605EbaF14D0b6BC7705ab45143Ee8",
28
+ "timestamp": "2022-12-23T00:00:00+00:00",
29
+ "version": "0.1",
30
+ "fee": "0.002"
31
+ },
32
+ {
33
+ "chainId": 10,
34
+ "address": "0xfbA75752D73d3Fb3aA13e7BC7cfD142E73E78a8A",
35
+ "timestamp": "2023-02-27T00:00:00+00:00",
36
+ "version": "0.1",
37
+ "fee": "0.002"
38
+ },
39
+ {
40
+ "chainId": 10,
41
+ "address": "0x408EB3F5A578b3eEcFe2c0cD58988fAb306885b4",
42
+ "timestamp": "2023-09-01T00:00:00+00:00",
43
+ "version": "0.2",
44
+ "fee": "0.002"
45
+ },
46
+ {
47
+ "chainId": 42161,
48
+ "address": "0x334264f4fbb56a84f80df722ba765d210f0cf555",
49
+ "timestamp": "2023-02-23T00:00:00+00:00",
50
+ "version": "0.1",
51
+ "fee": "0.002"
52
+ },
53
+ {
54
+ "chainId": 42161,
55
+ "address": "0x408EB3F5A578b3eEcFe2c0cD58988fAb306885b4",
56
+ "timestamp": "2023-09-01T00:00:00+00:00",
57
+ "version": "0.2",
58
+ "fee": "0.002"
59
+ },
60
+ {
61
+ "chainId": 100,
62
+ "address": "0x448fabd2d16bc48ecdbe68890414de7a1b6348fd",
63
+ "timestamp": "2023-07-27T00:00:00+00:00",
64
+ "version": "0.1",
65
+ "fee": "0.002"
66
+ },
67
+ {
68
+ "chainId": 100,
69
+ "address": "0x5faD44Dc5B63f1717523c340de357ef399FeA0F2",
70
+ "timestamp": "2023-09-01T00:00:00+00:00",
71
+ "version": "0.2",
72
+ "fee": "0.002"
73
+ },
74
+ {
75
+ "chainId": 137,
76
+ "address": "0x8866DAFa2762346c85098C5b2201fA7CB2dA6100",
77
+ "timestamp": "2023-09-07T00:00:00+00:00",
78
+ "version": "0.2",
79
+ "fee": "0.002"
80
+ }
81
+ ]
82
+ }