You are viewing a single comment's thread from:

RE: Tutorial - User Wallet History with Steem.js #12

in #utopian-io7 years ago

Sam, another great tutorial.

Your tutorial came a bit too late for me as I just have published a similar tutorial. But I did the same thing; I looked at the postpromoter code to learn :)

Did you find a good way to load more account data after your first request? I initially load 5000 rows from the account history, which takes some time. Would be better to load the data incrementally.​

Sort:  

Thanks, Jo. just been over to look at your latest post. Great tutorial and project you have there!

Index 0 of each returned item in the results array is an ID of sorts. You can get 50 items from -1, then item 0 will be your starting point for the previous 50 etc. e.g

        steem.api.getAccountHistory(ACCOUNT_NAME, -1, 50, (err, result) => {
          let endItem = result[0][0]
          
          steem.api.getAccountHistory(ACCOUNT_NAME, endItem, 50, (err, result) => {
            //
          });
        });

Excuse this horrible code but hopefully that illustrates better.

Thank you, Sam; for the kind words and the code :)

We're all just republishing the same tutorial!!!! LOL

Check this out. I use your favorite language (Typescript) to traverse the entire account history and filter by date. Enjoy the use of generator functions FTW!

https://utopian.io/utopian-io/@r351574nc3/tutorial-viewing-steemit-account-history

Coin Marketplace

STEEM 0.15
TRX 0.16
JST 0.028
BTC 68588.91
ETH 2458.42
USDT 1.00
SBD 2.35