Added
-
Simplified API with sensible defaults
tokenOutdefaults to"USDC"amountIndefaults to"1"- Example:
client.getPrice("WETH", ETHEREUM, UNISWAP_V3)
-
Optional price impact calculation
- Pass
includePriceImpact: trueas last parameter
- Pass
-
Token constants export via
dexap/tokenssubpathimport { WETH, USDC } from 'dexap/tokens'
-
Direct chain/DEX constant exports
import { ETHEREUM, UNISWAP_V3 } from 'dexap'
Changed
- API parameter order (BREAKING):
- Old:
getPrice(tokenIn, tokenOut, amount, chainId, dexType) - New:
getPrice(tokenIn, chainId, dexType, [tokenOut], [amount], [includePriceImpact])
- Old: