@kittycorn-labs/v4-sdk 1.0.0 → 1.1.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.
@@ -11,6 +11,7 @@ var v3Sdk = require('@uniswap/v3-sdk');
11
11
  var utils = require('ethers/lib/utils');
12
12
  var JSBI = _interopDefault(require('jsbi'));
13
13
  var ethers = require('ethers');
14
+ var smartOrderRouter = require('@kittycorn-labs/smart-order-router');
14
15
  var abi = require('@ethersproject/abi');
15
16
  var IMulticall = _interopDefault(require('@uniswap/v3-periphery/artifacts/contracts/interfaces/IMulticall.sol/IMulticall.json'));
16
17
 
@@ -803,6 +804,11 @@ function getPathCurrency(currency, pool) {
803
804
  } else if (pool.currency1.wrapped.equals(currency)) {
804
805
  return pool.currency1;
805
806
  } else {
807
+ var tokenize = smartOrderRouter.getSupportTokenizeByUnderlying(pool.chainId, currency);
808
+ if (tokenize !== undefined) {
809
+ // Recursively try to find the path currency for the tokenize token
810
+ return getPathCurrency(tokenize, pool);
811
+ }
806
812
  throw new Error("Expected currency " + currency.symbol + " to be either " + pool.currency0.symbol + " or " + pool.currency1.symbol);
807
813
  }
808
814
  }