0.0.7 • Published 6 years ago

xciweb3 v0.0.7

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

Xcare JavaScript API

This is the Ethereum compatible JavaScript API which implements the Generic JSON RPC spec. It's available on npm as a node module.

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

Documentation

Installation

Node.js

npm install xciweb3

Usage

Use the xciweb3 object directly from global namespace:

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

Set a provider (HttpProvider)

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

Set a provider (HttpProvider using HTTP Basic Authentication)

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

There you go, now you can use it:

var coinbase = xciweb3.eth.coinbase;
var balance = xciweb3.eth.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

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago