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?