Difference between revisions of "Steemjs"

From Bee Wiki (HIVE)
Jump to: navigation, search
(Created page with "Steem.js is a javascript library that allows developers to communicate and transact on the STEEM blockchain easily. A lot of applications use SteemJS, and the steemit.chat cha...")
 
(Redirected page to Steem.js)
 
Line 1: Line 1:
Steem.js is a javascript library that allows developers to communicate and transact on the STEEM blockchain easily. A lot of applications use SteemJS, and the steemit.chat channel #steemjs is pretty active if you are looking for help.
+
#REDIRECT [[Steem.js]]
 
 
[https://github.com/steemit/steem-js/tree/master/doc GitHub source]
 
 
 
== Browser ==
 
 
 
<pre class="html">&lt;script src=&quot;./steem.min.js&quot;&gt;&lt;/script&gt;
 
&lt;script&gt;
 
steem.api.getAccounts(['ned', 'dan'], function(err, response){
 
    console.log(err, response);
 
});
 
&lt;/script&gt;</pre>
 
== CDN ==
 
 
 
https://cdn.steemjs.com/lib/latest/steem.min.js<br/>
 
 
 
<pre class="html">&lt;script src=&quot;//cdn.steemjs.com/lib/latest/steem.min.js&quot;&gt;&lt;/script&gt;</pre>
 
== Webpack ==
 
 
 
[https://github.com/steemit/steem-js/blob/master/examples/webpack-example Please have a look at the webpack usage example.]
 
 
 
== Server ==
 
 
 
== Install ==
 
 
 
<pre>$ npm install steem --save</pre>
 
== WebSockets ==
 
 
 
wss://steemd.steemit.com By Default<br/> wss://node.steem.ws<br/> wss://this.piston.rocks<br/>
 
 
 
== Examples ==
 
 
 
=== Broadcast Vote ===
 
 
 
<pre class="js">var steem = require('steem');
 
 
 
var wif = steem.auth.toWif(username, password, 'posting');
 
steem.broadcast.vote(wif, voter, author, permlink, weight, function(err, result) {
 
    console.log(err, result);
 
});</pre>
 
=== Get Accounts ===
 
 
 
<pre class="js">steem.api.getAccounts(['ned', 'dan'], function(err, result) {
 
    console.log(err, result);
 
});</pre>
 
=== Get State ===
 
 
 
<pre class="js">steem.api.getState('/trends/funny', function(err, result) {
 
    console.log(err, result);
 
});</pre>
 
=== Reputation Formatter ===
 
 
 
<pre class="js">var reputation = steem.formatter.reputation(user.reputation);
 
console.log(reputation);</pre>
 

Latest revision as of 15:53, 14 July 2017

Redirect to: