Skip to main content

Overview

Moralis Streams makes it easy to work with webhook payloads by providing parsed, structured data for common on-chain activity. The data Moralis parses for you depends on the chain.
On EVM, Moralis includes ready-to-use parsed sections such as:
  • Transactions (txs)
  • Internal transactions (txsInternal)
  • ERC-20 transfers (erc20Transfers)
  • ERC-20 approvals (erc20Approvals)
  • NFT transfers (nftTransfers)
  • NFT approvals (nftApprovals)
  • Custom smart contract events, decoded using your ABI
This avoids manually decoding logs and building your own parsing pipeline.Example payload shape:
{
  "confirmed": false,
  "chainId": "0x1",
  "streamId": "uuid",
  "tag": "string",
  "retries": 0,
  "block": { },
  "logs": [],
  "txs": [],
  "txsInternal": [],
  "erc20Transfers": [],
  "erc20Approvals": [],
  "nftTransfers": [],
  "nftApprovals": { "ERC721": [], "ERC1155": [] }
}
Learn more about EVM Webhook Payloads.

Parsing Smart Contract Events (EVM)

Custom-event ABI decoding is an EVM-only feature. Bitcoin and Solana payloads are pre-parsed into their native shapes and do not require ABI decoding.
If you are streaming a smart contract event on EVM, you can decode the logs from the webhook into a typed structure.
import Moralis from "moralis";
import { BigNumber } from "@moralisweb3/core";

interface URI {
  value: string;
  id: BigNumber;
}

const webhookData = {
  confirmed: true,
  chainId: "0x1",
  abi: [
    {
      anonymous: false,
      inputs: [
        { indexed: false, internalType: "string", name: "value", type: "string" },
        { indexed: true, internalType: "uint256", name: "id", type: "uint256" },
      ],
      name: "URI",
      type: "event",
    },
  ],
  logs: [
    {
      logIndex: "475",
      transactionHash:
        "0x55125fa34ce16c295c222d48fc3efe210864dc2fb017f5965b4e3743d72342d5",
      address: "0x495f947276749ce646f68ac8c248420045cb7b5e",
      data: "0x0000000000000000000000000000000000000000000000000000000000000020...",
      topic0:
        "0x6bb7ff708619ba0610cba295a58592e0451dee2622938c8755667688daf3529b",
      topic1:
        "0xab6953e647a36018fc48d6223583597b84c755a0000000000000010000000001",
      topic2: null,
      topic3: null,
    },
  ],
  erc20Transfers: [],
  erc20Approvals: [],
  nftApprovals: { ERC1155: [], ERC721: [] },
  nftTransfers: [],
};

const decodedLogs = Moralis.Streams.parsedLogs<URI>(webhookData);

console.log(decodedLogs[0].value);
console.log(decodedLogs[0].id.toString());

Notes

  • On EVM, prefer the dedicated parsed arrays (erc20Transfers, nftTransfers, etc.) over decoding raw logs yourself.
  • On EVM, custom-event decoding relies on the ABI you configure for the stream — raw logs remain available in the payload alongside parsed data.
  • On Bitcoin, output addresses and values are already parsed; no decoding step is needed.
  • On Solana, account keys, instructions, and SPL balance snapshots are already parsed; subtract pre/post token balances to derive deltas.