@yodlpay/tokenlists 0.4.7 → 0.5.0

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.
@@ -2207,6 +2207,7 @@ var chains = [
2207
2207
  ],
2208
2208
  wrappedNativeToken: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
2209
2209
  explorerUrl: "https://etherscan.io",
2210
+ nativeTokenName: "ETH",
2210
2211
  timestamp: "2024-06-20T08:16:18.193Z",
2211
2212
  feeTreasury: "0x9C48d180e4eEE0dA2A899EE1E4c533cA5e92db77",
2212
2213
  curveRouterAddress: "0x99a58482BD75cbab83b27EC03CA68fF489b5788f"
@@ -2222,6 +2223,7 @@ var chains = [
2222
2223
  ],
2223
2224
  wrappedNativeToken: "0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6",
2224
2225
  explorerUrl: "https://goerli.etherscan.io",
2226
+ nativeTokenName: "ETH",
2225
2227
  timestamp: "2022-12-28T14:10:09+00:00",
2226
2228
  feeTreasury: "0x3E8A61F0532BA2b58660606d61110cC9E90c4D29"
2227
2229
  },
@@ -2236,6 +2238,7 @@ var chains = [
2236
2238
  ],
2237
2239
  wrappedNativeToken: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",
2238
2240
  explorerUrl: "https://arbiscan.io",
2241
+ nativeTokenName: "ETH",
2239
2242
  timestamp: "2024-06-20T08:16:18.932Z",
2240
2243
  feeTreasury: "0x5f0947253a8218894af13438ac2e2e0ced30d234",
2241
2244
  curveRouterAddress: "0x4c2af2df2a7e567b5155879720619ea06c5bb15d"
@@ -2251,6 +2254,7 @@ var chains = [
2251
2254
  ],
2252
2255
  wrappedNativeToken: "0x4200000000000000000000000000000000000006",
2253
2256
  explorerUrl: "https://optimistic.etherscan.io",
2257
+ nativeTokenName: "ETH",
2254
2258
  timestamp: "2024-06-20T08:16:19.165Z",
2255
2259
  feeTreasury: "0x5f0947253a8218894af13438ac2e2e0ced30d234",
2256
2260
  curveRouterAddress: "0x89287c32c2cac1c76227f6d300b2dbbab6b75c08"
@@ -2266,6 +2270,7 @@ var chains = [
2266
2270
  ],
2267
2271
  wrappedNativeToken: "0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB",
2268
2272
  explorerUrl: "https://snowtrace.io",
2273
+ nativeTokenName: "AVAX",
2269
2274
  timestamp: "2023-01-13T14:52:05+00:00",
2270
2275
  feeTreasury: "0x25e22F3ceE59F34622f7DC9a2078B85f17BfBe95"
2271
2276
  },
@@ -2280,6 +2285,7 @@ var chains = [
2280
2285
  ],
2281
2286
  wrappedNativeToken: "0xe91d153e0b41518a2ce8dd3d7944fa863463a97d",
2282
2287
  explorerUrl: "https://gnosisscan.io",
2288
+ nativeTokenName: "xDAI",
2283
2289
  timestamp: "2024-06-20T08:16:18.872Z",
2284
2290
  feeTreasury: "0x775aaf73a50C25eEBd308BBb9C34C73D081B423b",
2285
2291
  curveRouterAddress: "0xe6358f6a45b502477e83cc1cda759f540e4459ee"
@@ -2295,6 +2301,7 @@ var chains = [
2295
2301
  ],
2296
2302
  wrappedNativeToken: "0x4200000000000000000000000000000000000006",
2297
2303
  explorerUrl: "https://basescan.org",
2304
+ nativeTokenName: "ETH",
2298
2305
  timestamp: "2024-06-20T08:16:19.051Z",
2299
2306
  feeTreasury: "0x46959a8a332eca1a05Bd4F18115b8F2E1C2F2f05",
2300
2307
  curveRouterAddress: "0x0000000000000000000000000000000000000000"
@@ -2310,6 +2317,7 @@ var chains = [
2310
2317
  ],
2311
2318
  wrappedNativeToken: "0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270",
2312
2319
  explorerUrl: "https://polygonscan.com",
2320
+ nativeTokenName: "MATIC",
2313
2321
  timestamp: "2024-06-20T08:16:18.717Z",
2314
2322
  feeTreasury: "0x5f0947253a8218894af13438ac2e2E0CeD30d234",
2315
2323
  curveRouterAddress: "0x2a426b3Bb4fa87488387545f15D01d81352732F9"
@@ -2361,6 +2369,13 @@ var routers = [
2361
2369
  version: "0.4",
2362
2370
  fee: "0.002"
2363
2371
  },
2372
+ {
2373
+ chainId: 1,
2374
+ address: "0x42ecf39814824a684529d57e1635d30a90fb9c33",
2375
+ timestamp: "2024-07-17T00:00:00+00:00",
2376
+ version: "0.5",
2377
+ fee: "0.002"
2378
+ },
2364
2379
  {
2365
2380
  chainId: 5,
2366
2381
  address: "0x8412D3c11aa605EbaF14D0b6BC7705ab45143Ee8",
@@ -2396,6 +2411,13 @@ var routers = [
2396
2411
  version: "0.4",
2397
2412
  fee: "0.002"
2398
2413
  },
2414
+ {
2415
+ chainId: 10,
2416
+ address: "0x589fce694575064b5637310804587338037d1de9",
2417
+ timestamp: "2024-07-17T00:00:00+00:00",
2418
+ version: "0.5",
2419
+ fee: "0.002"
2420
+ },
2399
2421
  {
2400
2422
  chainId: 42161,
2401
2423
  address: "0x334264f4fbb56a84f80df722ba765d210f0cf555",
@@ -2424,6 +2446,13 @@ var routers = [
2424
2446
  version: "0.4",
2425
2447
  fee: "0.002"
2426
2448
  },
2449
+ {
2450
+ chainId: 42161,
2451
+ address: "0x627a23113d5d4b2731002d71a6330802374d71d9",
2452
+ timestamp: "2024-07-17T00:00:00+00:00",
2453
+ version: "0.5",
2454
+ fee: "0.002"
2455
+ },
2427
2456
  {
2428
2457
  chainId: 100,
2429
2458
  address: "0x448fabd2d16bc48ecdbe68890414de7a1b6348fd",
@@ -2452,6 +2481,13 @@ var routers = [
2452
2481
  version: "0.4",
2453
2482
  fee: "0.002"
2454
2483
  },
2484
+ {
2485
+ chainId: 100,
2486
+ address: "0xbb8f4e641bbef2fb3e4d73ddf902bee92cee8889",
2487
+ timestamp: "2024-07-17T00:00:00+00:00",
2488
+ version: "0.5",
2489
+ fee: "0.002"
2490
+ },
2455
2491
  {
2456
2492
  chainId: 137,
2457
2493
  address: "0x8866DAFa2762346c85098C5b2201fA7CB2dA6100",
@@ -2473,6 +2509,13 @@ var routers = [
2473
2509
  version: "0.4",
2474
2510
  fee: "0.002"
2475
2511
  },
2512
+ {
2513
+ chainId: 137,
2514
+ address: "0x24794f216fd5a90927c47b8799fd73c9a8d083a1",
2515
+ timestamp: "2024-07-17T00:00:00+00:00",
2516
+ version: "0.5",
2517
+ fee: "0.002"
2518
+ },
2476
2519
  {
2477
2520
  chainId: 8453,
2478
2521
  address: "0x2BaE9Bb53BCe89c760dBfA55D854D43ab96EE19f",
@@ -2500,6 +2543,13 @@ var routers = [
2500
2543
  timestamp: "2024-06-28T10:50:00+00:00",
2501
2544
  version: "0.4",
2502
2545
  fee: "0.002"
2546
+ },
2547
+ {
2548
+ chainId: 8453,
2549
+ address: "0x556280bb6f34b4387662e59de18028052cd4d466",
2550
+ timestamp: "2024-07-17T00:00:00+00:00",
2551
+ version: "0.5",
2552
+ fee: "0.002"
2503
2553
  }
2504
2554
  ];
2505
2555
  var routerlist = {
@@ -13285,238 +13335,844 @@ var YodlRouterV04 = [
13285
13335
  }
13286
13336
  ];
13287
13337
 
13288
- var YODL_ROUTER_ABIS = {
13289
- "0.1": YodlRouterV01,
13290
- "0.2": YodlRouterV02,
13291
- "0.3": YodlRouterV03,
13292
- "0.4": YodlRouterV04,
13293
- "test": YodlRouterV03
13294
- };
13295
- var CURVE_ROUTER_ABI = CurveRouterV13Abi;
13296
-
13297
- var TokenListTagNames;
13298
-
13299
- (function (TokenListTagNames) {
13300
- // Networks
13301
- TokenListTagNames["MAINNET"] = "Mainnet";
13302
- TokenListTagNames["OPTIMISM"] = "Optimism";
13303
- TokenListTagNames["ARBITRUM"] = "Arbitrum";
13304
- TokenListTagNames["AVALANCHE"] = "Avalanche";
13305
- TokenListTagNames["BASE"] = "Base";
13306
- TokenListTagNames["TESTNET"] = "TESTNET"; // Coin/currency
13307
-
13308
- TokenListTagNames["STABLECOIN"] = "Stablecoin";
13309
- TokenListTagNames["USD"] = "USD";
13310
- TokenListTagNames["EUR"] = "EUR"; // Misc
13311
-
13312
- TokenListTagNames["TOP_10"] = "Top10";
13313
- TokenListTagNames["NATIVE_TOKEN"] = "Native Token";
13314
- })(TokenListTagNames || (TokenListTagNames = {}));
13315
-
13316
- /**
13317
- * Comparator function that allows sorting version from lowest to highest
13318
- * @param versionA version A to compare
13319
- * @param versionB version B to compare
13320
- * @returns -1 if versionA comes before versionB, 0 if versionA is equal to version B, and 1 if version A comes after version B
13321
- */
13322
- function versionComparator(versionA, versionB) {
13323
- if (versionA.major < versionB.major) {
13324
- return -1;
13325
- } else if (versionA.major > versionB.major) {
13326
- return 1;
13327
- } else if (versionA.minor < versionB.minor) {
13328
- return -1;
13329
- } else if (versionA.minor > versionB.minor) {
13330
- return 1;
13331
- } else if (versionA.patch < versionB.patch) {
13332
- return -1;
13333
- } else if (versionA.patch > versionB.patch) {
13334
- return 1;
13335
- } else {
13336
- return 0;
13337
- }
13338
- }
13339
-
13340
- /**
13341
- * Returns true if versionB is an update over versionA
13342
- */
13343
-
13344
- function isVersionUpdate(base, update) {
13345
- return versionComparator(base, update) < 0;
13346
- }
13347
-
13348
- /**
13349
- * Enum describing types of version differences
13350
- */
13351
- var VersionUpgrade;
13352
-
13353
- (function (VersionUpgrade) {
13354
- VersionUpgrade[VersionUpgrade["NONE"] = 0] = "NONE";
13355
- VersionUpgrade[VersionUpgrade["PATCH"] = 1] = "PATCH";
13356
- VersionUpgrade[VersionUpgrade["MINOR"] = 2] = "MINOR";
13357
- VersionUpgrade[VersionUpgrade["MAJOR"] = 3] = "MAJOR";
13358
- })(VersionUpgrade || (VersionUpgrade = {}));
13359
- /**
13360
- * Return the upgrade type from the base version to the update version.
13361
- * Note that downgrades and equivalent versions are both treated as `NONE`.
13362
- * @param base base list
13363
- * @param update update to the list
13364
- */
13365
-
13366
-
13367
- function getVersionUpgrade(base, update) {
13368
- if (update.major > base.major) {
13369
- return VersionUpgrade.MAJOR;
13370
- }
13371
-
13372
- if (update.major < base.major) {
13373
- return VersionUpgrade.NONE;
13374
- }
13375
-
13376
- if (update.minor > base.minor) {
13377
- return VersionUpgrade.MINOR;
13378
- }
13379
-
13380
- if (update.minor < base.minor) {
13381
- return VersionUpgrade.NONE;
13382
- }
13383
-
13384
- return update.patch > base.patch ? VersionUpgrade.PATCH : VersionUpgrade.NONE;
13385
- }
13386
-
13387
- /**
13388
- * compares two token info key values
13389
- * this subset of full deep equal functionality does not work on objects or object arrays
13390
- * @param a comparison item a
13391
- * @param b comparison item b
13392
- */
13393
- function compareTokenInfoProperty(a, b) {
13394
- if (a === b) return true;
13395
- if (typeof a !== typeof b) return false;
13396
-
13397
- if (Array.isArray(a) && Array.isArray(b)) {
13398
- return a.every(function (el, i) {
13399
- return b[i] === el;
13400
- });
13401
- }
13402
-
13403
- return false;
13404
- }
13405
- /**
13406
- * Computes the diff of a token list where the first argument is the base and the second argument is the updated list.
13407
- * @param base base list
13408
- * @param update updated list
13409
- */
13410
-
13411
-
13412
- function diffTokenLists(base, update) {
13413
- var indexedBase = base.reduce(function (memo, tokenInfo) {
13414
- if (!memo[tokenInfo.chainId]) memo[tokenInfo.chainId] = {};
13415
- memo[tokenInfo.chainId][tokenInfo.address] = tokenInfo;
13416
- return memo;
13417
- }, {});
13418
- var newListUpdates = update.reduce(function (memo, tokenInfo) {
13419
- var _indexedBase$tokenInf;
13420
-
13421
- var baseToken = (_indexedBase$tokenInf = indexedBase[tokenInfo.chainId]) == null ? void 0 : _indexedBase$tokenInf[tokenInfo.address];
13422
-
13423
- if (!baseToken) {
13424
- memo.added.push(tokenInfo);
13425
- } else {
13426
- var changes = Object.keys(tokenInfo).filter(function (s) {
13427
- return s !== "address" && s !== "chainId";
13428
- }).filter(function (s) {
13429
- return !compareTokenInfoProperty(tokenInfo[s], baseToken[s]);
13430
- });
13431
-
13432
- if (changes.length > 0) {
13433
- if (!memo.changed[tokenInfo.chainId]) {
13434
- memo.changed[tokenInfo.chainId] = {};
13435
- }
13436
-
13437
- memo.changed[tokenInfo.chainId][tokenInfo.address] = changes;
13438
- }
13439
- }
13440
-
13441
- if (!memo.index[tokenInfo.chainId]) {
13442
- var _memo$index$tokenInfo;
13443
-
13444
- memo.index[tokenInfo.chainId] = (_memo$index$tokenInfo = {}, _memo$index$tokenInfo[tokenInfo.address] = true, _memo$index$tokenInfo);
13445
- } else {
13446
- memo.index[tokenInfo.chainId][tokenInfo.address] = true;
13447
- }
13448
-
13449
- return memo;
13450
- }, {
13451
- added: [],
13452
- changed: {},
13453
- index: {}
13454
- });
13455
- var removed = base.reduce(function (list, curr) {
13456
- if (!newListUpdates.index[curr.chainId] || !newListUpdates.index[curr.chainId][curr.address]) {
13457
- list.push(curr);
13458
- }
13459
-
13460
- return list;
13461
- }, []);
13462
- return {
13463
- added: newListUpdates.added,
13464
- changed: newListUpdates.changed,
13465
- removed: removed
13466
- };
13467
- }
13468
-
13469
- /**
13470
- * Returns the minimum version bump for the given list
13471
- * @param baseList the base list of tokens
13472
- * @param updatedList the updated list of tokens
13473
- */
13474
-
13475
- function minVersionBump(baseList, updatedList) {
13476
- var diff = diffTokenLists(baseList, updatedList);
13477
- if (diff.removed.length > 0) return VersionUpgrade.MAJOR;
13478
- if (diff.added.length > 0) return VersionUpgrade.MINOR;
13479
- if (Object.keys(diff.changed).length > 0) return VersionUpgrade.PATCH;
13480
- return VersionUpgrade.NONE;
13481
- }
13482
-
13483
- /**
13484
- * Returns the next version of the list given a base version and the upgrade type
13485
- * @param base current version
13486
- * @param bump the upgrade type
13487
- */
13488
-
13489
- function nextVersion(base, bump) {
13490
- switch (bump) {
13491
- case VersionUpgrade.NONE:
13492
- return base;
13493
-
13494
- case VersionUpgrade.MAJOR:
13495
- return {
13496
- major: base.major + 1,
13497
- minor: 0,
13498
- patch: 0
13499
- };
13500
-
13501
- case VersionUpgrade.MINOR:
13502
- return {
13503
- major: base.major,
13504
- minor: base.minor + 1,
13505
- patch: 0
13506
- };
13507
-
13508
- case VersionUpgrade.PATCH:
13509
- return {
13510
- major: base.major,
13511
- minor: base.minor,
13512
- patch: base.patch + 1
13513
- };
13514
- }
13515
- }
13516
-
13517
- var tokenlist = /*#__PURE__*/featuredTokenlist.tokens.concat( //@ts-ignore
13518
- generatedTokenlist.tokens);
13519
- function getChains() {
13338
+ var YodlRouterV05 = [
13339
+ {
13340
+ inputs: [
13341
+ ],
13342
+ stateMutability: "nonpayable",
13343
+ type: "constructor"
13344
+ },
13345
+ {
13346
+ anonymous: false,
13347
+ inputs: [
13348
+ {
13349
+ indexed: true,
13350
+ internalType: "address",
13351
+ name: "priceFeed0",
13352
+ type: "address"
13353
+ },
13354
+ {
13355
+ indexed: true,
13356
+ internalType: "address",
13357
+ name: "priceFeed1",
13358
+ type: "address"
13359
+ },
13360
+ {
13361
+ indexed: false,
13362
+ internalType: "int256",
13363
+ name: "exchangeRate0",
13364
+ type: "int256"
13365
+ },
13366
+ {
13367
+ indexed: false,
13368
+ internalType: "int256",
13369
+ name: "exchangeRate1",
13370
+ type: "int256"
13371
+ }
13372
+ ],
13373
+ name: "Convert",
13374
+ type: "event"
13375
+ },
13376
+ {
13377
+ anonymous: false,
13378
+ inputs: [
13379
+ {
13380
+ indexed: true,
13381
+ internalType: "address",
13382
+ name: "sender",
13383
+ type: "address"
13384
+ },
13385
+ {
13386
+ indexed: true,
13387
+ internalType: "address",
13388
+ name: "receiver",
13389
+ type: "address"
13390
+ },
13391
+ {
13392
+ indexed: false,
13393
+ internalType: "address",
13394
+ name: "token",
13395
+ type: "address"
13396
+ },
13397
+ {
13398
+ indexed: false,
13399
+ internalType: "uint256",
13400
+ name: "amount",
13401
+ type: "uint256"
13402
+ },
13403
+ {
13404
+ indexed: false,
13405
+ internalType: "uint256",
13406
+ name: "fees",
13407
+ type: "uint256"
13408
+ },
13409
+ {
13410
+ indexed: false,
13411
+ internalType: "bytes32",
13412
+ name: "memo",
13413
+ type: "bytes32"
13414
+ }
13415
+ ],
13416
+ name: "Yodl",
13417
+ type: "event"
13418
+ },
13419
+ {
13420
+ anonymous: false,
13421
+ inputs: [
13422
+ {
13423
+ indexed: true,
13424
+ internalType: "address",
13425
+ name: "sender",
13426
+ type: "address"
13427
+ },
13428
+ {
13429
+ indexed: true,
13430
+ internalType: "address",
13431
+ name: "receiver",
13432
+ type: "address"
13433
+ },
13434
+ {
13435
+ indexed: true,
13436
+ internalType: "uint256",
13437
+ name: "amount",
13438
+ type: "uint256"
13439
+ }
13440
+ ],
13441
+ name: "YodlNativeTokenTransfer",
13442
+ type: "event"
13443
+ },
13444
+ {
13445
+ inputs: [
13446
+ ],
13447
+ name: "MAX_EXTRA_FEE_BPS",
13448
+ outputs: [
13449
+ {
13450
+ internalType: "uint256",
13451
+ name: "",
13452
+ type: "uint256"
13453
+ }
13454
+ ],
13455
+ stateMutability: "view",
13456
+ type: "function"
13457
+ },
13458
+ {
13459
+ inputs: [
13460
+ ],
13461
+ name: "NATIVE_TOKEN",
13462
+ outputs: [
13463
+ {
13464
+ internalType: "address",
13465
+ name: "",
13466
+ type: "address"
13467
+ }
13468
+ ],
13469
+ stateMutability: "view",
13470
+ type: "function"
13471
+ },
13472
+ {
13473
+ inputs: [
13474
+ {
13475
+ internalType: "uint256",
13476
+ name: "amount",
13477
+ type: "uint256"
13478
+ },
13479
+ {
13480
+ internalType: "uint256",
13481
+ name: "feeBps",
13482
+ type: "uint256"
13483
+ }
13484
+ ],
13485
+ name: "calculateFee",
13486
+ outputs: [
13487
+ {
13488
+ internalType: "uint256",
13489
+ name: "",
13490
+ type: "uint256"
13491
+ }
13492
+ ],
13493
+ stateMutability: "pure",
13494
+ type: "function"
13495
+ },
13496
+ {
13497
+ inputs: [
13498
+ {
13499
+ internalType: "address[2]",
13500
+ name: "priceFeeds",
13501
+ type: "address[2]"
13502
+ },
13503
+ {
13504
+ internalType: "uint256",
13505
+ name: "amount",
13506
+ type: "uint256"
13507
+ }
13508
+ ],
13509
+ name: "exchangeRate",
13510
+ outputs: [
13511
+ {
13512
+ internalType: "uint256",
13513
+ name: "converted",
13514
+ type: "uint256"
13515
+ },
13516
+ {
13517
+ internalType: "address[2]",
13518
+ name: "priceFeedsUsed",
13519
+ type: "address[2]"
13520
+ },
13521
+ {
13522
+ internalType: "int256[2]",
13523
+ name: "prices",
13524
+ type: "int256[2]"
13525
+ }
13526
+ ],
13527
+ stateMutability: "view",
13528
+ type: "function"
13529
+ },
13530
+ {
13531
+ inputs: [
13532
+ {
13533
+ internalType: "address",
13534
+ name: "token",
13535
+ type: "address"
13536
+ }
13537
+ ],
13538
+ name: "sweep",
13539
+ outputs: [
13540
+ ],
13541
+ stateMutability: "nonpayable",
13542
+ type: "function"
13543
+ },
13544
+ {
13545
+ inputs: [
13546
+ {
13547
+ internalType: "uint256",
13548
+ name: "amount",
13549
+ type: "uint256"
13550
+ },
13551
+ {
13552
+ internalType: "uint256",
13553
+ name: "feeBps",
13554
+ type: "uint256"
13555
+ },
13556
+ {
13557
+ internalType: "address",
13558
+ name: "token",
13559
+ type: "address"
13560
+ },
13561
+ {
13562
+ internalType: "address",
13563
+ name: "from",
13564
+ type: "address"
13565
+ },
13566
+ {
13567
+ internalType: "address",
13568
+ name: "to",
13569
+ type: "address"
13570
+ }
13571
+ ],
13572
+ name: "transferFee",
13573
+ outputs: [
13574
+ {
13575
+ internalType: "uint256",
13576
+ name: "",
13577
+ type: "uint256"
13578
+ }
13579
+ ],
13580
+ stateMutability: "nonpayable",
13581
+ type: "function"
13582
+ },
13583
+ {
13584
+ inputs: [
13585
+ ],
13586
+ name: "uniswapRouter",
13587
+ outputs: [
13588
+ {
13589
+ internalType: "contract ISwapRouter02",
13590
+ name: "",
13591
+ type: "address"
13592
+ }
13593
+ ],
13594
+ stateMutability: "view",
13595
+ type: "function"
13596
+ },
13597
+ {
13598
+ inputs: [
13599
+ ],
13600
+ name: "version",
13601
+ outputs: [
13602
+ {
13603
+ internalType: "string",
13604
+ name: "",
13605
+ type: "string"
13606
+ }
13607
+ ],
13608
+ stateMutability: "view",
13609
+ type: "function"
13610
+ },
13611
+ {
13612
+ inputs: [
13613
+ ],
13614
+ name: "wrappedNativeToken",
13615
+ outputs: [
13616
+ {
13617
+ internalType: "contract IWETH9",
13618
+ name: "",
13619
+ type: "address"
13620
+ }
13621
+ ],
13622
+ stateMutability: "view",
13623
+ type: "function"
13624
+ },
13625
+ {
13626
+ inputs: [
13627
+ ],
13628
+ name: "yodlFeeBps",
13629
+ outputs: [
13630
+ {
13631
+ internalType: "uint256",
13632
+ name: "",
13633
+ type: "uint256"
13634
+ }
13635
+ ],
13636
+ stateMutability: "view",
13637
+ type: "function"
13638
+ },
13639
+ {
13640
+ inputs: [
13641
+ ],
13642
+ name: "yodlFeeTreasury",
13643
+ outputs: [
13644
+ {
13645
+ internalType: "address",
13646
+ name: "",
13647
+ type: "address"
13648
+ }
13649
+ ],
13650
+ stateMutability: "view",
13651
+ type: "function"
13652
+ },
13653
+ {
13654
+ inputs: [
13655
+ {
13656
+ components: [
13657
+ {
13658
+ internalType: "address",
13659
+ name: "sender",
13660
+ type: "address"
13661
+ },
13662
+ {
13663
+ internalType: "address",
13664
+ name: "receiver",
13665
+ type: "address"
13666
+ },
13667
+ {
13668
+ internalType: "uint256",
13669
+ name: "amountIn",
13670
+ type: "uint256"
13671
+ },
13672
+ {
13673
+ internalType: "uint256",
13674
+ name: "amountOut",
13675
+ type: "uint256"
13676
+ },
13677
+ {
13678
+ internalType: "bytes32",
13679
+ name: "memo",
13680
+ type: "bytes32"
13681
+ },
13682
+ {
13683
+ internalType: "address[9]",
13684
+ name: "route",
13685
+ type: "address[9]"
13686
+ },
13687
+ {
13688
+ internalType: "uint256[3][4]",
13689
+ name: "swapParams",
13690
+ type: "uint256[3][4]"
13691
+ },
13692
+ {
13693
+ internalType: "address[4]",
13694
+ name: "factoryAddresses",
13695
+ type: "address[4]"
13696
+ },
13697
+ {
13698
+ internalType: "address[2]",
13699
+ name: "priceFeeds",
13700
+ type: "address[2]"
13701
+ },
13702
+ {
13703
+ internalType: "address",
13704
+ name: "extraFeeReceiver",
13705
+ type: "address"
13706
+ },
13707
+ {
13708
+ internalType: "uint256",
13709
+ name: "extraFeeBps",
13710
+ type: "uint256"
13711
+ },
13712
+ {
13713
+ internalType: "uint256",
13714
+ name: "yd",
13715
+ type: "uint256"
13716
+ },
13717
+ {
13718
+ components: [
13719
+ {
13720
+ internalType: "address",
13721
+ name: "yApp",
13722
+ type: "address"
13723
+ },
13724
+ {
13725
+ internalType: "uint256",
13726
+ name: "sessionId",
13727
+ type: "uint256"
13728
+ },
13729
+ {
13730
+ internalType: "bytes[]",
13731
+ name: "payload",
13732
+ type: "bytes[]"
13733
+ }
13734
+ ],
13735
+ internalType: "struct AbstractYodlRouter.YApp[]",
13736
+ name: "yAppList",
13737
+ type: "tuple[]"
13738
+ }
13739
+ ],
13740
+ internalType: "struct YodlCurveRouter.YodlCurveParams",
13741
+ name: "params",
13742
+ type: "tuple"
13743
+ }
13744
+ ],
13745
+ name: "yodlWithCurve",
13746
+ outputs: [
13747
+ {
13748
+ internalType: "uint256",
13749
+ name: "",
13750
+ type: "uint256"
13751
+ }
13752
+ ],
13753
+ stateMutability: "payable",
13754
+ type: "function"
13755
+ },
13756
+ {
13757
+ inputs: [
13758
+ {
13759
+ components: [
13760
+ {
13761
+ internalType: "bytes32",
13762
+ name: "memo",
13763
+ type: "bytes32"
13764
+ },
13765
+ {
13766
+ internalType: "uint256",
13767
+ name: "amount",
13768
+ type: "uint256"
13769
+ },
13770
+ {
13771
+ internalType: "address[2]",
13772
+ name: "priceFeeds",
13773
+ type: "address[2]"
13774
+ },
13775
+ {
13776
+ internalType: "address",
13777
+ name: "token",
13778
+ type: "address"
13779
+ },
13780
+ {
13781
+ internalType: "address",
13782
+ name: "receiver",
13783
+ type: "address"
13784
+ },
13785
+ {
13786
+ internalType: "address",
13787
+ name: "extraFeeReceiver",
13788
+ type: "address"
13789
+ },
13790
+ {
13791
+ internalType: "uint256",
13792
+ name: "extraFeeBps",
13793
+ type: "uint256"
13794
+ },
13795
+ {
13796
+ internalType: "uint256",
13797
+ name: "yd",
13798
+ type: "uint256"
13799
+ },
13800
+ {
13801
+ components: [
13802
+ {
13803
+ internalType: "address",
13804
+ name: "yApp",
13805
+ type: "address"
13806
+ },
13807
+ {
13808
+ internalType: "uint256",
13809
+ name: "sessionId",
13810
+ type: "uint256"
13811
+ },
13812
+ {
13813
+ internalType: "bytes[]",
13814
+ name: "payload",
13815
+ type: "bytes[]"
13816
+ }
13817
+ ],
13818
+ internalType: "struct AbstractYodlRouter.YApp[]",
13819
+ name: "yAppList",
13820
+ type: "tuple[]"
13821
+ }
13822
+ ],
13823
+ internalType: "struct YodlTransferRouter.YodlTransferParams",
13824
+ name: "params",
13825
+ type: "tuple"
13826
+ }
13827
+ ],
13828
+ name: "yodlWithToken",
13829
+ outputs: [
13830
+ {
13831
+ internalType: "uint256",
13832
+ name: "",
13833
+ type: "uint256"
13834
+ }
13835
+ ],
13836
+ stateMutability: "payable",
13837
+ type: "function"
13838
+ },
13839
+ {
13840
+ inputs: [
13841
+ {
13842
+ components: [
13843
+ {
13844
+ internalType: "address",
13845
+ name: "sender",
13846
+ type: "address"
13847
+ },
13848
+ {
13849
+ internalType: "address",
13850
+ name: "receiver",
13851
+ type: "address"
13852
+ },
13853
+ {
13854
+ internalType: "uint256",
13855
+ name: "amountIn",
13856
+ type: "uint256"
13857
+ },
13858
+ {
13859
+ internalType: "uint256",
13860
+ name: "amountOut",
13861
+ type: "uint256"
13862
+ },
13863
+ {
13864
+ internalType: "bytes32",
13865
+ name: "memo",
13866
+ type: "bytes32"
13867
+ },
13868
+ {
13869
+ internalType: "bytes",
13870
+ name: "path",
13871
+ type: "bytes"
13872
+ },
13873
+ {
13874
+ internalType: "address[2]",
13875
+ name: "priceFeeds",
13876
+ type: "address[2]"
13877
+ },
13878
+ {
13879
+ internalType: "address",
13880
+ name: "extraFeeReceiver",
13881
+ type: "address"
13882
+ },
13883
+ {
13884
+ internalType: "uint256",
13885
+ name: "extraFeeBps",
13886
+ type: "uint256"
13887
+ },
13888
+ {
13889
+ internalType: "enum YodlUniswapRouter.SwapType",
13890
+ name: "swapType",
13891
+ type: "uint8"
13892
+ },
13893
+ {
13894
+ internalType: "uint256",
13895
+ name: "yd",
13896
+ type: "uint256"
13897
+ },
13898
+ {
13899
+ components: [
13900
+ {
13901
+ internalType: "address",
13902
+ name: "yApp",
13903
+ type: "address"
13904
+ },
13905
+ {
13906
+ internalType: "uint256",
13907
+ name: "sessionId",
13908
+ type: "uint256"
13909
+ },
13910
+ {
13911
+ internalType: "bytes[]",
13912
+ name: "payload",
13913
+ type: "bytes[]"
13914
+ }
13915
+ ],
13916
+ internalType: "struct AbstractYodlRouter.YApp[]",
13917
+ name: "yAppList",
13918
+ type: "tuple[]"
13919
+ }
13920
+ ],
13921
+ internalType: "struct YodlUniswapRouter.YodlUniswapParams",
13922
+ name: "params",
13923
+ type: "tuple"
13924
+ }
13925
+ ],
13926
+ name: "yodlWithUniswap",
13927
+ outputs: [
13928
+ {
13929
+ internalType: "uint256",
13930
+ name: "",
13931
+ type: "uint256"
13932
+ }
13933
+ ],
13934
+ stateMutability: "payable",
13935
+ type: "function"
13936
+ },
13937
+ {
13938
+ stateMutability: "payable",
13939
+ type: "receive"
13940
+ }
13941
+ ];
13942
+
13943
+ var YODL_ROUTER_ABIS = {
13944
+ "0.1": YodlRouterV01,
13945
+ "0.2": YodlRouterV02,
13946
+ "0.3": YodlRouterV03,
13947
+ "0.4": YodlRouterV04,
13948
+ "0.5": YodlRouterV05,
13949
+ "test": YodlRouterV03
13950
+ };
13951
+ var CURVE_ROUTER_ABI = CurveRouterV13Abi;
13952
+
13953
+ var TokenListTagNames;
13954
+
13955
+ (function (TokenListTagNames) {
13956
+ // Networks
13957
+ TokenListTagNames["MAINNET"] = "Mainnet";
13958
+ TokenListTagNames["OPTIMISM"] = "Optimism";
13959
+ TokenListTagNames["ARBITRUM"] = "Arbitrum";
13960
+ TokenListTagNames["AVALANCHE"] = "Avalanche";
13961
+ TokenListTagNames["BASE"] = "Base";
13962
+ TokenListTagNames["TESTNET"] = "TESTNET"; // Coin/currency
13963
+
13964
+ TokenListTagNames["STABLECOIN"] = "Stablecoin";
13965
+ TokenListTagNames["USD"] = "USD";
13966
+ TokenListTagNames["EUR"] = "EUR"; // Misc
13967
+
13968
+ TokenListTagNames["TOP_10"] = "Top10";
13969
+ TokenListTagNames["NATIVE_TOKEN"] = "Native Token";
13970
+ })(TokenListTagNames || (TokenListTagNames = {}));
13971
+
13972
+ /**
13973
+ * Comparator function that allows sorting version from lowest to highest
13974
+ * @param versionA version A to compare
13975
+ * @param versionB version B to compare
13976
+ * @returns -1 if versionA comes before versionB, 0 if versionA is equal to version B, and 1 if version A comes after version B
13977
+ */
13978
+ function versionComparator(versionA, versionB) {
13979
+ if (versionA.major < versionB.major) {
13980
+ return -1;
13981
+ } else if (versionA.major > versionB.major) {
13982
+ return 1;
13983
+ } else if (versionA.minor < versionB.minor) {
13984
+ return -1;
13985
+ } else if (versionA.minor > versionB.minor) {
13986
+ return 1;
13987
+ } else if (versionA.patch < versionB.patch) {
13988
+ return -1;
13989
+ } else if (versionA.patch > versionB.patch) {
13990
+ return 1;
13991
+ } else {
13992
+ return 0;
13993
+ }
13994
+ }
13995
+
13996
+ /**
13997
+ * Returns true if versionB is an update over versionA
13998
+ */
13999
+
14000
+ function isVersionUpdate(base, update) {
14001
+ return versionComparator(base, update) < 0;
14002
+ }
14003
+
14004
+ /**
14005
+ * Enum describing types of version differences
14006
+ */
14007
+ var VersionUpgrade;
14008
+
14009
+ (function (VersionUpgrade) {
14010
+ VersionUpgrade[VersionUpgrade["NONE"] = 0] = "NONE";
14011
+ VersionUpgrade[VersionUpgrade["PATCH"] = 1] = "PATCH";
14012
+ VersionUpgrade[VersionUpgrade["MINOR"] = 2] = "MINOR";
14013
+ VersionUpgrade[VersionUpgrade["MAJOR"] = 3] = "MAJOR";
14014
+ })(VersionUpgrade || (VersionUpgrade = {}));
14015
+ /**
14016
+ * Return the upgrade type from the base version to the update version.
14017
+ * Note that downgrades and equivalent versions are both treated as `NONE`.
14018
+ * @param base base list
14019
+ * @param update update to the list
14020
+ */
14021
+
14022
+
14023
+ function getVersionUpgrade(base, update) {
14024
+ if (update.major > base.major) {
14025
+ return VersionUpgrade.MAJOR;
14026
+ }
14027
+
14028
+ if (update.major < base.major) {
14029
+ return VersionUpgrade.NONE;
14030
+ }
14031
+
14032
+ if (update.minor > base.minor) {
14033
+ return VersionUpgrade.MINOR;
14034
+ }
14035
+
14036
+ if (update.minor < base.minor) {
14037
+ return VersionUpgrade.NONE;
14038
+ }
14039
+
14040
+ return update.patch > base.patch ? VersionUpgrade.PATCH : VersionUpgrade.NONE;
14041
+ }
14042
+
14043
+ /**
14044
+ * compares two token info key values
14045
+ * this subset of full deep equal functionality does not work on objects or object arrays
14046
+ * @param a comparison item a
14047
+ * @param b comparison item b
14048
+ */
14049
+ function compareTokenInfoProperty(a, b) {
14050
+ if (a === b) return true;
14051
+ if (typeof a !== typeof b) return false;
14052
+
14053
+ if (Array.isArray(a) && Array.isArray(b)) {
14054
+ return a.every(function (el, i) {
14055
+ return b[i] === el;
14056
+ });
14057
+ }
14058
+
14059
+ return false;
14060
+ }
14061
+ /**
14062
+ * Computes the diff of a token list where the first argument is the base and the second argument is the updated list.
14063
+ * @param base base list
14064
+ * @param update updated list
14065
+ */
14066
+
14067
+
14068
+ function diffTokenLists(base, update) {
14069
+ var indexedBase = base.reduce(function (memo, tokenInfo) {
14070
+ if (!memo[tokenInfo.chainId]) memo[tokenInfo.chainId] = {};
14071
+ memo[tokenInfo.chainId][tokenInfo.address] = tokenInfo;
14072
+ return memo;
14073
+ }, {});
14074
+ var newListUpdates = update.reduce(function (memo, tokenInfo) {
14075
+ var _indexedBase$tokenInf;
14076
+
14077
+ var baseToken = (_indexedBase$tokenInf = indexedBase[tokenInfo.chainId]) == null ? void 0 : _indexedBase$tokenInf[tokenInfo.address];
14078
+
14079
+ if (!baseToken) {
14080
+ memo.added.push(tokenInfo);
14081
+ } else {
14082
+ var changes = Object.keys(tokenInfo).filter(function (s) {
14083
+ return s !== "address" && s !== "chainId";
14084
+ }).filter(function (s) {
14085
+ return !compareTokenInfoProperty(tokenInfo[s], baseToken[s]);
14086
+ });
14087
+
14088
+ if (changes.length > 0) {
14089
+ if (!memo.changed[tokenInfo.chainId]) {
14090
+ memo.changed[tokenInfo.chainId] = {};
14091
+ }
14092
+
14093
+ memo.changed[tokenInfo.chainId][tokenInfo.address] = changes;
14094
+ }
14095
+ }
14096
+
14097
+ if (!memo.index[tokenInfo.chainId]) {
14098
+ var _memo$index$tokenInfo;
14099
+
14100
+ memo.index[tokenInfo.chainId] = (_memo$index$tokenInfo = {}, _memo$index$tokenInfo[tokenInfo.address] = true, _memo$index$tokenInfo);
14101
+ } else {
14102
+ memo.index[tokenInfo.chainId][tokenInfo.address] = true;
14103
+ }
14104
+
14105
+ return memo;
14106
+ }, {
14107
+ added: [],
14108
+ changed: {},
14109
+ index: {}
14110
+ });
14111
+ var removed = base.reduce(function (list, curr) {
14112
+ if (!newListUpdates.index[curr.chainId] || !newListUpdates.index[curr.chainId][curr.address]) {
14113
+ list.push(curr);
14114
+ }
14115
+
14116
+ return list;
14117
+ }, []);
14118
+ return {
14119
+ added: newListUpdates.added,
14120
+ changed: newListUpdates.changed,
14121
+ removed: removed
14122
+ };
14123
+ }
14124
+
14125
+ /**
14126
+ * Returns the minimum version bump for the given list
14127
+ * @param baseList the base list of tokens
14128
+ * @param updatedList the updated list of tokens
14129
+ */
14130
+
14131
+ function minVersionBump(baseList, updatedList) {
14132
+ var diff = diffTokenLists(baseList, updatedList);
14133
+ if (diff.removed.length > 0) return VersionUpgrade.MAJOR;
14134
+ if (diff.added.length > 0) return VersionUpgrade.MINOR;
14135
+ if (Object.keys(diff.changed).length > 0) return VersionUpgrade.PATCH;
14136
+ return VersionUpgrade.NONE;
14137
+ }
14138
+
14139
+ /**
14140
+ * Returns the next version of the list given a base version and the upgrade type
14141
+ * @param base current version
14142
+ * @param bump the upgrade type
14143
+ */
14144
+
14145
+ function nextVersion(base, bump) {
14146
+ switch (bump) {
14147
+ case VersionUpgrade.NONE:
14148
+ return base;
14149
+
14150
+ case VersionUpgrade.MAJOR:
14151
+ return {
14152
+ major: base.major + 1,
14153
+ minor: 0,
14154
+ patch: 0
14155
+ };
14156
+
14157
+ case VersionUpgrade.MINOR:
14158
+ return {
14159
+ major: base.major,
14160
+ minor: base.minor + 1,
14161
+ patch: 0
14162
+ };
14163
+
14164
+ case VersionUpgrade.PATCH:
14165
+ return {
14166
+ major: base.major,
14167
+ minor: base.minor,
14168
+ patch: base.patch + 1
14169
+ };
14170
+ }
14171
+ }
14172
+
14173
+ var tokenlist = /*#__PURE__*/featuredTokenlist.tokens.concat( //@ts-ignore
14174
+ generatedTokenlist.tokens);
14175
+ function getChains() {
13520
14176
  return chainlist.chains;
13521
14177
  }
13522
14178
  function getChain(chainId) {
@@ -13636,6 +14292,13 @@ function getShortNames() {
13636
14292
  return chain.shortName;
13637
14293
  });
13638
14294
  }
14295
+ function getNativeToken(chainId) {
14296
+ var _chainlist$chains$fin;
14297
+
14298
+ return (_chainlist$chains$fin = chainlist.chains.find(function (chain) {
14299
+ return chain.chainId === chainId;
14300
+ })) == null ? void 0 : _chainlist$chains$fin.nativeTokenName;
14301
+ }
13639
14302
  function getNativeWrappedToken(chainId) {
13640
14303
  var nativeTokens = featuredTokenlist.tokens.filter(function (t) {
13641
14304
  return t.chainId === chainId && t.tags.map(function (tag) {
@@ -13654,5 +14317,5 @@ function getNativeWrappedToken(chainId) {
13654
14317
  return nativeTokens[0];
13655
14318
  }
13656
14319
 
13657
- export { CURVE_ROUTER_ABI, TokenListTagNames, VersionUpgrade, YODL_ROUTER_ABIS, diffTokenLists, getChain, getChains, getFaucetAddress, getFeaturedTokenBySymbol, getFiatCurrencies, getFiatCurrency, getFiatFeeds, getLatestRouter, getNativeWrappedToken, getPriceFeed, getPriceFeeds, getRouter, getRouterByAddress, getRouters, getShortNames, getTokenByAddress, getTokenBySymbol, getTokenFeeds, getTokens, getVersionUpgrade, isVersionUpdate, minVersionBump, nextVersion, versionComparator };
14320
+ export { CURVE_ROUTER_ABI, TokenListTagNames, VersionUpgrade, YODL_ROUTER_ABIS, diffTokenLists, getChain, getChains, getFaucetAddress, getFeaturedTokenBySymbol, getFiatCurrencies, getFiatCurrency, getFiatFeeds, getLatestRouter, getNativeToken, getNativeWrappedToken, getPriceFeed, getPriceFeeds, getRouter, getRouterByAddress, getRouters, getShortNames, getTokenByAddress, getTokenBySymbol, getTokenFeeds, getTokens, getVersionUpgrade, isVersionUpdate, minVersionBump, nextVersion, versionComparator };
13658
14321
  //# sourceMappingURL=tokenlists.esm.js.map