@yodlpay/tokenlists 1.1.0 → 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.
@@ -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-C75unsqB.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-DPv0KZek.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 }){
@@ -1,8 +1,3 @@
1
- import * as fs from 'fs';
2
- import * as path from 'path';
3
- import __node_cjsUrl from 'node:url';
4
- import __node_cjsPath from 'node:path';
5
-
6
1
  const yodlRouterAbiV01 = [
7
2
  {
8
3
  inputs: [
@@ -16677,7 +16672,7 @@ const schedulerCache = /*#__PURE__*/ new Map();
16677
16672
  } catch (err) {
16678
16673
  const data = getRevertErrorData(err);
16679
16674
  // Check for CCIP-Read offchain lookup signature.
16680
- const { offchainLookup, offchainLookupSignature } = await import('./ccip-Cm28A1_H.js');
16675
+ const { offchainLookup, offchainLookupSignature } = await import('./ccip-BgewxUIz.js');
16681
16676
  if (client.ccipRead !== false && data?.slice(0, 10) === offchainLookupSignature && to) return {
16682
16677
  data: await offchainLookup(client, {
16683
16678
  data,
@@ -33213,8 +33208,6 @@ const REGISTRY = registryData.stablecoins;
33213
33208
  return results;
33214
33209
  }
33215
33210
 
33216
- const __filename$1 = __node_cjsUrl.fileURLToPath(import.meta.url);
33217
- const __dirname$1 = __node_cjsPath.dirname(__filename$1);
33218
33211
  /**
33219
33212
  * Featured token overrides - tokens that are manually curated and should not be
33220
33213
  * updated from on-chain data. These allow intentional duplicates (e.g., native
@@ -33254,9 +33247,6 @@ const __dirname$1 = __node_cjsPath.dirname(__filename$1);
33254
33247
  ]
33255
33248
  }
33256
33249
  ];
33257
- // Paths to token list files
33258
- const FEATURED_TOKENLIST_PATH = path.resolve(__dirname$1, 'tokenlist-featured.json');
33259
- const GENERATED_TOKENLIST_PATH = path.resolve(__dirname$1, 'tokenlist-generated.json');
33260
33250
  /**
33261
33251
  * Compute display decimals based on token characteristics
33262
33252
  */ function computeDisplayDecimals(symbol, decimals, coinGeckoId) {
@@ -33278,29 +33268,6 @@ const GENERATED_TOKENLIST_PATH = path.resolve(__dirname$1, 'tokenlist-generated.
33278
33268
  // Default to showing reasonable precision (max 6)
33279
33269
  return Math.min(decimals, 6);
33280
33270
  }
33281
- /**
33282
- * Read featured tokenlist from disk
33283
- */ function readFeaturedTokenlist() {
33284
- return JSON.parse(fs.readFileSync(FEATURED_TOKENLIST_PATH, 'utf-8'));
33285
- }
33286
- /**
33287
- * Write featured tokenlist to disk
33288
- */ function writeFeaturedTokenlist(tokens) {
33289
- const data = {
33290
- timestamp: new Date().toISOString(),
33291
- tokens
33292
- };
33293
- fs.writeFileSync(FEATURED_TOKENLIST_PATH, JSON.stringify(data, null, 2) + '\n');
33294
- }
33295
- /**
33296
- * Write generated tokenlist to disk
33297
- */ function writeGeneratedTokenlist(tokens) {
33298
- const data = {
33299
- timestamp: new Date().toISOString(),
33300
- tokens
33301
- };
33302
- fs.writeFileSync(GENERATED_TOKENLIST_PATH, JSON.stringify(data, null, 2));
33303
- }
33304
33271
  const tokenlist = featuredTokenlist.tokens.concat(generatedTokenlist.tokens);
33305
33272
  function getTokenByAddress(tokenAddress, chainId) {
33306
33273
  return tokenlist.find((token)=>isAddressEqual(tokenAddress, token.address) && (!chainId || token.chainId === chainId));
@@ -33339,4 +33306,4 @@ function getNativeWrappedToken(chainId) {
33339
33306
  return token;
33340
33307
  }
33341
33308
 
33342
- export { getStablecoinsByPeg as A, BaseError$1 as B, COINGECKO_PLATFORM_TO_CHAIN_ID as C, getTokenByAddress as D, getTokenBySymbol as E, FEATURED_TOKENLIST_PATH as F, GENERATED_TOKENLIST_PATH as G, HttpRequestError as H, getTokens as I, isNativeToken as J, isStablecoin as K, readFeaturedTokenlist as L, tokenlist as M, NATIVE_TOKEN_ADDRESS as N, writeFeaturedTokenlist as O, writeGeneratedTokenlist as P, YODL_ROUTER_ABIS as Y, localBatchGatewayRequest as a, concat$1 as b, call as c, decodeErrorResult as d, encodeAbiParameters as e, isHex as f, getUrl as g, FEATURED_TOKEN_OVERRIDES as h, isAddressEqual as i, chains as j, computeDisplayDecimals as k, localBatchGatewayUrl as l, getChain as m, getChainById as n, getChains as o, getFeaturedTokenBySymbol as p, getNativeToken as q, getNativeWrappedToken as r, stringify$1 as s, getPublicClient as t, getRouter as u, getRouterAbi as v, getRouterByAddress as w, getShortNames as x, getStablecoinCurrency as y, getStablecoinInfo as z };
33309
+ export { getTokenByAddress as A, BaseError$1 as B, COINGECKO_PLATFORM_TO_CHAIN_ID as C, getTokenBySymbol as D, getTokens as E, FEATURED_TOKEN_OVERRIDES as F, isNativeToken as G, HttpRequestError as H, isStablecoin as I, tokenlist as J, NATIVE_TOKEN_ADDRESS as N, YODL_ROUTER_ABIS as Y, localBatchGatewayRequest as a, concat$1 as b, call as c, decodeErrorResult as d, encodeAbiParameters as e, isHex as f, getUrl as g, chains as h, isAddressEqual as i, computeDisplayDecimals as j, getChain as k, localBatchGatewayUrl as l, getChainById as m, getChains as n, getFeaturedTokenBySymbol as o, getNativeToken as p, getNativeWrappedToken as q, getPublicClient as r, stringify$1 as s, getRouter as t, getRouterAbi as u, getRouterByAddress as v, getShortNames as w, getStablecoinCurrency as x, getStablecoinInfo as y, getStablecoinsByPeg as z };
@@ -1,27 +1,3 @@
1
- var fs = require('fs');
2
- var path = require('path');
3
-
4
- function _interopNamespace(e) {
5
- if (e && e.__esModule) return e;
6
- var n = Object.create(null);
7
- if (e) {
8
- Object.keys(e).forEach(function (k) {
9
- if (k !== 'default') {
10
- var d = Object.getOwnPropertyDescriptor(e, k);
11
- Object.defineProperty(n, k, d.get ? d : {
12
- enumerable: true,
13
- get: function () { return e[k]; }
14
- });
15
- }
16
- });
17
- }
18
- n.default = e;
19
- return n;
20
- }
21
-
22
- var fs__namespace = /*#__PURE__*/_interopNamespace(fs);
23
- var path__namespace = /*#__PURE__*/_interopNamespace(path);
24
-
25
1
  const yodlRouterAbiV01 = [
26
2
  {
27
3
  inputs: [
@@ -16696,7 +16672,7 @@ const schedulerCache = /*#__PURE__*/ new Map();
16696
16672
  } catch (err) {
16697
16673
  const data = getRevertErrorData(err);
16698
16674
  // Check for CCIP-Read offchain lookup signature.
16699
- const { offchainLookup, offchainLookupSignature } = await Promise.resolve().then(function () { return require('./ccip-E6OCw-JN.cjs'); });
16675
+ const { offchainLookup, offchainLookupSignature } = await Promise.resolve().then(function () { return require('./ccip-xBg9Xffd.cjs'); });
16700
16676
  if (client.ccipRead !== false && data?.slice(0, 10) === offchainLookupSignature && to) return {
16701
16677
  data: await offchainLookup(client, {
16702
16678
  data,
@@ -33271,9 +33247,6 @@ const REGISTRY = registryData.stablecoins;
33271
33247
  ]
33272
33248
  }
33273
33249
  ];
33274
- // Paths to token list files
33275
- const FEATURED_TOKENLIST_PATH = path__namespace.resolve(__dirname, 'tokenlist-featured.json');
33276
- const GENERATED_TOKENLIST_PATH = path__namespace.resolve(__dirname, 'tokenlist-generated.json');
33277
33250
  /**
33278
33251
  * Compute display decimals based on token characteristics
33279
33252
  */ function computeDisplayDecimals(symbol, decimals, coinGeckoId) {
@@ -33295,29 +33268,6 @@ const GENERATED_TOKENLIST_PATH = path__namespace.resolve(__dirname, 'tokenlist-g
33295
33268
  // Default to showing reasonable precision (max 6)
33296
33269
  return Math.min(decimals, 6);
33297
33270
  }
33298
- /**
33299
- * Read featured tokenlist from disk
33300
- */ function readFeaturedTokenlist() {
33301
- return JSON.parse(fs__namespace.readFileSync(FEATURED_TOKENLIST_PATH, 'utf-8'));
33302
- }
33303
- /**
33304
- * Write featured tokenlist to disk
33305
- */ function writeFeaturedTokenlist(tokens) {
33306
- const data = {
33307
- timestamp: new Date().toISOString(),
33308
- tokens
33309
- };
33310
- fs__namespace.writeFileSync(FEATURED_TOKENLIST_PATH, JSON.stringify(data, null, 2) + '\n');
33311
- }
33312
- /**
33313
- * Write generated tokenlist to disk
33314
- */ function writeGeneratedTokenlist(tokens) {
33315
- const data = {
33316
- timestamp: new Date().toISOString(),
33317
- tokens
33318
- };
33319
- fs__namespace.writeFileSync(GENERATED_TOKENLIST_PATH, JSON.stringify(data, null, 2));
33320
- }
33321
33271
  const tokenlist = featuredTokenlist.tokens.concat(generatedTokenlist.tokens);
33322
33272
  function getTokenByAddress(tokenAddress, chainId) {
33323
33273
  return tokenlist.find((token)=>isAddressEqual(tokenAddress, token.address) && (!chainId || token.chainId === chainId));
@@ -33358,9 +33308,7 @@ function getNativeWrappedToken(chainId) {
33358
33308
 
33359
33309
  exports.BaseError = BaseError$1;
33360
33310
  exports.COINGECKO_PLATFORM_TO_CHAIN_ID = COINGECKO_PLATFORM_TO_CHAIN_ID;
33361
- exports.FEATURED_TOKENLIST_PATH = FEATURED_TOKENLIST_PATH;
33362
33311
  exports.FEATURED_TOKEN_OVERRIDES = FEATURED_TOKEN_OVERRIDES;
33363
- exports.GENERATED_TOKENLIST_PATH = GENERATED_TOKENLIST_PATH;
33364
33312
  exports.HttpRequestError = HttpRequestError;
33365
33313
  exports.NATIVE_TOKEN_ADDRESS = NATIVE_TOKEN_ADDRESS;
33366
33314
  exports.YODL_ROUTER_ABIS = YODL_ROUTER_ABIS;
@@ -33394,8 +33342,5 @@ exports.isNativeToken = isNativeToken;
33394
33342
  exports.isStablecoin = isStablecoin;
33395
33343
  exports.localBatchGatewayRequest = localBatchGatewayRequest;
33396
33344
  exports.localBatchGatewayUrl = localBatchGatewayUrl;
33397
- exports.readFeaturedTokenlist = readFeaturedTokenlist;
33398
33345
  exports.stringify = stringify$1;
33399
33346
  exports.tokenlist = tokenlist;
33400
- exports.writeFeaturedTokenlist = writeFeaturedTokenlist;
33401
- exports.writeGeneratedTokenlist = writeGeneratedTokenlist;
package/dist/index.cjs CHANGED
@@ -1,13 +1,11 @@
1
1
  Object.defineProperty(exports, '__esModule', { value: true });
2
2
 
3
- var index = require('./index-DPv0KZek.cjs');
3
+ var index = require('./index-Cy6vXO61.cjs');
4
4
 
5
5
 
6
6
 
7
7
  exports.COINGECKO_PLATFORM_TO_CHAIN_ID = index.COINGECKO_PLATFORM_TO_CHAIN_ID;
8
- exports.FEATURED_TOKENLIST_PATH = index.FEATURED_TOKENLIST_PATH;
9
8
  exports.FEATURED_TOKEN_OVERRIDES = index.FEATURED_TOKEN_OVERRIDES;
10
- exports.GENERATED_TOKENLIST_PATH = index.GENERATED_TOKENLIST_PATH;
11
9
  exports.NATIVE_TOKEN_ADDRESS = index.NATIVE_TOKEN_ADDRESS;
12
10
  exports.YODL_ROUTER_ABIS = index.YODL_ROUTER_ABIS;
13
11
  exports.chains = index.chains;
@@ -31,7 +29,4 @@ exports.getTokenBySymbol = index.getTokenBySymbol;
31
29
  exports.getTokens = index.getTokens;
32
30
  exports.isNativeToken = index.isNativeToken;
33
31
  exports.isStablecoin = index.isStablecoin;
34
- exports.readFeaturedTokenlist = index.readFeaturedTokenlist;
35
32
  exports.tokenlist = index.tokenlist;
36
- exports.writeFeaturedTokenlist = index.writeFeaturedTokenlist;
37
- exports.writeGeneratedTokenlist = index.writeGeneratedTokenlist;
package/dist/index.d.ts CHANGED
@@ -5444,27 +5444,10 @@ declare const FEATURED_TOKEN_OVERRIDES: Array<{
5444
5444
  primary: string;
5445
5445
  addresses: string[];
5446
5446
  }>;
5447
- declare const FEATURED_TOKENLIST_PATH: string;
5448
- declare const GENERATED_TOKENLIST_PATH: string;
5449
5447
  /**
5450
5448
  * Compute display decimals based on token characteristics
5451
5449
  */
5452
5450
  declare function computeDisplayDecimals(symbol: string, decimals: number, coinGeckoId?: string): number;
5453
- /**
5454
- * Read featured tokenlist from disk
5455
- */
5456
- declare function readFeaturedTokenlist(): {
5457
- timestamp: string;
5458
- tokens: TokenInfo[];
5459
- };
5460
- /**
5461
- * Write featured tokenlist to disk
5462
- */
5463
- declare function writeFeaturedTokenlist(tokens: TokenInfo[]): void;
5464
- /**
5465
- * Write generated tokenlist to disk
5466
- */
5467
- declare function writeGeneratedTokenlist(tokens: TokenInfo[]): void;
5468
5451
  declare const tokenlist: TokenInfo[];
5469
5452
  declare function getTokenByAddress(tokenAddress: string, chainId?: number): TokenInfo | undefined;
5470
5453
  declare function getFeaturedTokenBySymbol(tokenSymbol: string, chainId?: number): TokenInfo | undefined;
@@ -10872,5 +10855,5 @@ declare function getRouterAbi(version: AbiVersion): readonly [{
10872
10855
  readonly type: "receive";
10873
10856
  }];
10874
10857
 
10875
- export { COINGECKO_PLATFORM_TO_CHAIN_ID, FEATURED_TOKENLIST_PATH, FEATURED_TOKEN_OVERRIDES, GENERATED_TOKENLIST_PATH, NATIVE_TOKEN_ADDRESS, YODL_ROUTER_ABIS, chains, computeDisplayDecimals, getChain, getChainById, getChains, getFeaturedTokenBySymbol, getNativeToken, getNativeWrappedToken, getPublicClient, getRouter, getRouterAbi, getRouterByAddress, getShortNames, getStablecoinCurrency, getStablecoinInfo, getStablecoinsByPeg, getTokenByAddress, getTokenBySymbol, getTokens, isNativeToken, isStablecoin, readFeaturedTokenlist, tokenlist, writeFeaturedTokenlist, writeGeneratedTokenlist };
10858
+ export { COINGECKO_PLATFORM_TO_CHAIN_ID, FEATURED_TOKEN_OVERRIDES, NATIVE_TOKEN_ADDRESS, YODL_ROUTER_ABIS, chains, computeDisplayDecimals, getChain, getChainById, getChains, getFeaturedTokenBySymbol, getNativeToken, getNativeWrappedToken, getPublicClient, getRouter, getRouterAbi, getRouterByAddress, getShortNames, getStablecoinCurrency, getStablecoinInfo, getStablecoinsByPeg, getTokenByAddress, getTokenBySymbol, getTokens, isNativeToken, isStablecoin, tokenlist };
10876
10859
  export type { AbiVersion, FiatCurrency, NotStablecoinInfo, RouterAbiMap, StablecoinCheckResult, StablecoinInfo, TokenInfo, YodlChain };
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- export { C as COINGECKO_PLATFORM_TO_CHAIN_ID, F as FEATURED_TOKENLIST_PATH, h as FEATURED_TOKEN_OVERRIDES, G as GENERATED_TOKENLIST_PATH, N as NATIVE_TOKEN_ADDRESS, Y as YODL_ROUTER_ABIS, j as chains, k as computeDisplayDecimals, m as getChain, n as getChainById, o as getChains, p as getFeaturedTokenBySymbol, q as getNativeToken, r as getNativeWrappedToken, t as getPublicClient, u as getRouter, v as getRouterAbi, w as getRouterByAddress, x as getShortNames, y as getStablecoinCurrency, z as getStablecoinInfo, A as getStablecoinsByPeg, D as getTokenByAddress, E as getTokenBySymbol, I as getTokens, J as isNativeToken, K as isStablecoin, L as readFeaturedTokenlist, M as tokenlist, O as writeFeaturedTokenlist, P as writeGeneratedTokenlist } from './index-C75unsqB.js';
1
+ export { C as COINGECKO_PLATFORM_TO_CHAIN_ID, F as FEATURED_TOKEN_OVERRIDES, N as NATIVE_TOKEN_ADDRESS, Y as YODL_ROUTER_ABIS, h as chains, j as computeDisplayDecimals, k as getChain, m as getChainById, n as getChains, o as getFeaturedTokenBySymbol, p as getNativeToken, q as getNativeWrappedToken, r as getPublicClient, t as getRouter, u as getRouterAbi, v as getRouterByAddress, w as getShortNames, x as getStablecoinCurrency, y as getStablecoinInfo, z as getStablecoinsByPeg, A as getTokenByAddress, D as getTokenBySymbol, E as getTokens, G as isNativeToken, I as isStablecoin, J as tokenlist } from './index-BJWL_ASb.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yodlpay/tokenlists",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "Tokenlist typings, schema and lists.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",