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

# useTransactionStatus

> Poll for the final outcome of a submitted transaction hash.

The `useTransactionStatus` hook allows you to check the status of a transaction that has already been submitted to the network. This is useful when you have a transaction hash from an external source or a multi-signature workflow and need to wait for its confirmation.

#### Features

* Automatic Polling: The hook uses the SDK's built-in sleep strategy to periodically check the network until the transaction settles.
* Success and Failure Tracking: It identifies whether a transaction succeeded, failed, or was not found on the network.
* Simple State Management: Returns standard loading and data states, making it easy to show progress spinners or success messages.

#### Usage

```tsx theme={null}
import { useTransactionStatus } from "@sorokit/hooks";

function TransactionTracker({ hash }) {
  const { data, isLoading, error } = useTransactionStatus(hash);

  if (isLoading) return <span>Waiting for ledger close...</span>;
  if (error) return <span>Error: {error.message}</span>;

  return (
    <div>
      <p>Status: {data.status}</p>
      {data.status === "SUCCESS" && <p>Transaction confirmed!</p>}
    </div>
  );
}
```

#### Parameters

* hash: The unique string identifier for the transaction.
* options: An optional object containing an `enabled` boolean to control when the polling starts.

#### Return Value

The hook returns a query result where `data` is an object containing:

* status: A string indicating the result (SUCCESS, FAILED, or NOT\_FOUND).
* returnValue: The raw XDR result of the transaction if it was a successful contract call.
