@yodlpay/tokenlists 1.1.1 → 1.1.3
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/README.md +17 -44
- package/dist/{ccip-xBg9Xffd.cjs → ccip-DHHrdFRp.cjs} +1 -1
- package/dist/{ccip-BgewxUIz.js → ccip-D_Tl0Okc.js} +1 -1
- package/dist/{index-BJWL_ASb.js → index-DDrpnhH2.js} +17537 -2631
- package/dist/{index-Cy6vXO61.cjs → index-DexvUg55.cjs} +17536 -2633
- package/dist/index.cjs +1 -4
- package/dist/index.d.ts +11 -13
- package/dist/index.js +1 -1
- package/dist/tokens/stablecoin-registry.json +32 -3
- package/dist/tokens/tokenlist-featured.json +1 -1
- package/dist/tokens/tokenlist-generated.json +17453 -2573
- package/package.json +3 -6
package/README.md
CHANGED
|
@@ -17,21 +17,20 @@ yarn add @yodlpay/tokenlists
|
|
|
17
17
|
```typescript
|
|
18
18
|
import {
|
|
19
19
|
chains,
|
|
20
|
-
getChain,
|
|
21
20
|
getChainById,
|
|
22
|
-
getChains,
|
|
23
21
|
getShortNames,
|
|
24
22
|
getNativeToken,
|
|
25
23
|
getRouter,
|
|
26
24
|
getRouterByAddress,
|
|
27
|
-
type YodlChain
|
|
25
|
+
type YodlChain,
|
|
26
|
+
type RouterConfig,
|
|
27
|
+
type YodlChainExtension
|
|
28
28
|
} from '@yodlpay/tokenlists';
|
|
29
29
|
|
|
30
30
|
// Get all supported chains
|
|
31
|
-
const allChains =
|
|
31
|
+
const allChains = chains;
|
|
32
32
|
|
|
33
33
|
// Get chain by ID
|
|
34
|
-
const ethereum = getChain(1);
|
|
35
34
|
const arbitrum = getChainById(42161);
|
|
36
35
|
|
|
37
36
|
// Get router config for a chain
|
|
@@ -124,6 +123,7 @@ const router = getContract({
|
|
|
124
123
|
|
|
125
124
|
## Supported Chains
|
|
126
125
|
|
|
126
|
+
### Mainnets
|
|
127
127
|
- Ethereum (1)
|
|
128
128
|
- Arbitrum (42161)
|
|
129
129
|
- Optimism (10)
|
|
@@ -132,6 +132,10 @@ const router = getContract({
|
|
|
132
132
|
- Gnosis (100)
|
|
133
133
|
- BSC (56)
|
|
134
134
|
|
|
135
|
+
### Testnets
|
|
136
|
+
- Arbitrum Sepolia (421614)
|
|
137
|
+
- BSC Testnet (97)
|
|
138
|
+
|
|
135
139
|
## Development
|
|
136
140
|
|
|
137
141
|
```bash
|
|
@@ -145,7 +149,7 @@ yarn test
|
|
|
145
149
|
yarn build
|
|
146
150
|
|
|
147
151
|
# Update token lists
|
|
148
|
-
yarn update
|
|
152
|
+
yarn update:tokens
|
|
149
153
|
|
|
150
154
|
# Type check
|
|
151
155
|
yarn typecheck
|
|
@@ -153,29 +157,13 @@ yarn typecheck
|
|
|
153
157
|
|
|
154
158
|
## Token List Update Process
|
|
155
159
|
|
|
156
|
-
The package maintains
|
|
160
|
+
The package maintains these data files:
|
|
157
161
|
|
|
158
162
|
- **Featured** (`tokenlist-featured.json`) - Manually curated tokens with metadata updated from on-chain data
|
|
159
163
|
- **Generated** (`tokenlist-generated.json`) - Auto-fetched tokens from external sources (cross-checked with other services as they are added)
|
|
164
|
+
- **Stablecoin Registry** (`stablecoin-registry.json`) - Mapping of CoinGecko IDs to fiat currencies (USD, EUR, etc.) for stablecoin detection
|
|
160
165
|
|
|
161
|
-
###
|
|
162
|
-
|
|
163
|
-
```bash
|
|
164
|
-
yarn update:stablecoins
|
|
165
|
-
```
|
|
166
|
-
|
|
167
|
-
Fetches stablecoin data from CoinGecko category APIs and updates `stablecoin-registry.json`. The script:
|
|
168
|
-
|
|
169
|
-
1. Fetches tokens from CoinGecko stablecoin categories (USD, EUR, GBP, JPY, etc.)
|
|
170
|
-
2. Filters to only include tokens present in the tokenlists (by coinGeckoId)
|
|
171
|
-
3. Outputs a simple mapping of `coinGeckoId → peggedTo` currency
|
|
172
|
-
|
|
173
|
-
To update everything at once:
|
|
174
|
-
```bash
|
|
175
|
-
yarn update:all # Runs update:stablecoins then update
|
|
176
|
-
```
|
|
177
|
-
|
|
178
|
-
### How `yarn update` Works
|
|
166
|
+
### How `yarn update:tokens` Works
|
|
179
167
|
|
|
180
168
|
1. **Fetch tokens from Relay Link API** - Discovers tokens across all supported chains
|
|
181
169
|
2. **Enrich with on-chain data** - Verifies name, symbol, and decimals directly from contracts
|
|
@@ -187,6 +175,7 @@ yarn update:all # Runs update:stablecoins then update
|
|
|
187
175
|
- Circulating/max supply ratio (must be ≥ 0.1%)
|
|
188
176
|
5. **Remove duplicates** - Tokens with duplicate symbols on the same chain are removed
|
|
189
177
|
6. **Write to generated list** - Updates `tokenlist-generated.json`
|
|
178
|
+
7. **Update stablecoin registry** - Fetches stablecoin data from CoinGecko and updates `stablecoin-registry.json`
|
|
190
179
|
|
|
191
180
|
### Featured Token Overrides
|
|
192
181
|
|
|
@@ -205,29 +194,13 @@ When querying by symbol, the `primary` address is returned. Use `getTokenByAddre
|
|
|
205
194
|
|
|
206
195
|
### Token Logo Management
|
|
207
196
|
|
|
208
|
-
Token logos are stored in Vercel Blob storage
|
|
197
|
+
Token logos are stored in Vercel Blob storage. Run:
|
|
209
198
|
|
|
210
|
-
**Download logos locally:**
|
|
211
199
|
```bash
|
|
212
|
-
yarn
|
|
200
|
+
yarn update:logos
|
|
213
201
|
```
|
|
214
|
-
- Downloads logos from external URLs in token lists
|
|
215
|
-
- Converts all images to optimized WebP format (512px max, 85% quality)
|
|
216
|
-
- Upscales small images with [Real-ESRGAN](https://github.com/xinntao/Real-ESRGAN) if available
|
|
217
|
-
- Saves to `logos/tokens/` directory
|
|
218
|
-
- Updates token lists to point to Vercel Blob URLs
|
|
219
202
|
|
|
220
|
-
|
|
221
|
-
```bash
|
|
222
|
-
# Upload new logos (skip existing)
|
|
223
|
-
yarn upload-logos
|
|
224
|
-
|
|
225
|
-
# Force re-upload all logos
|
|
226
|
-
yarn upload-logos --force
|
|
227
|
-
|
|
228
|
-
# Preview without uploading
|
|
229
|
-
yarn upload-logos --dry-run
|
|
230
|
-
```
|
|
203
|
+
This downloads logos from external URLs, converts them to optimized WebP format, and uploads them to Vercel Blob storage.
|
|
231
204
|
|
|
232
205
|
Requires `BLOB_READ_WRITE_TOKEN` environment variable (set in `.env` or export).
|
|
233
206
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as BaseError, g as getUrl, s as stringify, d as decodeErrorResult, i as isAddressEqual, l as localBatchGatewayUrl, a as localBatchGatewayRequest, c as call, b as concat, e as encodeAbiParameters, H as HttpRequestError, f as isHex } from './index-
|
|
1
|
+
import { B as BaseError, g as getUrl, s as stringify, d as decodeErrorResult, i as isAddressEqual, l as localBatchGatewayUrl, a as localBatchGatewayRequest, c as call, b as concat, e as encodeAbiParameters, H as HttpRequestError, f as isHex } from './index-DDrpnhH2.js';
|
|
2
2
|
|
|
3
3
|
class OffchainLookupError extends BaseError {
|
|
4
4
|
constructor({ callbackSelector, cause, data, extraData, sender, urls }){
|