Skip to content

Apolo-Technologies/webze.js

Repository files navigation

Migration 0.13.0 -> 0.14.0

webze.js version 0.14.0 supports multiple instances of webze object. To migrate to this version, please follow the guide:

-var webze = require('webze');
+var Webze = require('webze');
+var webze = new Webze();

Zerium JavaScript API

Join the chat at https://gitter.im/zerium/webze.js

This is the Zerium compatible JavaScript API which implements the Generic JSON RPC spec. It's available on npm as a node module, for bower and component as an embeddable js and as a meteor.js package.

NPM version Build Status dependency status dev dependency status Coverage Status Stories in Ready

You need to run a local Zerium node to use this library.

Documentation

Installation

Node.js

npm install webze

Yarn

yarn add webze

Meteor.js

meteor add zerium:webze

As Browser module

Bower

bower install webze

Component

component install zerium/webze.js
  • Include webze.min.js in your html file. (not required for the meteor package)

Usage

Use the webze object directly from global namespace:

console.log(webze); // {eth: .., shh: ...} // it's here!

Set a provider (HttpProvider)

if (typeof webze !== 'undefined') {
  webze = new Webze(webze.currentProvider);
} else {
  // set the provider you want from Webze.providers
  webze = new Webze(new Webze.providers.HttpProvider("http://localhost:8545"));
}

Set a provider (HttpProvider using HTTP Basic Authentication)

webze.setProvider(new webze.providers.HttpProvider('http://host.url', 0, BasicAuthUsername, BasicAuthPassword));

There you go, now you can use it:

var coinbase = webze.zrm.coinbase;
var balance = webze.zrm.getBalance(coinbase);

You can find more examples in example directory.

Contribute!

Requirements

  • Node.js
  • npm
sudo apt-get update
sudo apt-get install nodejs
sudo apt-get install npm
sudo apt-get install nodejs-legacy

Building (gulp)

npm run-script build

Testing (mocha)

npm test

Community

Other implementations

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published