@uniswap/router-sdk 1.21.0 → 1.21.2
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 +1 -0
- package/dist/router-sdk.cjs.development.js +5 -3
- package/dist/router-sdk.cjs.development.js.map +1 -1
- package/dist/router-sdk.cjs.production.min.js +1 -1
- package/dist/router-sdk.cjs.production.min.js.map +1 -1
- package/dist/router-sdk.esm.js +6 -5
- package/dist/router-sdk.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/router-sdk.esm.js
CHANGED
|
@@ -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
|
|
@@ -700,8 +701,8 @@ var MixedRouteSDK = /*#__PURE__*/function () {
|
|
|
700
701
|
var prevPool = pools[i - 1];
|
|
701
702
|
var pool = pools[i];
|
|
702
703
|
var inputToken = tokenPath[i];
|
|
703
|
-
var outputToken = pool.token0.wrapped.equals(inputToken.wrapped) ? pool.token1 : pool.token0;
|
|
704
|
-
!isValidTokenPath(prevPool, pool, inputToken) ? process.env.NODE_ENV !== "production" ? invariant(false,
|
|
704
|
+
var outputToken = pool instanceof Pool ? pool.token0.equals(inputToken) ? pool.token1 : pool.token0 : pool.token0.wrapped.equals(inputToken.wrapped) ? pool.token1 : pool.token0;
|
|
705
|
+
!isValidTokenPath(prevPool, pool, inputToken) ? process.env.NODE_ENV !== "production" ? invariant(false, "PATH") : invariant(false) : void 0;
|
|
705
706
|
tokenPath.push(outputToken);
|
|
706
707
|
}
|
|
707
708
|
this.pools = pools;
|
|
@@ -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
|