Alchemy – Does Alchemy ‘getAssetTransfers’ Retrieve All Transactions or Just Asset Transfers?

alchemytransactions

I'm working with alchemy's SDK and it looks like the getAssetTransfers API endpoint will return any value transaction from an address.

However, it also looks like it can return a list of all transactions for an address even if no value is sent (like calling a function for example).

Can it do this?

Best Answer

Heya 👋🏼 Full disclosure: Alchemy Developer Advocate speaking :)

getAssetTransfers gets all transaction types that you specify in your query, including "transactions even if no value is sent" as long as they fall under one of the supported transaction types.

The transactions you're seeing are probably internal transactions, since in the tutorial you linked, internal is one of the transaction types you're asking for:

const data = await alchemy.core.getAssetTransfers({
  fromBlock: "0x0",
  fromAddress: "0x5c43B1eD97e52d009611D89b74fA829FE4ac56b1",
  category: ["external", "internal", "erc20", "erc721", "erc1155"],
});

Our docs show table with all of the transaction types that are supported:

  1. external
  2. internal
  3. erc20
  4. erc721
  5. erc1155
  6. specialnft

Hope that helps!

Related Topic