Skip to main content
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

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.