Transactions by wallet how to get internal transactions with the sdk

How to enable internal transactions for Moralis.EvmApi.transaction.getWalletTransactions using the backend.

I am trying to “include”: “internal_transactions”, I am using the backend to fetch transaction data as follows.

I get an error

Something went wrong Moralis SDK Error: [C0005] Request contains unknown parameter: internal. This operation supports the following parameters: address, chain, fromBlock, toBlock, fromDate, toDate, cursor, limit, disableTotal

app.get("/gettransactions", async (req, res) => {
  try {
    const { query } = req;

    const response = await Moralis.EvmApi.transaction.getWalletTransactionsVerbose({
      chain: "0x1",
      address: query.contractAddress,
      include: "internal_transactions",
      limit: 10 
    });

    console.log(response); // Added console log to display response

    return res.status(200).json(response.result);
  } catch (e) {
    console.log(`Something went wrong ${e}`);
    return res.status(400).json();
  }
});

maybe you have to update the sdk version?

this is the one im using

“moralis”: “^2.14.3”

Tried other versions, same error, anything else you can think of?

by looking now at the documentation it looks like getting native transactions has that option for internal transactions

end it is not present for decoded transactions (verbose endpoint)

yes, you are right, it works fine, thank you

1 Like