diff --git a/exchanges/bitfinex/bitfinex_types.go b/exchanges/bitfinex/bitfinex_types.go index 08e925226ea..0ab1bb50a79 100644 --- a/exchanges/bitfinex/bitfinex_types.go +++ b/exchanges/bitfinex/bitfinex_types.go @@ -663,6 +663,8 @@ const ( wsEventUnsubscribed = "unsubscribed" wsEventAuth = "auth" wsEventError = "error" + wsEventConf = "conf" + wsEventInfo = "info" ) // WsAuthRequest container for WS auth request diff --git a/exchanges/bitfinex/bitfinex_websocket.go b/exchanges/bitfinex/bitfinex_websocket.go index 4751dec0966..1f18e0f2544 100644 --- a/exchanges/bitfinex/bitfinex_websocket.go +++ b/exchanges/bitfinex/bitfinex_websocket.go @@ -476,6 +476,17 @@ func (b *Bitfinex) handleWSEvent(respRaw []byte) error { } return fmt.Errorf("WS auth subscription error; Status: %s Error Code: %d", status, errCode) } + case wsEventInfo: + // Nothing to do with info for now. + // version or platform.status might be useful in the future. + case wsEventConf: + status, err := jsonparser.GetUnsafeString(respRaw, "status") + if err != nil { + return fmt.Errorf("error parsing WS configure channel event status: %w from message: %s", err, respRaw) + } + if status != "OK" { + return fmt.Errorf("WS configure channel error; Status: %s", status) + } default: return fmt.Errorf("unknown WS event msg: %s", respRaw) }