Get Presale Orders by User
Retrieve all presale orders placed by the current authenticated user
USER QUERY
Get My Presale Orders
View your complete presale order history including pending, processing, and completed orders.
User Orders
This query returns all presale orders for the currently authenticated user, providing a complete order history.
Overview
The getPresaleOrdersByUser
query allows users to retrieve all their presale orders across all presale rounds, making it easy to track purchases and order status.
GraphQL Schema
query {
getPresaleOrdersByUser: [PreSaleOrder]
}
Parameters
📋 No Parameters Required
This query automatically retrieves orders for the authenticated user. No parameters needed.
Return Value
✓ Success Response
Returns an array of [PreSaleOrder] objects, each containing:
Example Usage
Request
query GetMyOrders {
getPresaleOrdersByUser {
id
presaleId
ndbAmount
destination
extAddr
status
createdAt
updatedAt
}
}
Response
{
"data": {
"getPresaleOrdersByUser": [
{
"id": 456,
"presaleId": 12,
"ndbAmount": 1000.0,
"destination": 1,
"extAddr": null,
"status": 2,
"createdAt": 1704067200,
"updatedAt": 1704153600
},
{
"id": 457,
"presaleId": 12,
"ndbAmount": 2500.0,
"destination": 2,
"extAddr": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
"status": 0,
"createdAt": 1704240000,
"updatedAt": 1704240000
},
{
"id": 432,
"presaleId": 11,
"ndbAmount": 500.0,
"destination": 1,
"extAddr": null,
"status": 2,
"createdAt": 1702080000,
"updatedAt": 1702166400
}
]
}
}
Orders Retrieved
Successfully retrieved 3 presale orders for the current user across different presale rounds.
Use Cases
Order Dashboard
Display a comprehensive dashboard showing all user orders with status, amounts, and delivery information.
Portfolio Tracking
Track total token allocations and investment across multiple presale rounds.
Pending Payments
Identify orders awaiting payment completion and take action to finalize purchases.
Order History
View complete historical records of all presale participation for tax and accounting purposes.
Order Status Reference
Status: 0
Pending Payment
Complete payment to finalize
Status: 1
Processing
Payment confirmed, processing
Status: 2
Completed
Tokens delivered
Best Practices
🔄 Regular Polling
Poll this endpoint regularly to keep order status up-to-date in your UI, especially for pending orders.
📱 Status Notifications
Implement notifications for status changes to keep users informed of payment confirmations and deliveries.
💾 Client-Side Filtering
Allow users to filter orders by status, presale round, or date range for better navigation.
📊 Data Aggregation
Calculate totals, averages, and summaries client-side to provide insights into user investment patterns.