
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
staking-rewards-api
Advanced tools
SDK for staking pools to monitor validator rewards and earnings, and finding top validators on Ethereum and BSC for best returns.
A powerful SDK for monitoring validator rewards, earnings, and identifying top-performing validators on Ethereum and BSC networks. Built for staking pools, validator operators, and DeFi platforms that need real-time insights into validator performance.
The Staking Rewards API provides comprehensive tools for tracking and analyzing validator performance across Ethereum and Binance Smart Chain (BSC) networks. Whether you're running a staking pool, managing multiple validators, or building analytics dashboards, this SDK gives you the data you need to optimize returns and monitor validator earnings.
npm install staking-rewards-api
import {
getTopValidatorsETH,
getValidatorRewardsETH,
runValidatorRewardsStreamETH
} from 'staking-rewards-api';
const token = 'YOUR_BITQUERY_TOKEN';
// Find top 10 validators on Ethereum (last 24 hours)
const topValidators = await getTopValidatorsETH(token, 24, 10);
console.log('Top Validators:', topValidators);
// Get rewards for a specific validator
const rewards = await getValidatorRewardsETH(
token,
'0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb',
24 // hours ago
);
console.log('Validator Rewards:', rewards);
// Stream live validator rewards
const ws = await runValidatorRewardsStreamETH(token, '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb', {
onData: (data) => {
console.log('New reward:', data);
},
onError: (error) => {
console.error('Stream error:', error);
}
});
getTopValidatorsETH(token, hoursAgo, limit)Get the top-performing validators on Ethereum network.
Parameters:
token (string, required): Your Bitquery OAuth tokenhoursAgo (number, optional): Hours to look back (default: 24)limit (number, optional): Number of validators to return (default: 10)Returns: JSON object containing top validators data with total tips, rewards, and performance metrics
Example:
const topValidators = await getTopValidatorsETH(token, 48, 20);
getTopValidatorsBSC(token, hoursAgo, limit)Get the top-performing validators on BSC network.
Parameters: Same as getTopValidatorsETH
Example:
const topValidators = await getTopValidatorsBSC(token, 24, 15);
getValidatorRewardsETH(token, address, hoursAgo)Get historical rewards for a specific Ethereum validator.
Parameters:
token (string, required): Your Bitquery OAuth tokenaddress (string, required): The validator addresshoursAgo (number, optional): Hours to look back (default: 24)Returns: JSON object containing validator rewards, balance changes, and transaction details
Example:
const rewards = await getValidatorRewardsETH(
token,
'0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb',
72 // last 3 days
);
getValidatorRewardsBSC(token, address, hoursAgo)Get historical rewards for a specific BSC validator.
Parameters: Same as getValidatorRewardsETH
Example:
const rewards = await getValidatorRewardsBSC(token, '0x...', 24);
All streaming functions return a WebSocket connection and accept an options object with:
onData (function): Callback for incoming dataonError (function): Callback for errorsautoCloseMs (number): Automatically close connection after N millisecondsrunValidatorRewardsStreamETH(token, address, options)Stream live validator rewards for a single Ethereum validator.
Example:
const ws = await runValidatorRewardsStreamETH(token, '0x...', {
onData: (data) => console.log('Reward update:', data),
onError: (err) => console.error('Error:', err),
autoCloseMs: 60000 // close after 1 minute
});
runMultipleValidatorRewardsStreamETH(token, addresses, options)Stream rewards for multiple Ethereum validators simultaneously.
Example:
const addresses = [
'0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb',
'0x8ba1f109551bD432803012645Hac136c22C92900'
];
const ws = await runMultipleValidatorRewardsStreamETH(token, addresses, {
onData: (data) => console.log('Multi-validator update:', data)
});
runAllValidatorRewardsStreamETH(token, options)Stream rewards for all Ethereum validators (use with caution - high volume).
Example:
const ws = await runAllValidatorRewardsStreamETH(token, {
onData: (data) => console.log('All validators update:', data)
});
runValidatorRewardsStreamBSC(token, address, options)runMultipleValidatorRewardsStreamBSC(token, addresses, options)runAllValidatorRewardsStreamBSC(token, options)Usage is identical to Ethereum functions, but for BSC network.
This SDK uses Bitquery's Transaction Balance API for Ethereum and BSCto fetch blockchain data. To get started:
Bitquery provides comprehensive blockchain data APIs for Ethereum, BSC, and 40+ other networks. Perfect for building analytics, monitoring tools, and data-driven applications.
{
"data": {
"EVM": {
"TransactionBalances": [
{
"TokenBalance": {
"Address": "0x...",
"Currency": {
"Name": "Ethereum",
"Symbol": "ETH"
}
},
"Total_tip_native": "1.23456789",
"Total_tip_usd": "2345.67",
"number_of_tips": 42
}
]
}
}
}
{
"data": {
"EVM": {
"TransactionBalances": [
{
"Post": "100.5",
"Pre": "99.2",
"Total_tip_native": "1.3",
"Total_tip_usd": "2345.67",
"number_of_tips": 5
}
]
}
}
}
You can set your Bitquery token as an environment variable:
export BITQUERY_TOKEN=your_token_here
Then use it in your code:
const token = process.env.BITQUERY_TOKEN;
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
MIT License - see LICENSE file for details
Made with ❤️ by the Bitquery Team
Empowering staking pools and validator operators with actionable blockchain insights.
FAQs
SDK for staking pools to monitor validator rewards and earnings, and finding top validators on Ethereum and BSC for best returns.
The npm package staking-rewards-api receives a total of 1 weekly downloads. As such, staking-rewards-api popularity was classified as not popular.
We found that staking-rewards-api demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.