Files
gocryptotrader/currency/manager_types.go
Scott 7c7aebe22f Binance: Fixes expiring futures contract pair formatting (#836)
* Fixes expiring contract formatting

* minor simplification

* shazniterinos

* Removes secret scientific test

* continue to address nits

* Shazniterinos

* Adds `bypassConfigFormatUpgrades` feature. Fixes Binance pair parsing.

* lint fix

* Adds test for binance func

* Consistent messaging and oopsie fix
2021-11-16 15:02:31 +11:00

36 lines
1.2 KiB
Go

package currency
import (
"sync"
"github.com/thrasher-corp/gocryptotrader/exchanges/asset"
)
// PairsManager manages asset pairs
type PairsManager struct {
BypassConfigFormatUpgrades bool `json:"bypassConfigFormatUpgrades"`
RequestFormat *PairFormat `json:"requestFormat,omitempty"`
ConfigFormat *PairFormat `json:"configFormat,omitempty"`
UseGlobalFormat bool `json:"useGlobalFormat,omitempty"`
LastUpdated int64 `json:"lastUpdated,omitempty"`
Pairs map[asset.Item]*PairStore `json:"pairs"`
m sync.RWMutex
}
// PairStore stores a currency pair store
type PairStore struct {
AssetEnabled *bool `json:"assetEnabled"`
Enabled Pairs `json:"enabled"`
Available Pairs `json:"available"`
RequestFormat *PairFormat `json:"requestFormat,omitempty"`
ConfigFormat *PairFormat `json:"configFormat,omitempty"`
}
// PairFormat returns the pair format
type PairFormat struct {
Uppercase bool `json:"uppercase"`
Delimiter string `json:"delimiter,omitempty"`
Separator string `json:"separator,omitempty"`
Index string `json:"index,omitempty"`
}