Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

supportsSubscriptions method added to providers #3116

Merged
merged 3 commits into from
Oct 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;