My contribution to dhive! ( Node wrapper for hive rpc api )
My merge request : https://gitlab.syncad.com/hive/dhive/-/merge_requests/7/diffs
Dsteem was an amazing library written by , it provided a robust tool for us javascript developer to better interact with steem blockchain. In comparison with steemjs official library, it proved to be a faster and simpler syntax to work with. Developing dapp with dsteem is more pleasant, not to mention the intellisense that comes with typescript. Lessen the hours needed to read and search through documentations.
Other than that, typescript also provided a better bug control with its typed feature, further saved us developers from hidden variables error that took most of the time to catch and trace.
Due to this, I wish to further learn more about typescript and helped in developing on this rebranded library of dhive. Dhive still pertains all of its feature from dsteem. However there's still lots of feature need to be added in comparison with hivejs.
So these are the features related to hivemine that I've developed and hope to bring more in future! Do correct me if there's flaw and error!
Added Hivemind API query
import "mocha";
import * as assert from "assert";
import { Client, Asset, Transaction, PrivateKey } from "./../src";
import { getTestnetAccounts, randomString, agent, TEST_NODE } from "./common";
describe("HivemindAPI", function () {
this.slow(500);
this.timeout(20 * 1000);
const client = Client.testnet({ agent });
const liveClient = new Client(TEST_NODE, { agent });
let acc: { username: string; password: string };
it('getRankedPosts', async () => {
const r = await liveClient.hivemind.getRankedPosts({ limit: 1, sort: 'trending', tag: '', observer: "" })
console.log('rankedposts', r)
assert.equal(r.length, 1)
})
it('getCommunity', async () => {
const r = await liveClient.hivemind.getCommunity({ name: 'hive-148441', observer: '' })
console.log('community', r)
//assert.equal(r.length, 1)
})
it('getAccountNotifications', async () => {
const r = await liveClient.hivemind.getAccountNotifications({ account: 'acidyo', limit: 2 })
console.log('notifies', r)
//assert.equal(r.length, 1)
})
it('listCommunities', async () => {
const r = await liveClient.hivemind.listCommunities({ limit: 2 })
console.log('communities', r)
})
it('listAllSubscriptions', async () => {
const r = await liveClient.hivemind.listAllSubscriptions({ account: 'acidyo' })
console.log('subscriptions', r)
//assert.equal(r.length, 1)
})
});
This is the full test code by mocha which proved to be successful in retrieving data. This also signifies all the api calls to hivemind you can make using dhive!
Tips for the day : Do you know notifications is actually handled by hivemind? You can use dhive to query it too!
The great thing about typescript is that the queries you placed as parameters of dhive functions is checked in realtime. Suggestion will show as what options are available. That's a much more pleasant programming experience.
Future plan :
- To add encode memo function
- Further improve documentations
Your support is my motivation!
Leave My contribution to dhive! ( Node wrapper for hive rpc api ) to:
Read more #hivedevs posts
Best Posts From Dr.Crypto!
We have not curated any of tngflx's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.
More Posts From Dr.Crypto!
- Hey is anyone still using this platform? Posted via D.Buzz
- Contribution to dhive : Added memo encryption and decrypt feature
- Contribution to dhive : Added memo encryption and decrypt feature
- Hi everyone
- My contribution to dhive! ( Node wrapper for hive rpc api )
- My contribution to dhive! ( Node wrapper for hive rpc api )
- My contribution to dhive! ( Node wrapper for hive rpc api )
- Is it the right time to buy bitcoin?
- Is it the right time to buy bitcoin?
- Is it the right time to buy bitcoin now?
- Bitcoin halving, is it the right time to buy now?
- @justinsunsteemit You're losing!!
- Whats your thought on building a dating dapp on steem?
- Added community feature to STEEM ULTIMATE EDITOR!
- A better trending page for serious bloggers!
- Started my work as doctor!!
- A hassle free way to bid your vote! Helper tool for bidbots
- Added quick image and video search from Pixabay!
- Edit your old blog post with ease!
- New feature : Chart Editor! Integration with STEEM ULTIMATE EDITOR