Moralis.Cloud.define('getTotalDistributed', async (request) => {
const web3 = Moralis.web3ByChain('0xa86a');
const contract = new web3.eth.Contract(abi, '0xZZZZZZZZZZZZ);
const totalDistributed = await contract.methods.getTotalDividendsDistributed().call().catch(() => 'error with code');
const options = {
address: '0xZZZZZZZZZZZZZZ',
chain: 'avalanche',
exchange: 'exchange?'
};
const price = await Moralis.Web3API.token.getTokenPrice(options);
return { totalDistributed, price };
});
Hi there,
Iām willing to get some exchange information of our token on the Avalanche network: Total Distributed, Volume, Mcap, etc.
Iām looking for a way to integrate it into cloud functions in Moralis.
Understood that Avalanche network was added, how about the chain/exchange?
Thanks in advance.