From 334b3bf0ccd27125b19ce8ab9a769862fff42bfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Rasc=C3=A3o?= Date: Mon, 11 Oct 2021 01:39:09 +0100 Subject: [PATCH] ftx: fix websocket authentication of subaccounts (#801) --- exchanges/ftx/ftx_types.go | 7 ++++--- exchanges/ftx/ftx_websocket.go | 8 +++++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/exchanges/ftx/ftx_types.go b/exchanges/ftx/ftx_types.go index 718714d7..ecd061ec 100644 --- a/exchanges/ftx/ftx_types.go +++ b/exchanges/ftx/ftx_types.go @@ -553,9 +553,10 @@ type OptionFillsData struct { // AuthenticationData stores authentication variables required type AuthenticationData struct { - Key string `json:"key"` - Sign string `json:"sign"` - Time int64 `json:"time"` + Key string `json:"key"` + Sign string `json:"sign"` + Time int64 `json:"time"` + SubAccount string `json:"subaccount,omitempty"` } // Authenticate stores authentication variables required diff --git a/exchanges/ftx/ftx_websocket.go b/exchanges/ftx/ftx_websocket.go index f84d6c8c..601ce1a0 100644 --- a/exchanges/ftx/ftx_websocket.go +++ b/exchanges/ftx/ftx_websocket.go @@ -90,11 +90,13 @@ func (f *FTX) WsAuth() error { sign := crypto.HexEncodeToString(hmac) req := Authenticate{Operation: "login", Args: AuthenticationData{ - Key: f.API.Credentials.Key, - Sign: sign, - Time: intNonce, + Key: f.API.Credentials.Key, + Sign: sign, + Time: intNonce, + SubAccount: f.API.Credentials.Subaccount, }, } + return f.Websocket.Conn.SendJSONMessage(req) }