@yodlpay/tokenlists 1.0.2 → 1.1.1

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 CHANGED
@@ -71,6 +71,35 @@ const dai = getTokenBySymbol('DAI', 1);
71
71
  const weth = getNativeWrappedToken(1);
72
72
  ```
73
73
 
74
+ ### Stablecoins
75
+
76
+ ```typescript
77
+ import {
78
+ isStablecoin,
79
+ getStablecoinCurrency,
80
+ getStablecoinInfo,
81
+ getStablecoinsByPeg,
82
+ type FiatCurrency,
83
+ type StablecoinCheckResult
84
+ } from '@yodlpay/tokenlists';
85
+
86
+ // Check if a token is a stablecoin (by coinGeckoId)
87
+ isStablecoin('tether'); // true
88
+ isStablecoin('ethereum'); // false
89
+
90
+ // Get the currency a stablecoin is pegged to
91
+ getStablecoinCurrency('usd-coin'); // 'USD'
92
+ getStablecoinCurrency('euro-coin'); // 'EUR'
93
+
94
+ // Get detailed stablecoin info for a token
95
+ const token = getTokenBySymbol('USDC', 1);
96
+ const info = getStablecoinInfo(token);
97
+ // { isStablecoin: true, peggedTo: 'USD' }
98
+
99
+ // Get all stablecoin coinGeckoIds for a currency
100
+ getStablecoinsByPeg('EUR'); // ['euro-coin', 'monerium-eur-money', ...]
101
+ ```
102
+
74
103
  ### Router ABIs
75
104
 
76
105
  ```typescript
@@ -129,6 +158,23 @@ The package maintains two token lists:
129
158
  - **Featured** (`tokenlist-featured.json`) - Manually curated tokens with metadata updated from on-chain data
130
159
  - **Generated** (`tokenlist-generated.json`) - Auto-fetched tokens from external sources (cross-checked with other services as they are added)
131
160
 
161
+ ### Updating Stablecoin Registry
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
+
132
178
  ### How `yarn update` Works
133
179
 
134
180
  1. **Fetch tokens from Relay Link API** - Discovers tokens across all supported chains
@@ -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-QILtCArq.js';
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-BJWL_ASb.js';
2
2
 
3
3
  class OffchainLookupError extends BaseError {
4
4
  constructor({ callbackSelector, cause, data, extraData, sender, urls }){
@@ -1,4 +1,4 @@
1
- var index = require('./index-BxN39P-j.cjs');
1
+ var index = require('./index-Cy6vXO61.cjs');
2
2
 
3
3
  class OffchainLookupError extends index.BaseError {
4
4
  constructor({ callbackSelector, cause, data, extraData, sender, urls }){