Skip to content

Monitoring Rewards

Learn how to monitor your HYRA token earnings, track task performance, and manage your rewards in the Hyra Network.

The monitoring system allows you to:

  • Track Earnings: Monitor your HYRA token balance and earnings
  • View Transaction History: See all your task submissions and rewards
  • Monitor ZKP Status: Track proof verification and validation
  • Analyze Performance: Understand your task completion success rate
  • Manage Rewards: Withdraw tokens and manage your earnings
from hyra_sdk import HyraClient
# Initialize client
client = HyraClient()
const { HyraClient } = require("@hyra-network/sdk");
// Initialize client
const client = new HyraClient();
# Get your current HYRA token balance
balance = client.get_balance()
print(f"Current Balance: {balance['tokens']} HYRA")
print(f"Pending Rewards: {balance['pending']} HYRA")
print(f"Total Earned: {balance['total_earned']} HYRA")
// Get your current HYRA token balance
const balance = await client.getBalance();
console.log(`Current Balance: ${balance.tokens} HYRA`);
console.log(`Pending Rewards: ${balance.pending} HYRA`);
console.log(`Total Earned: ${balance.totalEarned} HYRA`);
# Get detailed balance information
balance = client.get_balance()
# Balance structure:
{
"tokens": int, # Available HYRA tokens
"pending": int, # Pending rewards
"total_earned": int, # Total lifetime earnings
"withdrawn": int, # Total withdrawn amount
"staked": int # Staked tokens (if applicable)
}
// Get detailed balance information
const balance = await client.getBalance();
// Balance structure:
{
tokens: number, // Available HYRA tokens
pending: number, // Pending rewards
totalEarned: number, // Total lifetime earnings
withdrawn: number, // Total withdrawn amount
staked: number // Staked tokens (if applicable)
}
# Get balance history over time
history = client.get_balance_history(days=30)
for entry in history:
print(f"Date: {entry['date']}")
print(f"Balance: {entry['balance']} HYRA")
print(f"Change: {entry['change']} HYRA")
// Get balance history over time
const history = await client.getBalanceHistory(30); // 30 days
history.forEach((entry) => {
console.log(`Date: ${entry.date}`);
console.log(`Balance: ${entry.balance} HYRA`);
console.log(`Change: ${entry.change} HYRA`);
});
# Get your transaction history
transactions = client.get_transaction_history()
for tx in transactions:
print(f"Type: {tx['type']}")
print(f"Amount: {tx['amount']} HYRA")
print(f"Date: {tx['timestamp']}")
print(f"Task ID: {tx['task_id']}")
print(f"Status: {tx['status']}")
print("---")
// Get your transaction history
const transactions = await client.getTransactionHistory();
transactions.forEach((tx) => {
console.log(`Type: ${tx.type}`);
console.log(`Amount: ${tx.amount} HYRA`);
console.log(`Date: ${tx.timestamp}`);
console.log(`Task ID: ${tx.taskId}`);
console.log(`Status: ${tx.status}`);
console.log("---");
});
# Filter by transaction type
rewards = client.get_transaction_history(type="reward")
submissions = client.get_transaction_history(type="submission")
# Filter by date range
recent = client.get_transaction_history(days=7)
# Filter by status
pending = client.get_transaction_history(status="pending")
completed = client.get_transaction_history(status="completed")
// Filter by transaction type
const rewards = await client.getTransactionHistory({ type: "reward" });
const submissions = await client.getTransactionHistory({ type: "submission" });
// Filter by date range
const recent = await client.getTransactionHistory({ days: 7 });
// Filter by status
const pending = await client.getTransactionHistory({ status: "pending" });
const completed = await client.getTransactionHistory({ status: "completed" });
# Get your task performance statistics
stats = client.get_task_statistics()
print(f"Total Tasks: {stats['total_tasks']}")
print(f"Completed: {stats['completed']}")
print(f"Success Rate: {stats['success_rate']}%")
print(f"Average Reward: {stats['avg_reward']} HYRA")
print(f"Total Earnings: {stats['total_earnings']} HYRA")
// Get your task performance statistics
const stats = await client.getTaskStatistics();
console.log(`Total Tasks: ${stats.totalTasks}`);
console.log(`Completed: ${stats.completed}`);
console.log(`Success Rate: ${stats.successRate}%`);
console.log(`Average Reward: ${stats.avgReward} HYRA`);
console.log(`Total Earnings: ${stats.totalEarnings} HYRA`);
# Get detailed task history
tasks = client.get_task_history()
for task in tasks:
print(f"Task ID: {task['task_id']}")
print(f"Model: {task['model_name']}")
print(f"Reward: {task['reward']} HYRA")
print(f"Status: {task['status']}")
print(f"Submitted: {task['submitted_at']}")
print(f"Verified: {task['verified_at']}")
print("---")
// Get detailed task history
const tasks = await client.getTaskHistory();
tasks.forEach((task) => {
console.log(`Task ID: ${task.taskId}`);
console.log(`Model: ${task.modelName}`);
console.log(`Reward: ${task.reward} HYRA`);
console.log(`Status: ${task.status}`);
console.log(`Submitted: ${task.submittedAt}`);
console.log(`Verified: ${task.verifiedAt}`);
console.log("---");
});
# Check ZKP proof status
zkp_status = client.get_zkp_status()
print(f"Proofs Generated: {zkp_status['proofs_generated']}")
print(f"Proofs Verified: {zkp_status['proofs_verified']}")
print(f"Pending Verification: {zkp_status['pending_verification']}")
print(f"Failed Proofs: {zkp_status['failed_proofs']}")
// Check ZKP proof status
const zkpStatus = await client.getZKPStatus();
console.log(`Proofs Generated: ${zkpStatus.proofsGenerated}`);
console.log(`Proofs Verified: ${zkpStatus.proofsVerified}`);
console.log(`Pending Verification: ${zkpStatus.pendingVerification}`);
console.log(`Failed Proofs: ${zkpStatus.failedProofs}`);
# Get detailed proof information
proofs = client.get_proof_details()
for proof in proofs:
print(f"Task ID: {proof['task_id']}")
print(f"Proof Hash: {proof['proof_hash']}")
print(f"Status: {proof['status']}")
print(f"Generated At: {proof['generated_at']}")
print(f"Verified At: {proof['verified_at']}")
print("---")
// Get detailed proof information
const proofs = await client.getProofDetails();
proofs.forEach((proof) => {
console.log(`Task ID: ${proof.taskId}`);
console.log(`Proof Hash: ${proof.proofHash}`);
console.log(`Status: ${proof.status}`);
console.log(`Generated At: ${proof.generatedAt}`);
console.log(`Verified At: ${proof.verifiedAt}`);
console.log("---");
});
import time
# Set up real-time monitoring
def monitor_rewards_realtime():
while True:
try:
# Check balance
balance = client.get_balance()
print(f"Current Balance: {balance['tokens']} HYRA")
# Check for new rewards
new_rewards = client.get_new_rewards()
if new_rewards:
print(f"New rewards: {new_rewards}")
time.sleep(60) # Check every minute
except KeyboardInterrupt:
break
# Start monitoring
monitor_rewards_realtime()
// Set up real-time monitoring
async function monitorRewardsRealtime() {
while (true) {
try {
// Check balance
const balance = await client.getBalance();
console.log(`Current Balance: ${balance.tokens} HYRA`);
// Check for new rewards
const newRewards = await client.getNewRewards();
if (newRewards.length > 0) {
console.log(`New rewards: ${newRewards}`);
}
await new Promise((resolve) => setTimeout(resolve, 60000)); // Check every minute
} catch (error) {
console.log(`Monitoring error: ${error.message}`);
await new Promise((resolve) => setTimeout(resolve, 60000));
}
}
}
// Start monitoring
monitorRewardsRealtime();
# Get detailed performance analytics
analytics = client.get_performance_analytics()
print(f"Daily Average: {analytics['daily_avg']} HYRA")
print(f"Weekly Total: {analytics['weekly_total']} HYRA")
print(f"Monthly Total: {analytics['monthly_total']} HYRA")
print(f"Best Day: {analytics['best_day']} HYRA")
print(f"Success Rate: {analytics['success_rate']}%")
// Get detailed performance analytics
const analytics = await client.getPerformanceAnalytics();
console.log(`Daily Average: ${analytics.dailyAvg} HYRA`);
console.log(`Weekly Total: ${analytics.weeklyTotal} HYRA`);
console.log(`Monthly Total: ${analytics.monthlyTotal} HYRA`);
console.log(`Best Day: ${analytics.bestDay} HYRA`);
console.log(`Success Rate: ${analytics.successRate}%`);
# Get quality-based reward metrics
quality_metrics = client.get_quality_metrics()
print(f"High Quality Tasks: {quality_metrics['high_quality']}")
print(f"Quality Bonus Earned: {quality_metrics['quality_bonus']} HYRA")
print(f"Average Quality Score: {quality_metrics['avg_quality_score']}")
// Get quality-based reward metrics
const qualityMetrics = await client.getQualityMetrics();
console.log(`High Quality Tasks: ${qualityMetrics.highQuality}`);
console.log(`Quality Bonus Earned: ${qualityMetrics.qualityBonus} HYRA`);
console.log(`Average Quality Score: ${qualityMetrics.avgQualityScore}`);
# Withdraw your earned HYRA tokens
def withdraw_tokens(amount, address):
try:
tx_hash = client.withdraw_tokens(amount, address)
print(f"Withdrawal successful: {tx_hash}")
return tx_hash
except Exception as e:
print(f"Withdrawal failed: {e}")
return None
# Withdraw 100 HYRA tokens
withdraw_tokens(100, "your_wallet_address")
// Withdraw your earned HYRA tokens
async function withdrawTokens(amount, address) {
try {
const txHash = await client.withdrawTokens(amount, address);
console.log(`Withdrawal successful: ${txHash}`);
return txHash;
} catch (error) {
console.log(`Withdrawal failed: ${error.message}`);
return null;
}
}
// Withdraw 100 HYRA tokens
await withdrawTokens(100, "your_wallet_address");
# Stake your HYRA tokens for additional rewards
def stake_tokens(amount):
try:
tx_hash = client.stake_tokens(amount)
print(f"Staking successful: {tx_hash}")
return tx_hash
except Exception as e:
print(f"Staking failed: {e}")
return None
# Stake 50 HYRA tokens
stake_tokens(50)
// Stake your HYRA tokens for additional rewards
async function stakeTokens(amount) {
try {
const txHash = await client.stakeTokens(amount);
console.log(`Staking successful: ${txHash}`);
return txHash;
} catch (error) {
console.log(`Staking failed: ${error.message}`);
return null;
}
}
// Stake 50 HYRA tokens
await stakeTokens(50);
#!/usr/bin/env python3
"""
Complete monitoring script for Hyra Network rewards
"""
from hyra_sdk import HyraClient
import time
from datetime import datetime
def main():
# Initialize client
client = HyraClient()
print("=== Hyra Network Rewards Monitor ===")
print(f"Started at: {datetime.now()}")
print()
# Get current status
balance = client.get_balance()
stats = client.get_task_statistics()
zkp_status = client.get_zkp_status()
print("📊 Current Status:")
print(f" Balance: {balance['tokens']} HYRA")
print(f" Pending: {balance['pending']} HYRA")
print(f" Total Earned: {balance['total_earned']} HYRA")
print()
print("📈 Task Performance:")
print(f" Total Tasks: {stats['total_tasks']}")
print(f" Completed: {stats['completed']}")
print(f" Success Rate: {stats['success_rate']}%")
print(f" Average Reward: {stats['avg_reward']} HYRA")
print()
print("🔐 ZKP Status:")
print(f" Proofs Generated: {zkp_status['proofs_generated']}")
print(f" Proofs Verified: {zkp_status['proofs_verified']}")
print(f" Pending: {zkp_status['pending_verification']}")
print()
# Get recent transactions
recent_txs = client.get_transaction_history(days=1)
if recent_txs:
print("💰 Recent Transactions:")
for tx in recent_txs[:5]: # Show last 5
print(f" {tx['type']}: {tx['amount']} HYRA at {tx['timestamp']}")
print()
# Get pending transactions
pending = client.get_pending_transactions()
if pending:
print("⏳ Pending Transactions:")
for tx in pending:
print(f" {tx['type']}: {tx['amount']} HYRA")
print()
if __name__ == "__main__":
main()
#!/usr/bin/env node
/**
* Complete monitoring script for Hyra Network rewards
*/
const { HyraClient } = require("@hyra-network/sdk");
async function main() {
// Initialize client
const client = new HyraClient();
console.log("=== Hyra Network Rewards Monitor ===");
console.log(`Started at: ${new Date()}`);
console.log();
// Get current status
const balance = await client.getBalance();
const stats = await client.getTaskStatistics();
const zkpStatus = await client.getZKPStatus();
console.log("📊 Current Status:");
console.log(` Balance: ${balance.tokens} HYRA`);
console.log(` Pending: ${balance.pending} HYRA`);
console.log(` Total Earned: ${balance.totalEarned} HYRA`);
console.log();
console.log("📈 Task Performance:");
console.log(` Total Tasks: ${stats.totalTasks}`);
console.log(` Completed: ${stats.completed}`);
console.log(` Success Rate: ${stats.successRate}%`);
console.log(` Average Reward: ${stats.avgReward} HYRA`);
console.log();
console.log("🔐 ZKP Status:");
console.log(` Proofs Generated: ${zkpStatus.proofsGenerated}`);
console.log(` Proofs Verified: ${zkpStatus.proofsVerified}`);
console.log(` Pending: ${zkpStatus.pendingVerification}`);
console.log();
// Get recent transactions
const recentTxs = await client.getTransactionHistory({ days: 1 });
if (recentTxs.length > 0) {
console.log("💰 Recent Transactions:");
recentTxs.slice(0, 5).forEach((tx) => {
console.log(` ${tx.type}: ${tx.amount} HYRA at ${tx.timestamp}`);
});
console.log();
}
// Get pending transactions
const pending = await client.getPendingTransactions();
if (pending.length > 0) {
console.log("⏳ Pending Transactions:");
pending.forEach((tx) => {
console.log(` ${tx.type}: ${tx.amount} HYRA`);
});
console.log();
}
}
main().catch(console.error);
# Set up automated monitoring with alerts
def setup_monitoring_alerts():
client = HyraClient()
# Set up monitoring thresholds
MIN_BALANCE = 10 # Minimum balance alert
TARGET_DAILY_EARNINGS = 50 # Target daily earnings
while True:
try:
# Check balance
balance = client.get_balance()
if balance['tokens'] < MIN_BALANCE:
print(f"⚠️ Low balance alert: {balance['tokens']} HYRA")
# Check daily earnings
daily_earnings = client.get_daily_earnings()
if daily_earnings < TARGET_DAILY_EARNINGS:
print(f"📉 Below target earnings: {daily_earnings} HYRA")
# Check for new rewards
new_rewards = client.get_new_rewards()
if new_rewards:
print(f"🎉 New rewards received: {new_rewards}")
time.sleep(300) # Check every 5 minutes
except Exception as e:
print(f"Monitoring error: {e}")
time.sleep(300)
# Start monitoring
setup_monitoring_alerts()
// Set up automated monitoring with alerts
async function setupMonitoringAlerts() {
const client = new HyraClient();
// Set up monitoring thresholds
const MIN_BALANCE = 10; // Minimum balance alert
const TARGET_DAILY_EARNINGS = 50; // Target daily earnings
while (true) {
try {
// Check balance
const balance = await client.getBalance();
if (balance.tokens < MIN_BALANCE) {
console.log(`⚠️ Low balance alert: ${balance.tokens} HYRA`);
}
// Check daily earnings
const dailyEarnings = await client.getDailyEarnings();
if (dailyEarnings < TARGET_DAILY_EARNINGS) {
console.log(`📉 Below target earnings: ${dailyEarnings} HYRA`);
}
// Check for new rewards
const newRewards = await client.getNewRewards();
if (newRewards.length > 0) {
console.log(`🎉 New rewards received: ${newRewards}`);
}
await new Promise((resolve) => setTimeout(resolve, 300000)); // Check every 5 minutes
} catch (error) {
console.log(`Monitoring error: ${error.message}`);
await new Promise((resolve) => setTimeout(resolve, 300000));
}
}
}
// Start monitoring
setupMonitoringAlerts();

When implementing these monitoring features in your SDK, consider:

  1. Caching: Cache frequently accessed data to reduce API calls
  2. Rate Limiting: Implement rate limiting to avoid overwhelming the network
  3. Error Handling: Provide comprehensive error handling for network issues
  4. Real-time Updates: Use WebSocket connections for real-time updates
  5. Data Persistence: Store historical data locally for offline access
# Core monitoring methods to implement
class HyraClient:
def get_balance(self) -> Dict[str, int]:
"""Get current HYRA token balance"""
pass
def get_transaction_history(self, **filters) -> List[Dict]:
"""Get transaction history with optional filters"""
pass
def get_task_statistics(self) -> Dict[str, Any]:
"""Get task performance statistics"""
pass
def get_zkp_status(self) -> Dict[str, int]:
"""Get ZKP proof status"""
pass
def get_performance_analytics(self) -> Dict[str, Any]:
"""Get detailed performance analytics"""
pass
def withdraw_tokens(self, amount: int, address: str) -> str:
"""Withdraw HYRA tokens to specified address"""
pass
def stake_tokens(self, amount: int) -> str:
"""Stake HYRA tokens for additional rewards"""
pass
// Core monitoring methods to implement
class HyraClient {
async getBalance() {
// Get current HYRA token balance
}
async getTransactionHistory(filters = {}) {
// Get transaction history with optional filters
}
async getTaskStatistics() {
// Get task performance statistics
}
async getZKPStatus() {
// Get ZKP proof status
}
async getPerformanceAnalytics() {
// Get detailed performance analytics
}
async withdrawTokens(amount, address) {
// Withdraw HYRA tokens to specified address
}
async stakeTokens(amount) {
// Stake HYRA tokens for additional rewards
}
}
  • Daily Checks: Monitor your balance and recent transactions daily
  • Weekly Analysis: Review your performance metrics weekly
  • Monthly Reports: Generate comprehensive monthly reports
  • Batch Requests: Group multiple API calls together
  • Cache Data: Store frequently accessed data locally
  • Error Recovery: Implement retry logic for failed requests
  • Private Key Safety: Never expose your private key in monitoring scripts
  • Secure Storage: Store sensitive data securely
  • Access Control: Limit access to monitoring systems
  1. Balance Not Updating

    • Check if transactions are still pending
    • Verify ZKP proof verification status
    • Wait for blockchain confirmation
  2. Missing Transactions

    • Check transaction filters
    • Verify date ranges
    • Ensure proper API authentication
  3. Performance Issues

    • Implement caching
    • Use batch requests
    • Optimize API calls
  • Documentation: Check the official documentation
  • Community: Join the Hyra Discord community
  • Support: Contact support for technical issues
  • Set Up Monitoring: Implement the monitoring scripts
  • Track Performance: Monitor your task completion success rate
  • Optimize Earnings: Use analytics to improve your performance
  • Manage Rewards: Withdraw and stake your HYRA tokens

Ready to start monitoring your rewards? Check out the Python SDK or Node.js SDK documentation for implementation details.