Erc20 internal transactions

Hey @067pab

For info about transactions you need to use gettransactions, for token transfers getTokenTransfers.

For example getTransactions returns array like this:

[
  {
    "hash": "0x057Ec652A4F150f7FF94f089A38008f49a0DF88e",
    "nonce": "326595425",
    "transaction_index": "25",
    "from_address": "0xd4a3BebD824189481FC45363602b83C9c7e9cbDf",
    "to_address": "0xa71db868318f0a0bae9411347cd4a6fa23d8d4ef",
    "value": "650000000000000000",
    "gas": "6721975",
    "gas_price": "20000000000",
    "input": "string",
    "receipt_cumulative_gas_used": "1340925",
    "receipt_gas_used": "1340925",
    "receipt_contract_address": "0x1d6a4cf64b52f6c73f201839aded7379ce58059c",
    "receipt_root": "string",
    "receipt_status": "1",
    "block_timestamp": "2021-04-02T10:07:54.000Z",
    "block_number": "12526958",
    "block_hash": "0x0372c302e3c52e8f2e15d155e2c545e6d802e479236564af052759253b20fd86"
  }
]

So using basic JS and function .filter() you can filter the array to have only internal transactions.
Example:

const address = "0x...342"
const transactions = await Moralis.Web3API.account.getTransactions({ address  });

const internalTXs = transactions.filter((tx) => tx["to_address"] === address)

Hope this helps :man_mechanic:

@jswift24 @alex12 Hello, did you find a way to get the internal txs? It seems like Moralis team does not understand the problem.

I have the same problem, my internal transfers are not returned by the getTransactions or getTokenTransfers methods, some transfers are returned but the last one (which is the most important for me) is not returned.

1 Like

Hi all internal transactions are not in our api right now

+1 for support for internal transactions

Please add support for internal transactions, it is a business-critical feature.

For instance, people can send you ETH using smart contracts and this ETH will be sent as an internal transaction (read: smart contract logic). In no way systems using your APIs will be able to understand that your account received some ETH, despite it has indeed arrived.

Thanks!

you can vote this on roadmap.moralis.io