Get Presales
Query to retrieve all presale rounds with comprehensive details
ADMIN ONLY
Get All Presales
Retrieve comprehensive information about all presale rounds, including timing, token details, and custom conditions.
Admin Access Required
This query is only accessible to users with ADMIN privileges. Standard users cannot view all presale rounds.
Overview
The getPreSales query allows administrators to retrieve a complete list of all presale rounds that have been created in the system, regardless of their status.
GraphQL Schema
query {
getPreSales: [PreSale]
}Parameters
📋 No Parameters Required
This query does not require any parameters. It returns all presale rounds automatically.
Return Value
✓ Success Response
Returns an array of [PreSale] objects, each containing:
Example Usage
Request
query GetAllPresales {
getPreSales {
id
startedAt
endedAt
tokenAmount
tokenPrice
status
conditions {
name
value
}
}
}Response
{
"data": {
"getPreSales": [
{
"id": 12,
"startedAt": 1704067200.0,
"endedAt": 1706745600.0,
"tokenAmount": 1000000.0,
"tokenPrice": 0.5,
"status": 2,
"conditions": [
{
"name": "Minimum Purchase",
"value": "100 tokens"
},
{
"name": "Maximum Purchase",
"value": "10000 tokens"
}
]
},
{
"id": 13,
"startedAt": 1709337600.0,
"endedAt": 1712016000.0,
"tokenAmount": 500000.0,
"tokenPrice": 0.75,
"status": 1,
"conditions": [
{
"name": "Whitelist",
"value": "Required"
},
{
"name": "KYC",
"value": "Level 2 verification"
}
]
}
]
}
}Presale Rounds Retrieved
The query successfully returned all presale rounds with their complete details, including conditions and status information.
Use Cases
Dashboard Overview
Display all presale rounds in an admin dashboard for comprehensive management and monitoring.
Analytics & Reporting
Analyze historical presale performance, token distribution, and pricing strategies across all rounds.
Audit & Compliance
Review all presale rounds for regulatory compliance, condition enforcement, and audit trails.
Strategy Planning
Compare past presale rounds to inform future pricing, timing, and token allocation strategies.
Status Values
Status: 1
Pending
Not yet started
Status: 2
Started
Currently active
Status: 3
Ended
Completed
Best Practices
🔄 Regular Monitoring
Query presale rounds regularly to monitor their status and track token sales progress.
📊 Data Analysis
Use the returned data to generate reports and visualizations for stakeholder presentations.
🎯 Filter Client-Side
For status-specific queries, consider using getPreSaleByStatus for more efficient filtering.
💾 Caching Strategy
Implement appropriate caching for this data as presale information changes infrequently.