Skip to content

bitwheeze/golos-js

 
 

Repository files navigation

Golos.js

Golos.js the JavaScript API for Golos blockchain

npm version

Install

$ npm install golos-classic-js --save

Here is full documentation: https://github.com/golos-blockchain/golos-js/tree/master/doc

Browser

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>

WebSockets and HTTP transport

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/');

Examples

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.

Issues

When you find issues, please report them!

License

MIT

About

JavaScript library for GOLOS blockchain

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 99.9%
  • HTML 0.1%