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