Skip to content

Commit

Permalink
Merge pull request #7 from tiagosiebler/fixws
Browse files Browse the repository at this point in the history
Fix ws auth when subaccounts are used
  • Loading branch information
tiagosiebler authored Apr 29, 2021
2 parents 6d57ba5 + 996dad4 commit 8f9f648
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ftx-api",
"version": "1.0.3",
"version": "1.0.4",
"description": "Node.js connector for FTX's REST APIs and WebSockets",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand Down
3 changes: 2 additions & 1 deletion src/websocket-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ export class WebsocketClient extends EventEmitter {
}

private requestTryAuthenticate(wsKey: string) {
const { key, secret } = this.options;
const { key, secret, subAccountName } = this.options;
if (!key || !secret) {
this.logger.debug(`Connection "${wsKey}" will remain unauthenticated due to missing key/secret`);
return;
Expand All @@ -171,6 +171,7 @@ export class WebsocketClient extends EventEmitter {
key,
signWsAuthenticate(timestamp, secret),
timestamp,
subAccountName,
);
this.tryWsSend(wsKey, JSON.stringify(authMsg));
}
Expand Down

0 comments on commit 8f9f648

Please sign in to comment.