> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chainstack.com/llms.txt
> Use this file to discover all available pages before exploring further.

# ots_getTransactionError | Hyperliquid EVM

> The ots_getTransactionError JSON-RPC method retrieves the raw revert reason for failed transactions on the Hyperliquid EVM blockchain.

<Info>
  This method is available on Chainstack. Not all Hyperliquid methods are available on Chainstack, as the open-source node implementation does not support them yet — see [Hyperliquid methods](/docs/hyperliquid-methods) for the full availability breakdown.
</Info>

The `ots_getTransactionError` JSON-RPC method retrieves the raw revert reason for failed transactions on the Hyperliquid EVM blockchain. This Otterscan-specific method provides detailed error messages from smart contract failures, helping developers debug transaction issues.

## Parameters

1. **transaction hash** (string, required): The hash of the failed transaction to analyze

## Response

The method returns the raw error data from the failed transaction, or null if the transaction succeeded or error data is unavailable.

### Response structure

* `result` — hex-encoded error message from the revert reason, or `null` if not available

## Usage example

`ots_getTransactionError` is an Otterscan-specific method, so the EVM libraries below call it through their generic JSON-RPC request interfaces rather than a dedicated helper.

<CodeGroup>
  ```shell Shell theme={"system"}
  curl -X POST https://hyperliquid-mainnet.core.chainstack.com/4f8d8f4040bdacd1577bff8058438274/evm \
    -H "Content-Type: application/json" \
    -d '{
      "jsonrpc": "2.0",
      "method": "ots_getTransactionError",
      "params": ["0xf94f3d2ed5b59aefb6a0e566af8e86552014d84f6ed2f38a1366dedffe723381"],
      "id": 1
    }'
  ```

  ```python web3.py theme={"system"}
  from web3 import Web3

  w3 = Web3(Web3.HTTPProvider("YOUR_CHAINSTACK_ENDPOINT"))

  tx_hash = "0xf94f3d2ed5b59aefb6a0e566af8e86552014d84f6ed2f38a1366dedffe723381"
  response = w3.provider.make_request("ots_getTransactionError", [tx_hash])

  print(response["result"])
  ```

  ```javascript ethers.js theme={"system"}
  import { JsonRpcProvider } from "ethers";

  const provider = new JsonRpcProvider("YOUR_CHAINSTACK_ENDPOINT");

  const txHash =
    "0xf94f3d2ed5b59aefb6a0e566af8e86552014d84f6ed2f38a1366dedffe723381";
  const result = await provider.send("ots_getTransactionError", [txHash]);

  console.log(result);
  ```

  ```typescript viem theme={"system"}
  import { createPublicClient, http } from "viem";

  const client = createPublicClient({
    transport: http("YOUR_CHAINSTACK_ENDPOINT"),
  });

  const txHash =
    "0xf94f3d2ed5b59aefb6a0e566af8e86552014d84f6ed2f38a1366dedffe723381";
  const result = await client.request({
    method: "ots_getTransactionError",
    params: [txHash],
  });

  console.log(result);
  ```
</CodeGroup>

<Note>
  **Use your own endpoint in your code.** The code examples use a placeholder Chainstack endpoint (YOUR\_CHAINSTACK\_ENDPOINT) — replace it with your own Hyperliquid node endpoint from the [Chainstack console](https://console.chainstack.com/). The curl above uses a shared public endpoint for quick checks only; do not use it in production.
</Note>

### Example response (with error)

```json theme={"system"}
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0x08c379a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000001e496e73756666696369656e742062616c616e636520666f72207472616e736665720000000000000000000000000000000000000000000000000000000000"
}
```

### Example response (no error)

```json theme={"system"}
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": null
}
```

### Decoding error messages

The returned hex data typically contains an ABI-encoded error message. Common patterns:

* `0x08c379a0...` — Standard revert with string message
* Custom error selectors — Contract-specific error codes

To decode the message, remove the function selector (first 4 bytes) and ABI-decode the remaining data as a string.

## Use cases

The `ots_getTransactionError` method is essential for:

* **Smart contract debugging**: Understand why transactions failed
* **User experience**: Display meaningful error messages to users
* **Testing automation**: Validate expected failure conditions
* **Error monitoring**: Track and categorize contract failures
* **Support tools**: Help users understand transaction failures
* **Development workflow**: Debug contract interactions during development
* **Audit trails**: Document failure reasons for compliance
* **Gas optimization**: Identify operations that consistently fail
* **Integration testing**: Verify error handling in dApps
* **Customer support**: Quickly diagnose user transaction issues

This method is particularly valuable during smart contract development and when providing support for dApp users experiencing transaction failures.


## OpenAPI

````yaml openapi/hyperliquid_node_api/hyperevm/evm_ots_get_transaction_error.json post /evm
openapi: 3.0.0
info:
  title: Hyperliquid EVM API - ots_getTransactionError
  version: 1.0.0
servers:
  - url: >-
      https://hyperliquid-mainnet.core.chainstack.com/4f8d8f4040bdacd1577bff8058438274
security: []
paths:
  /evm:
    post:
      summary: ots_getTransactionError
      description: >-
        Retrieve detailed error information for a failed transaction on
        Hyperliquid EVM. Get specific revert reasons and execution failures.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - jsonrpc
                - method
                - params
                - id
              properties:
                jsonrpc:
                  type: string
                  enum:
                    - '2.0'
                  default: '2.0'
                  description: JSON-RPC version
                method:
                  type: string
                  enum:
                    - ots_getTransactionError
                  default: ots_getTransactionError
                  description: The RPC method name
                params:
                  type: array
                  description: 'Parameters: [transaction hash]'
                  default:
                    - >-
                      0xf94f3d2ed5b59aefb6a0e566af8e86552014d84f6ed2f38a1366dedffe723381
                id:
                  type: integer
                  default: 1
                  description: Request identifier
            example:
              jsonrpc: '2.0'
              method: ots_getTransactionError
              params:
                - >-
                  0xf94f3d2ed5b59aefb6a0e566af8e86552014d84f6ed2f38a1366dedffe723381
              id: 1
      responses:
        '200':
          description: Successful response with transaction error details
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                    description: JSON-RPC version
                  id:
                    type: integer
                    description: Request identifier
                  result:
                    type: string
                    description: Error message or null if no error
              example:
                jsonrpc: '2.0'
                id: 1
                result: 'execution reverted: insufficient balance'

````