Socket
Socket
Sign inDemoInstall

ethjs

Package Overview
Dependencies
Maintainers
2
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ethjs - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

4

package.json
{
"name": "ethjs",
"version": "0.1.1",
"description": "A light-weight highly optimised JS utility for Ethereum",
"version": "0.1.2",
"description": "A light-weight, highly optimised JS utility for Ethereum",
"main": "lib/index.js",

@@ -6,0 +6,0 @@ "files": [

@@ -54,17 +54,26 @@ ## ethjs

const Eth = require('ethjs');
const eth = new Eth(Eth.HttpProvider('https://ropsten.infura.io'));
const eth = new Eth(new Eth.HttpProvider('https://ropsten.infura.io'));
eth.getBlockByNumber(45300, (err, block) => {
console.log(err, block);
// result null { ...block data... }
});
const abi = [{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"}];
const etherValue = Eth.toWei(72, 'ether');
const token = eth.contract(abi).at('0x6e0E0e02377Bc1d90E8a7c21f12BA385C2C35f78');
// result <BN ...>
const tokenABI = [{
"constant": true,
"inputs": [],
"name": "totalSupply",
"outputs":[{"name": "","type": "uint256"}],
"payable": false,
"type": "function",
}];
const token = eth.contract(tokenABI).at('0x6e0E0e02377Bc1d90E8a7c21f12BA385C2C35f78');
token.totalSupply().then((totalSupply) => {
console.log(totalSupply.toString(10));
// result <BN ...> 4500000
});
const etherValue = Eth.toWei(72, 'ether');
```

@@ -88,2 +97,3 @@

- [Developer guide](docs/developer-guide.md) - Contributing to `ethjs` and writing your own code and coverage.
- [Examples](http://github.com/ethjs/examples) - Examples of `ethjs` in use.

@@ -94,3 +104,3 @@ ## Help out

- Create, enhance, and debug ethjs rules (see our guide to ["Working on rules"](./github/CONTRIBUTING.md)).
- Create, enhance, and debug ethjs rules (see our guide to ["Working on rules"](./.github/CONTRIBUTING.md)).
- Improve documentation.

@@ -113,2 +123,21 @@ - Chime in on any open issue or pull request.

## Our Relationship with Ethereum & EthereumJS
We would like to mention that we are not in any way affiliated with the Ethereum Foundation. However, we love the work they do and work with them often to make Ethereum great! Our aim is to support the Ethereum ecosystem with a policy of diversity, modularity, simplicity, transparency, clarity, optimization and extensibility.
Many of our modules use code from `web3.js` and the `ethereumjs-` repositories. We thank the authors where we can in the relevant repositories.
## Special Thanks
`ethjs` was built by a strong community of Ethereum developers. A special thanks to:
- [Fabian Vogelsteller](https://twitter.com/feindura?lang=en) - for his work on `Mist` and `web3.js`
- [Tim Coulter](https://github.com/tcoulter) - for his work on `TestRPC` and `Truffle`
- [Aaron Davis](https://github.com/kumavis) - for his guidence and work on `MetaMask` and `ethereumjs`
- [Richard Moore](https://github.com/ricmoo) - for his work on `ethers-io` and `ethers-wallet` from which so much of `ethjs` is build from
- [Karl Floersch](https://twitter.com/karl_dot_tech?lang=en) - for his guidence and support
- [Martin B.](https://github.com/wanderer) - for his work on `ethereumjs`
- [Alex Beregszaszi](https://github.com/axic) - for his work on `ethereumjs`
- [Vitalik Buterin](https://twitter.com/VitalikButerin) - for creating `Ethereum`
## Licence

@@ -115,0 +144,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc