npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

cn_get_voters

v0.2.9

Published

Returns array of {address, #votes} for all the voters of a given candidate/SR on the Tron blockchain

Downloads

15

Readme

cn_get_voters

Get the list of { address, number_votes } for a given SR (Super Representant) or candidate on the Tron Blockchain

Installation

npm install cn_get_voters

Usage

Add this npm install --save cn_list_voters

cn_get_voters uses Promises:

var cn_list = require("cn_list_voters");
var voters_list = cn_list.getVoters('TDGy2M9qWBepSHDEutWWxWd1JZfmAed3BP'); 

voters_list.then( function(data){ 
		console.log("Candidate: " + data.candidate);
		console.log("Total votes: " + data.total_votes );
		console.log("Number of voters: " + data.num_voters );

		console.log(data.list); 
	} );

Available properties for data param

  • candidate: The SR/candidate address
  • total_votes: Total number of votes at the moment of the execution of the script
  • num_voters: Number of address voting that SR/candidate, at the moment of the execution of the script
  • list: Array containing javascript objects {address, number_votes} Example:
 [{ address: 'TUBN16b7beL6b7bXUHeL7bd2DPDf6eqhEW', votes: 250 },
  { address: 'TRs6NpvZs6CD2ZsrU76CZsiebaEcKdz2kF', votes: 5010 },
  { address: 'TNZf7Q5SmhRQJSmC4GhRSmYZJmmBUd7wpY', votes: 497461 },
  { address: 'TMTUBy8J6cvNkJ6PVacvJ6G2MUPTPRB93u', votes: 24625 },
  { address: 'TMQWERNiQS5FhiQZZ1S5iQ4Cgf5zf6NhLi', votes: 208 },
  { address: 'TSYu6GHS8TyHXS8MXVTyS8uDQhsGXpsCYC', votes: 2774 }]
  • csv: Returns exactly the same information as list but in comma separated value (csv) format, so you can easily import into MySQL, etc..
TUBN16b7beL6b7bXUHeL7bd2DPDf6eqhEW,250
TRs6NpvZs6CD2ZsrU76CZsiebaEcKdz2kF,5010
TNZf7Q5SmhRQJSmC4GhRSmYZJmmBUd7wpY,497461
TMTUBy8J6cvNkJ6PVacvJ6G2MUPTPRB93u,24625
TMQWERNiQS5FhiQZZ1S5iQ4Cgf5zf6NhLi,208
TSYu6GHS8TyHXS8MXVTyS8uDQhsGXpsCYC,2774

Credits

Community Node

CommunityNode is a Tron SuperRepresentant candidate

https://tronscan.org/#/address/TDGy2M9qWBepSHDEutWWxWd1JZfmAed3BP/voters

Telegram: https://t.me/CommunityNode