create account

New Tool: Claim Hive Rewards for Multiple Accounts Easily! by thecrazygm

View this thread on: hive.blogpeakd.comecency.com
· @thecrazygm · (edited)
$8.73
New Tool: Claim Hive Rewards for Multiple Accounts Easily!
Had an interesting little side job this morning helping a Hive user out. They needed to claim their pending HIVE/HBD rewards across a whole bunch of different accounts they manage, and it got me thinking about the hassle involved. Logging in and out of multiple accounts, even if it's just via Keychain clicks, solely to click 'Claim Rewards' can be a real headache, especially if you manage several accounts.

So, that little task inspired me to put together a more generic tool to streamline this process: introducing **`claim-rewards`**, a Python script designed to let you claim pending rewards for multiple Hive accounts using the posting authority of just _one_ main account.

## How Does It Work? (Leveraging Posting Authority)

The magic behind this script relies on Hive's flexible account authority system. Let's say you manage several accounts: `alt-account1`, `alt-account2`, `alt-account3`, etc., but you primarily use `your-main-account`. You need to grant _posting authority_ from each of those alt accounts (`alt-account1`, `alt-account2`, etc.) _to_ `your-main-account`. A straightforward way to manage these account authorities is by using our **Hive Account Authority tool**, which you can find right here:
[**https://thecrazygm.com/hivetools/account/authority**](https://thecrazygm.com/hivetools/account/authority)

Once you've used the tool to grant the necessary posting authorities on the Hive blockchain, `your-main-account` gains the ability to perform posting-level actions – including claiming rewards! – on behalf of those other accounts. This script leverages that. You provide the posting key for `your-main-account`, and a list of all the accounts (`your-main-account`, `alt-account1`, `alt-account2`, etc.), and it iterates through, claiming rewards for each using `your-main-account`'s granted authority.

## Setup and Usage

The setup is pretty straightforward:

1.  **Grant Authorities:** Before running the script, you _must_ grant posting authority from your alt accounts to your main account on the Hive blockchain. The script relies on these permissions being set correctly.

2.  **Create `accounts.yaml`:** Create a YAML file (by default, the script looks for `accounts.yaml` in the same directory, but you can specify a path using `--accounts`). This file lists all the accounts you want to process. **Important:** List your main account (the one whose posting key you'll use) _first_.
    ```yaml
    # Example accounts.yaml
    # The first account is the authority account whose WIF will be used.
    # Ensure this account has been granted posting authority by the other accounts below.
    accounts:
      - your-main-account # WIF for this account is needed
      - alt-account1
      - alt-account2
      - some-other-account-you-manage
    # Optional: You can put the WIF here instead of using --wif or ENV var
    # wif: 5JYourPostingPrivateKeyHere
    ```
3.  **Provide Posting Key:** The script needs the posting WIF (private key) for your main account. You can provide it in one of three ways:
    - Add it directly to the `accounts.yaml` file (under the `wif:` key, see example above).
    - Pass it using the `--wif` command-line argument when running the script.
    - Set it as an environment variable named `POSTING_WIF`.
4.  **Run the Script:** Execute the script. Since it uses the `uv run --script` shebang, if you have `uv` installed, it should handle the dependencies (`hive-nectar`, `pyyaml`) automatically. Otherwise, you might need to install them manually first.

## Seeing it in Action

Here's a quick look at the script running normally:

![Running the script - claiming rewards across multiple accounts.](https://files.peakd.com/file/peakd-hive/thecrazygm/Eo44H4KmHixkf2n147vSNcRd8TvVkoSEbVCVztFSNnfmFRDT1xZeRk4ZhYuzksWp3rf.png)

And here's an example with the `--debug` flag enabled for more verbose output, showing which accounts are being processed and what rewards are found:

![Running with --debug flag for more detailed logs.](https://files.peakd.com/file/peakd-hive/thecrazygm/23tRrM22rd2dEnCJ6ExGHjZ61MnMv21QaxzMraBSPhq2mK2Hzoc3FYKSQrZJwgZjZ2vkQ.png)

## Technical bit

For those curious about the code using `hive-nectar`, the core action happens with something like `main_account.claim_reward_balance(account=target_account_name)`, where `main_account` is the `Account` object instantiated with your main account's WIF. Now I can put this bad boy in a cron job and never have to worry about the other accounts again!

## Get the Tool!

The complete code, along with more detailed setup instructions and usage examples (including the handy `--dry-run` option to see what it _would_ do without actually broadcasting anything), is available on GitHub:
[**https://github.com/TheCrazyGM/claim-rewards**](https://github.com/TheCrazyGM/claim-rewards)

Hopefully, this little utility saves some fellow Hive users the repetitive strain of clicking "Claim Rewards" across many accounts! Let me know if you find it useful!

As always,
Michael Garcia a.k.a. TheCrazyGM
πŸ‘  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 67 others
properties (23)
authorthecrazygm
permlinknew-tool-claim-hive-rewards-for-multiple-accounts-easily
categoryhive-186392
json_metadata{"app":"peakd/2025.4.6","format":"markdown","image":["https://files.peakd.com/file/peakd-hive/thecrazygm/Eo44H4KmHixkf2n147vSNcRd8TvVkoSEbVCVztFSNnfmFRDT1xZeRk4ZhYuzksWp3rf.png","https://files.peakd.com/file/peakd-hive/thecrazygm/23tRrM22rd2dEnCJ6ExGHjZ61MnMv21QaxzMraBSPhq2mK2Hzoc3FYKSQrZJwgZjZ2vkQ.png"],"tags":["dev","nectar","income","tribes","archon","proofofbrain"],"users":[]}
created2025-04-24 16:57:36
last_update2025-05-04 14:12:45
depth0
children5
last_payout2025-05-01 16:57:36
cashout_time1969-12-31 23:59:59
total_payout_value4.019 HBD
curator_payout_value4.713 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length5,035
author_reputation94,082,504,161,142
root_title"New Tool: Claim Hive Rewards for Multiple Accounts Easily!"
beneficiaries
0.
accountthecrazygm.bank
weight1,500
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id142,296,835
net_rshares27,047,631,543,150
author_curate_reward""
vote details (131)
@herman-german ·
$0.19
Would be great if the script would also claim the SCOT rewards on hive-engine once a day 😁
πŸ‘  , , , , , ,
properties (23)
authorherman-german
permlinkre-thecrazygm-svpizy
categoryhive-186392
json_metadata{"tags":["hive-186392"],"app":"peakd/2025.4.6","image":[],"users":[]}
created2025-05-03 22:40:48
last_update2025-05-03 22:40:48
depth1
children2
last_payout2025-05-10 22:40:48
cashout_time1969-12-31 23:59:59
total_payout_value0.096 HBD
curator_payout_value0.096 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length90
author_reputation17,413,738,323,227
root_title"New Tool: Claim Hive Rewards for Multiple Accounts Easily!"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id142,493,392
net_rshares553,998,533,491
author_curate_reward""
vote details (7)
@thecrazygm ·
$0.61
Nothing to see here. ;)
![lalala](https://files.peakd.com/file/peakd-hive/thecrazygm/Eo6BJwhbb6yW871oe71X48TXWo3MMbcewJhDdiYSCwKreqexBc5VV6MBhxBUazn95dF.png)

I'll release it in a day or two when I'm done working the bugs out. 
πŸ‘  , , , , , , ,
properties (23)
authorthecrazygm
permlinkre-herman-german-svqq3e
categoryhive-186392
json_metadata{"tags":["hive-186392"],"app":"peakd/2025.4.6"}
created2025-05-04 14:11:39
last_update2025-05-04 14:11:39
depth2
children1
last_payout2025-05-11 14:11:39
cashout_time1969-12-31 23:59:59
total_payout_value0.304 HBD
curator_payout_value0.303 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length227
author_reputation94,082,504,161,142
root_title"New Tool: Claim Hive Rewards for Multiple Accounts Easily!"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id142,504,056
net_rshares1,670,843,569,757
author_curate_reward""
vote details (8)
@herman-german ·
$0.20
That’s awesome. πŸ’ͺ
πŸ‘  , , , , , ,
properties (23)
authorherman-german
permlinkre-thecrazygm-svqxxx
categoryhive-186392
json_metadata{"tags":["hive-186392"],"app":"peakd/2025.4.6","image":[],"users":[]}
created2025-05-04 17:01:09
last_update2025-05-04 17:01:09
depth3
children0
last_payout2025-05-11 17:01:09
cashout_time1969-12-31 23:59:59
total_payout_value0.098 HBD
curator_payout_value0.098 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length17
author_reputation17,413,738,323,227
root_title"New Tool: Claim Hive Rewards for Multiple Accounts Easily!"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id142,508,070
net_rshares550,590,532,529
author_curate_reward""
vote details (7)
@meno ·
$0.08
very cool bud... very cool.

πŸ‘  , , , , , ,
properties (23)
authormeno
permlinkre-thecrazygm-sv8nx1
categoryhive-186392
json_metadata{"tags":["hive-186392"],"app":"peakd/2025.4.6","image":[],"users":[]}
created2025-04-24 20:07:48
last_update2025-04-24 20:07:48
depth1
children0
last_payout2025-05-01 20:07:48
cashout_time1969-12-31 23:59:59
total_payout_value0.040 HBD
curator_payout_value0.039 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length29
author_reputation521,450,717,635,018
root_title"New Tool: Claim Hive Rewards for Multiple Accounts Easily!"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id142,299,662
net_rshares232,117,735,732
author_curate_reward""
vote details (7)
@tydynrain ·
$0.18
More excellent tools! I didn't even know that posting authority could be granted to another account, super cool, and you even made a too for that too! I'm really glad that I started following you, as I find and learn so much great stuff! 😁 πŸ™ πŸ’š ✨ πŸ€™ 
πŸ‘  , , , , , , , , ,
properties (23)
authortydynrain
permlinkre-thecrazygm-2025424t214410659z
categoryhive-186392
json_metadata{"tags":["dev","nectar","income","tribes","archon","proofofbrain"],"app":"ecency/3.2.0-vision","format":"markdown+html"}
created2025-04-25 07:44:15
last_update2025-04-25 07:44:15
depth1
children0
last_payout2025-05-02 07:44:15
cashout_time1969-12-31 23:59:59
total_payout_value0.091 HBD
curator_payout_value0.090 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length248
author_reputation203,179,022,448,406
root_title"New Tool: Claim Hive Rewards for Multiple Accounts Easily!"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id142,307,938
net_rshares529,590,869,452
author_curate_reward""
vote details (10)