Skip to content

Commit

Permalink
Merge branch '1.0' into ens-documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
nivida committed Aug 13, 2018
2 parents 0d0b100 + 7a034a1 commit e99e562
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 513 deletions.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,25 @@ web3.eth.getAccounts()
.then(console.log);
```

### Usage with TypeScript

Type definitions are maintained at [DefinitelyTyped](https://github.com/DefinitelyTyped/DefinitelyTyped) by others. You can install them with

```bash
npm install --dev @types/web3.js
```

You might need to install type definitions for `bignumber.js` and `lodash` too.

And then use `web3.js` as follows:

```typescript
import Web3 = require("web3"); // Note the special syntax! Copy this line when in doubt!
const web3 = new Web3("ws://localhost:8546");
```

**Please note:** We do not support TypeScript ourselves. If you have any issue with TypeScript and `web3.js` do not create an issue here. Go over to DefinitelyTyped and do it there.

## Documentation

Documentation can be found at [read the docs][docs]
Expand Down
2 changes: 1 addition & 1 deletion docs/web3-utils.rst
Original file line number Diff line number Diff line change
Expand Up @@ -978,7 +978,7 @@ Parameters
----------

1. ``number`` - ``String|Number|BN``: The value.
1. ``unit`` - ``String`` (optional, defaults to ``"ether"``): The ether to convert from. Possible units are:
2. ``unit`` - ``String`` (optional, defaults to ``"ether"``): The ether to convert from. Possible units are:
- ``noether``: '0'
- ``wei``: '1'
- ``kwei``: '1000'
Expand Down
2 changes: 1 addition & 1 deletion packages/web3-providers-ws/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ var WebsocketProvider = function WebsocketProvider(url, options) {
}

// notification
if(!id && result.method.indexOf('_subscription') !== -1) {
if(!id && result && result.method && result.method.indexOf('_subscription') !== -1) {
_this.notificationCallbacks.forEach(function(callback){
if(_.isFunction(callback))
callback(result);
Expand Down
27 changes: 0 additions & 27 deletions packages/web3/index.d.ts

This file was deleted.

3 changes: 0 additions & 3 deletions packages/web3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"repository": "https://github.com/ethereum/web3.js/tree/master/packages/web3",
"license": "LGPL-3.0",
"main": "src/index.js",
"types": "index.d.ts",
"bugs": {
"url": "https://github.com/ethereum/web3.js/issues"
},
Expand Down Expand Up @@ -43,8 +42,6 @@
}
],
"dependencies": {
"@types/underscore": "^1.8.0",
"@types/bignumber.js": "^4.0.2",
"web3-bzz": "1.0.0-beta.35",
"web3-core": "1.0.0-beta.35",
"web3-eth": "1.0.0-beta.35",
Expand Down
Loading

0 comments on commit e99e562

Please sign in to comment.