Steem.js: Comment, upvote, downvote, transfert. You wanted it, you got it.
Credit @klye
Hey developers, here is the news: Now you can upvote, downvote, comment and tranfert using Steem.js!
Here the package:
https://github.com/adcpm/steem
https://www.npmjs.com/package/steem
Here the examples:
UpVote
/* @params username, password, author, permlink, weight */
steem.broadcast.upvote('fabien', 'sgs56sd84hbr51qpodg1', 'steemjs', 'permlink-of-the-post', 10000, function(err, result) {
console.log(err, result);
});
DownVote
/* @params username, password, author, permlink, weight */
steem.broadcast.downvote('fabien', 'sgs56sd84hbr51qpodg1', 'steemjs', 'permlink-of-the-post', 10000, function(err, result) {
console.log(err, result);
});
Post
/* @params username, password, parentAuthor, parentPermlink, author, permlink, title, body, jsonMetadata */
steem.broadcast.comment('fabien', 'sgs56sd84hbr51qpodg1',
'',
'steemjs',
'fabien',
'this-is-the-slug-of-my-article',
'This is the title',
'This is the body',
{tags: ['steemjs', 'steem']},
function(err, result) {
console.log(err, result);
});
Transfer
/* @params username, password, from, to, amount, memo */
steem.broadcast.transfer('fabien', 'sgs56sd84hbr51qpodg1', 'you', 'steemjs', '50.000 SBD', 'Donation', function(err, result) {
console.log(err, result);
});
Thank's to @heimindanger who helped for the methods and browser side support. You also want to contribute and get rewarded for that? Contact me on the rocket chat @fabien or channel #steemjs.
More will come, stay tuned.
PS : This is not my real password on examples ;)
Fabien
How to check the balance
Keep going bro..;)
Thank you!
For anyone else finding this now, like me, it's changed:
Thank you very helpful!
Hi Yoghurt,
Could you please advise me how to downvote by using steem.broadcast.vote()? I did set weight to 0, but it seems a bad practice
Thank you so much for any help
appreciate your help.
nice post.. this is what im looking. thanks
Thks for making developpers work easy.
This post has been linked to from another place on Steem.
About linkback_bot
Now you're talking my language!
Really cool thing !!! It must be upvoted
But how does one specify whether the post is a standalone post or a comment?
By not including a parent permlink, it will be a main post, conversely, by including a parent permlink, it will be a comment under a post (the post or the comment above it identified by the parent permlink). Late answer here, but somebody may find this handy someday.
Thanks, I did figure it out eventually, but as you say, others will surely find it helpful!