This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ethers = require(`ethers`) | |
const { ChainId, Token, TokenAmount, Fetcher, Pair, Route, Trade, TradeType, Percent } = | |
require(`@pancakeswap-libs/sdk`); | |
const Web3 = require(`web3`); | |
const { JsonRpcProvider } = require("@ethersproject/providers"); | |
require(“dotenv”).config() | |
const provider = new JsonRpcProvider(`https://bsc-dataseed1.binance.org/`); | |
const web3 = new Web3(`wss://apis.ankr.com/wss/c40792ffe3514537be9fb4109b32d257/946dd909d324e5a6caa2b72ba75c5799/binance/full/main`); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* eslint-disable no-param-reassign */ | |
const getNextPage = (page, limit, totalResults) => { | |
if (totalResults / limit > page) { | |
return page + 1; | |
} | |
return null; | |
}; | |
const getPreviousPage = (page) => { |