When requested data from other chains like Polygon BSC the data comes empty,
export const getTransactionHistory = async (address, chain) => {
const options = {
chain: "matic",
address,
order: "desc",
};
let transactions = await Moralis.Web3.getTransactions(options);
transactions = transactions.map((transaction) => {
if (transaction.value !== "0" && transaction.gas_price) {
transaction.value = web3.utils.fromWei(transaction.value);
transaction.gas_price = web3.utils.fromWei(String(transaction.gas_price));
transaction.chain = chain;
}
return transaction;
});
transactions = transactions.filter((block) => block.value !== "0");
return transactions;
};