joshstevens19 / simple-uniswap-sdk

Uniswap SDK which handles the routes automatically for you, changes in trade quotes reactive subscriptions, exposure to formatted easy to understand information, bringing back the best trade quotes automatically, generating transactions for you and much more.
MIT License
188 stars 95 forks source link

Error with MKR token routing #17

Closed 0xpbj closed 3 years ago

0xpbj commented 3 years ago

image

Seeing this above error when I try to get routes from MKR token. Here's the code snippet:


const { UniswapPair, ChainId, UniswapVersion, UniswapPairSettings } = require('simple-uniswap-sdk')
const uniswapPair = new UniswapPair({
  fromTokenContractAddress: '0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2', //mkr token
  toTokenContractAddress: '0xdac17f958d2ee523a2206206994597c13d831ec7', //usdt token
  ethereumAddress: '0x4cb2b6dcb8da65f8421fed3d44e0828e0abcda60',
  chainId: ChainId.MAINNET,
  settings: new UniswapPairSettings({
    slippage: 0.005,
    deadlineMinutes: 20,
    disableMultihops: false,
    uniswapVersions: [UniswapVersion.v2],
  })
})

const doWork = async () => {
  const uniswapPairFactory = await uniswapPair.createFactory()
  const trade = await uniswapPairFactory.trade('1')
  console.log('TRADE ', trade.transaction)
  console.log('Trade Route', trade.routeText)
  trade.destroy()
}

doWork()
joshstevens19 commented 3 years ago

This is now fixed in 3.4.1 thanks let me know if you have any issues.