# trace_callMany - Tempo RPC Method

Traces multiple calls in sequence on Tempo, where each call can depend on the state changes of the previous one.

This method requires an archive node. It is not available on full nodes.

## When to Use This Method

- **Trace multiple calls across different blocks** - Execute calls at different historical block heights for cross-block state analysis on Tempo
- **Historical state comparison** - Compare how the same call would execute at different points in Tempo chain history
- **Multi-step simulation** - Simulate a sequence of dependent calls where each step builds on the previous one for merchant settlement, treasury operations, payout automation, and stablecoin-native financial applications
- **Batch operation tracing** - Preview multiple contract interactions in a single RPC request

## Best Practices

- Each call specifies its own block number for cross-block analysis
- Useful for comparing state across time without multiple requests
- More efficient than separate trace\_call requests for multi-step workflows
- Requires archive node access for historical block state

## Request Parameters

- `calls` (`Array, required`): Array of [callObject, traceTypes] pairs
- `blockNumber` (`QUANTITY|TAG, optional`): Block number or tag (default: latest)

## Request Example

```json
{
  "jsonrpc": "2.0",
  "method": "trace_callMany",
  "params": [
    [
      [{"to": "0x0bd34b0a5be345c9bf7a147eb698e993511180cb", "data": "0x70a082310000000000000000000000000bd34b0a5be345c9bf7a147eb698e993511180cb"}, ["trace"]],
      [{"to": "0x0bd34b0a5be345c9bf7a147eb698e993511180cb", "data": "0x18160ddd"}, ["trace"]]
    ],
    "latest"
  ],
  "id": 1
}
```

## Response Fields

This method returns no documented fields.

## Successful Response

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {}
}
```

## Code Examples

cURL
JavaScript
Python

```bash
curl -X POST https://api-tempo-mainnet.n.dwellir.com/YOUR_API_KEY \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "trace_callMany",
    "params": [
      [
        [{"to": "0x0bd34b0a5be345c9bf7a147eb698e993511180cb", "data": "0x70a082310000000000000000000000000bd34b0a5be345c9bf7a147eb698e993511180cb"}, ["trace"]],
        [{"to": "0x0bd34b0a5be345c9bf7a147eb698e993511180cb", "data": "0x18160ddd"}, ["trace"]]
      ],
      "latest"
    ],
    "id": 1
  }'
```

```javascript
import { JsonRpcProvider } from 'ethers';

const provider = new JsonRpcProvider('https://api-tempo-mainnet.n.dwellir.com/YOUR_API_KEY');

const results = await provider.send('trace_callMany', [
  [
    [{ to: '0x0bd34b0a5be345c9bf7a147eb698e993511180cb', data: '0x70a082310000000000000000000000000bd34b0a5be345c9bf7a147eb698e993511180cb' }, ['trace']],
    [{ to: '0x0bd34b0a5be345c9bf7a147eb698e993511180cb', data: '0x18160ddd' }, ['trace']]
  ],
  'latest'
]);
console.log('Call results:', results.length);
for (const result of results) {
  console.log('  Output:', result.output);
}
```

```python
from web3 import Web3

w3 = Web3(Web3.HTTPProvider('https://api-tempo-mainnet.n.dwellir.com/YOUR_API_KEY'))

results = w3.provider.make_request('trace_callMany', [
    [
        [{'to': '0x0bd34b0a5be345c9bf7a147eb698e993511180cb', 'data': '0x70a082310000000000000000000000000bd34b0a5be345c9bf7a147eb698e993511180cb'}, ['trace']],
        [{'to': '0x0bd34b0a5be345c9bf7a147eb698e993511180cb', 'data': '0x18160ddd'}, ['trace']]
    ],
    'latest'
])
for i, result in enumerate(results['result']):
    print(f'Call {i}: output={result.get("output", "N/A")}')
```

## Related Methods

- [`trace_call`](https://www.dwellir.com/docs/tempo/trace_call) - Trace a single call
- [`eth_call`](https://www.dwellir.com/docs/tempo/eth_call) - Execute call without trace
