How to create these tables?

how to create??

ā€œEthTokenBalanceā€
ā€œEthTokenTransfersā€
ā€œEthTransactionsā€
ā€œItemā€

howto

1 Like

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 :nerd_face:
https://docs.moralis.io/transactions-and-balances/token-balances

Carlos Z

1 Like

@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?