diff --git a/exchanges/bitfinex/bitfinex_websocket.go b/exchanges/bitfinex/bitfinex_websocket.go index dc57d0b7d01..f33e6421d97 100644 --- a/exchanges/bitfinex/bitfinex_websocket.go +++ b/exchanges/bitfinex/bitfinex_websocket.go @@ -438,11 +438,11 @@ func (b *Bitfinex) handleWSEvent(respRaw []byte) error { return fmt.Errorf("%v channel subscribe listener not found", subID) } case wsEventUnsubscribed: - chanID, err := jsonparser.GetInt(respRaw, "chanId") + chanID, err := jsonparser.GetUnsafeString(respRaw, "chanId") if err != nil { return fmt.Errorf("error parsing WS unsubscribed event chanId: %w from message: %s", err, respRaw) } - if !b.Websocket.Match.IncomingWithData("unsubscribe:"+strconv.Itoa(int(chanID)), respRaw) { + if !b.Websocket.Match.IncomingWithData("unsubscribe:"+chanID, respRaw) { return fmt.Errorf("%v channel unsubscribe listener not found", chanID) } case wsEventError: @@ -450,8 +450,8 @@ func (b *Bitfinex) handleWSEvent(respRaw []byte) error { if !b.Websocket.Match.IncomingWithData("subscribe:"+subID, respRaw) { return fmt.Errorf("%v channel subscribe listener not found", subID) } - } else if chanID, err := jsonparser.GetInt(respRaw, "chanId"); err == nil { - if !b.Websocket.Match.IncomingWithData("unsubscribe:"+strconv.Itoa(int(chanID)), respRaw) { + } else if chanID, err := jsonparser.GetUnsafeString(respRaw, "chanId"); err == nil { + if !b.Websocket.Match.IncomingWithData("unsubscribe:"+chanID, respRaw) { return fmt.Errorf("%v channel unsubscribe listener not found", chanID) } } else {