Recurring card billing is here. Subscribe once and you're covered every month

Get started
Spectrum Nodes

How Do You Get Every Transaction for a Wallet on Ethereum, Base, Arbitrum, and Polygon?

Featured image for: How Do You Get Every Transaction for a Wallet on Ethereum, Base, Arbitrum, and Polygon?
Share

By Daniel Chayra, Spectrum Nodes · Updated November 4, 2026

Short answer: No JSON RPC method returns a wallet's history, so you assemble it from three sources. Token transfers come from eth_getLogs, filtered on the Transfer event with the wallet in the sender or receiver topic. Native and internal transfers come from call traces, through debug_traceBlockByNumber with the callTracer, or trace_filter where the node supports it. Balances at past blocks come from an archive node. Once the backfill is done, address activity webhooks push every new transfer so you stop polling. The method is the same on Ethereum, Base, Arbitrum, and Polygon, with a few chain quirks covered below.

On Spectrum Nodes, Ethereum, Base, Arbitrum, and Polygon endpoints include archive data and the debug and trace methods on every plan, Free included, and our address activity webhooks run on all four. The examples use a Spectrum endpoint URL in $SPECTRUM_RPC_URL. Any endpoint with archive and trace access works the same way.

Why Doesn't eth_getTransactionByHash Give You a Wallet's History?

You need the hash first, and nothing in the standard JSON RPC API lists hashes by address. Even with every hash in hand, the transaction object misses most of what a wallet does:

  • Token transfers. When a wallet sends USDC, the transaction's to is the USDC contract. The recipient appears only in the Transfer log.
  • Internal transfers. When a contract sends ETH to the wallet, for a swap paid out in ETH, a bridge withdrawal, or a multisig payout, no transaction goes to the wallet at all. The transfer exists only inside the call trace.
  • Smart accounts. An ERC4337 wallet's actions arrive through the EntryPoint contract, sent by a bundler, so the wallet is never the transaction's from.

eth_getTransactionCount helps with one check. For a regular wallet (an externally owned account), the count at the latest block equals the number of transactions it has sent, failed ones included, so you can confirm your list of outgoing transactions is complete. It says nothing about what the wallet received.

Where each kind of activity shows up

ActivityWhere it livesHow to read it
Native coin sent or received at the top levelThe transaction's from, to, and valueTraces, or full blocks from eth_getBlockByNumber
Native coin moved by a contract (internal)Call traces onlydebug_traceBlockByNumber with callTracer, or trace_filter
ERC20 and ERC721 transfersTransfer logseth_getLogs
ERC1155 transfersTransferSingle and TransferBatch logseth_getLogs
Gas paidReceiptseth_getTransactionReceipt or eth_getBlockReceipts
Balance at a past blockArchive stateeth_getBalance or eth_call with that block number

Step 1: How Do You Get Token Transfers With eth_getLogs?

Filter on the Transfer event's signature hash and put the wallet in the topic that matches the direction. ERC20 and ERC721 share the signature Transfer(address,address,uint256), whose hash is 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. Topic 1 is the sender and topic 2 the receiver, each padded to 32 bytes. ERC20 logs carry the amount in data, and ERC721 logs add a fourth topic with the token ID.

Transfers sent by the wallet:

curl -s -X POST "$SPECTRUM_RPC_URL" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "eth_getLogs",
    "params": [{
      "fromBlock": "0x18cba80",
      "toBlock": "0x18cc24f",
      "topics": [
        "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
        "0x000000000000000000000000d8da6bf26964af9d7eed9e03e53415d37aa96045"
      ]
    }]
  }'

For transfers received, put null in topic 1 and the padded wallet in topic 2:

"topics": [
  "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
  null,
  "0x000000000000000000000000d8da6bf26964af9d7eed9e03e53415d37aa96045"
]

That block range is 26,000,000 to 26,001,999 on Ethereum. Providers cap how many blocks one eth_getLogs call can span, often 10,000 on paid plans and far fewer on free ones. Walk history in windows, halve the window when a call errors or times out, and record the last block you finished so a restart picks up from there.

The same query in TypeScript with viem:

import { createPublicClient, http, parseAbiItem } from 'viem'
import { mainnet } from 'viem/chains' // or base, arbitrum, polygon

const client = createPublicClient({
  chain: mainnet,
  transport: http(process.env.SPECTRUM_RPC_URL),
})

const wallet = '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045'
const transfer = parseAbiItem(
  'event Transfer(address indexed from, address indexed to, uint256 value)',
)
const range = { fromBlock: 26_000_000n, toBlock: 26_001_999n }

// strict: true skips ERC721 logs, which share this signature but index the token ID
const [sent, received] = await Promise.all([
  client.getLogs({ event: transfer, args: { from: wallet }, strict: true, ...range }),
  client.getLogs({ event: transfer, args: { to: wallet }, strict: true, ...range }),
])

for (const log of [...sent, ...received]) {
  console.log(log.blockNumber, log.address, log.args.from, log.args.to, log.args.value)
}

ERC1155. Query TransferSingle (0xc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62) and TransferBatch (0x4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb). Topic 1 is the operator, so the wallet goes in topic 2 for transfers sent or topic 3 for transfers received.

Where Transfer logs miss balance changes:

  • WETH9 style contracts, such as WETH on Ethereum and Base, emit Deposit and Withdrawal when you wrap and unwrap, not Transfer
  • Rebasing tokens change balances without emitting any event
  • Tokens that don't follow the standard can skip or misreport the event

Catch all three by reconciling. Sum each token's inflows and outflows up to block N, then compare the total with balanceOf at block N through eth_call on an archive node. A mismatch points at a token to handle by hand.

Shortcut on Spectrum Nodes: our unified API's getTransfers returns a wallet's ERC20 transfers as sender or receiver, merged and deduplicated, 1,000 per page with a cursor, on 16 EVM chains including Ethereum, Base, Arbitrum, and Polygon. It defaults to the last 10,000 blocks, so set fromBlock:

curl -s -X POST "$SPECTRUM_API_URL" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "getTransfers",
    "params": {
      "chain": "base",
      "address": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
      "fromBlock": 38000000,
      "toBlock": "latest"
    }
  }'

$SPECTRUM_API_URL is your endpoint URL ending in /v1. Pass the returned cursor back in the next call to get the next page.

Step 2: How Do You Get Native and Internal Transfers From Traces?

Trace every block in your range and walk the call tree. debug_traceBlockByNumber with the built in callTracer replays a block and returns one call tree per transaction: the top level call and every internal call under it.

curl -s -X POST "$SPECTRUM_RPC_URL" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "debug_traceBlockByNumber",
    "params": ["0x18cba80", { "tracer": "callTracer" }]
  }'

Each entry in the result holds a txHash and a result frame with type, from, to, value in hex, an error field when the frame reverted, and child frames under calls. This function collects every native coin move into or out of the wallet:

// Frame types that can move native coins. DELEGATECALL and STATICCALL never do.
const VALUE_TYPES = new Set(['CALL', 'CREATE', 'CREATE2', 'SELFDESTRUCT'])

function nativeMoves(frame, wallet, txHash, depth = 0, out = []) {
  if (frame.error) return out // a reverted frame, and everything under it, moved nothing
  const value = BigInt(frame.value ?? '0x0')
  const from = frame.from?.toLowerCase()
  const to = frame.to?.toLowerCase()
  if (VALUE_TYPES.has(frame.type) && value > 0n && (from === wallet || to === wallet)) {
    out.push({ txHash, from, to, value, kind: depth === 0 ? 'external' : 'internal' })
  }
  for (const child of frame.calls ?? []) nativeMoves(child, wallet, txHash, depth + 1, out)
  return out
}

// blockTraces is the result array from debug_traceBlockByNumber
const wallet = '0xd8da6bf26964af9d7eed9e03e53415d37aa96045'
const moves = blockTraces.flatMap((t) => nativeMoves(t.result, wallet, t.txHash))

A DELEGATECALL frame can show a value, but it runs code in the caller's context and moves nothing, which is why the function skips it.

Tracing costs one call per block. A year of Ethereum blocks is about 2.6M calls, which on our plans is 263M credits at 100 credits per debug_traceBlockByNumber, inside the 1.15B credits of the $150 Business plan.

trace_filter, where the node supports it. Nodes running Erigon or Reth also serve trace_filter, which searches a block range for traces from or to an address, so you skip blocks the wallet never touched. Geth based clients don't have it. On Spectrum Nodes, trace_filter works on Ethereum, Base, BNB Smart Chain, Optimism, and HyperEVM.

curl -s -X POST "$SPECTRUM_RPC_URL" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "trace_filter",
    "params": [{
      "fromBlock": "0x18cba80",
      "toBlock": "0x18cc24f",
      "toAddress": ["0xd8da6bf26964af9d7eed9e03e53415d37aa96045"],
      "after": 0,
      "count": 500
    }]
  }'

Run it once with toAddress for incoming and once with fromAddress for outgoing, since nodes differ on how they combine the two fields in one call. Page with after and count. In the results, keep traces with a non zero action.value, drop any whose action.callType is delegatecall, and drop any trace that has an error or sits under one that does (match parents by traceAddress).

Gas fees. A wallet pays gas on every transaction it sends, failed ones included. Read gasUsed × effectiveGasPrice from the receipt, or pull a whole block of receipts with eth_getBlockReceipts. On Base, add the receipt's l1Fee, the cost of posting the transaction to Ethereum. On Arbitrum that cost is already converted into L2 gas inside gasUsed, and the receipt's gasUsedForL1 shows how much.

Step 3: When Do You Need an Archive Node?

Whenever you read state at a past block or trace an old one. A full node keeps state for recent blocks only, typically the last 128, and answers older state queries with a missing trie node error. You need archive data for:

  • eth_getBalance, eth_call (for balanceOf), eth_getStorageAt, and eth_getCode at an old block number
  • debug_traceBlockByNumber, debug_traceTransaction, and trace_* on old blocks, because the node replays them on the state before the block
  • Daily or month end balance snapshots, and the reconciliation check from Step 1

Logs and receipts are block data, not state, but full nodes don't always keep them either. Since July 8, 2025, every Ethereum execution client can drop block bodies and receipts from before the Merge (block 15,537,394). Polygon's Bor client indexes logs and transactions for about the last two months by default. If a wallet's history goes back years, ask your provider for archive data on each chain by name.

On Spectrum Nodes you choose archive when you create an endpoint, and the unified API's getBalance and getTokenBalance accept a blockHeight for a past balance on archive nodes.

Step 4: How Do You Keep the History Live Without Polling?

Use address activity webhooks. Polling means calling eth_getLogs and tracing every new block for every wallet, retrying when the node falls behind, and unwinding reorgs yourself. A webhook moves that work to the provider and sends you the result.

Spectrum Webhooks' address activity type watches a list of addresses on one chain and sends every matching transfer in a block as one signed POST:

  • Categories: external (native coin, top level), internal (native coin moved by a contract, read from traces), erc20, erc721, and erc1155. ERC20 events arrive with the token's symbol and decimals, so your handler makes no second call
  • At least once: dedupe on the X-Spectrum-Event-Id header and repeats become no ops
  • Reorgs: if a delivered block is orphaned, a rollback delivery arrives with removed: true and the same events, so you can reverse them. Live detection covers reorgs up to 64 blocks deep
  • Signed: every delivery is signed and sent over HTTPS
  • Chains: address activity runs on Ethereum, Base, Arbitrum, and Polygon, among others. Internal transfers need the chain's debug namespace, which all four have on our endpoints

You create webhooks in the Webhooks section of the Spectrum dashboard. More detail: Spectrum Webhooks: Monitor Wallets and Contract Events.

To switch from backfill to live without a gap:

  1. Create the webhook first and note the block number of its first delivery
  2. Backfill from the wallet's first activity up to that block with Steps 1 and 2
  3. Dedupe the overlap on transaction hash plus log index for token transfers, and transaction hash plus trace position for internal transfers. The webhook payload can include logIndex and typeTraceAddress for this
  4. Run the Step 1 reconciliation once a day against an archive balance

How Do Block Explorer APIs Compare?

Block explorer APIs return per address lists, which saves you the indexing and makes them handy for spot checks. For a product they have limits:

  • Separate endpoints for normal, internal, ERC20, ERC721, and ERC1155 history, and a separate query per chain
  • Free keys are limited to a few calls a second with a daily cap, and some chains need a paid plan
  • The explorer decides what it indexes, and it sends no notice when a reorg changes rows you already pulled
  • Nothing is pushed, so you poll for new rows

Raw RPC plus webhooks gives you the same history from the chain itself, with new activity pushed to you.

Which Method Works on Each Chain?

ChainChain IDToken transfersNative and internal transfersWatch for
Ethereum1eth_getLogsdebug_traceBlockByNumber, or trace_filter on Erigon or Reth nodesBlocks before the Merge (15,537,394) need a node that kept full history
Base8453eth_getLogsdebug_traceBlockByNumber, or trace_filter on Reth based nodesETH bridged from Ethereum arrives as an internal call inside a deposit transaction. Add l1Fee to gas
Arbitrum One42161eth_getLogsdebug_traceBlockByNumber from block 22,207,817, arbtrace_* before itBlocks before the Nitro upgrade need a Classic node. The L1 cost sits inside gasUsed
Polygon PoS137eth_getLogsLogTransfer logs, or debug_traceBlockByNumberNo trace_filter on Bor nodes. Default log index window of about two months

Polygon: Native POL From Logs

Polygon PoS writes a log for every native POL transfer, internal ones included. The node emits LogTransfer from the system contract 0x0000000000000000000000000000000000001010, with the sender in topic 2, the receiver in topic 3, and the amount plus both balances before and after in data. Its signature hash is 0xe6497e3ee548a3372136af2fcb0696db31fc6cf20260707645068bd3fe97f3c4, so you can read POL history with eth_getLogs instead of tracing every block:

curl -s -X POST "$SPECTRUM_POLYGON_RPC_URL" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "eth_getLogs",
    "params": [{
      "address": "0x0000000000000000000000000000000000001010",
      "fromBlock": "0x5265c00",
      "toBlock": "0x52663cf",
      "topics": [
        "0xe6497e3ee548a3372136af2fcb0696db31fc6cf20260707645068bd3fe97f3c4",
        null,
        null,
        "0x000000000000000000000000d8da6bf26964af9d7eed9e03e53415d37aa96045"
      ]
    }]
  }'

That returns POL received between blocks 86,400,000 and 86,401,999. Move the wallet to topic 2 for POL sent. Polygon Labs ended its support for the Erigon client on Polygon PoS on August 1, 2026, and Bor, the client it recommends, has no trace_filter, so use debug_traceBlockByNumber when you need the call context.

Arbitrum and Base: Upgrades and Bridges

Arbitrum One ran on its Classic stack before block 22,207,817. Nitro nodes hold the raw data for those blocks but can't execute them, so traces and eth_call on older blocks go to a Classic node through the arbtrace_* methods. If your wallets were active before Nitro, check that your provider serves them. Spectrum Nodes serves arbtrace_* on those blocks.

On Base, deposits bridged from Ethereum arrive as deposit transactions (type 0x7e). ETH sent through the standard bridge reaches the wallet as an internal call inside one, so traces catch it and a scan of top level transactions doesn't.

FAQ

Is there an RPC method that returns all transactions for an address? No. The standard Ethereum JSON RPC API has no lookup by address. Build the history from eth_getLogs for tokens, traces for native and internal transfers, and archive reads for past balances.

How do I get internal transactions for a wallet? From call traces. Run debug_traceBlockByNumber with callTracer on each block and keep CALL, CREATE, CREATE2, and SELFDESTRUCT frames with a non zero value that touch the wallet. On Erigon or Reth nodes, trace_filter with fromAddress or toAddress searches a block range for you.

How do I get all ERC20 transfers for a wallet? Call eth_getLogs with topic 0 set to the Transfer hash (0xddf252ad…) and the wallet, padded to 32 bytes, in topic 1 for transfers sent or topic 2 for transfers received. On Spectrum Nodes, getTransfers returns both directions in one paged call.

Do I need an archive node to get a wallet's transaction history? For past balances and for tracing old blocks, yes. Token transfers come from logs, which full nodes serve only if they kept the history, and many drop old block data, such as Ethereum's history from before the Merge.

What block range can eth_getLogs query? It depends on the provider and plan. Many cap paid plans at 10,000 blocks per call and free plans much lower, and some allow any range with a cap on response size. Split long ranges into windows and shrink a window when a call fails.

How do I track a wallet without polling? Use address activity webhooks. Spectrum Webhooks send every native, internal, ERC20, ERC721, and ERC1155 transfer for the addresses you watch, signed and at least once, with a rollback delivery if a reorg removes a block.

How do I get wallet transactions on Polygon without trace_filter? Read native POL transfers, internal ones included, from the LogTransfer logs that Polygon PoS emits from 0x0000000000000000000000000000000000001010, and token transfers from the usual Transfer logs. For call context, use debug_traceBlockByNumber with callTracer.

Does this work on other EVM chains? The eth_getLogs and trace method works on most EVM chains, with each chain's quirks around clients, bridges, and history. Spectrum Nodes serves RPC on 139 chains, with archive data and tracing on many of them.

References

All checked November 4, 2026.

Start Now: https://dashboard.spectrumnodes.com/auth/signup

Backfilling thousands of wallets across chains? Book a call: https://calendly.com/spectrumnodes-sales/30min