Golos.js the JavaScript API for Golos blockchain
$ npm install golos-classic-js --save
Here is full documentation: https://github.com/golos-blockchain/golos-js/tree/master/doc
Online library minify js available in jsDelivr CND and Unpkg CDN.
<script src="./golos.min.js"></script>
<script>
golos.api.getAccounts(['ned', 'dan'], function(err, response){
console.log(err, response);
});
</script>
Library support 2 transport types: ws, wss for websocket and http, https for pure HTTP JSONRPC.
wss://api-golos.blckchnd.com/ws
wss://api.aleksw.space/ws
wss://golos.lexai.host/ws
https://api-golos.blckchnd.com/
https://api.aleksw.space/
https://golos.lexai.host/
golos.config.set('websocket','wss://golos.lexai.host/ws');
or
golos.config.set('websocket','https://golos.lexai.host/');
Broadcast Vote
var golos = require('golos');
var wif = golos.auth.toWif(username, password, 'posting');
golos.broadcast.vote(wif, voter, author, permlink, weight, function(err, result) {
console.log(err, result);
});
Get Accounts
golos.api.getAccounts(['ned', 'dan'], function(err, result) {
console.log(err, result);
});
Other examples in the documentation.
When you find issues, please report them!
MIT