diff options
Diffstat (limited to 'cmd/mist/assets/ext/ethereum.js/README.md')
-rw-r--r-- | cmd/mist/assets/ext/ethereum.js/README.md | 45 |
1 files changed, 31 insertions, 14 deletions
diff --git a/cmd/mist/assets/ext/ethereum.js/README.md b/cmd/mist/assets/ext/ethereum.js/README.md index 865b62c6b..02988fe73 100644 --- a/cmd/mist/assets/ext/ethereum.js/README.md +++ b/cmd/mist/assets/ext/ethereum.js/README.md @@ -1,6 +1,6 @@ # Ethereum JavaScript API -This is the Ethereum compatible JavaScript API using `Promise`s +This is the Ethereum compatible [JavaScript API](https://github.com/ethereum/wiki/wiki/JavaScript-API) which implements the [Generic JSON RPC](https://github.com/ethereum/wiki/wiki/Generic-JSON-RPC) spec. It's available on npm as a node module and also for bower and component as an embeddable js [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![dependency status][dep-image]][dep-url] [![dev dependency status][dep-dev-image]][dep-dev-url] @@ -23,7 +23,7 @@ Component component install ethereum/ethereum.js * Include `ethereum.min.js` in your html file. -* Include [es6-promise](https://github.com/jakearchibald/es6-promise) or another ES6-Shim if your browser doesn't support ECMAScript 6. +* Include [bignumber.js](https://github.com/MikeMcl/bignumber.js/) ## Usage Require the library: @@ -37,25 +37,41 @@ Set a provider (QtProvider, WebSocketProvider, HttpRpcProvider) There you go, now you can use it: ``` -web3.eth.coinbase.then(function(result){ - console.log(result); - return web3.eth.balanceAt(result); -}).then(function(balance){ - console.log(web3.toDecimal(balance)); -}).catch(function(err){ - console.log(err); -}); +var coinbase = web3.eth.coinbase; +var balance = web3.eth.balanceAt(coinbase); ``` For another example see `example/index.html`. -## Building +## Contribute! -* `gulp build` +### Requirements +* Node.js +* npm +* gulp (build) +* mocha (tests) + +```bash +sudo apt-get update +sudo apt-get install nodejs +sudo apt-get install npm +sudo apt-get install nodejs-legacy +``` + +### Building (gulp) + +```bash +npm run-script build +``` -### Testing + +### Testing (mocha) + +```bash +npm test +``` **Please note this repo is in it's early stage.** @@ -76,4 +92,5 @@ ethereum -ws -loglevel=4 [dep-image]: https://david-dm.org/ethereum/ethereum.js.svg [dep-url]: https://david-dm.org/ethereum/ethereum.js [dep-dev-image]: https://david-dm.org/ethereum/ethereum.js/dev-status.svg -[dep-dev-url]: https://david-dm.org/ethereum/ethereum.js#info=devDependencies
\ No newline at end of file +[dep-dev-url]: https://david-dm.org/ethereum/ethereum.js#info=devDependencies + |