@yodlpay/tokenlists 0.6.22 → 0.7.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.
@@ -3277,22 +3277,7 @@ var chains = [
3277
3277
  nativeTokenName: "ETH",
3278
3278
  timestamp: "2024-06-20T08:16:18.193Z",
3279
3279
  feeTreasury: "0x9C48d180e4eEE0dA2A899EE1E4c533cA5e92db77",
3280
- curveRouterAddress: "0x99a58482BD75cbab83b27EC03CA68fF489b5788f"
3281
- },
3282
- {
3283
- chainName: "Ethereum Goerli",
3284
- shortName: "gor",
3285
- testnet: true,
3286
- chainId: 5,
3287
- logoUri: "https://raw.githubusercontent.com/yodlpay/logos/main/logos/chains/5/logo.svg",
3288
- rpcUrls: [
3289
- "https://rpc.ankr.com/eth_goerli"
3290
- ],
3291
- wrappedNativeToken: "0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6",
3292
- explorerUrl: "https://goerli.etherscan.io",
3293
- nativeTokenName: "ETH",
3294
- timestamp: "2022-12-28T14:10:09+00:00",
3295
- feeTreasury: "0x3E8A61F0532BA2b58660606d61110cC9E90c4D29"
3280
+ curveRouterAddress: "0x16C6521Dff6baB339122a0FE25a9116693265353"
3296
3281
  },
3297
3282
  {
3298
3283
  chainName: "Arbitrum One",
@@ -3308,7 +3293,7 @@ var chains = [
3308
3293
  nativeTokenName: "ETH",
3309
3294
  timestamp: "2024-06-20T08:16:18.932Z",
3310
3295
  feeTreasury: "0x5f0947253a8218894af13438ac2e2e0ced30d234",
3311
- curveRouterAddress: "0x4c2af2df2a7e567b5155879720619ea06c5bb15d"
3296
+ curveRouterAddress: "0x2191718CD32d02B8E60BAdFFeA33E4B5DD9A0A0D"
3312
3297
  },
3313
3298
  {
3314
3299
  chainName: "Optimism",
@@ -3324,7 +3309,7 @@ var chains = [
3324
3309
  nativeTokenName: "ETH",
3325
3310
  timestamp: "2024-06-20T08:16:19.165Z",
3326
3311
  feeTreasury: "0x5f0947253a8218894af13438ac2e2e0ced30d234",
3327
- curveRouterAddress: "0x89287c32c2cac1c76227f6d300b2dbbab6b75c08"
3312
+ curveRouterAddress: "0x0DCDED3545D565bA3B19E683431381007245d983"
3328
3313
  },
3329
3314
  {
3330
3315
  chainName: "Avalanche",
@@ -3355,7 +3340,7 @@ var chains = [
3355
3340
  nativeTokenName: "xDAI",
3356
3341
  timestamp: "2024-06-20T08:16:18.872Z",
3357
3342
  feeTreasury: "0x775aaf73a50C25eEBd308BBb9C34C73D081B423b",
3358
- curveRouterAddress: "0xe6358f6a45b502477e83cc1cda759f540e4459ee"
3343
+ curveRouterAddress: "0x0DCDED3545D565bA3B19E683431381007245d983"
3359
3344
  },
3360
3345
  {
3361
3346
  chainName: "Base",
@@ -3371,7 +3356,7 @@ var chains = [
3371
3356
  nativeTokenName: "ETH",
3372
3357
  timestamp: "2024-06-20T08:16:19.051Z",
3373
3358
  feeTreasury: "0x46959a8a332eca1a05Bd4F18115b8F2E1C2F2f05",
3374
- curveRouterAddress: "0x0000000000000000000000000000000000000000"
3359
+ curveRouterAddress: "0x4f37A9d177470499A2dD084621020b023fcffc1F"
3375
3360
  },
3376
3361
  {
3377
3362
  chainName: "Polygon",
@@ -3387,7 +3372,7 @@ var chains = [
3387
3372
  nativeTokenName: "MATIC",
3388
3373
  timestamp: "2024-06-20T08:16:18.717Z",
3389
3374
  feeTreasury: "0x5f0947253a8218894af13438ac2e2E0CeD30d234",
3390
- curveRouterAddress: "0x2a426b3Bb4fa87488387545f15D01d81352732F9"
3375
+ curveRouterAddress: "0x0DCDED3545D565bA3B19E683431381007245d983"
3391
3376
  },
3392
3377
  {
3393
3378
  chainName: "BNB Smart Chain",
@@ -3406,7 +3391,7 @@ var chains = [
3406
3391
  nativeTokenName: "BNB",
3407
3392
  timestamp: "2024-07-24T08:16:18.717Z",
3408
3393
  feeTreasury: "0x698609f1ae8E0ce7e65d3028d1f00297A6bF21e5",
3409
- curveRouterAddress: "0x0000000000000000000000000000000000000000"
3394
+ curveRouterAddress: "0xA72C85C258A81761433B4e8da60505Fe3Dd551CC"
3410
3395
  }
3411
3396
  ];
3412
3397
  var chainlist = {
@@ -3429,51 +3414,51 @@ var version$1 = {
3429
3414
  var routers = [
3430
3415
  {
3431
3416
  chainId: 1,
3432
- address: "0xd89F15383385a492A86005Af4AcCD9486312A3f3",
3433
- timestamp: "2024-09-01T00:00:00+00:00",
3434
- version: "0.6",
3417
+ address: "0x33a57Dbf2a0141073795114a8AbD9aCc263c069D",
3418
+ timestamp: "2024-09-12T00:00:00+00:00",
3419
+ version: "0.7",
3435
3420
  fee: "0.002"
3436
3421
  },
3437
3422
  {
3438
3423
  chainId: 10,
3439
- address: "0xe3b5e219d01Ee6aE42eC0bC20f18f91502DC69e5",
3440
- timestamp: "2024-08-09T00:00:00+00:00",
3441
- version: "0.6",
3424
+ address: "0x5a1564F9B26493311A7bF6cCA0873E8Bb093C4f6",
3425
+ timestamp: "2024-08-12T00:00:00+00:00",
3426
+ version: "0.7",
3442
3427
  fee: "0.002"
3443
3428
  },
3444
3429
  {
3445
3430
  chainId: 42161,
3446
- address: "0xe3b5e219d01Ee6aE42eC0bC20f18f91502DC69e5",
3447
- timestamp: "2024-09-03T00:00:00+00:00",
3448
- version: "0.6",
3431
+ address: "0x5a1564F9B26493311A7bF6cCA0873E8Bb093C4f6",
3432
+ timestamp: "2024-09-12T00:00:00+00:00",
3433
+ version: "0.7",
3449
3434
  fee: "0.002"
3450
3435
  },
3451
3436
  {
3452
3437
  chainId: 100,
3453
- address: "0xe3b5e219d01Ee6aE42eC0bC20f18f91502DC69e5",
3454
- timestamp: "2024-09-03T00:00:00+00:00",
3455
- version: "0.6",
3438
+ address: "0x5a1564F9B26493311A7bF6cCA0873E8Bb093C4f6",
3439
+ timestamp: "2024-09-12T00:00:00+00:00",
3440
+ version: "0.7",
3456
3441
  fee: "0.002"
3457
3442
  },
3458
3443
  {
3459
3444
  chainId: 137,
3460
- address: "0xe3b5e219d01Ee6aE42eC0bC20f18f91502DC69e5",
3461
- timestamp: "2024-09-03T00:00:00+00:00",
3462
- version: "0.6",
3445
+ address: "0x5a1564F9B26493311A7bF6cCA0873E8Bb093C4f6",
3446
+ timestamp: "2024-09-12T00:00:00+00:00",
3447
+ version: "0.7",
3463
3448
  fee: "0.002"
3464
3449
  },
3465
3450
  {
3466
3451
  chainId: 8453,
3467
- address: "0xe3b5e219d01Ee6aE42eC0bC20f18f91502DC69e5",
3468
- timestamp: "2024-09-03T00:00:00+00:00",
3469
- version: "0.6",
3452
+ address: "0x5a1564F9B26493311A7bF6cCA0873E8Bb093C4f6",
3453
+ timestamp: "2024-09-12T00:00:00+00:00",
3454
+ version: "0.7",
3470
3455
  fee: "0.002"
3471
3456
  },
3472
3457
  {
3473
3458
  chainId: 56,
3474
- address: "0xe3b5e219d01Ee6aE42eC0bC20f18f91502DC69e5",
3475
- timestamp: "2024-09-03T00:00:00+00:00",
3476
- version: "0.6",
3459
+ address: "0x5a1564F9B26493311A7bF6cCA0873E8Bb093C4f6",
3460
+ timestamp: "2024-09-12T00:00:00+00:00",
3461
+ version: "0.7",
3477
3462
  fee: "0.002"
3478
3463
  }
3479
3464
  ];
@@ -10372,6 +10357,37 @@ var fiatCurrencies = [
10372
10357
  }
10373
10358
  ];
10374
10359
 
10360
+ var CurveRouters = [
10361
+ {
10362
+ chainId: 1,
10363
+ address: "0x16C6521Dff6baB339122a0FE25a9116693265353"
10364
+ },
10365
+ {
10366
+ chainId: 10,
10367
+ address: "0x0DCDED3545D565bA3B19E683431381007245d983"
10368
+ },
10369
+ {
10370
+ chainId: 56,
10371
+ address: "0xA72C85C258A81761433B4e8da60505Fe3Dd551CC"
10372
+ },
10373
+ {
10374
+ chainId: 100,
10375
+ address: "0x0DCDED3545D565bA3B19E683431381007245d983"
10376
+ },
10377
+ {
10378
+ chainId: 137,
10379
+ address: "0x0DCDED3545D565bA3B19E683431381007245d983"
10380
+ },
10381
+ {
10382
+ chainId: 8453,
10383
+ address: "0x4f37A9d177470499A2dD084621020b023fcffc1F"
10384
+ },
10385
+ {
10386
+ chainId: 42161,
10387
+ address: "0x2191718CD32d02B8E60BAdFFeA33E4B5DD9A0A0D"
10388
+ }
10389
+ ];
10390
+
10375
10391
  var CurveRouterV13Abi = [
10376
10392
  {
10377
10393
  name: "TokenExchange",
@@ -14633,239 +14649,1162 @@ var YodlRouterV06 = [
14633
14649
  }
14634
14650
  ];
14635
14651
 
14636
- var YODL_ROUTER_ABIS = {
14637
- "0.1": YodlRouterV01,
14638
- "0.2": YodlRouterV02,
14639
- "0.3": YodlRouterV03,
14640
- "0.4": YodlRouterV04,
14641
- "0.5": YodlRouterV05,
14642
- "0.6": YodlRouterV06,
14643
- "test": YodlRouterV03
14644
- };
14645
- var CURVE_ROUTER_ABI = CurveRouterV13Abi;
14646
-
14647
- var TokenListTagNames;
14648
-
14649
- (function (TokenListTagNames) {
14650
- // Networks
14651
- TokenListTagNames["MAINNET"] = "Mainnet";
14652
- TokenListTagNames["OPTIMISM"] = "Optimism";
14653
- TokenListTagNames["ARBITRUM"] = "Arbitrum";
14654
- TokenListTagNames["AVALANCHE"] = "Avalanche";
14655
- TokenListTagNames["BASE"] = "Base";
14656
- TokenListTagNames["TESTNET"] = "TESTNET"; // Coin/currency
14657
-
14658
- TokenListTagNames["STABLECOIN"] = "Stablecoin";
14659
- TokenListTagNames["USD"] = "USD";
14660
- TokenListTagNames["EUR"] = "EUR"; // Misc
14661
-
14662
- TokenListTagNames["TOP_10"] = "Top10";
14663
- TokenListTagNames["NATIVE_TOKEN"] = "Native Token";
14664
- })(TokenListTagNames || (TokenListTagNames = {}));
14665
-
14666
- /**
14667
- * Comparator function that allows sorting version from lowest to highest
14668
- * @param versionA version A to compare
14669
- * @param versionB version B to compare
14670
- * @returns -1 if versionA comes before versionB, 0 if versionA is equal to version B, and 1 if version A comes after version B
14671
- */
14672
- function versionComparator(versionA, versionB) {
14673
- if (versionA.major < versionB.major) {
14674
- return -1;
14675
- } else if (versionA.major > versionB.major) {
14676
- return 1;
14677
- } else if (versionA.minor < versionB.minor) {
14678
- return -1;
14679
- } else if (versionA.minor > versionB.minor) {
14680
- return 1;
14681
- } else if (versionA.patch < versionB.patch) {
14682
- return -1;
14683
- } else if (versionA.patch > versionB.patch) {
14684
- return 1;
14685
- } else {
14686
- return 0;
14687
- }
14688
- }
14689
-
14690
- /**
14691
- * Returns true if versionB is an update over versionA
14692
- */
14693
-
14694
- function isVersionUpdate(base, update) {
14695
- return versionComparator(base, update) < 0;
14696
- }
14697
-
14698
- /**
14699
- * Enum describing types of version differences
14700
- */
14701
- var VersionUpgrade;
14702
-
14703
- (function (VersionUpgrade) {
14704
- VersionUpgrade[VersionUpgrade["NONE"] = 0] = "NONE";
14705
- VersionUpgrade[VersionUpgrade["PATCH"] = 1] = "PATCH";
14706
- VersionUpgrade[VersionUpgrade["MINOR"] = 2] = "MINOR";
14707
- VersionUpgrade[VersionUpgrade["MAJOR"] = 3] = "MAJOR";
14708
- })(VersionUpgrade || (VersionUpgrade = {}));
14709
- /**
14710
- * Return the upgrade type from the base version to the update version.
14711
- * Note that downgrades and equivalent versions are both treated as `NONE`.
14712
- * @param base base list
14713
- * @param update update to the list
14714
- */
14715
-
14716
-
14717
- function getVersionUpgrade(base, update) {
14718
- if (update.major > base.major) {
14719
- return VersionUpgrade.MAJOR;
14720
- }
14721
-
14722
- if (update.major < base.major) {
14723
- return VersionUpgrade.NONE;
14724
- }
14725
-
14726
- if (update.minor > base.minor) {
14727
- return VersionUpgrade.MINOR;
14728
- }
14729
-
14730
- if (update.minor < base.minor) {
14731
- return VersionUpgrade.NONE;
14732
- }
14733
-
14734
- return update.patch > base.patch ? VersionUpgrade.PATCH : VersionUpgrade.NONE;
14735
- }
14736
-
14737
- /**
14738
- * compares two token info key values
14739
- * this subset of full deep equal functionality does not work on objects or object arrays
14740
- * @param a comparison item a
14741
- * @param b comparison item b
14742
- */
14743
- function compareTokenInfoProperty(a, b) {
14744
- if (a === b) return true;
14745
- if (typeof a !== typeof b) return false;
14746
-
14747
- if (Array.isArray(a) && Array.isArray(b)) {
14748
- return a.every(function (el, i) {
14749
- return b[i] === el;
14750
- });
14751
- }
14752
-
14753
- return false;
14754
- }
14755
- /**
14756
- * Computes the diff of a token list where the first argument is the base and the second argument is the updated list.
14757
- * @param base base list
14758
- * @param update updated list
14759
- */
14760
-
14761
-
14762
- function diffTokenLists(base, update) {
14763
- var indexedBase = base.reduce(function (memo, tokenInfo) {
14764
- if (!memo[tokenInfo.chainId]) memo[tokenInfo.chainId] = {};
14765
- memo[tokenInfo.chainId][tokenInfo.address] = tokenInfo;
14766
- return memo;
14767
- }, {});
14768
- var newListUpdates = update.reduce(function (memo, tokenInfo) {
14769
- var _indexedBase$tokenInf;
14770
-
14771
- var baseToken = (_indexedBase$tokenInf = indexedBase[tokenInfo.chainId]) == null ? void 0 : _indexedBase$tokenInf[tokenInfo.address];
14772
-
14773
- if (!baseToken) {
14774
- memo.added.push(tokenInfo);
14775
- } else {
14776
- var changes = Object.keys(tokenInfo).filter(function (s) {
14777
- return s !== "address" && s !== "chainId";
14778
- }).filter(function (s) {
14779
- return !compareTokenInfoProperty(tokenInfo[s], baseToken[s]);
14780
- });
14781
-
14782
- if (changes.length > 0) {
14783
- if (!memo.changed[tokenInfo.chainId]) {
14784
- memo.changed[tokenInfo.chainId] = {};
14785
- }
14786
-
14787
- memo.changed[tokenInfo.chainId][tokenInfo.address] = changes;
14788
- }
14789
- }
14790
-
14791
- if (!memo.index[tokenInfo.chainId]) {
14792
- var _memo$index$tokenInfo;
14793
-
14794
- memo.index[tokenInfo.chainId] = (_memo$index$tokenInfo = {}, _memo$index$tokenInfo[tokenInfo.address] = true, _memo$index$tokenInfo);
14795
- } else {
14796
- memo.index[tokenInfo.chainId][tokenInfo.address] = true;
14797
- }
14798
-
14799
- return memo;
14800
- }, {
14801
- added: [],
14802
- changed: {},
14803
- index: {}
14804
- });
14805
- var removed = base.reduce(function (list, curr) {
14806
- if (!newListUpdates.index[curr.chainId] || !newListUpdates.index[curr.chainId][curr.address]) {
14807
- list.push(curr);
14808
- }
14809
-
14810
- return list;
14811
- }, []);
14812
- return {
14813
- added: newListUpdates.added,
14814
- changed: newListUpdates.changed,
14815
- removed: removed
14816
- };
14817
- }
14818
-
14819
- /**
14820
- * Returns the minimum version bump for the given list
14821
- * @param baseList the base list of tokens
14822
- * @param updatedList the updated list of tokens
14823
- */
14824
-
14825
- function minVersionBump(baseList, updatedList) {
14826
- var diff = diffTokenLists(baseList, updatedList);
14827
- if (diff.removed.length > 0) return VersionUpgrade.MAJOR;
14828
- if (diff.added.length > 0) return VersionUpgrade.MINOR;
14829
- if (Object.keys(diff.changed).length > 0) return VersionUpgrade.PATCH;
14830
- return VersionUpgrade.NONE;
14831
- }
14832
-
14833
- /**
14834
- * Returns the next version of the list given a base version and the upgrade type
14835
- * @param base current version
14836
- * @param bump the upgrade type
14837
- */
14838
-
14839
- function nextVersion(base, bump) {
14840
- switch (bump) {
14841
- case VersionUpgrade.NONE:
14842
- return base;
14843
-
14844
- case VersionUpgrade.MAJOR:
14845
- return {
14846
- major: base.major + 1,
14847
- minor: 0,
14848
- patch: 0
14849
- };
14850
-
14851
- case VersionUpgrade.MINOR:
14852
- return {
14853
- major: base.major,
14854
- minor: base.minor + 1,
14855
- patch: 0
14856
- };
14857
-
14858
- case VersionUpgrade.PATCH:
14859
- return {
14860
- major: base.major,
14861
- minor: base.minor,
14862
- patch: base.patch + 1
14652
+ var YodlRouterV07 = [
14653
+ {
14654
+ type: "constructor",
14655
+ inputs: [
14656
+ ],
14657
+ stateMutability: "nonpayable"
14658
+ },
14659
+ {
14660
+ type: "receive",
14661
+ stateMutability: "payable"
14662
+ },
14663
+ {
14664
+ type: "function",
14665
+ name: "CHAINLINK_FEED",
14666
+ inputs: [
14667
+ ],
14668
+ outputs: [
14669
+ {
14670
+ name: "",
14671
+ type: "int8",
14672
+ internalType: "int8"
14673
+ }
14674
+ ],
14675
+ stateMutability: "view"
14676
+ },
14677
+ {
14678
+ type: "function",
14679
+ name: "EXTERNAL_FEED",
14680
+ inputs: [
14681
+ ],
14682
+ outputs: [
14683
+ {
14684
+ name: "",
14685
+ type: "int8",
14686
+ internalType: "int8"
14687
+ }
14688
+ ],
14689
+ stateMutability: "view"
14690
+ },
14691
+ {
14692
+ type: "function",
14693
+ name: "MAX_EXTRA_FEE_BPS",
14694
+ inputs: [
14695
+ ],
14696
+ outputs: [
14697
+ {
14698
+ name: "",
14699
+ type: "uint256",
14700
+ internalType: "uint256"
14701
+ }
14702
+ ],
14703
+ stateMutability: "view"
14704
+ },
14705
+ {
14706
+ type: "function",
14707
+ name: "NATIVE_TOKEN",
14708
+ inputs: [
14709
+ ],
14710
+ outputs: [
14711
+ {
14712
+ name: "",
14713
+ type: "address",
14714
+ internalType: "address"
14715
+ }
14716
+ ],
14717
+ stateMutability: "view"
14718
+ },
14719
+ {
14720
+ type: "function",
14721
+ name: "NULL_FEED",
14722
+ inputs: [
14723
+ ],
14724
+ outputs: [
14725
+ {
14726
+ name: "",
14727
+ type: "int8",
14728
+ internalType: "int8"
14729
+ }
14730
+ ],
14731
+ stateMutability: "view"
14732
+ },
14733
+ {
14734
+ type: "function",
14735
+ name: "RATE_VERIFIER",
14736
+ inputs: [
14737
+ ],
14738
+ outputs: [
14739
+ {
14740
+ name: "",
14741
+ type: "address",
14742
+ internalType: "address"
14743
+ }
14744
+ ],
14745
+ stateMutability: "view"
14746
+ },
14747
+ {
14748
+ type: "function",
14749
+ name: "calculateFee",
14750
+ inputs: [
14751
+ {
14752
+ name: "amount",
14753
+ type: "uint256",
14754
+ internalType: "uint256"
14755
+ },
14756
+ {
14757
+ name: "feeBps",
14758
+ type: "uint256",
14759
+ internalType: "uint256"
14760
+ }
14761
+ ],
14762
+ outputs: [
14763
+ {
14764
+ name: "",
14765
+ type: "uint256",
14766
+ internalType: "uint256"
14767
+ }
14768
+ ],
14769
+ stateMutability: "pure"
14770
+ },
14771
+ {
14772
+ type: "function",
14773
+ name: "emitConversionEvent",
14774
+ inputs: [
14775
+ {
14776
+ name: "priceFeeds",
14777
+ type: "tuple[2]",
14778
+ internalType: "struct AbstractYodlRouter.PriceFeed[2]",
14779
+ components: [
14780
+ {
14781
+ name: "feedAddress",
14782
+ type: "address",
14783
+ internalType: "address"
14784
+ },
14785
+ {
14786
+ name: "feedType",
14787
+ type: "int8",
14788
+ internalType: "int8"
14789
+ },
14790
+ {
14791
+ name: "currency",
14792
+ type: "string",
14793
+ internalType: "string"
14794
+ },
14795
+ {
14796
+ name: "amount",
14797
+ type: "uint256",
14798
+ internalType: "uint256"
14799
+ },
14800
+ {
14801
+ name: "deadline",
14802
+ type: "uint256",
14803
+ internalType: "uint256"
14804
+ },
14805
+ {
14806
+ name: "signature",
14807
+ type: "bytes",
14808
+ internalType: "bytes"
14809
+ }
14810
+ ]
14811
+ },
14812
+ {
14813
+ name: "prices",
14814
+ type: "int256[2]",
14815
+ internalType: "int256[2]"
14816
+ }
14817
+ ],
14818
+ outputs: [
14819
+ ],
14820
+ stateMutability: "nonpayable"
14821
+ },
14822
+ {
14823
+ type: "function",
14824
+ name: "exchangeRate",
14825
+ inputs: [
14826
+ {
14827
+ name: "priceFeeds",
14828
+ type: "tuple[2]",
14829
+ internalType: "struct AbstractYodlRouter.PriceFeed[2]",
14830
+ components: [
14831
+ {
14832
+ name: "feedAddress",
14833
+ type: "address",
14834
+ internalType: "address"
14835
+ },
14836
+ {
14837
+ name: "feedType",
14838
+ type: "int8",
14839
+ internalType: "int8"
14840
+ },
14841
+ {
14842
+ name: "currency",
14843
+ type: "string",
14844
+ internalType: "string"
14845
+ },
14846
+ {
14847
+ name: "amount",
14848
+ type: "uint256",
14849
+ internalType: "uint256"
14850
+ },
14851
+ {
14852
+ name: "deadline",
14853
+ type: "uint256",
14854
+ internalType: "uint256"
14855
+ },
14856
+ {
14857
+ name: "signature",
14858
+ type: "bytes",
14859
+ internalType: "bytes"
14860
+ }
14861
+ ]
14862
+ },
14863
+ {
14864
+ name: "amount",
14865
+ type: "uint256",
14866
+ internalType: "uint256"
14867
+ }
14868
+ ],
14869
+ outputs: [
14870
+ {
14871
+ name: "converted",
14872
+ type: "uint256",
14873
+ internalType: "uint256"
14874
+ },
14875
+ {
14876
+ name: "priceFeedsUsed",
14877
+ type: "address[2]",
14878
+ internalType: "address[2]"
14879
+ },
14880
+ {
14881
+ name: "prices",
14882
+ type: "int256[2]",
14883
+ internalType: "int256[2]"
14884
+ }
14885
+ ],
14886
+ stateMutability: "view"
14887
+ },
14888
+ {
14889
+ type: "function",
14890
+ name: "sweep",
14891
+ inputs: [
14892
+ {
14893
+ name: "token",
14894
+ type: "address",
14895
+ internalType: "address"
14896
+ }
14897
+ ],
14898
+ outputs: [
14899
+ ],
14900
+ stateMutability: "nonpayable"
14901
+ },
14902
+ {
14903
+ type: "function",
14904
+ name: "uniswapRouter",
14905
+ inputs: [
14906
+ ],
14907
+ outputs: [
14908
+ {
14909
+ name: "",
14910
+ type: "address",
14911
+ internalType: "contract ISwapRouter02"
14912
+ }
14913
+ ],
14914
+ stateMutability: "view"
14915
+ },
14916
+ {
14917
+ type: "function",
14918
+ name: "verifyRateSignature",
14919
+ inputs: [
14920
+ {
14921
+ name: "priceFeed",
14922
+ type: "tuple",
14923
+ internalType: "struct AbstractYodlRouter.PriceFeed",
14924
+ components: [
14925
+ {
14926
+ name: "feedAddress",
14927
+ type: "address",
14928
+ internalType: "address"
14929
+ },
14930
+ {
14931
+ name: "feedType",
14932
+ type: "int8",
14933
+ internalType: "int8"
14934
+ },
14935
+ {
14936
+ name: "currency",
14937
+ type: "string",
14938
+ internalType: "string"
14939
+ },
14940
+ {
14941
+ name: "amount",
14942
+ type: "uint256",
14943
+ internalType: "uint256"
14944
+ },
14945
+ {
14946
+ name: "deadline",
14947
+ type: "uint256",
14948
+ internalType: "uint256"
14949
+ },
14950
+ {
14951
+ name: "signature",
14952
+ type: "bytes",
14953
+ internalType: "bytes"
14954
+ }
14955
+ ]
14956
+ }
14957
+ ],
14958
+ outputs: [
14959
+ {
14960
+ name: "",
14961
+ type: "bool",
14962
+ internalType: "bool"
14963
+ }
14964
+ ],
14965
+ stateMutability: "view"
14966
+ },
14967
+ {
14968
+ type: "function",
14969
+ name: "version",
14970
+ inputs: [
14971
+ ],
14972
+ outputs: [
14973
+ {
14974
+ name: "",
14975
+ type: "string",
14976
+ internalType: "string"
14977
+ }
14978
+ ],
14979
+ stateMutability: "view"
14980
+ },
14981
+ {
14982
+ type: "function",
14983
+ name: "wrappedNativeToken",
14984
+ inputs: [
14985
+ ],
14986
+ outputs: [
14987
+ {
14988
+ name: "",
14989
+ type: "address",
14990
+ internalType: "contract IWETH9"
14991
+ }
14992
+ ],
14993
+ stateMutability: "view"
14994
+ },
14995
+ {
14996
+ type: "function",
14997
+ name: "yodlFeeBps",
14998
+ inputs: [
14999
+ ],
15000
+ outputs: [
15001
+ {
15002
+ name: "",
15003
+ type: "uint256",
15004
+ internalType: "uint256"
15005
+ }
15006
+ ],
15007
+ stateMutability: "view"
15008
+ },
15009
+ {
15010
+ type: "function",
15011
+ name: "yodlFeeTreasury",
15012
+ inputs: [
15013
+ ],
15014
+ outputs: [
15015
+ {
15016
+ name: "",
15017
+ type: "address",
15018
+ internalType: "address"
15019
+ }
15020
+ ],
15021
+ stateMutability: "view"
15022
+ },
15023
+ {
15024
+ type: "function",
15025
+ name: "yodlWithCurve",
15026
+ inputs: [
15027
+ {
15028
+ name: "params",
15029
+ type: "tuple",
15030
+ internalType: "struct YodlCurveRouter.YodlCurveParams",
15031
+ components: [
15032
+ {
15033
+ name: "sender",
15034
+ type: "address",
15035
+ internalType: "address"
15036
+ },
15037
+ {
15038
+ name: "receiver",
15039
+ type: "address",
15040
+ internalType: "address"
15041
+ },
15042
+ {
15043
+ name: "amountIn",
15044
+ type: "uint256",
15045
+ internalType: "uint256"
15046
+ },
15047
+ {
15048
+ name: "amountOut",
15049
+ type: "uint256",
15050
+ internalType: "uint256"
15051
+ },
15052
+ {
15053
+ name: "memo",
15054
+ type: "bytes32",
15055
+ internalType: "bytes32"
15056
+ },
15057
+ {
15058
+ name: "route",
15059
+ type: "address[11]",
15060
+ internalType: "address[11]"
15061
+ },
15062
+ {
15063
+ name: "swapParams",
15064
+ type: "uint256[5][5]",
15065
+ internalType: "uint256[5][5]"
15066
+ },
15067
+ {
15068
+ name: "factoryAddresses",
15069
+ type: "address[5]",
15070
+ internalType: "address[5]"
15071
+ },
15072
+ {
15073
+ name: "priceFeeds",
15074
+ type: "tuple[2]",
15075
+ internalType: "struct AbstractYodlRouter.PriceFeed[2]",
15076
+ components: [
15077
+ {
15078
+ name: "feedAddress",
15079
+ type: "address",
15080
+ internalType: "address"
15081
+ },
15082
+ {
15083
+ name: "feedType",
15084
+ type: "int8",
15085
+ internalType: "int8"
15086
+ },
15087
+ {
15088
+ name: "currency",
15089
+ type: "string",
15090
+ internalType: "string"
15091
+ },
15092
+ {
15093
+ name: "amount",
15094
+ type: "uint256",
15095
+ internalType: "uint256"
15096
+ },
15097
+ {
15098
+ name: "deadline",
15099
+ type: "uint256",
15100
+ internalType: "uint256"
15101
+ },
15102
+ {
15103
+ name: "signature",
15104
+ type: "bytes",
15105
+ internalType: "bytes"
15106
+ }
15107
+ ]
15108
+ },
15109
+ {
15110
+ name: "extraFeeReceiver",
15111
+ type: "address",
15112
+ internalType: "address"
15113
+ },
15114
+ {
15115
+ name: "extraFeeBps",
15116
+ type: "uint256",
15117
+ internalType: "uint256"
15118
+ },
15119
+ {
15120
+ name: "yd",
15121
+ type: "uint256",
15122
+ internalType: "uint256"
15123
+ },
15124
+ {
15125
+ name: "yAppList",
15126
+ type: "tuple[]",
15127
+ internalType: "struct AbstractYodlRouter.YApp[]",
15128
+ components: [
15129
+ {
15130
+ name: "yApp",
15131
+ type: "address",
15132
+ internalType: "address"
15133
+ },
15134
+ {
15135
+ name: "sessionId",
15136
+ type: "uint256",
15137
+ internalType: "uint256"
15138
+ },
15139
+ {
15140
+ name: "payload",
15141
+ type: "bytes[]",
15142
+ internalType: "bytes[]"
15143
+ }
15144
+ ]
15145
+ }
15146
+ ]
15147
+ }
15148
+ ],
15149
+ outputs: [
15150
+ {
15151
+ name: "",
15152
+ type: "uint256",
15153
+ internalType: "uint256"
15154
+ }
15155
+ ],
15156
+ stateMutability: "payable"
15157
+ },
15158
+ {
15159
+ type: "function",
15160
+ name: "yodlWithToken",
15161
+ inputs: [
15162
+ {
15163
+ name: "params",
15164
+ type: "tuple",
15165
+ internalType: "struct YodlTransferRouter.YodlTransferParams",
15166
+ components: [
15167
+ {
15168
+ name: "memo",
15169
+ type: "bytes32",
15170
+ internalType: "bytes32"
15171
+ },
15172
+ {
15173
+ name: "amount",
15174
+ type: "uint256",
15175
+ internalType: "uint256"
15176
+ },
15177
+ {
15178
+ name: "priceFeeds",
15179
+ type: "tuple[2]",
15180
+ internalType: "struct AbstractYodlRouter.PriceFeed[2]",
15181
+ components: [
15182
+ {
15183
+ name: "feedAddress",
15184
+ type: "address",
15185
+ internalType: "address"
15186
+ },
15187
+ {
15188
+ name: "feedType",
15189
+ type: "int8",
15190
+ internalType: "int8"
15191
+ },
15192
+ {
15193
+ name: "currency",
15194
+ type: "string",
15195
+ internalType: "string"
15196
+ },
15197
+ {
15198
+ name: "amount",
15199
+ type: "uint256",
15200
+ internalType: "uint256"
15201
+ },
15202
+ {
15203
+ name: "deadline",
15204
+ type: "uint256",
15205
+ internalType: "uint256"
15206
+ },
15207
+ {
15208
+ name: "signature",
15209
+ type: "bytes",
15210
+ internalType: "bytes"
15211
+ }
15212
+ ]
15213
+ },
15214
+ {
15215
+ name: "token",
15216
+ type: "address",
15217
+ internalType: "address"
15218
+ },
15219
+ {
15220
+ name: "receiver",
15221
+ type: "address",
15222
+ internalType: "address"
15223
+ },
15224
+ {
15225
+ name: "extraFeeReceiver",
15226
+ type: "address",
15227
+ internalType: "address"
15228
+ },
15229
+ {
15230
+ name: "extraFeeBps",
15231
+ type: "uint256",
15232
+ internalType: "uint256"
15233
+ },
15234
+ {
15235
+ name: "yd",
15236
+ type: "uint256",
15237
+ internalType: "uint256"
15238
+ },
15239
+ {
15240
+ name: "yAppList",
15241
+ type: "tuple[]",
15242
+ internalType: "struct AbstractYodlRouter.YApp[]",
15243
+ components: [
15244
+ {
15245
+ name: "yApp",
15246
+ type: "address",
15247
+ internalType: "address"
15248
+ },
15249
+ {
15250
+ name: "sessionId",
15251
+ type: "uint256",
15252
+ internalType: "uint256"
15253
+ },
15254
+ {
15255
+ name: "payload",
15256
+ type: "bytes[]",
15257
+ internalType: "bytes[]"
15258
+ }
15259
+ ]
15260
+ }
15261
+ ]
15262
+ }
15263
+ ],
15264
+ outputs: [
15265
+ {
15266
+ name: "",
15267
+ type: "uint256",
15268
+ internalType: "uint256"
15269
+ }
15270
+ ],
15271
+ stateMutability: "payable"
15272
+ },
15273
+ {
15274
+ type: "function",
15275
+ name: "yodlWithUniswap",
15276
+ inputs: [
15277
+ {
15278
+ name: "params",
15279
+ type: "tuple",
15280
+ internalType: "struct YodlUniswapRouter.YodlUniswapParams",
15281
+ components: [
15282
+ {
15283
+ name: "sender",
15284
+ type: "address",
15285
+ internalType: "address"
15286
+ },
15287
+ {
15288
+ name: "receiver",
15289
+ type: "address",
15290
+ internalType: "address"
15291
+ },
15292
+ {
15293
+ name: "amountIn",
15294
+ type: "uint256",
15295
+ internalType: "uint256"
15296
+ },
15297
+ {
15298
+ name: "amountOut",
15299
+ type: "uint256",
15300
+ internalType: "uint256"
15301
+ },
15302
+ {
15303
+ name: "memo",
15304
+ type: "bytes32",
15305
+ internalType: "bytes32"
15306
+ },
15307
+ {
15308
+ name: "path",
15309
+ type: "bytes",
15310
+ internalType: "bytes"
15311
+ },
15312
+ {
15313
+ name: "priceFeeds",
15314
+ type: "tuple[2]",
15315
+ internalType: "struct AbstractYodlRouter.PriceFeed[2]",
15316
+ components: [
15317
+ {
15318
+ name: "feedAddress",
15319
+ type: "address",
15320
+ internalType: "address"
15321
+ },
15322
+ {
15323
+ name: "feedType",
15324
+ type: "int8",
15325
+ internalType: "int8"
15326
+ },
15327
+ {
15328
+ name: "currency",
15329
+ type: "string",
15330
+ internalType: "string"
15331
+ },
15332
+ {
15333
+ name: "amount",
15334
+ type: "uint256",
15335
+ internalType: "uint256"
15336
+ },
15337
+ {
15338
+ name: "deadline",
15339
+ type: "uint256",
15340
+ internalType: "uint256"
15341
+ },
15342
+ {
15343
+ name: "signature",
15344
+ type: "bytes",
15345
+ internalType: "bytes"
15346
+ }
15347
+ ]
15348
+ },
15349
+ {
15350
+ name: "extraFeeReceiver",
15351
+ type: "address",
15352
+ internalType: "address"
15353
+ },
15354
+ {
15355
+ name: "extraFeeBps",
15356
+ type: "uint256",
15357
+ internalType: "uint256"
15358
+ },
15359
+ {
15360
+ name: "swapType",
15361
+ type: "uint8",
15362
+ internalType: "enum YodlUniswapRouter.SwapType"
15363
+ },
15364
+ {
15365
+ name: "yd",
15366
+ type: "uint256",
15367
+ internalType: "uint256"
15368
+ },
15369
+ {
15370
+ name: "yAppList",
15371
+ type: "tuple[]",
15372
+ internalType: "struct AbstractYodlRouter.YApp[]",
15373
+ components: [
15374
+ {
15375
+ name: "yApp",
15376
+ type: "address",
15377
+ internalType: "address"
15378
+ },
15379
+ {
15380
+ name: "sessionId",
15381
+ type: "uint256",
15382
+ internalType: "uint256"
15383
+ },
15384
+ {
15385
+ name: "payload",
15386
+ type: "bytes[]",
15387
+ internalType: "bytes[]"
15388
+ }
15389
+ ]
15390
+ }
15391
+ ]
15392
+ }
15393
+ ],
15394
+ outputs: [
15395
+ {
15396
+ name: "",
15397
+ type: "uint256",
15398
+ internalType: "uint256"
15399
+ }
15400
+ ],
15401
+ stateMutability: "payable"
15402
+ },
15403
+ {
15404
+ type: "event",
15405
+ name: "Convert",
15406
+ inputs: [
15407
+ {
15408
+ name: "priceFeed0",
15409
+ type: "address",
15410
+ indexed: true,
15411
+ internalType: "address"
15412
+ },
15413
+ {
15414
+ name: "priceFeed1",
15415
+ type: "address",
15416
+ indexed: true,
15417
+ internalType: "address"
15418
+ },
15419
+ {
15420
+ name: "exchangeRate0",
15421
+ type: "int256",
15422
+ indexed: false,
15423
+ internalType: "int256"
15424
+ },
15425
+ {
15426
+ name: "exchangeRate1",
15427
+ type: "int256",
15428
+ indexed: false,
15429
+ internalType: "int256"
15430
+ }
15431
+ ],
15432
+ anonymous: false
15433
+ },
15434
+ {
15435
+ type: "event",
15436
+ name: "ConvertWithExternalRate",
15437
+ inputs: [
15438
+ {
15439
+ name: "currency0",
15440
+ type: "string",
15441
+ indexed: true,
15442
+ internalType: "string"
15443
+ },
15444
+ {
15445
+ name: "priceFeed1",
15446
+ type: "address",
15447
+ indexed: true,
15448
+ internalType: "address"
15449
+ },
15450
+ {
15451
+ name: "exchangeRate0",
15452
+ type: "int256",
15453
+ indexed: false,
15454
+ internalType: "int256"
15455
+ },
15456
+ {
15457
+ name: "exchangeRate1",
15458
+ type: "int256",
15459
+ indexed: false,
15460
+ internalType: "int256"
15461
+ }
15462
+ ],
15463
+ anonymous: false
15464
+ },
15465
+ {
15466
+ type: "event",
15467
+ name: "Yodl",
15468
+ inputs: [
15469
+ {
15470
+ name: "sender",
15471
+ type: "address",
15472
+ indexed: true,
15473
+ internalType: "address"
15474
+ },
15475
+ {
15476
+ name: "receiver",
15477
+ type: "address",
15478
+ indexed: true,
15479
+ internalType: "address"
15480
+ },
15481
+ {
15482
+ name: "token",
15483
+ type: "address",
15484
+ indexed: false,
15485
+ internalType: "address"
15486
+ },
15487
+ {
15488
+ name: "amount",
15489
+ type: "uint256",
15490
+ indexed: false,
15491
+ internalType: "uint256"
15492
+ },
15493
+ {
15494
+ name: "fees",
15495
+ type: "uint256",
15496
+ indexed: false,
15497
+ internalType: "uint256"
15498
+ },
15499
+ {
15500
+ name: "memo",
15501
+ type: "bytes32",
15502
+ indexed: false,
15503
+ internalType: "bytes32"
15504
+ }
15505
+ ],
15506
+ anonymous: false
15507
+ },
15508
+ {
15509
+ type: "event",
15510
+ name: "YodlNativeTokenTransfer",
15511
+ inputs: [
15512
+ {
15513
+ name: "sender",
15514
+ type: "address",
15515
+ indexed: true,
15516
+ internalType: "address"
15517
+ },
15518
+ {
15519
+ name: "receiver",
15520
+ type: "address",
15521
+ indexed: true,
15522
+ internalType: "address"
15523
+ },
15524
+ {
15525
+ name: "amount",
15526
+ type: "uint256",
15527
+ indexed: true,
15528
+ internalType: "uint256"
15529
+ }
15530
+ ],
15531
+ anonymous: false
15532
+ },
15533
+ {
15534
+ type: "error",
15535
+ name: "ECDSAInvalidSignature",
15536
+ inputs: [
15537
+ ]
15538
+ },
15539
+ {
15540
+ type: "error",
15541
+ name: "ECDSAInvalidSignatureLength",
15542
+ inputs: [
15543
+ {
15544
+ name: "length",
15545
+ type: "uint256",
15546
+ internalType: "uint256"
15547
+ }
15548
+ ]
15549
+ },
15550
+ {
15551
+ type: "error",
15552
+ name: "ECDSAInvalidSignatureS",
15553
+ inputs: [
15554
+ {
15555
+ name: "s",
15556
+ type: "bytes32",
15557
+ internalType: "bytes32"
15558
+ }
15559
+ ]
15560
+ }
15561
+ ];
15562
+
15563
+ var YODL_ROUTER_ABIS = {
15564
+ "0.1": YodlRouterV01,
15565
+ "0.2": YodlRouterV02,
15566
+ "0.3": YodlRouterV03,
15567
+ "0.4": YodlRouterV04,
15568
+ "0.5": YodlRouterV05,
15569
+ "0.6": YodlRouterV06,
15570
+ "0.7": YodlRouterV07,
15571
+ "test": YodlRouterV03
15572
+ };
15573
+ var CURVE_ROUTER_ABI = CurveRouterV13Abi;
15574
+
15575
+ var TokenListTagNames;
15576
+
15577
+ (function (TokenListTagNames) {
15578
+ // Networks
15579
+ TokenListTagNames["MAINNET"] = "Mainnet";
15580
+ TokenListTagNames["OPTIMISM"] = "Optimism";
15581
+ TokenListTagNames["ARBITRUM"] = "Arbitrum";
15582
+ TokenListTagNames["AVALANCHE"] = "Avalanche";
15583
+ TokenListTagNames["BASE"] = "Base";
15584
+ TokenListTagNames["TESTNET"] = "TESTNET"; // Coin/currency
15585
+
15586
+ TokenListTagNames["STABLECOIN"] = "Stablecoin";
15587
+ TokenListTagNames["USD"] = "USD";
15588
+ TokenListTagNames["EUR"] = "EUR"; // Misc
15589
+
15590
+ TokenListTagNames["TOP_10"] = "Top10";
15591
+ TokenListTagNames["NATIVE_TOKEN"] = "Native Token";
15592
+ })(TokenListTagNames || (TokenListTagNames = {}));
15593
+
15594
+ /**
15595
+ * Comparator function that allows sorting version from lowest to highest
15596
+ * @param versionA version A to compare
15597
+ * @param versionB version B to compare
15598
+ * @returns -1 if versionA comes before versionB, 0 if versionA is equal to version B, and 1 if version A comes after version B
15599
+ */
15600
+ function versionComparator(versionA, versionB) {
15601
+ if (versionA.major < versionB.major) {
15602
+ return -1;
15603
+ } else if (versionA.major > versionB.major) {
15604
+ return 1;
15605
+ } else if (versionA.minor < versionB.minor) {
15606
+ return -1;
15607
+ } else if (versionA.minor > versionB.minor) {
15608
+ return 1;
15609
+ } else if (versionA.patch < versionB.patch) {
15610
+ return -1;
15611
+ } else if (versionA.patch > versionB.patch) {
15612
+ return 1;
15613
+ } else {
15614
+ return 0;
15615
+ }
15616
+ }
15617
+
15618
+ /**
15619
+ * Returns true if versionB is an update over versionA
15620
+ */
15621
+
15622
+ function isVersionUpdate(base, update) {
15623
+ return versionComparator(base, update) < 0;
15624
+ }
15625
+
15626
+ /**
15627
+ * Enum describing types of version differences
15628
+ */
15629
+ var VersionUpgrade;
15630
+
15631
+ (function (VersionUpgrade) {
15632
+ VersionUpgrade[VersionUpgrade["NONE"] = 0] = "NONE";
15633
+ VersionUpgrade[VersionUpgrade["PATCH"] = 1] = "PATCH";
15634
+ VersionUpgrade[VersionUpgrade["MINOR"] = 2] = "MINOR";
15635
+ VersionUpgrade[VersionUpgrade["MAJOR"] = 3] = "MAJOR";
15636
+ })(VersionUpgrade || (VersionUpgrade = {}));
15637
+ /**
15638
+ * Return the upgrade type from the base version to the update version.
15639
+ * Note that downgrades and equivalent versions are both treated as `NONE`.
15640
+ * @param base base list
15641
+ * @param update update to the list
15642
+ */
15643
+
15644
+
15645
+ function getVersionUpgrade(base, update) {
15646
+ if (update.major > base.major) {
15647
+ return VersionUpgrade.MAJOR;
15648
+ }
15649
+
15650
+ if (update.major < base.major) {
15651
+ return VersionUpgrade.NONE;
15652
+ }
15653
+
15654
+ if (update.minor > base.minor) {
15655
+ return VersionUpgrade.MINOR;
15656
+ }
15657
+
15658
+ if (update.minor < base.minor) {
15659
+ return VersionUpgrade.NONE;
15660
+ }
15661
+
15662
+ return update.patch > base.patch ? VersionUpgrade.PATCH : VersionUpgrade.NONE;
15663
+ }
15664
+
15665
+ /**
15666
+ * compares two token info key values
15667
+ * this subset of full deep equal functionality does not work on objects or object arrays
15668
+ * @param a comparison item a
15669
+ * @param b comparison item b
15670
+ */
15671
+ function compareTokenInfoProperty(a, b) {
15672
+ if (a === b) return true;
15673
+ if (typeof a !== typeof b) return false;
15674
+
15675
+ if (Array.isArray(a) && Array.isArray(b)) {
15676
+ return a.every(function (el, i) {
15677
+ return b[i] === el;
15678
+ });
15679
+ }
15680
+
15681
+ return false;
15682
+ }
15683
+ /**
15684
+ * Computes the diff of a token list where the first argument is the base and the second argument is the updated list.
15685
+ * @param base base list
15686
+ * @param update updated list
15687
+ */
15688
+
15689
+
15690
+ function diffTokenLists(base, update) {
15691
+ var indexedBase = base.reduce(function (memo, tokenInfo) {
15692
+ if (!memo[tokenInfo.chainId]) memo[tokenInfo.chainId] = {};
15693
+ memo[tokenInfo.chainId][tokenInfo.address] = tokenInfo;
15694
+ return memo;
15695
+ }, {});
15696
+ var newListUpdates = update.reduce(function (memo, tokenInfo) {
15697
+ var _indexedBase$tokenInf;
15698
+
15699
+ var baseToken = (_indexedBase$tokenInf = indexedBase[tokenInfo.chainId]) == null ? void 0 : _indexedBase$tokenInf[tokenInfo.address];
15700
+
15701
+ if (!baseToken) {
15702
+ memo.added.push(tokenInfo);
15703
+ } else {
15704
+ var changes = Object.keys(tokenInfo).filter(function (s) {
15705
+ return s !== "address" && s !== "chainId";
15706
+ }).filter(function (s) {
15707
+ return !compareTokenInfoProperty(tokenInfo[s], baseToken[s]);
15708
+ });
15709
+
15710
+ if (changes.length > 0) {
15711
+ if (!memo.changed[tokenInfo.chainId]) {
15712
+ memo.changed[tokenInfo.chainId] = {};
15713
+ }
15714
+
15715
+ memo.changed[tokenInfo.chainId][tokenInfo.address] = changes;
15716
+ }
15717
+ }
15718
+
15719
+ if (!memo.index[tokenInfo.chainId]) {
15720
+ var _memo$index$tokenInfo;
15721
+
15722
+ memo.index[tokenInfo.chainId] = (_memo$index$tokenInfo = {}, _memo$index$tokenInfo[tokenInfo.address] = true, _memo$index$tokenInfo);
15723
+ } else {
15724
+ memo.index[tokenInfo.chainId][tokenInfo.address] = true;
15725
+ }
15726
+
15727
+ return memo;
15728
+ }, {
15729
+ added: [],
15730
+ changed: {},
15731
+ index: {}
15732
+ });
15733
+ var removed = base.reduce(function (list, curr) {
15734
+ if (!newListUpdates.index[curr.chainId] || !newListUpdates.index[curr.chainId][curr.address]) {
15735
+ list.push(curr);
15736
+ }
15737
+
15738
+ return list;
15739
+ }, []);
15740
+ return {
15741
+ added: newListUpdates.added,
15742
+ changed: newListUpdates.changed,
15743
+ removed: removed
15744
+ };
15745
+ }
15746
+
15747
+ /**
15748
+ * Returns the minimum version bump for the given list
15749
+ * @param baseList the base list of tokens
15750
+ * @param updatedList the updated list of tokens
15751
+ */
15752
+
15753
+ function minVersionBump(baseList, updatedList) {
15754
+ var diff = diffTokenLists(baseList, updatedList);
15755
+ if (diff.removed.length > 0) return VersionUpgrade.MAJOR;
15756
+ if (diff.added.length > 0) return VersionUpgrade.MINOR;
15757
+ if (Object.keys(diff.changed).length > 0) return VersionUpgrade.PATCH;
15758
+ return VersionUpgrade.NONE;
15759
+ }
15760
+
15761
+ /**
15762
+ * Returns the next version of the list given a base version and the upgrade type
15763
+ * @param base current version
15764
+ * @param bump the upgrade type
15765
+ */
15766
+
15767
+ function nextVersion(base, bump) {
15768
+ switch (bump) {
15769
+ case VersionUpgrade.NONE:
15770
+ return base;
15771
+
15772
+ case VersionUpgrade.MAJOR:
15773
+ return {
15774
+ major: base.major + 1,
15775
+ minor: 0,
15776
+ patch: 0
15777
+ };
15778
+
15779
+ case VersionUpgrade.MINOR:
15780
+ return {
15781
+ major: base.major,
15782
+ minor: base.minor + 1,
15783
+ patch: 0
15784
+ };
15785
+
15786
+ case VersionUpgrade.PATCH:
15787
+ return {
15788
+ major: base.major,
15789
+ minor: base.minor,
15790
+ patch: base.patch + 1
14863
15791
  };
14864
15792
  }
14865
15793
  }
14866
15794
 
14867
15795
  var tokenlist = /*#__PURE__*/featuredTokenlist.tokens.concat( //@ts-ignore
14868
15796
  generatedTokenlist.tokens);
15797
+ function getCurveRouterAddress(chainId) {
15798
+ var curveRouter = CurveRouters.find(function (router) {
15799
+ return router.chainId == chainId;
15800
+ });
15801
+
15802
+ if (curveRouter == undefined) {
15803
+ throw new Error("Unable to find CurveRouterNG for chainId " + chainId);
15804
+ }
15805
+
15806
+ return curveRouter.address;
15807
+ }
14869
15808
  function getChains() {
14870
15809
  return chainlist.chains;
14871
15810
  }
@@ -15006,5 +15945,5 @@ function getNativeWrappedToken(chainId) {
15006
15945
  return nativeTokens[0];
15007
15946
  }
15008
15947
 
15009
- export { CURVE_ROUTER_ABI, TokenListTagNames, VersionUpgrade, YODL_ROUTER_ABIS, diffTokenLists, getChain, getChains, getFeaturedTokenBySymbol, getFiatCurrencies, getFiatCurrency, getFiatFeeds, getLatestRouter, getNativeToken, getNativeWrappedToken, getPriceFeed, getPriceFeeds, getRouter, getRouterByAddress, getRouters, getShortNames, getTokenByAddress, getTokenBySymbol, getTokenFeeds, getTokens, getVersionUpgrade, isVersionUpdate, minVersionBump, nextVersion, versionComparator };
15948
+ export { CURVE_ROUTER_ABI, TokenListTagNames, VersionUpgrade, YODL_ROUTER_ABIS, diffTokenLists, getChain, getChains, getCurveRouterAddress, getFeaturedTokenBySymbol, getFiatCurrencies, getFiatCurrency, getFiatFeeds, getLatestRouter, getNativeToken, getNativeWrappedToken, getPriceFeed, getPriceFeeds, getRouter, getRouterByAddress, getRouters, getShortNames, getTokenByAddress, getTokenBySymbol, getTokenFeeds, getTokens, getVersionUpgrade, isVersionUpdate, minVersionBump, nextVersion, versionComparator };
15010
15949
  //# sourceMappingURL=tokenlists.esm.js.map