RE: SteemMonsters: How much DEC have you earned in the 22nd season?
Hi. It's hard for me to give a full script to do all the job because basically I do it in two steps with python scripts.
First, I query data from SteemMonsters API and save it in my local database
https://api.steemmonsters.io/transactions/history?limit=1000&types=sm_battle&from_block=35600000
From this API you can query 1000 battles at once, so you need to take care of from_block
parameter. I start from the latest block, query 1000 battles, remember the lowest block number and in the next iteration start from this new block number (from_block
parameter).
Last season started at block 36015998
and ended at block 36408813
.
When all data are in the database you have to only iterate over all battles and count DEC rewards.
DEC reward for given battle is here: