mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-04 15:10:54 +00:00
exchanges/websocket: Expose Trades/Fills feed through data channel (#814)
* Expose trade feed websocket exchange data through data channel Most relevant to applications that import GCT as a lib, this allows them to (through configuration, disabled by default) receive trade data through the data channel similarly to the orderbook feed. * exchanges: allow exposure of trade websocket feed through data channel * Expose fill feed websocket abstracted exchange data through data channel * exchanges: allow exposure of fill websocket feed through data channel
This commit is contained in:
@@ -8,10 +8,12 @@ import (
|
||||
"github.com/thrasher-corp/gocryptotrader/config"
|
||||
"github.com/thrasher-corp/gocryptotrader/currency"
|
||||
"github.com/thrasher-corp/gocryptotrader/exchanges/account"
|
||||
"github.com/thrasher-corp/gocryptotrader/exchanges/fill"
|
||||
"github.com/thrasher-corp/gocryptotrader/exchanges/order"
|
||||
"github.com/thrasher-corp/gocryptotrader/exchanges/orderbook"
|
||||
"github.com/thrasher-corp/gocryptotrader/exchanges/stream"
|
||||
"github.com/thrasher-corp/gocryptotrader/exchanges/ticker"
|
||||
"github.com/thrasher-corp/gocryptotrader/exchanges/trade"
|
||||
"github.com/thrasher-corp/gocryptotrader/log"
|
||||
)
|
||||
|
||||
@@ -245,6 +247,14 @@ func (m *websocketRoutineManager) WebsocketDataHandler(exchName string, data int
|
||||
if m.verbose {
|
||||
m.printAccountHoldingsChangeSummary(d)
|
||||
}
|
||||
case []trade.Data:
|
||||
if m.verbose {
|
||||
log.Infof(log.Trade, "%+v", d)
|
||||
}
|
||||
case []fill.Data:
|
||||
if m.verbose {
|
||||
log.Infof(log.Fill, "%+v", d)
|
||||
}
|
||||
default:
|
||||
if m.verbose {
|
||||
log.Warnf(log.WebsocketMgr,
|
||||
|
||||
Reference in New Issue
Block a user