Skip to content

Commit

Permalink
Merge pull request #2983 from AsyncLegs/request-options-types
Browse files Browse the repository at this point in the history
WebsocketProviderOptions has been adjusted
  • Loading branch information
nivida committed Aug 2, 2019
2 parents 77441bc + a4f07a1 commit 258acd0
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

- Length check of the PK added to the ``fromPrivateKey`` method of the ``Account`` model (#2928)
- Changed event added to the ``Contract`` events (#2960)
- WebsocketProvider options extended with ``requestOptions`` (#2938)
- ``changed`` listener added to Contract event subscriptions (#2960)

### Changed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export default class ProvidersModuleFactory {
headers.authorization = `Basic ${authToken}`;
}

connection = new W3CWebsocket(url, options.protocol, null, headers, null, options.clientConfig);
connection = new W3CWebsocket(url, options.protocol, null, headers, options.requestOptions, options.clientConfig);
} else {
connection = new window.WebSocket(url, options.protocol);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ describe('ProvidersModuleFactoryTest', () => {
expect(
providersModuleFactory.createWebsocketProvider('ws://username:password@hallo:5544', {
protocol: 'string',
clientConfig: 'string'
clientConfig: 'string',
requestOptions: null,
})
).toBeInstanceOf(WebsocketProvider);

Expand Down
1 change: 1 addition & 0 deletions packages/web3-providers/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,4 +180,5 @@ export interface WebsocketProviderOptions {
headers?: {};
protocol?: string;
clientConfig?: string;
requestOptions?: object
}

0 comments on commit 258acd0

Please sign in to comment.