Skip to content

Commit

Permalink
supportsSubscriptions method added to providers (#3116)
Browse files Browse the repository at this point in the history
* supportsSubscriptions method added to providers
  • Loading branch information
nivida committed Oct 8, 2019
1 parent 8840209 commit 9a13b32
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ Released with 1.0.0-beta.37 code base.

- localStorage support detection added (#3031)
- getNetworkType method extended with Görli testnet (#3095)
- supportsSubscriptions method added to providers (#3116)

### Fixed

Expand Down
9 changes: 9 additions & 0 deletions packages/web3-providers-http/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,5 +120,14 @@ HttpProvider.prototype.disconnect = function () {
//NO OP
};

/**
* Returns the desired boolean.
*
* @method supportsSubscriptions
* @returns {boolean}
*/
HttpProvider.prototype.supportsSubscriptions = function () {
return false;
};

module.exports = HttpProvider;
10 changes: 10 additions & 0 deletions packages/web3-providers-ipc/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -311,5 +311,15 @@ IpcProvider.prototype.reset = function () {
this.addDefaultEvents();
};

/**
* Returns the desired boolean.
*
* @method supportsSubscriptions
* @returns {boolean}
*/
IpcProvider.prototype.supportsSubscriptions = function () {
return true;
};

module.exports = IpcProvider;

10 changes: 10 additions & 0 deletions packages/web3-providers-ws/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -404,4 +404,14 @@ WebsocketProvider.prototype.disconnect = function () {
}
};

/**
* Returns the desired boolean.
*
* @method supportsSubscriptions
* @returns {boolean}
*/
WebsocketProvider.prototype.supportsSubscriptions = function () {
return true;
};

module.exports = WebsocketProvider;

0 comments on commit 9a13b32

Please sign in to comment.