Skip to content

Instantly share code, notes, and snippets.

@emre
Created July 12, 2018 10:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save emre/77fc693e0be1d377644310c5d5168015 to your computer and use it in GitHub Desktop.
Save emre/77fc693e0be1d377644310c5d5168015 to your computer and use it in GitHub Desktop.
producer rewards
from beem.account import Account
from beem.amount import Amount
def main():
witness_account = Account('emrebeyler')
total_rewarded_vests = 0
total_blocks = 0
for op in witness_account.history_reverse(only_ops=["producer_reward"]):
total_blocks += 1
total_rewarded_vests += Amount(op["vesting_shares"]).amount
print("Total block producer reward in VESTS:", total_rewarded_vests)
print("Total block producer reward in SP:",
witness_account.steem.vests_to_sp(total_rewarded_vests))
print("Total blocks produced:", total_blocks)
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment