Explorer

Get Order History

Learn how to retrieve transaction order history using the Okto SDK.

The getOrderHistory function retrieves the user's transaction order history.

Method Overview

MethodDescription
async getOrderHistoryGet user's order history

Get Order History

async getOrderHistory(oktoClient: OktoClient) retrieves the user's transaction order history.

Parameters

ParameterTypeDescription
oktoClientOktoClientInstance of OktoClient obtained from useOkto hook

Response

Success Response

Field NameTypeDescription
ordersPromise<Order[]>Array of order history

Example

Important: Transaction Lifecycle

The getOrderHistory function fetches the current status of a transaction on the Okto chain. However, the transaction status will continue to update on the Okto chain as it progresses through various stages in the Distributed Transaction Network (DTN).

To track a transaction to completion:

  • Keep fetching the order history for your specific jobId until the status shows "SUCCESSFUL"
  • Once successful, the transaction hash will be available in the response
  • Use this transaction hash to verify the transaction on the destination chain's explorer

Note

In case of errors, debug the error using the error code and refer to the SDK errors and warnings documentation for more details.

On this page