This script shows a confirmation dialog before executing the transaction that will claim the rewards for every stake.
We could add that this link shows a Tenderly simulation of the transaction before executing the real transaction.
Tenderly documentation to do this:
https://docs.tenderly.co/tenderly-sdk/tutorials-and-quickstarts/how-to-simulate-transactions-with-tenderly-sdk