@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.
@@ -1,4 +1,4 @@
1
- import { Percent, validateAndParseAddress, CurrencyAmount, Price, Fraction, TradeType, sortedInsert, WETH9 } from '@uniswap/sdk-core';
1
+ import { Percent, validateAndParseAddress, Token, CurrencyAmount, Price, Fraction, TradeType, sortedInsert, WETH9 } from '@uniswap/sdk-core';
2
2
  import JSBI from 'jsbi';
3
3
  import { Interface } from '@ethersproject/abi';
4
4
  import invariant from 'tiny-invariant';
@@ -624,7 +624,8 @@ function _createForOfIteratorHelperLoose(o, allowArrayLike) {
624
624
  }
625
625
 
626
626
  function isValidTokenPath(prevPool, currentPool, inputToken) {
627
- if (currentPool.involvesToken(inputToken)) return true;
627
+ if (inputToken instanceof Token && currentPool.involvesToken(inputToken)) return true;
628
+ if (currentPool instanceof Pool && currentPool.involvesToken(inputToken)) return true;
628
629
  // throw if both v4 pools, native/wrapped tokens not interchangeable in v4
629
630
  if (prevPool instanceof Pool && currentPool instanceof Pool) return false;
630
631
  // v2/v3 --> v4 valid if v2/v3 output is the wrapped version of the v4 pool native currency
@@ -2329,5 +2330,5 @@ var SwapRouter = /*#__PURE__*/function () {
2329
2330
  }();
2330
2331
  SwapRouter.INTERFACE = /*#__PURE__*/new Interface(abi$3);
2331
2332
 
2332
- export { ADDRESS_THIS, ADDRESS_ZERO, ApprovalTypes, ApproveAndCall, MIXED_QUOTER_V1_V2_FEE_PATH_PLACEHOLDER, MIXED_QUOTER_V2_V2_FEE_PATH_PLACEHOLDER, MIXED_QUOTER_V2_V3_FEE_PATH_PLACEHOLDER, MIXED_QUOTER_V2_V4_FEE_PATH_PLACEHOLDER, MSG_SENDER, MixedRoute, MixedRouteSDK, MixedRouteTrade, MulticallExtended, ONE, ONE_HUNDRED_PERCENT, PaymentsExtended, Protocol, RouteV2, RouteV3, RouteV4, SwapRouter, Trade, ZERO, ZERO_PERCENT, amountWithPathCurrency, encodeMixedRouteToPath, getOutputOfPools, getPathCurrency, isMint, partitionMixedRouteByProtocol, tradeComparator };
2333
+ export { ADDRESS_THIS, ADDRESS_ZERO, ApprovalTypes, ApproveAndCall, MIXED_QUOTER_V1_V2_FEE_PATH_PLACEHOLDER, MIXED_QUOTER_V2_V2_FEE_PATH_PLACEHOLDER, MIXED_QUOTER_V2_V3_FEE_PATH_PLACEHOLDER, MIXED_QUOTER_V2_V4_FEE_PATH_PLACEHOLDER, MSG_SENDER, MixedRoute, MixedRouteSDK, MixedRouteTrade, MulticallExtended, ONE, ONE_HUNDRED_PERCENT, PaymentsExtended, Protocol, RouteV2, RouteV3, RouteV4, SwapRouter, Trade, ZERO, ZERO_PERCENT, amountWithPathCurrency, encodeMixedRouteToPath, getOutputOfPools, getPathCurrency, isMint, isValidTokenPath, partitionMixedRouteByProtocol, tradeComparator };
2333
2334
  //# sourceMappingURL=router-sdk.esm.js.map