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