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/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
Ethereum 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, for bower and component as an embeddable js and as a meteor.js package.
You need to run a local ethrereum node to use this library.
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