@uniswap/router-sdk 1.20.0 → 1.21.1

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.
package/dist/index.d.ts CHANGED
@@ -12,3 +12,4 @@ export * from './utils/encodeMixedRouteToPath';
12
12
  export * from './utils/TPool';
13
13
  export * from './utils/pathCurrency';
14
14
  export * from './utils';
15
+ export * from './utils/isValidTokenPath';
@@ -629,7 +629,8 @@ function _createForOfIteratorHelperLoose(o, allowArrayLike) {
629
629
  }
630
630
 
631
631
  function isValidTokenPath(prevPool, currentPool, inputToken) {
632
- if (currentPool.involvesToken(inputToken)) return true;
632
+ if (inputToken instanceof sdkCore.Token && currentPool.involvesToken(inputToken)) return true;
633
+ if (currentPool instanceof v4Sdk.Pool && currentPool.involvesToken(inputToken)) return true;
633
634
  // throw if both v4 pools, native/wrapped tokens not interchangeable in v4
634
635
  if (prevPool instanceof v4Sdk.Pool && currentPool instanceof v4Sdk.Pool) return false;
635
636
  // v2/v3 --> v4 valid if v2/v3 output is the wrapped version of the v4 pool native currency
@@ -2360,6 +2361,7 @@ exports.encodeMixedRouteToPath = encodeMixedRouteToPath;
2360
2361
  exports.getOutputOfPools = getOutputOfPools;
2361
2362
  exports.getPathCurrency = getPathCurrency;
2362
2363
  exports.isMint = isMint;
2364
+ exports.isValidTokenPath = isValidTokenPath;
2363
2365
  exports.partitionMixedRouteByProtocol = partitionMixedRouteByProtocol;
2364
2366
  exports.tradeComparator = tradeComparator;
2365
2367
  //# sourceMappingURL=router-sdk.cjs.development.js.map