Ways to claim rewards
In my previous article, I had introduced you a simple tool written by me. Using it you can easily check wallet assets and also can accurately calculate the estimated account value.
And I also added a feature to remind the user if there are rewards to be claimed. In such a situation, the page will display a highlighted text: You have rewards to be claimed. When we get this prompt message, we can log in our wallet and click to claim our rewards.
But, Are you tired of this way?
Login->Check->Claim, We do the same thing over and over again. Is there a way to help us do these things automatically? The answer is yes!
There is a operation called
Unlike the Steem API, which we can call directly, to initiate this operation you need to fill out this structure, and make a transaction structure from it, sign it with your posting private key, and then broadcast it.
Script with the official python library for STEEM
It's too complicated for me. 😭
Fortunately, the official python library for STEEM did a lot of work for us, such as to fill out this structure, to make a transaction structure and to sign the translation with your posting private key, and to broadcast it.
All we need to do is call the method
claim_reward_balance of Steem Class.
A simplest script maybe like this:
#!/usr/bin/env python from steem import Steem steem=Steem() steem.claim_reward_balance(account = 'oflyhigh')
Let me save it as claim_rewards_for_oflyhigh.py.
To run the above script, we MUST do following things first:
Install steem-python with pip
pip install -U steem
Get Posting private key
Get Posting private key from
Show private key
Import Posting private key to local wallet
Input private key and set password for local wallet (First time)
Set UNLOCK environment variable
chmod u+x claim_rewards_for_oflyhigh.py
Run the script automatically
You can add this script to cron job to let it run automatically at specified intervals.
0 0 * * * /path/claim_rewards_for_oflyhigh.py >>log.txt 2>&1
Then the script will be executed at 00:00 every day.
More details about crontab can be found by
To claim rewards for multiple accounts is just as easy.
Create scripts for each account, and then setup cron job for each file. The benefit is that you can set different intervals for different users.
If you want to claim rewards for multiple account with same same interval, Place users in a list and then iterate through them may be the better way.