joshstevens19 / simple-pancakeswap-sdk

MIT License
37 stars 36 forks source link

I get the trade from the example, how do I send the trade from my wallet? #9

Closed TransFormes closed 2 years ago

TransFormes commented 2 years ago
const pancakeswapPair = new PancakeswapPair({
  // the contract address of the token you want to convert FROM
  fromTokenContractAddress: fromTokenContractAddress,
  // the contract address of the token you want to convert TO
  toTokenContractAddress: toTokenContractAddress,
  // the ethereum address of the user using this part of the dApp
  ethereumAddress: ethereumAddress,
});
// now to create the factory you just do
const pancakeswapPairFactory = await pancakeswapPair.createFactory();
// const trade = await pancakeswapPairFactory.findBestRoute('10');
const trade = await pancakeswapPairFactory.trade('10');