@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/index.d.ts
CHANGED
|
@@ -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
|
|
@@ -705,8 +706,8 @@ var MixedRouteSDK = /*#__PURE__*/function () {
|
|
|
705
706
|
var prevPool = pools[i - 1];
|
|
706
707
|
var pool = pools[i];
|
|
707
708
|
var inputToken = tokenPath[i];
|
|
708
|
-
var outputToken = pool.token0.wrapped.equals(inputToken.wrapped) ? pool.token1 : pool.token0;
|
|
709
|
-
!isValidTokenPath(prevPool, pool, inputToken) ? invariant(false,
|
|
709
|
+
var outputToken = pool instanceof v4Sdk.Pool ? pool.token0.equals(inputToken) ? pool.token1 : pool.token0 : pool.token0.wrapped.equals(inputToken.wrapped) ? pool.token1 : pool.token0;
|
|
710
|
+
!isValidTokenPath(prevPool, pool, inputToken) ? invariant(false, "PATH") : void 0;
|
|
710
711
|
tokenPath.push(outputToken);
|
|
711
712
|
}
|
|
712
713
|
this.pools = pools;
|
|
@@ -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
|