Is it possible to get the data of members who have delegated a token to an account?
I need their account name and the delegated amount.Dear @learncode, thank you very much for your post, it has been very helpful.
We have a clan account in Splinterlands where all members delegate tokens and I want to send the generated earnings to each member based on the amount delegated.
Looking forward to hearing from you.
Kind regards,
Hello,
I have not found a simple way to get a list of incoming delegations for a token.
This snippet of code will tell the total amount of incoming or outgoing delegation.
It may be possible to query the data you want my making a JSON RPC request. A good reference is the documentation here: https://github.com/hive-engine/steemsmartcontracts-wiki.
I'm going to see the documentation to find a solution.
Your post helped me a lot, thanks!!!
Thank you for the feedback.
Just following up on your question about getting the list of incoming delegations to an account. I found a simple way to request this data using the hiveengine API object.
Here's what it looks like:
In this case, the "tokens" string is the contract name, the "delegations" string is the table name, and the query is like a search filter for MongoDB.
There are additional filters you can use, as documented at https://github.com/hive-engine/steemsmartcontracts-wiki/blob/master/Tokens-Contract.md#delegations
So you can request the list of delegations based on the account delegated to or from, the symbol for the token, and the quantity. I believe you can include logical statements in the query also, to do things like only return results where the quantity is greater than N.
Example:
The rewards earned on this comment will go directly to the people(@hivetrending) sharing the post on Twitter as long as they are registered with @poshtoken. Sign up at https://hiveposh.com.
The code works great!!!! Thank you so much, I had been looking for a solution to the problem for months.
!PGM !PIZZA
BUY AND STAKE THE PGM TO SEND A LOT OF TOKENS!
The tokens that the command sends are: 0.1 PGM-0.1 LVL-2.5 BUDS-0.01 MOTA-0.05 DEC-15 SBT-1 STARBITS-0.00000001 BTC (SWWAP.BTC)
Discord
Support the curation account @ pgm-curator with a delegation 10 HP - 50 HP - 100 HP - 500 HP - 1000 HP
Get potential votes from @ pgm-curator by paying in PGM, here is a guide
I'm a bot, if you want a hand ask @ zottone444