Skip to content

VIZ.js the JavaScript Library with API support for VIZ blockchain

License

Notifications You must be signed in to change notification settings

VIZ-Blockchain/viz-js-lib

This branch is 158 commits ahead of, 29 commits behind GolosChain/golos-js:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Aug 2, 2023
d7312f3 · Aug 2, 2023
Feb 7, 2017
Jul 12, 2023
Sep 3, 2018
Jul 4, 2018
Aug 2, 2023
Feb 27, 2019
Jul 8, 2023
Jul 8, 2023
Jul 4, 2018
Jun 22, 2017
Feb 13, 2017
Jun 7, 2018
May 20, 2017
Oct 21, 2016
Feb 27, 2019
Jul 12, 2023
Nov 8, 2018
Jul 4, 2018
Jul 4, 2018
Aug 2, 2023
Oct 4, 2016
Jun 21, 2017

Repository files navigation

viz.js

viz.js the JavaScript Library with API Support for VIZ blockchain

npm version

Documentation

Here is full documentation: https://github.com/VIZ-Blockchain/viz-js-lib/tree/master/doc

Install

$ npm install viz-js-lib --save

Browser

Online library minify js available in jsDelivr CND and Unpkg CDN.

<script src="./viz.min.js"></script>
<script>
viz.api.getAccounts(['ned', 'dan'], function(err, response){
    console.log(err, response);
});
</script>

Build

apt-get install -y webpack
apt-get install -y npm
apt-get install -y git

npm install -g n
n v8.4.0
PATH="$PATH"

git clone https://github.com/VIZ-Blockchain/viz-js-lib.git
cd viz-js-lib/

npm install
npm run build-browser
ls dist

Server

WebSockets and HTTP transport

Library support 2 transport types: ws, wss for websocket and http, https for pure HTTP JSONRPC. Examples:

viz.config.set('websocket','wss://viz.lexai.host/');
viz.config.set('websocket','https://rpc.viz.lexai.host/');

Examples

Broadcast Vote

var viz = require('viz-js-lib');//nodejs lib

var wif = viz.auth.toWif(username, password, 'regular');
viz.broadcast.vote(wif, voter, author, permlink, weight, function(err, result) {
	console.log(err, result);
});

Get Accounts

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

Contributions

Patches are welcome! Contributors are listed in the package.json file. Please run the tests before opening a pull request and make sure that you are passing all of them. If you would like to contribute, but don't know what to work on, check the issues list.

Issues

When you find issues, please report them!

License

MIT

About

VIZ.js the JavaScript Library with API support for VIZ blockchain

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 99.8%
  • Other 0.2%