History
Paginated order and trade history for authenticated users.
Endpoints
| Method | Path | Description |
|---|---|---|
GET | /api/history/orders | Order history |
GET | /api/history/trades | Trade history |
Order history
GET /api/history/orders
Returns paginated order history for the authenticated user.
Request
import axios from 'axios';
const response = await axios.get('https://api.loafmarkets.com/api/history/orders', {
headers: { Authorization: `Bearer ${process.env.LOAF_PRIVY_JWT}` },
});
console.log(response.data);Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
page | number | No | (query) Page number (1-based). Default: 1. |
pageSize | number | No | (query) Results per page (1–100). Default: 20. |
Response
// See @loafmarkets/shared-types for the response type
type Response = Record<string, unknown>;Example response:
{
"success": true
}Errors
| Status | Code | Description |
|---|---|---|
400 | validation_error | Request failed schema validation. |
401 | unauthorized | Missing or invalid authentication. |
404 | not_found | Resource not found (where applicable). |
500 | internal_error | Unexpected server error. |
Requires Privy JWT authentication.
Trade history
GET /api/history/trades
Returns paginated trade history for the authenticated user.
Request
import axios from 'axios';
const response = await axios.get('https://api.loafmarkets.com/api/history/trades', {
headers: { Authorization: `Bearer ${process.env.LOAF_PRIVY_JWT}` },
});
console.log(response.data);Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
page | number | No | (query) Page number (1-based). Default: 1. |
pageSize | number | No | (query) Results per page (1–100). Default: 20. |
Response
// See @loafmarkets/shared-types for the response type
type Response = Record<string, unknown>;Example response:
{
"success": true
}Errors
| Status | Code | Description |
|---|---|---|
400 | validation_error | Request failed schema validation. |
401 | unauthorized | Missing or invalid authentication. |
404 | not_found | Resource not found (where applicable). |
500 | internal_error | Unexpected server error. |
Requires Privy JWT authentication.
Last updated on