Hello.
Is it possible to use array of topics? How I can do it?
For example I have this code:
const options = {
address: sSwapFactoryContractAddress,
chain: 'bsc',
topic0: sPairCreatedAddress,
topic1: ethers.utils.hexZeroPad(sWBNB, 32),
topic2: ethers.utils.hexZeroPad(sTokenContractAddress, 32)
};
const oLogs = await Moralis.Web3API.native.getLogsByAddress(options);
and it’s work fine. But I need check for another pairs like BUSD / USDT. So it will be nice to use code like:
const options = {
address: sSwapFactoryContractAddress,
chain: 'bsc',
topic0: sPairCreatedAddress,
topic1: [ethers.utils.hexZeroPad(sWBNB, 32), ethers.utils.hexZeroPad(sBUSD, 32), ethers.utils.hexZeroPad(sUSDT, 32)],
topic2: ethers.utils.hexZeroPad(sTokenContractAddress, 32)
};
const oLogs = await Moralis.Web3API.native.getLogsByAddress(options);
instead of:
const options = {
address: sSwapFactoryContractAddress,
chain: 'bsc',
topic0: sPairCreatedAddress,
topic1: ethers.utils.hexZeroPad(sWBNB, 32),
topic2: ethers.utils.hexZeroPad(sTokenContractAddress, 32)
};
const oLogs = await Moralis.Web3API.native.getLogsByAddress(options);
const options = {
address: sSwapFactoryContractAddress,
chain: 'bsc',
topic0: sPairCreatedAddress,
topic1: ethers.utils.hexZeroPad(sBUSD, 32),
topic2: ethers.utils.hexZeroPad(sTokenContractAddress, 32)
};
const oLogs = await Moralis.Web3API.native.getLogsByAddress(options);
const options = {
address: sSwapFactoryContractAddress,
chain: 'bsc',
topic0: sPairCreatedAddress,
topic1: ethers.utils.hexZeroPad(sUSDT, 32),
topic2: ethers.utils.hexZeroPad(sTokenContractAddress, 32)
};
const oLogs = await Moralis.Web3API.native.getLogsByAddress(options);
Thanks.