<!-- source: https://secondlayer.tools/docs/api-reference#list-contract-calls -->

## Decoded contract-call transactions

`GET /v1/index/contract-calls`

Top-level `contract_call` transactions in canonical blocks, oldest first, with arguments and result decoded. Failed calls are included; check `status`. The cursor is `<block_height>:<tx_index>`. `reorgs` covers every height on the page.

### Filters

| Name | Type | Description |
| --- | --- | --- |
| `contract_id` | string | Contract principal, or a comma-separated set of up to 20 (e.g. `SP1.sbtc-token,SP1.sbtc-registry`). Mutually exclusive with `trait`. |
| `trait` | enum | Only contracts that declare or implement this SIP standard, resolved as of the page's `to_height`. Mutually exclusive with `contract_id`. Values: `sip-009`, `sip-010`, `sip-013`. |
| `function_name` | string | Called function. Exact match. |
| `sender` | string | Transaction sender principal. Exact match. |

### Range and paging

| Name | Type | Description |
| --- | --- | --- |
| `limit` | integer · 1 to 1000 | Page size; capped at 1000. |
| `cursor` | string | `<block_height>:<tx_index>` from a previous page's `next_cursor`. Resumes after it. |
| `from_cursor` | string | Same as `cursor`. Mutually exclusive with it and with `from_height`. |
| `from_height` | integer | First block height to read. Mutually exclusive with a cursor. With neither, the read starts one day behind the tip. |
| `to_height` | integer | Last block height to read, inclusive. |

### Returns

A cursor envelope; `contract_calls` holds `ContractCall` objects.

### Responses

- `200` Cursor-paginated envelope
- `400` A parameter, filter, cursor or body field was refused; `code` says which
- `401` This bind requires the instance token, and it was missing or wrong
- `429` Rate limited; retry after `Retry-After` seconds

### Example

```bash
curl https://api.secondlayer.tools/v1/index/contract-calls \
  -H "Authorization: Bearer $SECONDLAYER_API_KEY"
```

```json
{
  "contract_calls": [
    {
      "cursor": "9048502:1",
      "block_height": 9048502,
      "block_time": "2026-09-23T13:14:42.000Z",
      "tx_id": "0x198d642edb1104a1757a8c353ad61231d0422ecb6ba83aa1ce45d05df44157e0",
      "tx_index": 1,
      "contract_id": "SM3VDXK3WZZSA84XXFKAFAF15NNZX32CTSG82JFQ4.sbtc-token",
      "function_name": "transfer",
      "sender": "SP15T1W26JTNS26VG17HM468KW7TQD3124KTYA9EJ",
      "status": "success",
      "args": [
        "300",
        "SP15T1W26JTNS26VG17HM468KW7TQD3124KTYA9EJ",
        "SPD3SCZDZ52X4ZX1878XWBFBJ29YRX0MFW9Z9W4V",
        null
      ],
      "result": true,
      "result_hex": "0x0703"
    }
  ],
  "next_cursor": "7960000:42",
  "tip": {
    "block_height": 9048690,
    "finalized_height": 9048457,
    "lag_seconds": 4,
    "source_block_height": 9048692
  },
  "reorgs": [
    {
      "id": "3f16c2c5-9551-4ae9-adb0-923668e5c65e",
      "detected_at": "2026-09-15T15:39:38.129Z",
      "fork_point_height": 8996511,
      "old_index_block_hash": "0x45ba0195071488eda13afa66d8ce8612558a739f781be5a032d96332797c4174",
      "new_index_block_hash": "0xa686ff58e7c5ccb26c850a7eaffa7e7274fcbc081c706344eb6f1e1446023df0",
      "orphaned_range": {
        "from": "8996511:0",
        "to": "8996512:2701"
      },
      "new_canonical_tip": "8996511:0"
    }
  ]
}
```
