Skip to content

Commit

Permalink
supportsSubscriptions method added to providers (web3#3116)
Browse files Browse the repository at this point in the history
* supportsSubscriptions method added to providers
  • Loading branch information
nivida authored and nachomazzara committed Jun 4, 2020
1 parent 1c8a4c8 commit 6b593d8
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,6 +120,15 @@ 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 6b593d8

Please sign in to comment.