Skip to content

v0.2.0

Latest

Choose a tag to compare

@slvDev slvDev released this 12 Dec 13:42

Added

  • Simplified API with sensible defaults

    • tokenOut defaults to "USDC"
    • amountIn defaults to "1"
    • Example: client.getPrice("WETH", ETHEREUM, UNISWAP_V3)
  • Optional price impact calculation

    • Pass includePriceImpact: true as last parameter
  • Token constants export via dexap/tokens subpath

    • import { 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])