Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.
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
6 changes: 5 additions & 1 deletion docs/include_package-core.rst
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,14 @@ Configuration
authorization: 'Basic username:password'
},

// Useful if requests result are large
clientConfig: {
// Useful if requests are large
maxReceivedFrameSize: 100000000, // bytes - default: 1MiB
maxReceivedMessageSize: 100000000, // bytes - default: 8MiB

// Useful to keep a connection alive
keepalive: true,
keepaliveInterval: 60000 // ms
},

// Enable auto reconnection
Expand Down
2 changes: 1 addition & 1 deletion packages/web3-core-helpers/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ export interface WebsocketProviderOptions {
reconnectDelay?: number;
headers?: any;
protocol?: string;
clientConfig?: string;
clientConfig?: object;
requestOptions?: any;
origin?: string;
reconnect?: ReconnectOptions;
Expand Down
12 changes: 7 additions & 5 deletions packages/web3-providers-ws/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,14 @@ var options = {
authorization: 'Basic username:password'
},

// Useful if requests are large
clientConfig: {
// Useful if requests are large
maxReceivedFrameSize: 100000000, // bytes - default: 1MiB
maxReceivedMessageSize: 100000000, // bytes - default: 8MiB

// Useful to keep a connection alive
keepalive: true,
keepaliveInterval: 60000 // ms
},

// Enable auto reconnection
Expand All @@ -57,12 +61,10 @@ var options = {
};

var ws = new Web3WsProvider('ws://localhost:8546', options);

(Additional client config options can be found [here][1])

[1]: https://github.com/web3-js/WebSocket-Node/blob/polyfill/globalThis/docs/WebSocketClient.md
```

Additional client config options can be found [here](https://github.com/theturtle32/WebSocket-Node/blob/v1.0.31/docs/WebSocketClient.md#client-config-options).

## Types

All the TypeScript typings are placed in the `types` folder.
Expand Down