@yodlpay/tokenlists 0.4.1 → 0.4.3-alpha.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.
@@ -70,7 +70,8 @@ var tokens = [
70
70
  tags: [
71
71
  "Mainnet",
72
72
  "Native Token",
73
- "featured"
73
+ "featured",
74
+ "wrapped"
74
75
  ],
75
76
  address: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"
76
77
  },
@@ -84,7 +85,8 @@ var tokens = [
84
85
  tags: [
85
86
  "Optimism",
86
87
  "Native Token",
87
- "featured"
88
+ "featured",
89
+ "wrapped"
88
90
  ],
89
91
  address: "0x4200000000000000000000000000000000000006"
90
92
  },
@@ -98,7 +100,8 @@ var tokens = [
98
100
  tags: [
99
101
  "Arbitrum",
100
102
  "Native Token",
101
- "featured"
103
+ "featured",
104
+ "wrapped"
102
105
  ],
103
106
  address: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1"
104
107
  },
@@ -112,7 +115,8 @@ var tokens = [
112
115
  tags: [
113
116
  "Base",
114
117
  "Native Token",
115
- "featured"
118
+ "featured",
119
+ "wrapped"
116
120
  ],
117
121
  address: "0x4200000000000000000000000000000000000006"
118
122
  },
@@ -540,7 +544,8 @@ var tokens = [
540
544
  "Stablecoin",
541
545
  "Native Token",
542
546
  "USD",
543
- "featured"
547
+ "featured",
548
+ "wrapped"
544
549
  ],
545
550
  logoUri: "https://raw.githubusercontent.com/yodlpay/tokenlists/main/logos/tokens/wxDAI.svg"
546
551
  },
@@ -583,7 +588,8 @@ var tokens = [
583
588
  tags: [
584
589
  "Polygon",
585
590
  "Native Token",
586
- "featured"
591
+ "featured",
592
+ "wrapped"
587
593
  ],
588
594
  address: "0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270"
589
595
  },
@@ -2344,6 +2350,13 @@ var routers = [
2344
2350
  version: "0.3",
2345
2351
  fee: "0.002"
2346
2352
  },
2353
+ {
2354
+ chainId: 10,
2355
+ address: "0x8ee49523463d041e28C2f80f95e3F511e1e73925",
2356
+ timestamp: "2024-06-28T00:00:00+00:00",
2357
+ version: "0.4",
2358
+ fee: "0.002"
2359
+ },
2347
2360
  {
2348
2361
  chainId: 42161,
2349
2362
  address: "0x334264f4fbb56a84f80df722ba765d210f0cf555",
@@ -2365,6 +2378,13 @@ var routers = [
2365
2378
  version: "0.3",
2366
2379
  fee: "0.002"
2367
2380
  },
2381
+ {
2382
+ chainId: 42161,
2383
+ address: "0x9569B81892B7168efe41cdc51aa075a71C0f4F5b",
2384
+ timestamp: "2024-06-28T00:00:00+00:00",
2385
+ version: "0.4",
2386
+ fee: "0.002"
2387
+ },
2368
2388
  {
2369
2389
  chainId: 100,
2370
2390
  address: "0x448fabd2d16bc48ecdbe68890414de7a1b6348fd",
@@ -2386,6 +2406,13 @@ var routers = [
2386
2406
  version: "0.3",
2387
2407
  fee: "0.002"
2388
2408
  },
2409
+ {
2410
+ chainId: 100,
2411
+ address: "0xAf69d83E142c6f4B8e72C634a03C0ab6f361d0CC",
2412
+ timestamp: "2024-06-28T00:00:00+00:00",
2413
+ version: "0.4",
2414
+ fee: "0.002"
2415
+ },
2389
2416
  {
2390
2417
  chainId: 137,
2391
2418
  address: "0x8866DAFa2762346c85098C5b2201fA7CB2dA6100",
@@ -2400,6 +2427,13 @@ var routers = [
2400
2427
  version: "0.3",
2401
2428
  fee: "0.002"
2402
2429
  },
2430
+ {
2431
+ chainId: 137,
2432
+ address: "0x0642F4e4fcfA014Db0134D6C96aCcBb2bdD77ba4",
2433
+ timestamp: "2024-06-28T00:00:00+00:00",
2434
+ version: "0.4",
2435
+ fee: "0.002"
2436
+ },
2403
2437
  {
2404
2438
  chainId: 8453,
2405
2439
  address: "0x2BaE9Bb53BCe89c760dBfA55D854D43ab96EE19f",
@@ -2420,6 +2454,13 @@ var routers = [
2420
2454
  timestamp: "2024-06-20T15:50:00+00:00",
2421
2455
  version: "0.3",
2422
2456
  fee: "0.002"
2457
+ },
2458
+ {
2459
+ chainId: 8453,
2460
+ address: "0xe066da17bf33B51271CFB568A04B6115402b6C2d",
2461
+ timestamp: "2024-06-28T10:50:00+00:00",
2462
+ version: "0.4",
2463
+ fee: "0.002"
2423
2464
  }
2424
2465
  ];
2425
2466
  var routerlist = {
@@ -13340,237 +13381,841 @@ var YodlRouterV03 = [
13340
13381
  }
13341
13382
  ];
13342
13383
 
13343
- var HIRO_ROUTER_ABIS = {
13344
- "0.1": YodlRouterV01,
13345
- "0.2": YodlRouterV02,
13346
- "0.3": YodlRouterV03,
13347
- "test": YodlRouterV03
13348
- };
13349
- var CURVE_ROUTER_ABI = CurveRouterV13Abi;
13350
-
13351
- var TokenListTagNames;
13352
-
13353
- (function (TokenListTagNames) {
13354
- // Networks
13355
- TokenListTagNames["MAINNET"] = "Mainnet";
13356
- TokenListTagNames["OPTIMISM"] = "Optimism";
13357
- TokenListTagNames["ARBITRUM"] = "Arbitrum";
13358
- TokenListTagNames["AVALANCHE"] = "Avalanche";
13359
- TokenListTagNames["BASE"] = "Base";
13360
- TokenListTagNames["TESTNET"] = "TESTNET"; // Coin/currency
13361
-
13362
- TokenListTagNames["STABLECOIN"] = "Stablecoin";
13363
- TokenListTagNames["USD"] = "USD";
13364
- TokenListTagNames["EUR"] = "EUR"; // Misc
13365
-
13366
- TokenListTagNames["TOP_10"] = "Top10";
13367
- TokenListTagNames["NATIVE_TOKEN"] = "Native Token";
13368
- })(TokenListTagNames || (TokenListTagNames = {}));
13369
-
13370
- /**
13371
- * Comparator function that allows sorting version from lowest to highest
13372
- * @param versionA version A to compare
13373
- * @param versionB version B to compare
13374
- * @returns -1 if versionA comes before versionB, 0 if versionA is equal to version B, and 1 if version A comes after version B
13375
- */
13376
- function versionComparator(versionA, versionB) {
13377
- if (versionA.major < versionB.major) {
13378
- return -1;
13379
- } else if (versionA.major > versionB.major) {
13380
- return 1;
13381
- } else if (versionA.minor < versionB.minor) {
13382
- return -1;
13383
- } else if (versionA.minor > versionB.minor) {
13384
- return 1;
13385
- } else if (versionA.patch < versionB.patch) {
13386
- return -1;
13387
- } else if (versionA.patch > versionB.patch) {
13388
- return 1;
13389
- } else {
13390
- return 0;
13391
- }
13392
- }
13393
-
13394
- /**
13395
- * Returns true if versionB is an update over versionA
13396
- */
13397
-
13398
- function isVersionUpdate(base, update) {
13399
- return versionComparator(base, update) < 0;
13400
- }
13401
-
13402
- /**
13403
- * Enum describing types of version differences
13404
- */
13405
- var VersionUpgrade;
13406
-
13407
- (function (VersionUpgrade) {
13408
- VersionUpgrade[VersionUpgrade["NONE"] = 0] = "NONE";
13409
- VersionUpgrade[VersionUpgrade["PATCH"] = 1] = "PATCH";
13410
- VersionUpgrade[VersionUpgrade["MINOR"] = 2] = "MINOR";
13411
- VersionUpgrade[VersionUpgrade["MAJOR"] = 3] = "MAJOR";
13412
- })(VersionUpgrade || (VersionUpgrade = {}));
13413
- /**
13414
- * Return the upgrade type from the base version to the update version.
13415
- * Note that downgrades and equivalent versions are both treated as `NONE`.
13416
- * @param base base list
13417
- * @param update update to the list
13418
- */
13419
-
13420
-
13421
- function getVersionUpgrade(base, update) {
13422
- if (update.major > base.major) {
13423
- return VersionUpgrade.MAJOR;
13424
- }
13425
-
13426
- if (update.major < base.major) {
13427
- return VersionUpgrade.NONE;
13428
- }
13429
-
13430
- if (update.minor > base.minor) {
13431
- return VersionUpgrade.MINOR;
13432
- }
13433
-
13434
- if (update.minor < base.minor) {
13435
- return VersionUpgrade.NONE;
13436
- }
13437
-
13438
- return update.patch > base.patch ? VersionUpgrade.PATCH : VersionUpgrade.NONE;
13439
- }
13440
-
13441
- /**
13442
- * compares two token info key values
13443
- * this subset of full deep equal functionality does not work on objects or object arrays
13444
- * @param a comparison item a
13445
- * @param b comparison item b
13446
- */
13447
- function compareTokenInfoProperty(a, b) {
13448
- if (a === b) return true;
13449
- if (typeof a !== typeof b) return false;
13450
-
13451
- if (Array.isArray(a) && Array.isArray(b)) {
13452
- return a.every(function (el, i) {
13453
- return b[i] === el;
13454
- });
13455
- }
13456
-
13457
- return false;
13458
- }
13459
- /**
13460
- * Computes the diff of a token list where the first argument is the base and the second argument is the updated list.
13461
- * @param base base list
13462
- * @param update updated list
13463
- */
13464
-
13465
-
13466
- function diffTokenLists(base, update) {
13467
- var indexedBase = base.reduce(function (memo, tokenInfo) {
13468
- if (!memo[tokenInfo.chainId]) memo[tokenInfo.chainId] = {};
13469
- memo[tokenInfo.chainId][tokenInfo.address] = tokenInfo;
13470
- return memo;
13471
- }, {});
13472
- var newListUpdates = update.reduce(function (memo, tokenInfo) {
13473
- var _indexedBase$tokenInf;
13474
-
13475
- var baseToken = (_indexedBase$tokenInf = indexedBase[tokenInfo.chainId]) == null ? void 0 : _indexedBase$tokenInf[tokenInfo.address];
13476
-
13477
- if (!baseToken) {
13478
- memo.added.push(tokenInfo);
13479
- } else {
13480
- var changes = Object.keys(tokenInfo).filter(function (s) {
13481
- return s !== "address" && s !== "chainId";
13482
- }).filter(function (s) {
13483
- return !compareTokenInfoProperty(tokenInfo[s], baseToken[s]);
13484
- });
13485
-
13486
- if (changes.length > 0) {
13487
- if (!memo.changed[tokenInfo.chainId]) {
13488
- memo.changed[tokenInfo.chainId] = {};
13489
- }
13490
-
13491
- memo.changed[tokenInfo.chainId][tokenInfo.address] = changes;
13492
- }
13493
- }
13494
-
13495
- if (!memo.index[tokenInfo.chainId]) {
13496
- var _memo$index$tokenInfo;
13497
-
13498
- memo.index[tokenInfo.chainId] = (_memo$index$tokenInfo = {}, _memo$index$tokenInfo[tokenInfo.address] = true, _memo$index$tokenInfo);
13499
- } else {
13500
- memo.index[tokenInfo.chainId][tokenInfo.address] = true;
13501
- }
13502
-
13503
- return memo;
13504
- }, {
13505
- added: [],
13506
- changed: {},
13507
- index: {}
13508
- });
13509
- var removed = base.reduce(function (list, curr) {
13510
- if (!newListUpdates.index[curr.chainId] || !newListUpdates.index[curr.chainId][curr.address]) {
13511
- list.push(curr);
13512
- }
13513
-
13514
- return list;
13515
- }, []);
13516
- return {
13517
- added: newListUpdates.added,
13518
- changed: newListUpdates.changed,
13519
- removed: removed
13520
- };
13521
- }
13522
-
13523
- /**
13524
- * Returns the minimum version bump for the given list
13525
- * @param baseList the base list of tokens
13526
- * @param updatedList the updated list of tokens
13527
- */
13528
-
13529
- function minVersionBump(baseList, updatedList) {
13530
- var diff = diffTokenLists(baseList, updatedList);
13531
- if (diff.removed.length > 0) return VersionUpgrade.MAJOR;
13532
- if (diff.added.length > 0) return VersionUpgrade.MINOR;
13533
- if (Object.keys(diff.changed).length > 0) return VersionUpgrade.PATCH;
13534
- return VersionUpgrade.NONE;
13535
- }
13536
-
13537
- /**
13538
- * Returns the next version of the list given a base version and the upgrade type
13539
- * @param base current version
13540
- * @param bump the upgrade type
13541
- */
13542
-
13543
- function nextVersion(base, bump) {
13544
- switch (bump) {
13545
- case VersionUpgrade.NONE:
13546
- return base;
13547
-
13548
- case VersionUpgrade.MAJOR:
13549
- return {
13550
- major: base.major + 1,
13551
- minor: 0,
13552
- patch: 0
13553
- };
13554
-
13555
- case VersionUpgrade.MINOR:
13556
- return {
13557
- major: base.major,
13558
- minor: base.minor + 1,
13559
- patch: 0
13560
- };
13561
-
13562
- case VersionUpgrade.PATCH:
13563
- return {
13564
- major: base.major,
13565
- minor: base.minor,
13566
- patch: base.patch + 1
13567
- };
13568
- }
13569
- }
13570
-
13571
- var tokenlist = /*#__PURE__*/featuredTokenlist.tokens.concat( //@ts-ignore
13572
- generatedTokenlist.tokens);
13573
- function getChains() {
13384
+ var YodlRouterV04 = [
13385
+ {
13386
+ inputs: [
13387
+ {
13388
+ internalType: "address",
13389
+ name: "_feeTreasury",
13390
+ type: "address"
13391
+ },
13392
+ {
13393
+ internalType: "uint256",
13394
+ name: "_baseFeeBps",
13395
+ type: "uint256"
13396
+ },
13397
+ {
13398
+ internalType: "string",
13399
+ name: "_version",
13400
+ type: "string"
13401
+ },
13402
+ {
13403
+ internalType: "address",
13404
+ name: "_uniswapRouter",
13405
+ type: "address"
13406
+ },
13407
+ {
13408
+ internalType: "address",
13409
+ name: "_curveRouter",
13410
+ type: "address"
13411
+ },
13412
+ {
13413
+ internalType: "address",
13414
+ name: "_wrappedNativeToken",
13415
+ type: "address"
13416
+ }
13417
+ ],
13418
+ stateMutability: "nonpayable",
13419
+ type: "constructor"
13420
+ },
13421
+ {
13422
+ anonymous: false,
13423
+ inputs: [
13424
+ {
13425
+ indexed: true,
13426
+ internalType: "address",
13427
+ name: "priceFeed0",
13428
+ type: "address"
13429
+ },
13430
+ {
13431
+ indexed: true,
13432
+ internalType: "address",
13433
+ name: "priceFeed1",
13434
+ type: "address"
13435
+ },
13436
+ {
13437
+ indexed: false,
13438
+ internalType: "int256",
13439
+ name: "exchangeRate0",
13440
+ type: "int256"
13441
+ },
13442
+ {
13443
+ indexed: false,
13444
+ internalType: "int256",
13445
+ name: "exchangeRate1",
13446
+ type: "int256"
13447
+ }
13448
+ ],
13449
+ name: "Convert",
13450
+ type: "event"
13451
+ },
13452
+ {
13453
+ anonymous: false,
13454
+ inputs: [
13455
+ {
13456
+ indexed: true,
13457
+ internalType: "address",
13458
+ name: "previousOwner",
13459
+ type: "address"
13460
+ },
13461
+ {
13462
+ indexed: true,
13463
+ internalType: "address",
13464
+ name: "newOwner",
13465
+ type: "address"
13466
+ }
13467
+ ],
13468
+ name: "OwnershipTransferred",
13469
+ type: "event"
13470
+ },
13471
+ {
13472
+ anonymous: false,
13473
+ inputs: [
13474
+ {
13475
+ indexed: true,
13476
+ internalType: "address",
13477
+ name: "sender",
13478
+ type: "address"
13479
+ },
13480
+ {
13481
+ indexed: true,
13482
+ internalType: "address",
13483
+ name: "receiver",
13484
+ type: "address"
13485
+ },
13486
+ {
13487
+ indexed: false,
13488
+ internalType: "address",
13489
+ name: "token",
13490
+ type: "address"
13491
+ },
13492
+ {
13493
+ indexed: false,
13494
+ internalType: "uint256",
13495
+ name: "amount",
13496
+ type: "uint256"
13497
+ },
13498
+ {
13499
+ indexed: false,
13500
+ internalType: "uint256",
13501
+ name: "fees",
13502
+ type: "uint256"
13503
+ },
13504
+ {
13505
+ indexed: false,
13506
+ internalType: "bytes32",
13507
+ name: "memo",
13508
+ type: "bytes32"
13509
+ }
13510
+ ],
13511
+ name: "Yodl",
13512
+ type: "event"
13513
+ },
13514
+ {
13515
+ anonymous: false,
13516
+ inputs: [
13517
+ {
13518
+ indexed: true,
13519
+ internalType: "address",
13520
+ name: "sender",
13521
+ type: "address"
13522
+ },
13523
+ {
13524
+ indexed: true,
13525
+ internalType: "address",
13526
+ name: "receiver",
13527
+ type: "address"
13528
+ },
13529
+ {
13530
+ indexed: true,
13531
+ internalType: "uint256",
13532
+ name: "amount",
13533
+ type: "uint256"
13534
+ }
13535
+ ],
13536
+ name: "YodlNativeTokenTransfer",
13537
+ type: "event"
13538
+ },
13539
+ {
13540
+ inputs: [
13541
+ ],
13542
+ name: "MAX_FEE_BPS",
13543
+ outputs: [
13544
+ {
13545
+ internalType: "uint256",
13546
+ name: "",
13547
+ type: "uint256"
13548
+ }
13549
+ ],
13550
+ stateMutability: "view",
13551
+ type: "function"
13552
+ },
13553
+ {
13554
+ inputs: [
13555
+ ],
13556
+ name: "NATIVE_TOKEN",
13557
+ outputs: [
13558
+ {
13559
+ internalType: "address",
13560
+ name: "",
13561
+ type: "address"
13562
+ }
13563
+ ],
13564
+ stateMutability: "view",
13565
+ type: "function"
13566
+ },
13567
+ {
13568
+ inputs: [
13569
+ ],
13570
+ name: "baseFeeBps",
13571
+ outputs: [
13572
+ {
13573
+ internalType: "uint256",
13574
+ name: "",
13575
+ type: "uint256"
13576
+ }
13577
+ ],
13578
+ stateMutability: "view",
13579
+ type: "function"
13580
+ },
13581
+ {
13582
+ inputs: [
13583
+ {
13584
+ internalType: "uint256",
13585
+ name: "amount",
13586
+ type: "uint256"
13587
+ },
13588
+ {
13589
+ internalType: "uint256",
13590
+ name: "feeBps",
13591
+ type: "uint256"
13592
+ }
13593
+ ],
13594
+ name: "calculateFee",
13595
+ outputs: [
13596
+ {
13597
+ internalType: "uint256",
13598
+ name: "",
13599
+ type: "uint256"
13600
+ }
13601
+ ],
13602
+ stateMutability: "pure",
13603
+ type: "function"
13604
+ },
13605
+ {
13606
+ inputs: [
13607
+ ],
13608
+ name: "curveRouter",
13609
+ outputs: [
13610
+ {
13611
+ internalType: "contract ICurveRouter",
13612
+ name: "",
13613
+ type: "address"
13614
+ }
13615
+ ],
13616
+ stateMutability: "view",
13617
+ type: "function"
13618
+ },
13619
+ {
13620
+ inputs: [
13621
+ {
13622
+ internalType: "address[2]",
13623
+ name: "priceFeeds",
13624
+ type: "address[2]"
13625
+ },
13626
+ {
13627
+ internalType: "uint256",
13628
+ name: "amount",
13629
+ type: "uint256"
13630
+ }
13631
+ ],
13632
+ name: "exchangeRate",
13633
+ outputs: [
13634
+ {
13635
+ internalType: "uint256",
13636
+ name: "converted",
13637
+ type: "uint256"
13638
+ },
13639
+ {
13640
+ internalType: "address[2]",
13641
+ name: "priceFeedsUsed",
13642
+ type: "address[2]"
13643
+ },
13644
+ {
13645
+ internalType: "int256[2]",
13646
+ name: "prices",
13647
+ type: "int256[2]"
13648
+ }
13649
+ ],
13650
+ stateMutability: "view",
13651
+ type: "function"
13652
+ },
13653
+ {
13654
+ inputs: [
13655
+ ],
13656
+ name: "feeTreasury",
13657
+ outputs: [
13658
+ {
13659
+ internalType: "address",
13660
+ name: "",
13661
+ type: "address"
13662
+ }
13663
+ ],
13664
+ stateMutability: "view",
13665
+ type: "function"
13666
+ },
13667
+ {
13668
+ inputs: [
13669
+ ],
13670
+ name: "owner",
13671
+ outputs: [
13672
+ {
13673
+ internalType: "address",
13674
+ name: "",
13675
+ type: "address"
13676
+ }
13677
+ ],
13678
+ stateMutability: "view",
13679
+ type: "function"
13680
+ },
13681
+ {
13682
+ inputs: [
13683
+ ],
13684
+ name: "renounceOwnership",
13685
+ outputs: [
13686
+ ],
13687
+ stateMutability: "nonpayable",
13688
+ type: "function"
13689
+ },
13690
+ {
13691
+ inputs: [
13692
+ {
13693
+ internalType: "address",
13694
+ name: "token",
13695
+ type: "address"
13696
+ }
13697
+ ],
13698
+ name: "sweep",
13699
+ outputs: [
13700
+ ],
13701
+ stateMutability: "nonpayable",
13702
+ type: "function"
13703
+ },
13704
+ {
13705
+ inputs: [
13706
+ {
13707
+ internalType: "address",
13708
+ name: "newOwner",
13709
+ type: "address"
13710
+ }
13711
+ ],
13712
+ name: "transferOwnership",
13713
+ outputs: [
13714
+ ],
13715
+ stateMutability: "nonpayable",
13716
+ type: "function"
13717
+ },
13718
+ {
13719
+ inputs: [
13720
+ ],
13721
+ name: "uniswapRouter",
13722
+ outputs: [
13723
+ {
13724
+ internalType: "contract ISwapRouter",
13725
+ name: "",
13726
+ type: "address"
13727
+ }
13728
+ ],
13729
+ stateMutability: "view",
13730
+ type: "function"
13731
+ },
13732
+ {
13733
+ inputs: [
13734
+ ],
13735
+ name: "version",
13736
+ outputs: [
13737
+ {
13738
+ internalType: "string",
13739
+ name: "",
13740
+ type: "string"
13741
+ }
13742
+ ],
13743
+ stateMutability: "view",
13744
+ type: "function"
13745
+ },
13746
+ {
13747
+ inputs: [
13748
+ ],
13749
+ name: "wrappedNativeToken",
13750
+ outputs: [
13751
+ {
13752
+ internalType: "contract IWETH9",
13753
+ name: "",
13754
+ type: "address"
13755
+ }
13756
+ ],
13757
+ stateMutability: "view",
13758
+ type: "function"
13759
+ },
13760
+ {
13761
+ inputs: [
13762
+ {
13763
+ components: [
13764
+ {
13765
+ internalType: "address",
13766
+ name: "sender",
13767
+ type: "address"
13768
+ },
13769
+ {
13770
+ internalType: "address",
13771
+ name: "receiver",
13772
+ type: "address"
13773
+ },
13774
+ {
13775
+ internalType: "uint256",
13776
+ name: "amountIn",
13777
+ type: "uint256"
13778
+ },
13779
+ {
13780
+ internalType: "uint256",
13781
+ name: "amountOut",
13782
+ type: "uint256"
13783
+ },
13784
+ {
13785
+ internalType: "bytes32",
13786
+ name: "memo",
13787
+ type: "bytes32"
13788
+ },
13789
+ {
13790
+ internalType: "address[9]",
13791
+ name: "route",
13792
+ type: "address[9]"
13793
+ },
13794
+ {
13795
+ internalType: "uint256[3][4]",
13796
+ name: "swapParams",
13797
+ type: "uint256[3][4]"
13798
+ },
13799
+ {
13800
+ internalType: "address[4]",
13801
+ name: "factoryAddresses",
13802
+ type: "address[4]"
13803
+ },
13804
+ {
13805
+ internalType: "address[2]",
13806
+ name: "priceFeeds",
13807
+ type: "address[2]"
13808
+ },
13809
+ {
13810
+ internalType: "address",
13811
+ name: "extraFeeReceiver",
13812
+ type: "address"
13813
+ },
13814
+ {
13815
+ internalType: "uint256",
13816
+ name: "extraFeeBps",
13817
+ type: "uint256"
13818
+ },
13819
+ {
13820
+ internalType: "bool",
13821
+ name: "returnRemainder",
13822
+ type: "bool"
13823
+ },
13824
+ {
13825
+ internalType: "uint256",
13826
+ name: "yd",
13827
+ type: "uint256"
13828
+ }
13829
+ ],
13830
+ internalType: "struct YodlRouterV1.YodlCurveParams",
13831
+ name: "params",
13832
+ type: "tuple"
13833
+ }
13834
+ ],
13835
+ name: "yodlWithCurve",
13836
+ outputs: [
13837
+ {
13838
+ internalType: "uint256",
13839
+ name: "",
13840
+ type: "uint256"
13841
+ }
13842
+ ],
13843
+ stateMutability: "payable",
13844
+ type: "function"
13845
+ },
13846
+ {
13847
+ inputs: [
13848
+ {
13849
+ internalType: "bytes32",
13850
+ name: "memo",
13851
+ type: "bytes32"
13852
+ },
13853
+ {
13854
+ internalType: "uint256",
13855
+ name: "amount",
13856
+ type: "uint256"
13857
+ },
13858
+ {
13859
+ internalType: "address[2]",
13860
+ name: "priceFeeds",
13861
+ type: "address[2]"
13862
+ },
13863
+ {
13864
+ internalType: "address",
13865
+ name: "token",
13866
+ type: "address"
13867
+ },
13868
+ {
13869
+ internalType: "address",
13870
+ name: "receiver",
13871
+ type: "address"
13872
+ },
13873
+ {
13874
+ internalType: "address",
13875
+ name: "extraFeeReceiver",
13876
+ type: "address"
13877
+ },
13878
+ {
13879
+ internalType: "uint256",
13880
+ name: "extraFeeBps",
13881
+ type: "uint256"
13882
+ },
13883
+ {
13884
+ internalType: "uint256",
13885
+ name: "yd",
13886
+ type: "uint256"
13887
+ }
13888
+ ],
13889
+ name: "yodlWithToken",
13890
+ outputs: [
13891
+ {
13892
+ internalType: "bool",
13893
+ name: "",
13894
+ type: "bool"
13895
+ }
13896
+ ],
13897
+ stateMutability: "payable",
13898
+ type: "function"
13899
+ },
13900
+ {
13901
+ inputs: [
13902
+ {
13903
+ components: [
13904
+ {
13905
+ internalType: "address",
13906
+ name: "sender",
13907
+ type: "address"
13908
+ },
13909
+ {
13910
+ internalType: "address",
13911
+ name: "receiver",
13912
+ type: "address"
13913
+ },
13914
+ {
13915
+ internalType: "uint256",
13916
+ name: "amountIn",
13917
+ type: "uint256"
13918
+ },
13919
+ {
13920
+ internalType: "uint256",
13921
+ name: "amountOut",
13922
+ type: "uint256"
13923
+ },
13924
+ {
13925
+ internalType: "bytes32",
13926
+ name: "memo",
13927
+ type: "bytes32"
13928
+ },
13929
+ {
13930
+ internalType: "bytes",
13931
+ name: "path",
13932
+ type: "bytes"
13933
+ },
13934
+ {
13935
+ internalType: "address[2]",
13936
+ name: "priceFeeds",
13937
+ type: "address[2]"
13938
+ },
13939
+ {
13940
+ internalType: "address",
13941
+ name: "extraFeeReceiver",
13942
+ type: "address"
13943
+ },
13944
+ {
13945
+ internalType: "uint256",
13946
+ name: "extraFeeBps",
13947
+ type: "uint256"
13948
+ },
13949
+ {
13950
+ internalType: "bool",
13951
+ name: "returnRemainder",
13952
+ type: "bool"
13953
+ },
13954
+ {
13955
+ internalType: "enum YodlRouterV1.SwapType",
13956
+ name: "swapType",
13957
+ type: "uint8"
13958
+ },
13959
+ {
13960
+ internalType: "uint256",
13961
+ name: "yd",
13962
+ type: "uint256"
13963
+ }
13964
+ ],
13965
+ internalType: "struct YodlRouterV1.YodlUniswapParams",
13966
+ name: "params",
13967
+ type: "tuple"
13968
+ }
13969
+ ],
13970
+ name: "yodlWithUniswap",
13971
+ outputs: [
13972
+ {
13973
+ internalType: "uint256",
13974
+ name: "",
13975
+ type: "uint256"
13976
+ }
13977
+ ],
13978
+ stateMutability: "payable",
13979
+ type: "function"
13980
+ },
13981
+ {
13982
+ stateMutability: "payable",
13983
+ type: "receive"
13984
+ }
13985
+ ];
13986
+
13987
+ var YODL_ROUTER_ABIS = {
13988
+ "0.1": YodlRouterV01,
13989
+ "0.2": YodlRouterV02,
13990
+ "0.3": YodlRouterV03,
13991
+ "0.4": YodlRouterV04,
13992
+ "test": YodlRouterV03
13993
+ };
13994
+ var CURVE_ROUTER_ABI = CurveRouterV13Abi;
13995
+
13996
+ var TokenListTagNames;
13997
+
13998
+ (function (TokenListTagNames) {
13999
+ // Networks
14000
+ TokenListTagNames["MAINNET"] = "Mainnet";
14001
+ TokenListTagNames["OPTIMISM"] = "Optimism";
14002
+ TokenListTagNames["ARBITRUM"] = "Arbitrum";
14003
+ TokenListTagNames["AVALANCHE"] = "Avalanche";
14004
+ TokenListTagNames["BASE"] = "Base";
14005
+ TokenListTagNames["TESTNET"] = "TESTNET"; // Coin/currency
14006
+
14007
+ TokenListTagNames["STABLECOIN"] = "Stablecoin";
14008
+ TokenListTagNames["USD"] = "USD";
14009
+ TokenListTagNames["EUR"] = "EUR"; // Misc
14010
+
14011
+ TokenListTagNames["TOP_10"] = "Top10";
14012
+ TokenListTagNames["NATIVE_TOKEN"] = "Native Token";
14013
+ })(TokenListTagNames || (TokenListTagNames = {}));
14014
+
14015
+ /**
14016
+ * Comparator function that allows sorting version from lowest to highest
14017
+ * @param versionA version A to compare
14018
+ * @param versionB version B to compare
14019
+ * @returns -1 if versionA comes before versionB, 0 if versionA is equal to version B, and 1 if version A comes after version B
14020
+ */
14021
+ function versionComparator(versionA, versionB) {
14022
+ if (versionA.major < versionB.major) {
14023
+ return -1;
14024
+ } else if (versionA.major > versionB.major) {
14025
+ return 1;
14026
+ } else if (versionA.minor < versionB.minor) {
14027
+ return -1;
14028
+ } else if (versionA.minor > versionB.minor) {
14029
+ return 1;
14030
+ } else if (versionA.patch < versionB.patch) {
14031
+ return -1;
14032
+ } else if (versionA.patch > versionB.patch) {
14033
+ return 1;
14034
+ } else {
14035
+ return 0;
14036
+ }
14037
+ }
14038
+
14039
+ /**
14040
+ * Returns true if versionB is an update over versionA
14041
+ */
14042
+
14043
+ function isVersionUpdate(base, update) {
14044
+ return versionComparator(base, update) < 0;
14045
+ }
14046
+
14047
+ /**
14048
+ * Enum describing types of version differences
14049
+ */
14050
+ var VersionUpgrade;
14051
+
14052
+ (function (VersionUpgrade) {
14053
+ VersionUpgrade[VersionUpgrade["NONE"] = 0] = "NONE";
14054
+ VersionUpgrade[VersionUpgrade["PATCH"] = 1] = "PATCH";
14055
+ VersionUpgrade[VersionUpgrade["MINOR"] = 2] = "MINOR";
14056
+ VersionUpgrade[VersionUpgrade["MAJOR"] = 3] = "MAJOR";
14057
+ })(VersionUpgrade || (VersionUpgrade = {}));
14058
+ /**
14059
+ * Return the upgrade type from the base version to the update version.
14060
+ * Note that downgrades and equivalent versions are both treated as `NONE`.
14061
+ * @param base base list
14062
+ * @param update update to the list
14063
+ */
14064
+
14065
+
14066
+ function getVersionUpgrade(base, update) {
14067
+ if (update.major > base.major) {
14068
+ return VersionUpgrade.MAJOR;
14069
+ }
14070
+
14071
+ if (update.major < base.major) {
14072
+ return VersionUpgrade.NONE;
14073
+ }
14074
+
14075
+ if (update.minor > base.minor) {
14076
+ return VersionUpgrade.MINOR;
14077
+ }
14078
+
14079
+ if (update.minor < base.minor) {
14080
+ return VersionUpgrade.NONE;
14081
+ }
14082
+
14083
+ return update.patch > base.patch ? VersionUpgrade.PATCH : VersionUpgrade.NONE;
14084
+ }
14085
+
14086
+ /**
14087
+ * compares two token info key values
14088
+ * this subset of full deep equal functionality does not work on objects or object arrays
14089
+ * @param a comparison item a
14090
+ * @param b comparison item b
14091
+ */
14092
+ function compareTokenInfoProperty(a, b) {
14093
+ if (a === b) return true;
14094
+ if (typeof a !== typeof b) return false;
14095
+
14096
+ if (Array.isArray(a) && Array.isArray(b)) {
14097
+ return a.every(function (el, i) {
14098
+ return b[i] === el;
14099
+ });
14100
+ }
14101
+
14102
+ return false;
14103
+ }
14104
+ /**
14105
+ * Computes the diff of a token list where the first argument is the base and the second argument is the updated list.
14106
+ * @param base base list
14107
+ * @param update updated list
14108
+ */
14109
+
14110
+
14111
+ function diffTokenLists(base, update) {
14112
+ var indexedBase = base.reduce(function (memo, tokenInfo) {
14113
+ if (!memo[tokenInfo.chainId]) memo[tokenInfo.chainId] = {};
14114
+ memo[tokenInfo.chainId][tokenInfo.address] = tokenInfo;
14115
+ return memo;
14116
+ }, {});
14117
+ var newListUpdates = update.reduce(function (memo, tokenInfo) {
14118
+ var _indexedBase$tokenInf;
14119
+
14120
+ var baseToken = (_indexedBase$tokenInf = indexedBase[tokenInfo.chainId]) == null ? void 0 : _indexedBase$tokenInf[tokenInfo.address];
14121
+
14122
+ if (!baseToken) {
14123
+ memo.added.push(tokenInfo);
14124
+ } else {
14125
+ var changes = Object.keys(tokenInfo).filter(function (s) {
14126
+ return s !== "address" && s !== "chainId";
14127
+ }).filter(function (s) {
14128
+ return !compareTokenInfoProperty(tokenInfo[s], baseToken[s]);
14129
+ });
14130
+
14131
+ if (changes.length > 0) {
14132
+ if (!memo.changed[tokenInfo.chainId]) {
14133
+ memo.changed[tokenInfo.chainId] = {};
14134
+ }
14135
+
14136
+ memo.changed[tokenInfo.chainId][tokenInfo.address] = changes;
14137
+ }
14138
+ }
14139
+
14140
+ if (!memo.index[tokenInfo.chainId]) {
14141
+ var _memo$index$tokenInfo;
14142
+
14143
+ memo.index[tokenInfo.chainId] = (_memo$index$tokenInfo = {}, _memo$index$tokenInfo[tokenInfo.address] = true, _memo$index$tokenInfo);
14144
+ } else {
14145
+ memo.index[tokenInfo.chainId][tokenInfo.address] = true;
14146
+ }
14147
+
14148
+ return memo;
14149
+ }, {
14150
+ added: [],
14151
+ changed: {},
14152
+ index: {}
14153
+ });
14154
+ var removed = base.reduce(function (list, curr) {
14155
+ if (!newListUpdates.index[curr.chainId] || !newListUpdates.index[curr.chainId][curr.address]) {
14156
+ list.push(curr);
14157
+ }
14158
+
14159
+ return list;
14160
+ }, []);
14161
+ return {
14162
+ added: newListUpdates.added,
14163
+ changed: newListUpdates.changed,
14164
+ removed: removed
14165
+ };
14166
+ }
14167
+
14168
+ /**
14169
+ * Returns the minimum version bump for the given list
14170
+ * @param baseList the base list of tokens
14171
+ * @param updatedList the updated list of tokens
14172
+ */
14173
+
14174
+ function minVersionBump(baseList, updatedList) {
14175
+ var diff = diffTokenLists(baseList, updatedList);
14176
+ if (diff.removed.length > 0) return VersionUpgrade.MAJOR;
14177
+ if (diff.added.length > 0) return VersionUpgrade.MINOR;
14178
+ if (Object.keys(diff.changed).length > 0) return VersionUpgrade.PATCH;
14179
+ return VersionUpgrade.NONE;
14180
+ }
14181
+
14182
+ /**
14183
+ * Returns the next version of the list given a base version and the upgrade type
14184
+ * @param base current version
14185
+ * @param bump the upgrade type
14186
+ */
14187
+
14188
+ function nextVersion(base, bump) {
14189
+ switch (bump) {
14190
+ case VersionUpgrade.NONE:
14191
+ return base;
14192
+
14193
+ case VersionUpgrade.MAJOR:
14194
+ return {
14195
+ major: base.major + 1,
14196
+ minor: 0,
14197
+ patch: 0
14198
+ };
14199
+
14200
+ case VersionUpgrade.MINOR:
14201
+ return {
14202
+ major: base.major,
14203
+ minor: base.minor + 1,
14204
+ patch: 0
14205
+ };
14206
+
14207
+ case VersionUpgrade.PATCH:
14208
+ return {
14209
+ major: base.major,
14210
+ minor: base.minor,
14211
+ patch: base.patch + 1
14212
+ };
14213
+ }
14214
+ }
14215
+
14216
+ var tokenlist = /*#__PURE__*/featuredTokenlist.tokens.concat( //@ts-ignore
14217
+ generatedTokenlist.tokens);
14218
+ function getChains() {
13574
14219
  return chainlist.chains;
13575
14220
  }
13576
14221
  function getChain(chainId) {
@@ -13687,6 +14332,23 @@ function getShortNames() {
13687
14332
  return chain.shortName;
13688
14333
  });
13689
14334
  }
14335
+ function getNativeWrappedToken(chainId) {
14336
+ var nativeTokens = featuredTokenlist.tokens.filter(function (t) {
14337
+ return t.chainId === chainId && t.tags.map(function (tag) {
14338
+ return tag.toLowerCase();
14339
+ }).includes('wrapped') && t.tags.map(function (tag) {
14340
+ return tag.toLowerCase();
14341
+ }).includes('native token');
14342
+ });
14343
+
14344
+ if (nativeTokens.length > 1) {
14345
+ throw new Error("Found more than one native wrapped token for chain " + chainId);
14346
+ } else if (nativeTokens.length < 1) {
14347
+ throw new Error("No native wrapped token found for chain " + chainId);
14348
+ }
14349
+
14350
+ return nativeTokens[0];
14351
+ }
13690
14352
 
13691
- export { CURVE_ROUTER_ABI, HIRO_ROUTER_ABIS, TokenListTagNames, VersionUpgrade, diffTokenLists, getChain, getChains, getFaucetAddress, getFeaturedTokenBySymbol, getFiatCurrency, getFiatFeeds, getLatestRouter, getPriceFeed, getPriceFeeds, getRouter, getRouterByAddress, getRouters, getShortNames, getTokenByAddress, getTokenBySymbol, getTokenFeeds, getTokens, getVersionUpgrade, isVersionUpdate, minVersionBump, nextVersion, versionComparator };
14353
+ export { CURVE_ROUTER_ABI, TokenListTagNames, VersionUpgrade, YODL_ROUTER_ABIS, diffTokenLists, getChain, getChains, getFaucetAddress, getFeaturedTokenBySymbol, getFiatCurrency, getFiatFeeds, getLatestRouter, getNativeWrappedToken, getPriceFeed, getPriceFeeds, getRouter, getRouterByAddress, getRouters, getShortNames, getTokenByAddress, getTokenBySymbol, getTokenFeeds, getTokens, getVersionUpgrade, isVersionUpdate, minVersionBump, nextVersion, versionComparator };
13692
14354
  //# sourceMappingURL=tokenlists.esm.js.map