IrChain JavaScript API
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.
You need to run a local IrChain node to use this library.
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; // {irc: .., shh: ...} // it's here!
Set a provider (HttpProvider)
if typeof webu !== 'undefined' webu = webucurrentProvider; else // set the provider you want from Webu.providers webu = "http://localhost:8545";
Set a provider (HttpProvider using HTTP Basic Authentication)
webu;
There you go, now you can use it:
var coinbase = webuirccoinbase;var balance = webuirc;
You can find more examples in example
directory.
Contribute!
Requirements
- Node.js
- npm
Building (gulp)
gulp
Testing (mocha)
npm test
Community
Other implementations
- Python Webu.py
- Haskell hs-webu
- Java webuj
- Scala webuj-scala
- Purescript purescript-webu
- PHP webu.php