@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.
package/dist/v4-sdk.esm.js
CHANGED
|
@@ -5,6 +5,7 @@ import { TickMath, TickListDataProvider, v3Swap, NoTickDataProvider, encodeSqrtR
|
|
|
5
5
|
import { isAddress, defaultAbiCoder } from 'ethers/lib/utils';
|
|
6
6
|
import JSBI from 'jsbi';
|
|
7
7
|
import { constants, ethers } from 'ethers';
|
|
8
|
+
import { getSupportTokenizeByUnderlying } from '@kittycorn-labs/smart-order-router';
|
|
8
9
|
import { Interface } from '@ethersproject/abi';
|
|
9
10
|
import IMulticall from '@uniswap/v3-periphery/artifacts/contracts/interfaces/IMulticall.sol/IMulticall.json';
|
|
10
11
|
|
|
@@ -798,6 +799,11 @@ function getPathCurrency(currency, pool) {
|
|
|
798
799
|
} else if (pool.currency1.wrapped.equals(currency)) {
|
|
799
800
|
return pool.currency1;
|
|
800
801
|
} else {
|
|
802
|
+
var tokenize = getSupportTokenizeByUnderlying(pool.chainId, currency);
|
|
803
|
+
if (tokenize !== undefined) {
|
|
804
|
+
// Recursively try to find the path currency for the tokenize token
|
|
805
|
+
return getPathCurrency(tokenize, pool);
|
|
806
|
+
}
|
|
801
807
|
throw new Error("Expected currency " + currency.symbol + " to be either " + pool.currency0.symbol + " or " + pool.currency1.symbol);
|
|
802
808
|
}
|
|
803
809
|
}
|