how to create??
āEthTokenBalanceā
āEthTokenTransfersā
āEthTransactionsā
āItemā
how to create??
āEthTokenBalanceā
āEthTokenTransfersā
āEthTransactionsā
āItemā
Hey @thomasmitchell, hope you are ok.
Check here: https://docs.moralis.io/transactions-and-balances/intro
Carlos Z
@thecil,
Ok, so Iām running that and all its returning are addresses. Iād like to inspect each for possible ERC20 token name, symbol, and decimals. Do you guys at Moralis have a convenience function or an indexed table of addresses and contract identity for that? Or am I stuck brute force web3 calling every address on the list for its identity? It seems like that should be a Moralis job, not something to bog down my front-end with.
Yes, we do have a way sir
https://docs.moralis.io/transactions-and-balances/token-balances
Carlos Z
@thecil if only that were true. Letās clarify my question. Iāve got getAllERC20() working fine, and pushed it to the screen. Iāve also merged it with price data from CoinGecko per the āI cloned Zerionā video (thereās an error in coinGeckoTokenList.json that brings back the wrong token for āUNIā. I/we/CoinGecko need to fix that).
As you can see what Iām trying to do is a FinTech-style drop-down drawer for each line that lists all transactions filtered by that token. It should read something like <Text>{list.date} {list.counterparty} {list.amount} </Text>
where list.counterparty is either an ENS or raw address. Butā¦Iāve got no, as weād call it back in my day: ārelationā aka ādictionaryā of token contract addresses to filter the transactions on.
import { Flex, Text } from "@chakra-ui/react";
import { useEffect } from "react";
import { useMoralis } from "react-moralis";
export const TransactionList = (props) => {
const { isAuthenticated, Moralis } = useMoralis();
useEffect(() => {
if (isAuthenticated) {
Moralis.Web3.getTransactions().then(console.log());
}
});
return (
<Flex justifyContent="center">
<Text>
Transaction List: {props.tokenName}, {props.symbol}
</Text>
</Flex>
);
};
All getTransactions() brings back is in pure addresses. And I donāt have a table to relate { name:āUniswapā || symbol:āUNIā } to { āethā: ā0x1f9840a85d5af5bf1d1762f925bdaddc4201f984ā }.
I stole that address information from
https://api.coingecko.com/api/v3/coins/uniswap
but Iād rather pull it from Moralis.
Thoughts?