mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-08 15:11:07 +00:00
Periodic available pairs update for manual exchanges
This commit is contained in:
@@ -16,6 +16,7 @@ import (
|
||||
"github.com/thrasher-/gocryptotrader/config"
|
||||
exchange "github.com/thrasher-/gocryptotrader/exchanges"
|
||||
"github.com/thrasher-/gocryptotrader/exchanges/request"
|
||||
"github.com/thrasher-/gocryptotrader/exchanges/ticker"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -114,6 +115,7 @@ func (o *OKEX) SetDefaults() {
|
||||
common.NewHTTPClientWithTimeout(exchange.DefaultHTTPTimeout))
|
||||
o.APIUrlDefault = apiURL
|
||||
o.APIUrl = o.APIUrlDefault
|
||||
o.AssetTypes = []string{ticker.Spot}
|
||||
}
|
||||
|
||||
// Setup method sets current configuration details if enabled
|
||||
|
||||
@@ -40,10 +40,6 @@ func (o *OKEX) UpdateTicker(p pair.CurrencyPair, assetType string) (ticker.Price
|
||||
var tickerPrice ticker.Price
|
||||
|
||||
if assetType != ticker.Spot {
|
||||
if p.SecondCurrency.String() == common.StringToLower("USDT") {
|
||||
p.SecondCurrency = "usd"
|
||||
currency = exchange.FormatExchangeCurrency(o.Name, p).String()
|
||||
}
|
||||
tick, err := o.GetContractPrice(currency, assetType)
|
||||
if err != nil {
|
||||
return tickerPrice, err
|
||||
@@ -58,11 +54,6 @@ func (o *OKEX) UpdateTicker(p pair.CurrencyPair, assetType string) (ticker.Price
|
||||
tickerPrice.High = tick.Ticker.High
|
||||
ticker.ProcessTicker(o.GetName(), p, tickerPrice, assetType)
|
||||
} else {
|
||||
if p.SecondCurrency.String() == common.StringToLower("USD") {
|
||||
p.SecondCurrency = "usdt"
|
||||
currency = exchange.FormatExchangeCurrency(o.Name, p).String()
|
||||
}
|
||||
|
||||
tick, err := o.GetSpotTicker(currency)
|
||||
if err != nil {
|
||||
return tickerPrice, err
|
||||
@@ -104,10 +95,6 @@ func (o *OKEX) UpdateOrderbook(p pair.CurrencyPair, assetType string) (orderbook
|
||||
currency := exchange.FormatExchangeCurrency(o.Name, p).String()
|
||||
|
||||
if assetType != ticker.Spot {
|
||||
if p.SecondCurrency.String() == common.StringToLower("USDT") {
|
||||
p.SecondCurrency = "usd"
|
||||
currency = exchange.FormatExchangeCurrency(o.Name, p).String()
|
||||
}
|
||||
orderbookNew, err := o.GetContractMarketDepth(currency, assetType)
|
||||
if err != nil {
|
||||
return orderBook, err
|
||||
@@ -124,11 +111,6 @@ func (o *OKEX) UpdateOrderbook(p pair.CurrencyPair, assetType string) (orderbook
|
||||
}
|
||||
|
||||
} else {
|
||||
if p.SecondCurrency.String() == common.StringToLower("USD") {
|
||||
p.SecondCurrency = "usdt"
|
||||
currency = exchange.FormatExchangeCurrency(o.Name, p).String()
|
||||
}
|
||||
|
||||
orderbookNew, err := o.GetSpotMarketDepth(ActualSpotDepthRequestParams{
|
||||
Symbol: currency,
|
||||
Size: 200,
|
||||
|
||||
Reference in New Issue
Block a user