Socket
Socket
Sign inDemoInstall

web3-eth-contract

Package Overview
Dependencies
Maintainers
2
Versions
440
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

web3-eth-contract - npm Package Compare versions

Comparing version 1.0.0-beta.55 to 1.0.0

src/index.js

47

package.json
{
"name": "web3-eth-contract",
"namespace": "ethereum",
"version": "1.0.0-beta.55",
"version": "1.0.0",
"description": "Web3 module to interact with Ethereum smart contracts.",
"repository": "https://github.com/ethereum/web3.js/tree/1.0/packages/web3-eth-contract",
"repository": "https://github.com/ethereum/web3.js/tree/1.x/packages/web3-eth-contract",
"license": "LGPL-3.0",
"main": "dist/web3-eth-contract.cjs.js",
"module": "dist/web3-eth-contract.esm.js",
"browser": "dist/web3-eth-contract.umd.js",
"types": "types/index.d.ts",
"scripts": {
"build": "rollup -c",
"dev": "rollup -c -w",
"test": "jest",
"dtslint": "dtslint types --onlyTestTsNext"
"engines": {
"node": ">=8.0.0 <=11.15.0"
},
"main": "src/index.js",
"dependencies": {
"@babel/runtime": "^7.3.1",
"@types/bn.js": "^4.11.4",
"lodash": "^4.17.11",
"web3-core": "1.0.0-beta.55",
"web3-core-helpers": "1.0.0-beta.55",
"web3-core-method": "1.0.0-beta.55",
"web3-core-subscriptions": "1.0.0-beta.55",
"web3-eth-abi": "1.0.0-beta.55",
"web3-eth-accounts": "1.0.0-beta.55",
"web3-providers": "1.0.0-beta.55",
"web3-utils": "1.0.0-beta.55"
},
"devDependencies": {
"definitelytyped-header-parser": "^1.0.1",
"dtslint": "0.4.2"
},
"files": [
"dist",
"types/index.d.ts"
],
"gitHead": "37347fd46344f45d1c57104920bdda0779f0d51c"
"underscore": "1.9.1",
"web3-core": "1.0.0",
"web3-core-helpers": "1.0.0",
"web3-core-method": "1.0.0",
"web3-core-promievent": "1.0.0",
"web3-core-subscriptions": "1.0.0",
"web3-eth-abi": "1.0.0",
"web3-utils": "1.0.0"
}
}
# web3-eth-contract
This is a sub module of [web3.js][repo]
This is a sub package of [web3.js][repo]
This is the contract module to be used in the `web3-eth` module.
This is the contract package to be used in the `web3-eth` package.
Please read the [documentation][docs] for more.

@@ -10,2 +10,4 @@

### Node.js
```bash

@@ -15,20 +17,34 @@ npm install web3-eth-contract

### In the Browser
Build running the following in the [web3.js][repo] repository:
```bash
npm run-script build-all
```
Then include `dist/web3-eth-contract.js` in your html file.
This will expose the `Web3EthContract` object on the window object.
## Usage
```js
import {Contract} from 'web3-eth-contract';
// in node.js
var Web3EthContract = require('web3-eth-contract');
new Contract(
'http://127.0.0.1:4546',
abi,
address,
options
);
// set provider for all later instances to use
Web3EthContract.setProvider('ws://localhost:8546');
var contract = new Web3EthContract(jsonInterface, address);
contract.methods.somFunc().send({from: ....})
.on('receipt', function(){
...
});
```
## Types
All the typescript typings are placed in the types folder.
[docs]: http://web3js.readthedocs.io/en/1.0/
[repo]: https://github.com/ethereum/web3.js
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