validatorL1Votes
Get validator voting information for L1 operations on Hyperliquid, including consensus data and validator participation.
When to Use This Endpoint#
The validatorL1Votes endpoint is essential for:
- Validator Monitoring — Track validator voting activity and participation
- Consensus Analysis — Analyze voting patterns and consensus formation
- Network Health — Monitor validator coordination on L1 operations
- Staking Insights — Understand validator behavior for staking decisions
Request#
Endpoint#
POST https://api-hyperliquid-mainnet-info.n.dwellir.com/info
Headers#
| Header | Value | Required |
|---|---|---|
Content-Type | application/json | Yes |
X-Api-Key | Your API key | Yes |
Parameters#
| Parameter | Type | Required | Description |
|---|---|---|---|
type | string | Yes | Must be "validatorL1Votes" |
Example Request#
{
"type": "validatorL1Votes"
}
Response#
Success Response#
Returns validator voting information for L1 operations.
{
"votes": []
}
Response Fields#
| Field | Type | Description |
|---|---|---|
votes | array | Array of validator vote records for L1 operations |
Code Examples#
- cURL
- JavaScript
- Python
- Go
curl -X POST 'https://api-hyperliquid-mainnet-info.n.dwellir.com/info' \
-H 'X-Api-Key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"type":"validatorL1Votes"}'
const ENDPOINT = 'https://api-hyperliquid-mainnet-info.n.dwellir.com/info';
const API_KEY = 'your-api-key-here';
async function getValidatorL1Votes() {
const response = await fetch(ENDPOINT, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-Api-Key': API_KEY
},
body: JSON.stringify({
type: 'validatorL1Votes'
})
});
if (!response.ok) {
throw new Error(`HTTP ${response.status}: ${response.statusText}`);
}
return await response.json();
}
// Usage
const votes = await getValidatorL1Votes();
console.log(`Total votes: ${votes.votes.length}`);
import requests
from typing import Dict
ENDPOINT = 'https://api-hyperliquid-mainnet-info.n.dwellir.com/info'
API_KEY = 'your-api-key-here'
def get_validator_l1_votes() -> Dict:
"""Get validator L1 voting information"""
response = requests.post(
ENDPOINT,
json={'type': 'validatorL1Votes'},
headers={
'Content-Type': 'application/json',
'X-Api-Key': API_KEY
},
timeout=10
)
response.raise_for_status()
return response.json()
# Usage
votes = get_validator_l1_votes()
print(f"Total votes: {len(votes['votes'])}")
package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
)
const (
Endpoint = "https://api-hyperliquid-mainnet-info.n.dwellir.com/info"
APIKey = "your-api-key-here"
)
type ValidatorL1VotesRequest struct {
Type string `json:"type"`
}
type ValidatorL1VotesResponse struct {
Votes []interface{} `json:"votes"`
}
func getValidatorL1Votes() (*ValidatorL1VotesResponse, error) {
reqBody, _ := json.Marshal(ValidatorL1VotesRequest{
Type: "validatorL1Votes",
})
req, _ := http.NewRequest("POST", Endpoint, bytes.NewBuffer(reqBody))
req.Header.Set("Content-Type", "application/json")
req.Header.Set("X-Api-Key", APIKey)
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
return nil, err
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var result ValidatorL1VotesResponse
if err := json.Unmarshal(body, &result); err != nil {
return nil, err
}
return &result, nil
}
func main() {
votes, err := getValidatorL1Votes()
if err != nil {
fmt.Printf("Error: %v\n", err)
return
}
fmt.Printf("Total votes: %d\n", len(votes.Votes))
}
Common Use Cases#
1. Monitor Validator Participation#
Track validator activity on L1 operations:
async function monitorValidatorActivity() {
const data = await getValidatorL1Votes();
console.log('=== Validator L1 Voting Activity ===\n');
console.log(`Total vote records: ${data.votes.length}`);
if (data.votes.length === 0) {
console.log('No recent L1 voting activity');
}
}
2. Analyze Consensus Patterns#
Analyze voting patterns and consensus formation:
async function analyzeConsensus() {
const data = await getValidatorL1Votes();
return {
totalVotes: data.votes.length,
timestamp: Date.now(),
hasActivity: data.votes.length > 0
};
}
// Usage
const analysis = await analyzeConsensus();
console.log(`Consensus analysis:`, analysis);
3. Build Validator Dashboard#
Create a monitoring dashboard for validators:
async function getValidatorDashboard() {
try {
const votes = await getValidatorL1Votes();
return {
status: 'operational',
voteCount: votes.votes.length,
lastUpdated: new Date().toISOString()
};
} catch (error) {
return {
status: 'error',
error: error.message
};
}
}
Error Handling#
Common Errors#
| Error | Cause | Solution |
|---|---|---|
401 Unauthorized | Invalid API key | Verify your API key is correct |
429 Too Many Requests | Rate limit exceeded | Implement request throttling |
500 Internal Server Error | Server issue | Retry with exponential backoff |
Error Response Example#
{
"error": "Invalid request",
"code": "INVALID_REQUEST"
}
Robust Error Handling#
async function safeGetValidatorL1Votes(maxRetries = 3) {
for (let i = 0; i < maxRetries; i++) {
try {
return await getValidatorL1Votes();
} catch (error) {
if (error.response?.status === 429) {
await new Promise(r => setTimeout(r, Math.pow(2, i) * 1000));
} else if (i === maxRetries - 1) {
throw error;
}
}
}
}
Best Practices#
- Poll regularly — Monitor validator activity at consistent intervals
- Cache appropriately — Cache results for several minutes to reduce load
- Handle empty responses — Account for periods with no L1 voting activity
- Implement timeouts — Use reasonable timeout values (10-30 seconds)
- Monitor trends — Track voting patterns over time for insights
Related Endpoints#
- delegatorSummary — Get delegation summary information
- delegations — Get staking delegation details
- meta — Get trading pair metadata
Access real-time Hyperliquid validator information with Dwellir's HyperCore Info Endpoint. Get your API key →