JSPM

web3

0.15.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 640958
  • Score
    100M100P100Q167315F
  • License LGPL-3.0

Ethereum JavaScript API, middleware to talk to a ethereum node over RPC

Package Exports

  • web3
  • web3/lib/solidity/coder
  • web3/lib/solidity/coder.js
  • web3/lib/utils/browser-xhr.js
  • web3/lib/utils/config
  • web3/lib/utils/sha3
  • web3/lib/utils/sha3.js
  • web3/lib/utils/utils
  • web3/lib/utils/utils.js
  • web3/lib/web3/event
  • web3/lib/web3/event.js
  • web3/lib/web3/formatters
  • web3/lib/web3/function
  • web3/lib/web3/function.js
  • web3/lib/web3/httpprovider
  • web3/lib/web3/httpprovider.js
  • web3/lib/web3/method
  • web3/lib/web3/methods/eth
  • web3/lib/web3/methods/net
  • web3/lib/web3/property
  • web3/package.json

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (web3) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Migration 0.13.0 -> 0.14.0

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

-var web3 = require('web3');
+var Web3 = require('web3');
+var web3 = new Web3();

Ethereum JavaScript API

Join the chat at https://gitter.im/ethereum/web3.js

This is the Ethereum 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 statusCoverage StatusStories in Ready

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

Documentation

Installation

Node.js

npm install web3

Meteor.js

meteor add ethereum:web3

As Browser module

Bower

bower install web3

Component

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

Usage

Use the web3 object directly from global namespace:

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

Set a provider (HttpProvider)

web3.setProvider(new web3.providers.HttpProvider('http://localhost:8545'));

There you go, now you can use it:

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