SteemJS : the library for JavaScript lovers. Now release!

in #steemjs8 years ago (edited)

Edit: Check out the new version on my new post here with 59 added methods : https://steemit.com/steemjs/@fabien/steemjs

SteemJS the JavaScript API for Steem blockchain

I've created a new npm package for Steem blockchain. There is already few methods, I will keep it updated daily with more features. Let me know if you have some suggestions in comments or on Slack https://steem.slack.com/ channel #steemjs. The project is Open Source feel free to contribute on GitHub. Hope you guys will like it!

https://www.npmjs.com/package/steem
https://github.com/adcpm/steem

Here is the documentation :

Install

$ npm install steem --save

Usage

var steem = require('steem');
var Steem = new steem();

Steem.getAccount('steemit', function(result, err) {
    console.log(result, err);
});

Send

var data = {
    'id': 1,
    'method': 'get_accounts',
    'params': [['steemit']]
};

Steem.send(data, function(result, err) {
    console.log(result, err);
});

http://piston.readthedocs.io/en/develop/lib.html#piston-api

Get Accounts

Steem.getAccounts(['ned', 'dan'], function(result, err) {
    console.log(result, err);
});

Get Account

Steem.getAccount('steemit', function(result, err) {
    console.log(result, err);
});

Get Block

Steem.getBlock(3000000, function(result, err) {
    console.log(result, err);
});

Streaming Block Number

Steem.streamBlockNumber(function(result) {
    console.log(result);
});

Streaming Block

Steem.streamBlock(function(result) {
    console.log(result);
});

Streaming Transactions

Steem.streamTransactions(function(result) {
    console.log(result);
});

Streaming Operations

Steem.streamOperations(function(result) {
    console.log(result);
});

TO-DO

  • Cancel All Subscriptions method
  • Connect Account method
  • Create Account method
  • What do you suggest?

License

MIT

Sort:  

Great job @fabien:

Guys, if you like it, give it also a star on github:

This wil help him find more contributors in the future :)

Cool project, but name could be more original. There are already two other (different) SteemJS libraries out there: SteemJS and .... SteemJS. Maybe you should discuss with other authors to see how to avoid future confusion.

Alright I will probably change the name to something more original. In meantime I've just edited the name and change it to Steem.JS (<- See the dot?).

That's so much more clear ;)

Wow - Very nice work there @fabien - Upvoted & Followed you!

Since you are already on it - may I suggest writing a WordPress plugin that can publish WordPress content to Steemit using the post-key?

I´m sure there will be a LOT of money in it for you if you do, and there is a growing demand for it. (hint hint)

@fabien Awesome man, I can't wait to use this on my projects. Having a library like this is a great addition. We need more wrappers. I also shortened your post here with steemurl, so you can track the clicks.
http://steemurl.com/D49xrN6A

Release for steemurl: http://steemurl.com/5ct_irFs

Thank you ma friend, that was exactly what i was looking for!


Have a look in this, it's great too!
https://steemit.com/writing/@steemitdude/when-you-need-an-idea-to-a-new-post

fabien you deserve 100000000 of steempower for it, really infinete thanks you

Great post!
But I dont understand with JavaScript, i need to learn JavaScript for future

I benefit a lot from Steem JS

Already, good job!!!!

Very good news! Thx ;)

Looks great! Excited to see where it goes.

Is it possible to make a miner with help of this library for Windows (x86)?

@fabien Awesome project, buddy! Is there any way to get user's blog posts?