Get Orders History
Get the orders history of a user.
The getOrdersHistory function retrieves the list of orders for the authenticated user.
Available on
To enable these chains for your application, please configure them in the Okto Dashboard.
Not available on
Example
import { getOrdersHistory } from "@okto_web3/core-js-sdk/explorer";
const ordersHistory = await getOrdersHistory(oktoClient); Method Overview
| Methods | Description |
|---|---|
async getOrdersHistory | Get the orders history of a user |
Get Orders History
async getOrdersHistory(OktoClient) retrieves the user's order history.
Parameters
| Parameter | Type | Description |
|---|---|---|
oktoClient | OktoClient | Okto client |
Response
Success Response
| Field Name | Type | Description |
|---|---|---|
result | Promise<Order[]> | Returns the list of orders for a user |
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
jobIduntil 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.