wallet/listwitnesses
Get list of all Super Representatives (witnesses) on the TRON network.
Endpoint
POST /wallet/listwitnesses
Parameters
No parameters required.
Response
Returns array of witness objects, each containing:
address
- Witness addressvoteCount
- Total votes receivedurl
- Witness website/information URLtotalProduced
- Total blocks producedtotalMissed
- Total blocks missedlatestBlockNum
- Latest block producedlatestSlotNum
- Latest slot numberisJobs
- Whether witness is active
Implementation Examples
- JavaScript
- Python
- cURL
// Get all witnesses
const response = await fetch('https://api-tron-mainnet.n.dwellir.com/YOUR_API_KEY/wallet/listwitnesses', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({}),
});
const data = await response.json();
const witnesses = data.witnesses || [];
// Sort by vote count
witnesses.sort((a, b) => b.voteCount - a.voteCount);
// Display top 27 Super Representatives
console.log('Top 27 Super Representatives:');
witnesses.slice(0, 27).forEach((witness, index) => {
const votes = (witness.voteCount / 1000000).toFixed(2); // Convert to millions
const reliability = witness.totalProduced > 0
? ((witness.totalProduced / (witness.totalProduced + witness.totalMissed)) * 100).toFixed(2)
: '0.00';
console.log(`${index + 1}. ${witness.url}`);
console.log(` Votes: ${votes}M | Reliability: ${reliability}%`);
console.log(` Blocks: ${witness.totalProduced} produced, ${witness.totalMissed} missed`);
});
// Find specific witness
const myWitness = witnesses.find(w => w.address === 'TYourWitnessAddress...');
if (myWitness) {
console.log(`\nYour witness ranking: #${witnesses.indexOf(myWitness) + 1}`);
}
import requests
url = "https://api-tron-mainnet.n.dwellir.com/YOUR_API_KEY/wallet/listwitnesses"
response = requests.post(url, json={})
data = response.json()
witnesses = data.get('witnesses', [])
# Sort by votes
witnesses.sort(key=lambda x: x.get('voteCount', 0), reverse=True)
print("=== TRON Super Representatives ===\n")
# Display top 27 SRs (active block producers)
for i, witness in enumerate(witnesses[:27], 1):
votes_millions = witness.get('voteCount', 0) / 1_000_000
total_produced = witness.get('totalProduced', 0)
total_missed = witness.get('totalMissed', 0)
# Calculate reliability
if total_produced + total_missed > 0:
reliability = (total_produced / (total_produced + total_missed)) * 100
else:
reliability = 0
print(f"{i}. {witness.get('url', 'Unknown')}")
print(f" Address: {witness.get('address', '')}")
print(f" Votes: {votes_millions:.2f}M")
print(f" Reliability: {reliability:.2f}%")
print(f" Blocks Produced: {total_produced:,}")
print(f" Blocks Missed: {total_missed:,}")
print()
# Show SR candidates (rank 28+)
print("\n=== Super Representative Candidates ===")
for i, witness in enumerate(witnesses[27:35], 28): # Show next 8 candidates
votes_millions = witness.get('voteCount', 0) / 1_000_000
print(f"{i}. {witness.get('url', 'Unknown')}: {votes_millions:.2f}M votes")
# Get all witnesses
curl -X POST https://api-tron-mainnet.n.dwellir.com/YOUR_API_KEY/wallet/listwitnesses \
-H "Content-Type: application/json" \
-d '{}'
# Get witnesses and filter top 5 by votes (using jq)
curl -X POST https://api-tron-mainnet.n.dwellir.com/YOUR_API_KEY/wallet/listwitnesses \
-H "Content-Type: application/json" \
-d '{}' | jq '.witnesses | sort_by(-.voteCount) | .[0:5]'
# Get specific witness info (using jq)
curl -X POST https://api-tron-mainnet.n.dwellir.com/YOUR_API_KEY/wallet/listwitnesses \
-H "Content-Type: application/json" \
-d '{}' | jq '.witnesses[] | select(.address == "TYourWitnessAddress...")'
Example Response
{
"witnesses": [
{
"address": "TSomeWitnessAddress...",
"voteCount": 2847395820,
"url": "https://tronsr.example.com",
"totalProduced": 1847293,
"totalMissed": 523,
"latestBlockNum": 58234569,
"latestSlotNum": 634829384,
"isJobs": true
},
{
"address": "TAnotherWitnessAddress...",
"voteCount": 2539482910,
"url": "https://anothersr.example.com",
"totalProduced": 1693847,
"totalMissed": 412,
"latestBlockNum": 58234547,
"latestSlotNum": 634829362,
"isJobs": true
}
]
}
Super Representative System
SR Roles
- Top 27: Active block producers (Super Representatives)
- 28-127: Super Representative Partners (receive rewards, no block production)
- 128+: Candidates (no rewards)
Voting Power
- 1 TRX = 1 Vote (when frozen for voting)
- Votes can be distributed among multiple SRs
- Votes remain until changed or TRX is unfrozen
Block Production
- SRs take turns producing blocks
- 3-second block time
- Missed blocks affect reliability score
Witness Analysis
// Analyze witness performance
function analyzeWitnesses(witnesses) {
const topSRs = witnesses.slice(0, 27);
// Calculate network statistics
const totalVotes = witnesses.reduce((sum, w) => sum + w.voteCount, 0);
const totalBlocks = topSRs.reduce((sum, w) => sum + w.totalProduced, 0);
const totalMissed = topSRs.reduce((sum, w) => sum + w.totalMissed, 0);
// Find most reliable SRs
const reliability = topSRs.map(w => ({
url: w.url,
address: w.address,
reliability: w.totalProduced / (w.totalProduced + w.totalMissed) * 100
})).sort((a, b) => b.reliability - a.reliability);
// Calculate voting concentration
const top5Votes = witnesses.slice(0, 5).reduce((sum, w) => sum + w.voteCount, 0);
const votingConcentration = (top5Votes / totalVotes) * 100;
return {
totalVotes: totalVotes / 1000000, // In millions
totalBlocks,
totalMissed,
networkReliability: (totalBlocks / (totalBlocks + totalMissed) * 100).toFixed(2),
votingConcentration: votingConcentration.toFixed(2),
mostReliable: reliability.slice(0, 5),
leastReliable: reliability.slice(-5).reverse()
};
}
// Monitor SR changes
async function monitorSRChanges(interval = 60000) {
let previousSRs = [];
setInterval(async () => {
const response = await fetch(`${API_URL}/wallet/listwitnesses`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({})
});
const data = await response.json();
const currentSRs = data.witnesses
.sort((a, b) => b.voteCount - a.voteCount)
.slice(0, 27)
.map(w => w.address);
// Check for changes
if (previousSRs.length > 0) {
const newSRs = currentSRs.filter(sr => !previousSRs.includes(sr));
const removedSRs = previousSRs.filter(sr => !currentSRs.includes(sr));
if (newSRs.length > 0 || removedSRs.length > 0) {
console.log('SR List Changed!');
if (newSRs.length > 0) console.log('New SRs:', newSRs);
if (removedSRs.length > 0) console.log('Removed SRs:', removedSRs);
}
}
previousSRs = currentSRs;
}, interval);
}
Best Practices
1. Vote Distribution
- Research SR reliability and contributions
- Consider distributing votes among multiple SRs
- Monitor SR performance regularly
2. SR Selection Criteria
- Block production reliability (>99.5%)
- Community contributions
- Technical infrastructure
- Reward sharing programs
3. Monitoring
- Track SR ranking changes
- Monitor block production stats
- Alert on significant vote shifts
Use Cases
- Voting Decisions: Research SRs before voting
- Network Monitoring: Track SR performance and reliability
- Reward Calculation: Estimate voting rewards
- Governance Participation: Engage in network governance
- SR Analytics: Analyze voting patterns and network health
Related Methods
- wallet/votewitnessaccount - Vote for Super Representatives
- wallet/getaccount - Check account votes
- wallet/freezebalancev2 - Freeze TRX for voting power