1.3.13420 • Published 3 years ago
xdc3-providers-ws v1.3.13420
xdc3-providers-ws
This is a websocket provider sub-package for xdc3.
Please read the documentation for more.
Installation
Node.js
npm install xdc3-providers-ws
Usage
const Web3WsProvider = require('xdc3-providers-ws');
const options = {
timeout: 30000, // ms
// Useful for credentialed urls, e.g: ws://username:password@localhost:8546
headers: {
authorization: 'Basic username:password'
},
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
reconnect: {
auto: true,
delay: 5000, // ms
maxAttempts: 5,
onTimeout: false
}
};
const ws = new Web3WsProvider('ws://localhost:8546', options);
Additional client config options can be found here.
Types
All the TypeScript typings are placed in the types
folder.
1.3.13420
3 years ago
1.3.13414
3 years ago
1.3.13416
3 years ago
1.2.136
3 years ago
1.2.135
3 years ago
1.3.13409
3 years ago
1.3.13408
3 years ago
1.3.134
3 years ago
1.3.13412
3 years ago
1.3.13401
3 years ago
1.3.1-alpha.1
3 years ago
1.3.133
3 years ago
1.3.2-alpha.0
3 years ago
1.0.0-beta.36
5 years ago