> For the complete documentation index, see [llms.txt](https://sodex.com/documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sodex.com/documentation/for-developers/api-reference/relayer-api/transaction-status.md).

# Transaction Status

`GET /api/v1/relayer/tx/status`

Query status of a submitted transaction by hash. No auth required.

Only returns transactions relayed by this service (`sender_type = TransactionRelayer`).

| Query     | Required | Description                                    |
| --------- | -------- | ---------------------------------------------- |
| `tx_hash` | yes      | Transaction hash (64 hex chars, optional `0x`) |

```json
{
  "hash": "0xabc...",
  "status": "TxStatusPending",
  "status_code": 1,
  "replaced_by_hash": ""
}
```

| Field              | Type   | Description                                                 |
| ------------------ | ------ | ----------------------------------------------------------- |
| `hash`             | string | Transaction hash                                            |
| `status`           | string | Status name (see [Transaction status](#status-values))      |
| `status_code`      | int    | Status code                                                 |
| `replaced_by_hash` | string | Replacement tx hash if replaced; omitted or empty otherwise |

**Common errors** (`status: "40001"`)

| Message                 | Cause                       |
| ----------------------- | --------------------------- |
| `tx_hash is required`   | No query parameter provided |
| `invalid tx_hash`       | Invalid hash format         |
| `transaction not found` | No matching relayer record  |

## Status values

| `status_code` | `status`                  | Meaning                              |
| ------------- | ------------------------- | ------------------------------------ |
| 0             | `Unknown TxStatus (0)`    | Unknown                              |
| 1             | `TxStatusPending`         | Submitted, awaiting confirmation     |
| 2             | `TxStatusReplaced`        | Replaced by a higher-gas transaction |
| 3             | `TxStatusConfirmed`       | Confirmed successfully               |
| 4             | `TxStatusConfirmedFailed` | Confirmed but execution failed       |

## Request example

Set `TX_HASH` to the hash returned by transaction submission.

```bash
curl -sS --get https://mainnet-gw.sodex.dev/api/v1/relayer/tx/status \
  --data-urlencode "tx_hash=$TX_HASH"
```
