v3.7.7: minor docs improvements. support for recvWindow for ws client
This commit is contained in:
@@ -98,6 +98,8 @@ export interface WSClientConfigurableOptions {
|
||||
pongTimeout?: number;
|
||||
pingInterval?: number;
|
||||
reconnectTimeout?: number;
|
||||
/** Override the recv window for authenticating over websockets (default: 5000 ms) */
|
||||
recvWindow?: number;
|
||||
restOptions?: RestClientOptions;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
requestOptions?: any;
|
||||
|
||||
@@ -123,6 +123,7 @@ export class WebsocketClient extends EventEmitter {
|
||||
pongTimeout: 1000,
|
||||
pingInterval: 10000,
|
||||
reconnectTimeout: 500,
|
||||
recvWindow: 5000,
|
||||
fetchTimeOffsetBeforeAuth: false,
|
||||
...options,
|
||||
};
|
||||
@@ -739,7 +740,9 @@ export class WebsocketClient extends EventEmitter {
|
||||
? (await this.restClient?.fetchTimeOffset()) || 0
|
||||
: 0;
|
||||
|
||||
const signatureExpiresAt = Date.now() + timeOffset + 5000;
|
||||
const recvWindow = this.options.recvWindow || 5000;
|
||||
|
||||
const signatureExpiresAt = Date.now() + timeOffset + recvWindow;
|
||||
|
||||
const signature = await signMessage(
|
||||
'GET/realtime' + signatureExpiresAt,
|
||||
|
||||
Reference in New Issue
Block a user