2.0.3 • Published 6 years ago

webu v2.0.3

Weekly downloads
5
License
LGPL-3.0
Repository
github
Last release
6 years ago

IrChain JavaScript API

Join the chat at https://gitter.im/irchain/webu.js

This is the IrChain 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 IrChain node to use this library.

Documentation

Installation

Node.js

npm install webu

Yarn

yarn add webu

Meteor.js

meteor add irchain:webu

As Browser module

Bower

bower install webu

Component

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

Usage

Use the webu object directly from global namespace:

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

Set a provider (HttpProvider)

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

Set a provider (HttpProvider using HTTP Basic Authentication)

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

There you go, now you can use it:

var coinbase = webu.irc.coinbase;
var balance = webu.irc.getBalance(coinbase);

You can find more examples in example directory.

Contribute!

Requirements

  • Node.js
  • npm

Building (gulp)

gulp

Testing (mocha)

npm test

Community

Other implementations

2.0.3

6 years ago

2.0.2

6 years ago

2.0.1

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago