Viewing a response to: @javivisan/re-learncode-rchi94
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. > from hiveengine.wallet import Wallet > Wallet('learncode').get_token('SWAP.HIVE') >> {'_id': 254860, 'account': 'learncode', 'symbol': 'SWAP.HIVE', 'balance': '0.00000000', 'stake': '0', 'pendingUnstake': '0', 'delegationsIn': '0', 'delegationsOut': '0', 'pendingUndelegations': '0'} 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.
author | learncode |
---|---|
permlink | re-javivisan-rcmdvf |
category | programming |
json_metadata | {"tags":["programming"],"app":"peakd/2022.05.8"} |
created | 2022-05-29 01:09:18 |
last_update | 2022-05-29 01:09:18 |
depth | 2 |
children | 5 |
last_payout | 2022-06-05 01:09:18 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 641 |
author_reputation | 682,726,195,093 |
root_title | "Part 6: Coding on Hive with Python - Interacting with the Hive-Engine Side Chain" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 113,597,619 |
net_rshares | 0 |
I'm going to see the documentation to find a solution. Your post helped me a lot, thanks!!!
author | javivisan |
---|---|
permlink | re-learncode-rcnixf |
category | programming |
json_metadata | {"tags":["programming"],"app":"peakd/2022.05.8"} |
created | 2022-05-29 15:56:03 |
last_update | 2022-05-29 15:56:03 |
depth | 3 |
children | 4 |
last_payout | 2022-06-05 15:56:03 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 91 |
author_reputation | 276,953,032,680,683 |
root_title | "Part 6: Coding on Hive with Python - Interacting with the Hive-Engine Side Chain" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 113,614,190 |
net_rshares | 0 |
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: > from hiveengine.api import Api > api = Api() > api.find("tokens", "delegations", query={"to": "learncode"}) 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 > fields: from = account that initiated the delegation to = account that received the delegation symbol = symbol of the token delegated quantity = quantity of tokens delegated 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: > api.find("tokens", "delegations", query={"to": "learncode", "from": "javivisan", "symbol": "BEE"})
author | learncode |
---|---|
permlink | re-javivisan-rct8lw |
category | programming |
json_metadata | {"tags":["programming"],"app":"peakd/2022.05.8"} |
created | 2022-06-01 17:58:45 |
last_update | 2022-06-01 17:58:45 |
depth | 4 |
children | 3 |
last_payout | 2022-06-08 17:58:45 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 1,210 |
author_reputation | 682,726,195,093 |
root_title | "Part 6: Coding on Hive with Python - Interacting with the Hive-Engine Side Chain" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 113,704,471 |
net_rshares | 9,288,244,991 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
javivisan | 0 | 9,288,244,991 | 100% |
The code works great!!!! Thank you so much, I had been looking for a solution to the problem for months. !PGM !PIZZA
author | javivisan |
---|---|
permlink | re-learncode-rcte9m |
category | programming |
json_metadata | {"tags":["programming"],"app":"peakd/2022.05.9"} |
created | 2022-06-01 20:01:00 |
last_update | 2022-06-01 20:01:00 |
depth | 5 |
children | 1 |
last_payout | 2022-06-08 20:01:00 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 116 |
author_reputation | 276,953,032,680,683 |
root_title | "Part 6: Coding on Hive with Python - Interacting with the Hive-Engine Side Chain" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 113,707,457 |
net_rshares | 0 |
https://twitter.com/HiveTrending/status/1532068157258489856 <sub> 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.</sub>
author | poshtoken | ||||||
---|---|---|---|---|---|---|---|
permlink | re-learncode-re-javivisan-rct8lw14474 | ||||||
category | programming | ||||||
json_metadata | "{"app":"Poshtoken 0.0.1","payoutToUser":["hivetrending"]}" | ||||||
created | 2022-06-01 18:36:36 | ||||||
last_update | 2022-06-01 18:36:36 | ||||||
depth | 5 | ||||||
children | 0 | ||||||
last_payout | 2022-06-08 18:36:36 | ||||||
cashout_time | 1969-12-31 23:59:59 | ||||||
total_payout_value | 0.000 HBD | ||||||
curator_payout_value | 0.000 HBD | ||||||
pending_payout_value | 0.000 HBD | ||||||
promoted | 0.000 HBD | ||||||
body_length | 262 | ||||||
author_reputation | 5,378,745,551,921,936 | ||||||
root_title | "Part 6: Coding on Hive with Python - Interacting with the Hive-Engine Side Chain" | ||||||
beneficiaries |
| ||||||
max_accepted_payout | 1,000,000.000 HBD | ||||||
percent_hbd | 0 | ||||||
post_id | 113,705,363 | ||||||
net_rshares | 0 |