Hivejs Tutorials-- #3

in GEMS4 years ago

Hello Everyone

As you know we work on the Hivejs Library. We try to understand how the hivejs work and what can we do with it. I am not a professional developer that is why I work on the basic stuff I learn and let people learn from me as well. I study the Hivejs every day and try to explain it to the junior developers just like me. In this tutorial, we are going to get the account history of Hive blockchain. The history will contain the transfers, delegations,vote comment and some other stuff from the account. So without wasting time let's start our today's tutorial.
image.png

image.png

So I have the visual studio open with a file named index.js. We will write our code here in the index file which is our main file.

Now we need to install the hived from node package module. we have installed it in the previous tutorials but if you don't know how to install it let me do it again. We just need to enter the following command in the terminal.

image.png

$ npm install @hiveio/hive-js --save

image.png

After successful installation, we can now write our code.

image.png

We are going to use this API. This will return the account history from the hive blockchain.

image.png

just like this.

image.png

Each block contains operations. let's filter that.

image.png

Now this will return the whole history of my account like from the creation to till now . The whole thing includes transfer, votes, account claiming, reward claiming etc.

image.png

Like here the steem account created my account and then delegated some steem( Almost 10 month ago)

image.png

Now this code will only print the name of voter and author. (In this case the person who voted me and my voting list)

image.png

This is just the basic stuff you can do a lot of things with it like we can use it in our apps. In the next post, i will try to create a basic tool using hivejs/hived which will help you in understanding liberty.


Now if you like the post please upvote and comment if you want to give me some advise
ntitled-1.png

Sort:  

Congratulations @pakgamer! You have completed the following achievement on the Hive blockchain and have been rewarded with new badge(s) :

You distributed more than 400 upvotes. Your next target is to reach 500 upvotes.

You can view your badges on your board And compare to others on the Ranking
If you no longer want to receive notifications, reply to this comment with the word STOP

Support the HiveBuzz project. Vote for our proposal!