Comparing version 0.0.6 to 0.1.0
199
package.json
{ | ||
"name": "ethjs", | ||
"version": "0.0.6", | ||
"main": "lib/main.js", | ||
"author": "Tarrence van As <tarrence13@gmail.com>", | ||
"version": "0.1.0", | ||
"description": "A highly optimised, light-weight JS utility for Ethereum", | ||
"main": "lib/index.js", | ||
"files": [ | ||
"dist", | ||
"internals", | ||
"lib", | ||
"src" | ||
], | ||
"scripts": { | ||
"clean": "rimraf lib/", | ||
"build": "babel src/ --out-dir lib/", | ||
"prepublish": "npm run clean && npm run build" | ||
"start": "npm test", | ||
"release": "npmpub", | ||
"pretest": "npm run lint", | ||
"prepublish": "npm run build", | ||
"prebuild": "npm run build:clean && npm run test", | ||
"build:clean": "npm run test:clean && rimraf ./dist", | ||
"build:commonjs": "cross-env BABEL_ENV=commonjs babel src --out-dir lib --copy-files", | ||
"build:umd": "cross-env BABEL_ENV=commonjs NODE_ENV=development webpack --config ./internals/webpack/webpack.config.js --progress", | ||
"build:umd:min": "cross-env BABEL_ENV=commonjs NODE_ENV=production webpack --config ./internals/webpack/webpack.config.js --progress", | ||
"build:stats": "cross-env BABEL_ENV=commonjs NODE_ENV=production webpack --config ./internals/webpack/webpack.config.js --progress --profile --json > dist/stats.json", | ||
"build": "npm run build:commonjs && npm run test:lib && npm run build:umd && npm run build:umd:min", | ||
"lint": "npm run lint:js", | ||
"lint:eslint": "eslint --ignore-path .gitignore --ignore-pattern **/**.min.js", | ||
"lint:js": "npm run lint:eslint -- . ", | ||
"lint:staged": "lint-staged", | ||
"test:clean": "rimraf ./coverage", | ||
"test": "mocha ./src/tests/**/*.js -R spec --timeout 2000000", | ||
"test:lib": "mocha ./lib/tests/**/*.js -R spec --timeout 2000000", | ||
"test-travis": "node ./node_modules/istanbul/lib/cli.js cover ./node_modules/mocha/bin/_mocha -- src/tests/**/*.js -R spec --timeout 2000000", | ||
"coveralls": "npm run test-travis && cat ./coverage/lcov.info | coveralls" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+ssh://git@github.com/ethjs/ethjs-filter.git" | ||
}, | ||
"dependencies": { | ||
"ethjs-contract": "0.1.5", | ||
"ethjs-filter": "0.1.5", | ||
"ethjs-provider-http": "0.1.3", | ||
"ethjs-query": "0.1.6", | ||
"ethjs-unit": "0.1.4", | ||
"ethjs-util": "0.1.3", | ||
"js-sha3": "0.5.5" | ||
}, | ||
"babel": { | ||
"plugins": [ | ||
["transform-es2015-template-literals", { "loose": true }], | ||
"transform-es2015-literals", | ||
"transform-es2015-function-name", | ||
"transform-es2015-arrow-functions", | ||
"transform-es2015-block-scoped-functions", | ||
["transform-es2015-classes", { "loose": true }], | ||
"transform-es2015-object-super", | ||
"transform-es2015-shorthand-properties", | ||
["transform-es2015-computed-properties", { "loose": true }], | ||
["transform-es2015-for-of", { "loose": true }], | ||
"transform-es2015-sticky-regex", | ||
"transform-es2015-unicode-regex", | ||
"check-es2015-constants", | ||
["transform-es2015-spread", { "loose": true }], | ||
"transform-es2015-parameters", | ||
["transform-es2015-destructuring", { "loose": true }], | ||
"transform-es2015-block-scoping", | ||
"transform-object-rest-spread", | ||
"transform-es3-member-expression-literals", | ||
"transform-es3-property-literals" | ||
], | ||
"env": { | ||
"commonjs": { | ||
"plugins": [ | ||
["transform-es2015-modules-commonjs", { "loose": true }] | ||
] | ||
} | ||
} | ||
}, | ||
"devDependencies": { | ||
"babel-cli": "^6.4.0", | ||
"babel-core": "^6.3.26", | ||
"babel-loader": "^6.2.0", | ||
"babel-plugin-transform-class-properties": "^6.4.0", | ||
"babel-plugin-transform-export-extensions": "^6.4.0", | ||
"babel-plugin-transform-object-rest-spread": "^6.3.13", | ||
"babel-preset-es2015": "^6.3.13", | ||
"babel-register": "^6.3.13", | ||
"rimraf": "^2.5.0", | ||
"webpack": "^1.12.11", | ||
"ws": "^1.0.1" | ||
"babel-cli": "6.18.0", | ||
"babel-core": "6.18.2", | ||
"babel-eslint": "7.1.0", | ||
"babel-loader": "6.2.8", | ||
"babel-plugin-check-es2015-constants": "6.8.0", | ||
"babel-plugin-transform-es2015-arrow-functions": "6.8.0", | ||
"babel-plugin-transform-es2015-block-scoped-functions": "6.8.0", | ||
"babel-plugin-transform-es2015-block-scoping": "6.18.0", | ||
"babel-plugin-transform-es2015-classes": "6.18.0", | ||
"babel-plugin-transform-es2015-computed-properties": "6.8.0", | ||
"babel-plugin-transform-es2015-destructuring": "6.19.0", | ||
"babel-plugin-transform-es2015-for-of": "6.18.0", | ||
"babel-plugin-transform-es2015-function-name": "6.9.0", | ||
"babel-plugin-transform-es2015-literals": "6.8.0", | ||
"babel-plugin-transform-es2015-modules-commonjs": "6.18.0", | ||
"babel-plugin-transform-es2015-object-super": "6.8.0", | ||
"babel-plugin-transform-es2015-parameters": "6.18.0", | ||
"babel-plugin-transform-es2015-shorthand-properties": "6.18.0", | ||
"babel-plugin-transform-es2015-spread": "6.8.0", | ||
"babel-plugin-transform-es2015-sticky-regex": "6.8.0", | ||
"babel-plugin-transform-es2015-template-literals": "6.8.0", | ||
"babel-plugin-transform-es2015-unicode-regex": "6.11.0", | ||
"babel-plugin-transform-es3-member-expression-literals": "6.5.0", | ||
"babel-plugin-transform-es3-property-literals": "6.5.0", | ||
"babel-plugin-transform-object-rest-spread": "6.19.0", | ||
"babel-register": "6.18.0", | ||
"chai": "3.5.0", | ||
"cross-env": "1.0.7", | ||
"ethjs-account": "0.1.0", | ||
"ethjs-signer": "0.1.0", | ||
"check-es3-syntax-cli": "0.1.3", | ||
"coveralls": "2.11.9", | ||
"cross-env": "1.0.7", | ||
"eslint": "2.10.1", | ||
"web3": "0.17.0-beta", | ||
"eslint-config-airbnb": "9.0.1", | ||
"eslint-import-resolver-webpack": "0.2.4", | ||
"eslint-plugin-import": "1.8.0", | ||
"eslint-plugin-jsx-a11y": "1.2.0", | ||
"eslint-plugin-react": "5.1.1", | ||
"ethereumjs-testrpc": "3.0.2", | ||
"eventsource-polyfill": "0.9.6", | ||
"istanbul": "0.4.5", | ||
"json-loader": "0.5.4", | ||
"lint-staged": "1.0.1", | ||
"mocha": "3.1.2", | ||
"pre-commit": "1.1.3", | ||
"rimraf": "2.3.4", | ||
"webpack": "2.1.0-beta.15" | ||
}, | ||
"dependencies": { | ||
"@reactivex/rxjs": "^5.0.0-beta.1", | ||
"axios": "^0.8.1", | ||
"ethereumjs-abi": "^0.4.0" | ||
} | ||
"engines": { | ||
"npm": ">=3", | ||
"node": ">=6.5.0" | ||
}, | ||
"keywords": [ | ||
"ethereum", | ||
"events", | ||
"rpc" | ||
], | ||
"author": "Nick Dodson <nick.dodson@consensys.net>", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/ethjs/ethjs-filter/issues" | ||
}, | ||
"homepage": "https://github.com/ethjs/ethjs-filter#readme", | ||
"lint-staged": { | ||
"lint:eslint": "*.js" | ||
}, | ||
"eslintConfig": { | ||
"parser": "babel-eslint", | ||
"extends": "airbnb", | ||
"env": { | ||
"node": true, | ||
"mocha": true, | ||
"es6": true | ||
}, | ||
"parserOptions": { | ||
"ecmaVersion": 6, | ||
"sourceType": "module" | ||
}, | ||
"rules": { | ||
"import/no-unresolved": 2, | ||
"comma-dangle": [ | ||
2, | ||
"always-multiline" | ||
], | ||
"indent": [ | ||
2, | ||
2, | ||
{ | ||
"SwitchCase": 1 | ||
} | ||
], | ||
"no-console": 1, | ||
"max-len": 0, | ||
"prefer-template": 2, | ||
"no-use-before-define": 0, | ||
"newline-per-chained-call": 0, | ||
"arrow-body-style": [ | ||
2, | ||
"as-needed" | ||
] | ||
} | ||
}, | ||
"pre-commit": "build" | ||
} |
151
README.md
@@ -1,39 +0,136 @@ | ||
# ethjs | ||
## ethjs | ||
A light weight Ethereum RPC interface written in ES6. RPC calls return a promise/stream. | ||
<div> | ||
<!-- Dependency Status --> | ||
<a href="https://david-dm.org/ethjs/ethjs"> | ||
<img src="https://david-dm.org/ethjs/ethjs.svg" | ||
alt="Dependency Status" /> | ||
</a> | ||
## Installation | ||
<!-- devDependency Status --> | ||
<a href="https://david-dm.org/ethjs/ethjs#info=devDependencies"> | ||
<img src="https://david-dm.org/ethjs/ethjs/dev-status.svg" alt="devDependency Status" /> | ||
</a> | ||
`npm install ethjs` | ||
<!-- Build Status --> | ||
<a href="https://travis-ci.org/ethjs/ethjs"> | ||
<img src="https://travis-ci.org/ethjs/ethjs.svg" | ||
alt="Build Status" /> | ||
</a> | ||
## Usage | ||
### Init | ||
``` | ||
import Eth from 'ethjs'; | ||
<!-- NPM Version --> | ||
<a href="https://www.npmjs.org/package/ethjs"> | ||
<img src="http://img.shields.io/npm/v/ethjs.svg" | ||
alt="NPM version" /> | ||
</a> | ||
const client = new Eth('<httpProviderUrl>'); | ||
<!-- Test Coverage --> | ||
<a href="https://coveralls.io/r/ethjs/ethjs"> | ||
<img src="https://coveralls.io/repos/github/ethjs/ethjs/badge.svg" alt="Test Coverage" /> | ||
</a> | ||
<!-- Javascript Style --> | ||
<a href="http://airbnb.io/javascript/"> | ||
<img src="https://img.shields.io/badge/code%20style-airbnb-brightgreen.svg" alt="js-airbnb-style" /> | ||
</a> | ||
</div> | ||
<br /> | ||
A highly optimised, light-weight JS utility for [Ethereum](https://www.ethereum.org/) based on [`web3.js`](https://github.com/ethereum/web3.js), but lighter, async only and using `BN.js`. | ||
Only **103 kB** minified! | ||
## Install | ||
``` | ||
### RPC methods | ||
[RPC methods](https://github.com/ethereum/wiki/wiki/JSON-RPC) exposed on client and follow function signature of RPC spec | ||
```js | ||
client.getCoinbase() | ||
.then(address => console.log(address), err => console.error(err)); | ||
npm install --save ethjs | ||
``` | ||
### Contracts | ||
Create contracts and generate an JS contract interface using the ABI. | ||
## Usage | ||
```js | ||
const contract = client.contracts.create(abi, { | ||
from: '<fromAddress>', | ||
data: contractCode, | ||
gas: 1000000, | ||
}).subscribe(res => console.log(res), err => console.error(err)); | ||
const Eth = require('ethjs'); | ||
const eth = new Eth(Eth.HttpProvider('https://ropsten.infura.io')); | ||
eth.getBlockByNumber(45300, (err, block) => { | ||
console.log(err, block); | ||
}); | ||
const abi = [{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"}]; | ||
const token = eth.contract(abi).at('0x6e0E0e02377Bc1d90E8a7c21f12BA385C2C35f78'); | ||
token.totalSupply().then((totalSupply) => { | ||
console.log(totalSupply.toString(10)); | ||
}); | ||
const etherValue = Eth.toWei(72, 'ether'); | ||
``` | ||
Contract functions can then be called | ||
```js | ||
contract.aFunctionName(10, 'an argument').subscribe(res => console.log(res), err => console.error(err)); | ||
## About | ||
A simple module for building dApps and applications that use Ethereum. | ||
Please see our complete [`user-guide`](docs/user-guide.md) for more information. | ||
## Contributing | ||
Please help better the ecosystem by submitting issues and pull requests to `ethjs`. We need all the help we can get to build the absolute best linting standards and utilities. We follow the AirBNB linting standard and the unix philosophy. | ||
## Guides | ||
You'll find more detailed information on using `ethjs` and tailoring it to your needs in our guides: | ||
- [User guide](docs/user-guide.md) - Usage, configuration, FAQ and complementary tools. | ||
- [Developer guide](docs/developer-guide.md) - Contributing to `ethjs` and writing your own code and coverage. | ||
## Help out | ||
There is always a lot of work to do, and will have many rules to maintain. So please help out in any way that you can: | ||
- Create, enhance, and debug ethjs rules (see our guide to ["Working on rules"](./github/CONTRIBUTING.md)). | ||
- Improve documentation. | ||
- Chime in on any open issue or pull request. | ||
- Open new issues about your ideas for making `ethjs` better, and pull requests to show us how your idea works. | ||
- Add new tests to *absolutely anything*. | ||
- Create or contribute to ecosystem tools. | ||
- Spread the word! | ||
Please consult our [Code of Conduct](CODE_OF_CONDUCT.md) docs before helping out. | ||
We communicate via [issues](https://github.com/ethjs/ethjs/issues) and [pull requests](https://github.com/ethjs/ethjs/pulls). | ||
## Important documents | ||
- [Changelog](CHANGELOG.md) | ||
- [Code of Conduct](CODE_OF_CONDUCT.md) | ||
- [License](https://raw.githubusercontent.com/ethjs/ethjs/master/LICENSE) | ||
## Licence | ||
This project is licensed under the MIT license, Copyright (c) 2016 Nick Dodson. For more information see LICENSE.md. | ||
``` | ||
Events can be subscribed to | ||
```js | ||
contract.AnEvent().subscribe(res => console.log(res), err => console.error(err)); | ||
The MIT License | ||
Copyright (c) 2016 Nick Dodson. nickdodson.com | ||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. | ||
``` |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
666075
12
8565
1
1
137
1
7
48
2
+ Addedethjs-contract@0.1.5
+ Addedethjs-filter@0.1.5
+ Addedethjs-provider-http@0.1.3
+ Addedethjs-query@0.1.6
+ Addedethjs-unit@0.1.4
+ Addedethjs-util@0.1.3
+ Addedjs-sha3@0.5.5
+ Addedbn.js@4.11.6(transitive)
+ Addedethjs-abi@0.1.5(transitive)
+ Addedethjs-contract@0.1.5(transitive)
+ Addedethjs-filter@0.1.5(transitive)
+ Addedethjs-format@0.1.5(transitive)
+ Addedethjs-provider-http@0.1.3(transitive)
+ Addedethjs-query@0.1.6(transitive)
+ Addedethjs-schema@0.1.4(transitive)
+ Addedethjs-unit@0.1.4(transitive)
+ Addedethjs-util@0.1.3(transitive)
+ Addedis-hex-prefixed@1.0.0(transitive)
+ Addedjs-sha3@0.5.5(transitive)
+ Addednumber-to-bn@1.4.0(transitive)
+ Addedstrip-hex-prefix@1.0.0(transitive)
+ Addedxhr2@0.1.3(transitive)
- Removed@reactivex/rxjs@^5.0.0-beta.1
- Removedaxios@^0.8.1
- Removedethereumjs-abi@^0.4.0
- Removed@reactivex/rxjs@5.5.12(transitive)
- Removedaxios@0.8.1(transitive)
- Removedbindings@1.5.0(transitive)
- Removedbluebird@3.7.2(transitive)
- Removedbn.js@4.12.05.2.1(transitive)
- Removedbrorand@1.1.0(transitive)
- Removedbrowserify-sha3@0.0.1(transitive)
- Removeddebug@2.6.9(transitive)
- Removedelliptic@6.5.7(transitive)
- Removedes6-shim@0.33.13(transitive)
- Removedethereumjs-abi@0.4.0(transitive)
- Removedethereumjs-util@2.6.0(transitive)
- Removedfile-uri-to-path@1.0.0(transitive)
- Removedfollow-redirects@0.0.7(transitive)
- Removedhash.js@1.1.7(transitive)
- Removedhmac-drbg@1.0.1(transitive)
- Removedinherits@2.0.4(transitive)
- Removedjs-sha3@0.3.1(transitive)
- Removedminimalistic-assert@1.0.1(transitive)
- Removedminimalistic-crypto-utils@1.0.1(transitive)
- Removedms@2.0.0(transitive)
- Removednan@2.13.22.20.0(transitive)
- Removedobject-assign@4.1.1(transitive)
- Removedrlp@2.2.7(transitive)
- Removedsecp256k1@2.0.10(transitive)
- Removedsha3@1.2.6(transitive)
- Removedstream-consume@0.1.1(transitive)
- Removedsymbol-observable@1.0.1(transitive)
- Removedutf8@2.1.1(transitive)