From 0b3fdd6fee91286ac0c6267b06f2631df1c7e77f Mon Sep 17 00:00:00 2001 From: Gareth Kirwan Date: Fri, 10 Jan 2025 15:28:42 +0700 Subject: [PATCH] Bitfinex: Rename channel consts --- exchanges/bitfinex/bitfinex_websocket.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/exchanges/bitfinex/bitfinex_websocket.go b/exchanges/bitfinex/bitfinex_websocket.go index 294b598fcde..811bd77289e 100644 --- a/exchanges/bitfinex/bitfinex_websocket.go +++ b/exchanges/bitfinex/bitfinex_websocket.go @@ -82,10 +82,10 @@ const ( wsFundingOfferUpdateRequest = wsFundingOfferUpdate + wsRequest wsFundingOfferCancelRequest = wsFundingOfferCancel + wsRequest wsCancelMultipleOrders = "oc_multi" - wsBook = "book" - wsCandles = "candles" - wsTicker = "ticker" - wsTrades = "trades" + wsBookChannel = "book" + wsCandlesChannel = "candles" + wsTickerChannel = "ticker" + wsTradesChannel = "trades" wsError = "error" wsEventSubscribed = "subscribed" wsEventUnsubscribed = "unsubscribed" @@ -116,10 +116,10 @@ var checksumStore = make(map[int]*checksum) var cMtx sync.Mutex var subscriptionNames = map[string]string{ - subscription.TickerChannel: wsTicker, - subscription.OrderbookChannel: wsBook, - subscription.CandlesChannel: wsCandles, - subscription.AllTradesChannel: wsTrades, + subscription.TickerChannel: wsTickerChannel, + subscription.OrderbookChannel: wsBookChannel, + subscription.CandlesChannel: wsCandlesChannel, + subscription.AllTradesChannel: wsTradesChannel, } // WsConnect starts a new websocket connection @@ -1767,7 +1767,7 @@ func (b *Bitfinex) subscribeToChan(subs subscription.List) error { } // subId is a single round-trip identifier that provides linking sub requests to chanIDs - // Although docs only mention subId for wsBook, it works for all chans + // Although docs only mention subId for wsBookChannel, it works for all chans subID := strconv.FormatInt(b.Websocket.Conn.GenerateMessageID(false), 10) req["subId"] = subID @@ -2237,7 +2237,7 @@ func subToMap(s *subscription.Subscription, a asset.Item, p currency.Pair) map[s pairFmt.Delimiter = ":" } symbol := p.Format(pairFmt).String() - if c == wsCandles { + if c == wsCandlesChannel { req["key"] = "trade:" + s.Interval.Short() + ":" + prefix + symbol + fundingPeriod } else { req["symbol"] = prefix + symbol