mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-07 15:11:03 +00:00
Exchanges: Add config variable to set bypassing of orderbook verification by exchange (#614)
* Exchanges: Add config variable to set bypassing of orderbook verification * Exchanges: Consolidate orderbook variables into config struct * Exchanges: Addr nit; set verification bypass on websocket book implementations
This commit is contained in:
@@ -312,6 +312,7 @@ func (c *CoinbasePro) ProcessSnapshot(snapshot *WebsocketOrderbookSnapshot) erro
|
||||
base.AssetType = asset.Spot
|
||||
base.Pair = pair
|
||||
base.ExchangeName = c.Name
|
||||
base.VerificationBypass = c.OrderbookVerificationBypass
|
||||
|
||||
return c.Websocket.Orderbook.LoadSnapshot(&base)
|
||||
}
|
||||
|
||||
@@ -166,8 +166,8 @@ func (c *CoinbasePro) Setup(exch *config.ExchangeConfig) error {
|
||||
UnSubscriber: c.Unsubscribe,
|
||||
GenerateSubscriptions: c.GenerateDefaultSubscriptions,
|
||||
Features: &c.Features.Supports.WebsocketCapabilities,
|
||||
OrderbookBufferLimit: exch.WebsocketOrderbookBufferLimit,
|
||||
BufferEnabled: exch.WebsocketOrderbookBufferEnabled,
|
||||
OrderbookBufferLimit: exch.OrderbookConfig.WebsocketBufferLimit,
|
||||
BufferEnabled: exch.OrderbookConfig.WebsocketBufferEnabled,
|
||||
SortBuffer: true,
|
||||
})
|
||||
if err != nil {
|
||||
@@ -400,7 +400,12 @@ func (c *CoinbasePro) FetchOrderbook(p currency.Pair, assetType asset.Item) (*or
|
||||
|
||||
// UpdateOrderbook updates and returns the orderbook for a currency pair
|
||||
func (c *CoinbasePro) UpdateOrderbook(p currency.Pair, assetType asset.Item) (*orderbook.Base, error) {
|
||||
book := &orderbook.Base{ExchangeName: c.Name, Pair: p, AssetType: assetType}
|
||||
book := &orderbook.Base{
|
||||
ExchangeName: c.Name,
|
||||
Pair: p,
|
||||
AssetType: assetType,
|
||||
VerificationBypass: c.OrderbookVerificationBypass,
|
||||
}
|
||||
fpair, err := c.FormatExchangeCurrency(p, assetType)
|
||||
if err != nil {
|
||||
return book, err
|
||||
|
||||
Reference in New Issue
Block a user