Documentation ¶
Index ¶
- Constants
- Variables
- func ConfirmECS(file []byte) bool
- func ConfirmSalt(file []byte) bool
- func DecryptConfigFile(configData, key []byte) ([]byte, error)
- func DefaultFilePath() string
- func EncryptConfigFile(configData, key []byte) ([]byte, error)
- func GetAndMigrateDefaultPath(configFile string) (string, error)
- func GetFilePath(configFile string) (configPath string, isImplicitDefaultPath bool, err error)
- func PromptForConfigKey(initialSetup bool) ([]byte, error)
- func SetConfig(c *Config)
- func Unencrypted() ([]byte, error)
- type APIConfig
- type APICredentialsConfig
- type APICredentialsValidatorConfig
- type APIEndpointsConfig
- type BankTransaction
- type Config
- func (c *Config) AssetTypeEnabled(a asset.Item, exch string) (bool, error)
- func (c *Config) CheckBankAccountConfig()
- func (c *Config) CheckClientBankAccounts()
- func (c *Config) CheckCommunicationsConfig()
- func (c *Config) CheckConfig() error
- func (c *Config) CheckConnectionMonitorConfig()
- func (c *Config) CheckCurrencyConfigValues() error
- func (c *Config) CheckCurrencyStateManager()
- func (c *Config) CheckDataHistoryMonitorConfig()
- func (c *Config) CheckExchangeConfigValues() error
- func (c *Config) CheckLoggerConfig() error
- func (c *Config) CheckNTPConfig()
- func (c *Config) CheckOrderManagerConfig()
- func (c *Config) CheckPairConfigFormats(exchName string) error
- func (c *Config) CheckPairConsistency(exchName string) error
- func (c *Config) CheckRemoteControlConfig()
- func (c *Config) CheckSyncManagerConfig()
- func (c *Config) CountEnabledExchanges() int
- func (c *Config) GetAllExchangeConfigs() []Exchange
- func (c *Config) GetAvailablePairs(exchName string, assetType asset.Item) (currency.Pairs, error)
- func (c *Config) GetClientBankAccounts(exchangeName, targetCurrency string) (*banking.Account, error)
- func (c *Config) GetCommunicationsConfig() base.CommunicationsConfig
- func (c *Config) GetCryptocurrencyProviderConfig() currency.Provider
- func (c *Config) GetCurrencyConfig() currency.Config
- func (c *Config) GetCurrencyPairConfig(exchName string, assetType asset.Item) (*currency.PairStore, error)
- func (c *Config) GetCurrencyPairDisplayConfig() *currency.PairFormat
- func (c *Config) GetDataPath(elem ...string) string
- func (c *Config) GetDisabledExchanges() []string
- func (c *Config) GetEnabledExchanges() []string
- func (c *Config) GetEnabledPairs(exchName string, assetType asset.Item) (currency.Pairs, error)
- func (c *Config) GetExchangeAssetTypes(exchName string) (asset.Items, error)
- func (c *Config) GetExchangeBankAccounts(exchangeName, id, depositingCurrency string) (*banking.Account, error)
- func (c *Config) GetExchangeConfig(name string) (*Exchange, error)
- func (c *Config) GetForexProviders() []currency.FXSettings
- func (c *Config) GetPairFormat(exchName string, assetType asset.Item) (currency.PairFormat, error)
- func (c *Config) GetPrimaryForexProvider() string
- func (c *Config) LoadConfig(configPath string, dryrun bool) error
- func (c *Config) PurgeExchangeAPICredentials()
- func (c *Config) ReadConfigFromFile(configPath string, dryrun bool) error
- func (c *Config) RemoveExchange(exchName string) bool
- func (c *Config) Save(writerProvider func() (io.Writer, error), keyProvider func() ([]byte, error)) error
- func (c *Config) SaveConfigToFile(configPath string) error
- func (c *Config) SetNTPCheck(input io.Reader) (string, error)
- func (c *Config) SetPairs(exchName string, assetType asset.Item, enabled bool, pairs currency.Pairs) error
- func (c *Config) SupportsExchangeAssetType(exchName string, assetType asset.Item) error
- func (c *Config) SupportsPair(exchName string, p currency.Pair, assetType asset.Item) bool
- func (c *Config) UpdateClientBankAccounts(bankCfg *banking.Account) error
- func (c *Config) UpdateCommunicationsConfig(config *base.CommunicationsConfig)
- func (c *Config) UpdateConfig(configPath string, newCfg *Config, dryrun bool) error
- func (c *Config) UpdateCryptocurrencyProviderConfig(config currency.Provider)
- func (c *Config) UpdateExchangeBankAccounts(exchangeName string, bankCfg []banking.Account) error
- func (c *Config) UpdateExchangeConfig(e *Exchange) error
- type ConnectionMonitorConfig
- type CurrencyPairFormatConfig
- type CurrencyStateManager
- type DataHistoryManager
- type DepcrecatedRPCConfig
- type Exchange
- type FeaturesConfig
- type FeaturesEnabledConfig
- type FeaturesSupportedConfig
- type GRPCConfig
- type NTPClientConfig
- type OrderManager
- type Orderbook
- type Post
- type Profiler
- type RemoteControlConfig
- type SyncManagerConfig
- type WebserverConfig
- type WebsocketRPCConfig
Constants ¶
const ( // EncryptConfirmString has a the general confirmation string to allow us to // see if the file is correctly encrypted EncryptConfirmString = "THORS-HAMMER" // SaltPrefix string SaltPrefix = "~GCT~SO~SALTY~" // SaltRandomLength is the number of random bytes to append after the prefix string SaltRandomLength = 12 )
const ( FXProviderFixer = "fixer" EncryptedFile = "config.dat" File = "config.json" TestFile = "../testdata/configtest.json" DefaultConnectionMonitorDelay = time.Second * 2 DefaultAPIKey = "Key" DefaultAPISecret = "Secret" DefaultAPIClientID = "ClientID" DefaultOrderbookPublishPeriod = time.Second * 10 // DefaultSyncerWorkers limits the number of sync workers DefaultSyncerWorkers = 15 // DefaultSyncerTimeoutREST the default time to switch from REST to websocket protocols without a response DefaultSyncerTimeoutREST = time.Second * 15 // DefaultSyncerTimeoutWebsocket the default time to switch from websocket to REST protocols without a response DefaultSyncerTimeoutWebsocket = time.Minute // DefaultWebsocketResponseCheckTimeout is the default timeout for // websocket responses. DefaultWebsocketResponseCheckTimeout = time.Millisecond * 30 // DefaultWebsocketResponseMaxLimit is the default maximum time for // websocket responses. DefaultWebsocketResponseMaxLimit = time.Second * 7 // DefaultWebsocketTrafficTimeout is the default timeout for websocket // traffic. DefaultWebsocketTrafficTimeout = time.Second * 30 )
Constants declared here are filename strings and test strings
const ( ErrExchangeNameEmpty = "exchange #%d name is empty" ErrNoEnabledExchanges = "no exchanges enabled" ErrFailureOpeningConfig = "fatal error opening %s file. Error: %s" ErrCheckingConfigValues = "fatal error checking config values. Error: %s" WarningExchangeAuthAPIDefaultOrEmptyValues = "exchange %s authenticated API support disabled due to default/empty APIKey/Secret/ClientID values" WarningPairsLastUpdatedThresholdExceeded = "exchange %s last manual update of available currency pairs has exceeded %d days. Manual update required!" )
Constants here hold some messages
const ( APIURLNonDefaultMessage = "NON_DEFAULT_HTTP_LINK_TO_EXCHANGE_API" WebsocketURLNonDefaultMessage = "NON_DEFAULT_HTTP_LINK_TO_WEBSOCKET_EXCHANGE_API" DefaultUnsetAPIKey = "Key" DefaultUnsetAPISecret = "Secret" DefaultUnsetAccountPlan = "accountPlan" )
Constants here define unset default values displayed in the config.json file
Variables ¶
var (
ErrExchangeNotFound = errors.New("exchange not found")
)
Public errors exported by this package
Functions ¶
func ConfirmECS ¶
ConfirmECS confirms that the encryption confirmation string is found
func ConfirmSalt ¶
ConfirmSalt checks whether the encrypted data contains a salt
func DecryptConfigFile ¶
DecryptConfigFile decrypts configuration data with the supplied key and returns the un-encrypted data as a byte array with an error
func DefaultFilePath ¶
func DefaultFilePath() string
DefaultFilePath returns the default config file path MacOS/Linux: $HOME/.gocryptotrader/config.json or config.dat Windows: %APPDATA%\GoCryptoTrader\config.json or config.dat Helpful for printing application usage
func EncryptConfigFile ¶
EncryptConfigFile encrypts configuration data that is parsed in with a key and returns it as a byte array with an error
func GetAndMigrateDefaultPath ¶
GetAndMigrateDefaultPath returns the target config file migrating it from the old default location to new one, if it was implicitly loaded from a default location and wasn't already in the correct 'new' default location
func GetFilePath ¶
GetFilePath returns the desired config file or the default config file name and whether it was loaded from a default location (rather than explicitly specified)
func PromptForConfigKey ¶
PromptForConfigKey asks for configuration key if initialSetup is true, the password needs to be repeated
func Unencrypted ¶
Unencrypted provides the default key provider implementation for unencrypted files
Types ¶
type APIConfig ¶
type APIConfig struct { AuthenticatedSupport bool `json:"authenticatedSupport"` AuthenticatedWebsocketSupport bool `json:"authenticatedWebsocketApiSupport"` PEMKeySupport bool `json:"pemKeySupport,omitempty"` Credentials APICredentialsConfig `json:"credentials"` CredentialsValidator *APICredentialsValidatorConfig `json:"credentialsValidator,omitempty"` OldEndPoints *APIEndpointsConfig `json:"endpoints,omitempty"` Endpoints map[string]string `json:"urlEndpoints"` }
APIConfig stores the exchange API config
type APICredentialsConfig ¶
type APICredentialsConfig struct { Key string `json:"key,omitempty"` Secret string `json:"secret,omitempty"` ClientID string `json:"clientID,omitempty"` Subaccount string `json:"subaccount,omitempty"` PEMKey string `json:"pemKey,omitempty"` OTPSecret string `json:"otpSecret,omitempty"` TradePassword string `json:"tradePassword,omitempty"` PIN string `json:"pin,omitempty"` }
APICredentialsConfig stores the API credentials
type APICredentialsValidatorConfig ¶
type APICredentialsValidatorConfig struct { // For Huobi (optional) RequiresPEM bool `json:"requiresPEM,omitempty"` RequiresKey bool `json:"requiresKey,omitempty"` RequiresSecret bool `json:"requiresSecret,omitempty"` RequiresClientID bool `json:"requiresClientID,omitempty"` RequiresBase64DecodeSecret bool `json:"requiresBase64DecodeSecret,omitempty"` }
APICredentialsValidatorConfig stores the API credentials validator settings
type APIEndpointsConfig ¶
type APIEndpointsConfig struct { URL string `json:"url"` URLSecondary string `json:"urlSecondary"` WebsocketURL string `json:"websocketURL"` }
APIEndpointsConfig stores the API endpoint addresses
type BankTransaction ¶
type BankTransaction struct { ReferenceNumber string `json:"referenceNumber"` TransactionNumber string `json:"transactionNumber"` PaymentInstructions string `json:"paymentInstructions"` }
BankTransaction defines a related banking transaction
type Config ¶
type Config struct { Name string `json:"name"` DataDirectory string `json:"dataDirectory"` EncryptConfig int `json:"encryptConfig"` GlobalHTTPTimeout time.Duration `json:"globalHTTPTimeout"` Database database.Config `json:"database"` Logging log.Config `json:"logging"` SyncManagerConfig SyncManagerConfig `json:"syncManager"` ConnectionMonitor ConnectionMonitorConfig `json:"connectionMonitor"` OrderManager OrderManager `json:"orderManager"` DataHistoryManager DataHistoryManager `json:"dataHistoryManager"` CurrencyStateManager CurrencyStateManager `json:"currencyStateManager"` Profiler Profiler `json:"profiler"` NTPClient NTPClientConfig `json:"ntpclient"` GCTScript gctscript.Config `json:"gctscript"` Currency currency.Config `json:"currencyConfig"` Communications base.CommunicationsConfig `json:"communications"` RemoteControl RemoteControlConfig `json:"remoteControl"` Portfolio portfolio.Base `json:"portfolioAddresses"` Exchanges []Exchange `json:"exchanges"` BankAccounts []banking.Account `json:"bankAccounts"` // Deprecated config settings, will be removed at a future date Webserver *WebserverConfig `json:"webserver,omitempty"` CurrencyPairFormat *currency.PairFormat `json:"currencyPairFormat,omitempty"` FiatDisplayCurrency *currency.Code `json:"fiatDispayCurrency,omitempty"` Cryptocurrencies *currency.Currencies `json:"cryptocurrencies,omitempty"` SMS *base.SMSGlobalConfig `json:"smsGlobal,omitempty"` // contains filtered or unexported fields }
Config is the overarching object that holds all the information for prestart management of Portfolio, Communications, Webserver and Enabled Exchanges
func ReadConfig ¶
ReadConfig verifies and checks for encryption and loads the config from a JSON object. Prompts for decryption key, if target data is encrypted. Returns the loaded configuration and whether it was encrypted.
func (*Config) AssetTypeEnabled ¶
AssetTypeEnabled checks to see if the asset type is enabled in configuration
func (*Config) CheckBankAccountConfig ¶
func (c *Config) CheckBankAccountConfig()
CheckBankAccountConfig checks all bank accounts to see if they are valid
func (*Config) CheckClientBankAccounts ¶
func (c *Config) CheckClientBankAccounts()
CheckClientBankAccounts checks client bank details
func (*Config) CheckCommunicationsConfig ¶
func (c *Config) CheckCommunicationsConfig()
CheckCommunicationsConfig checks to see if the variables are set correctly from config.json
func (*Config) CheckConfig ¶
CheckConfig checks all config settings
func (*Config) CheckConnectionMonitorConfig ¶
func (c *Config) CheckConnectionMonitorConfig()
CheckConnectionMonitorConfig checks and if zero value assigns default values
func (*Config) CheckCurrencyConfigValues ¶
CheckCurrencyConfigValues checks to see if the currency config values are correct or not
func (*Config) CheckCurrencyStateManager ¶
func (c *Config) CheckCurrencyStateManager()
CheckCurrencyStateManager ensures the currency state config is valid, or sets default values
func (*Config) CheckDataHistoryMonitorConfig ¶
func (c *Config) CheckDataHistoryMonitorConfig()
CheckDataHistoryMonitorConfig ensures the data history config is valid, or sets default values
func (*Config) CheckExchangeConfigValues ¶
CheckExchangeConfigValues returns configuration values for all enabled exchanges
func (*Config) CheckLoggerConfig ¶
CheckLoggerConfig checks to see logger values are present and valid in config if not creates a default instance of the logger
func (*Config) CheckNTPConfig ¶
func (c *Config) CheckNTPConfig()
CheckNTPConfig checks for missing or incorrectly configured NTPClient and recreates with known safe defaults
func (*Config) CheckOrderManagerConfig ¶
func (c *Config) CheckOrderManagerConfig()
CheckOrderManagerConfig ensures the order manager is setup correctly
func (*Config) CheckPairConfigFormats ¶
CheckPairConfigFormats checks to see if the pair config format is valid
func (*Config) CheckPairConsistency ¶
CheckPairConsistency checks to see if the enabled pair exists in the available pairs list
func (*Config) CheckRemoteControlConfig ¶
func (c *Config) CheckRemoteControlConfig()
CheckRemoteControlConfig checks to see if the old c.Webserver field is used and migrates the existing settings to the new RemoteControl struct
func (*Config) CheckSyncManagerConfig ¶
func (c *Config) CheckSyncManagerConfig()
CheckSyncManagerConfig checks config for valid values sets defaults if values are invalid
func (*Config) CountEnabledExchanges ¶
CountEnabledExchanges returns the number of exchanges that are enabled.
func (*Config) GetAllExchangeConfigs ¶
GetAllExchangeConfigs returns all exchange configurations
func (*Config) GetAvailablePairs ¶
GetAvailablePairs returns a list of currency pairs for a specific exchange
func (*Config) GetClientBankAccounts ¶
func (c *Config) GetClientBankAccounts(exchangeName, targetCurrency string) (*banking.Account, error)
GetClientBankAccounts returns banking details used for a given exchange and currency
func (*Config) GetCommunicationsConfig ¶
func (c *Config) GetCommunicationsConfig() base.CommunicationsConfig
GetCommunicationsConfig returns the communications configuration
func (*Config) GetCryptocurrencyProviderConfig ¶
GetCryptocurrencyProviderConfig returns the communications configuration
func (*Config) GetCurrencyConfig ¶
GetCurrencyConfig returns currency configurations
func (*Config) GetCurrencyPairConfig ¶
func (c *Config) GetCurrencyPairConfig(exchName string, assetType asset.Item) (*currency.PairStore, error)
GetCurrencyPairConfig returns currency pair config for the desired exchange and asset type
func (*Config) GetCurrencyPairDisplayConfig ¶
func (c *Config) GetCurrencyPairDisplayConfig() *currency.PairFormat
GetCurrencyPairDisplayConfig retrieves the currency pair display preference
func (*Config) GetDataPath ¶
GetDataPath gets the data path for the given subpath
func (*Config) GetDisabledExchanges ¶
GetDisabledExchanges returns a list of disabled exchanges
func (*Config) GetEnabledExchanges ¶
GetEnabledExchanges returns a list of enabled exchanges
func (*Config) GetEnabledPairs ¶
GetEnabledPairs returns a list of currency pairs for a specific exchange
func (*Config) GetExchangeAssetTypes ¶
GetExchangeAssetTypes returns the exchanges supported asset types
func (*Config) GetExchangeBankAccounts ¶
func (c *Config) GetExchangeBankAccounts(exchangeName, id, depositingCurrency string) (*banking.Account, error)
GetExchangeBankAccounts returns banking details associated with an exchange for depositing funds
func (*Config) GetExchangeConfig ¶
GetExchangeConfig returns exchange configurations by its individual name
func (*Config) GetForexProviders ¶
func (c *Config) GetForexProviders() []currency.FXSettings
GetForexProviders returns a list of available forex providers
func (*Config) GetPairFormat ¶
GetPairFormat returns the exchanges pair config storage format
func (*Config) GetPrimaryForexProvider ¶
GetPrimaryForexProvider returns the primary forex provider
func (*Config) LoadConfig ¶
LoadConfig loads your configuration file into your configuration object
func (*Config) PurgeExchangeAPICredentials ¶
func (c *Config) PurgeExchangeAPICredentials()
PurgeExchangeAPICredentials purges the stored API credentials
func (*Config) ReadConfigFromFile ¶
ReadConfigFromFile reads the configuration from the given file if target file is encrypted, prompts for encryption key Also - if not in dryrun mode - it checks if the configuration needs to be encrypted and stores the file as encrypted, if necessary (prompting for encryption key)
func (*Config) RemoveExchange ¶
RemoveExchange removes an exchange config
func (*Config) Save ¶
func (c *Config) Save(writerProvider func() (io.Writer, error), keyProvider func() ([]byte, error)) error
Save saves your configuration to the writer as a JSON object with encryption, if configured If there is an error when preparing the data to store, the writer is never requested
func (*Config) SaveConfigToFile ¶
SaveConfigToFile saves your configuration to your desired path as a JSON object. The function encrypts the data and prompts for encryption key, if necessary
func (*Config) SetNTPCheck ¶
SetNTPCheck allows the user to change how they are prompted for timesync alerts
func (*Config) SetPairs ¶
func (c *Config) SetPairs(exchName string, assetType asset.Item, enabled bool, pairs currency.Pairs) error
SetPairs sets the exchanges currency pairs
func (*Config) SupportsExchangeAssetType ¶
SupportsExchangeAssetType returns whether or not the exchange supports the supplied asset type
func (*Config) SupportsPair ¶
SupportsPair returns true or not whether the exchange supports the supplied pair
func (*Config) UpdateClientBankAccounts ¶
UpdateClientBankAccounts updates the configuration for a bank
func (*Config) UpdateCommunicationsConfig ¶
func (c *Config) UpdateCommunicationsConfig(config *base.CommunicationsConfig)
UpdateCommunicationsConfig sets a new updated version of a Communications configuration
func (*Config) UpdateConfig ¶
UpdateConfig updates the config with a supplied config file
func (*Config) UpdateCryptocurrencyProviderConfig ¶
UpdateCryptocurrencyProviderConfig returns the communications configuration
func (*Config) UpdateExchangeBankAccounts ¶
UpdateExchangeBankAccounts updates the configuration for the associated exchange bank
func (*Config) UpdateExchangeConfig ¶
UpdateExchangeConfig updates exchange configurations
type ConnectionMonitorConfig ¶
type ConnectionMonitorConfig struct { DNSList []string `json:"preferredDNSList"` PublicDomainList []string `json:"preferredDomainList"` CheckInterval time.Duration `json:"checkInterval"` }
ConnectionMonitorConfig defines the connection monitor variables to ensure that there is internet connectivity
type CurrencyPairFormatConfig ¶
type CurrencyPairFormatConfig struct { Uppercase bool `json:"uppercase"` Delimiter string `json:"delimiter,omitempty"` Separator string `json:"separator,omitempty"` Index string `json:"index,omitempty"` }
CurrencyPairFormatConfig stores the users preferred currency pair display
type CurrencyStateManager ¶
type CurrencyStateManager struct { Enabled *bool `json:"enabled"` Delay time.Duration `json:"delay"` }
CurrencyStateManager defines a set of configuration options for the currency state manager
type DataHistoryManager ¶
type DataHistoryManager struct { Enabled bool `json:"enabled"` CheckInterval time.Duration `json:"checkInterval"` MaxJobsPerCycle int64 `json:"maxJobsPerCycle"` MaxResultInsertions int64 `json:"maxResultInsertions"` Verbose bool `json:"verbose"` }
DataHistoryManager holds all information required for the data history manager
type DepcrecatedRPCConfig ¶
type DepcrecatedRPCConfig struct { Enabled bool `json:"enabled"` ListenAddress string `json:"listenAddress"` }
DepcrecatedRPCConfig stores the deprecatedRPCConfig settings
type Exchange ¶
type Exchange struct { Name string `json:"name"` Enabled bool `json:"enabled"` Verbose bool `json:"verbose"` UseSandbox bool `json:"useSandbox,omitempty"` HTTPTimeout time.Duration `json:"httpTimeout"` HTTPUserAgent string `json:"httpUserAgent,omitempty"` HTTPDebugging bool `json:"httpDebugging,omitempty"` WebsocketResponseCheckTimeout time.Duration `json:"websocketResponseCheckTimeout"` WebsocketResponseMaxLimit time.Duration `json:"websocketResponseMaxLimit"` WebsocketTrafficTimeout time.Duration `json:"websocketTrafficTimeout"` ConnectionMonitorDelay time.Duration `json:"connectionMonitorDelay"` ProxyAddress string `json:"proxyAddress,omitempty"` BaseCurrencies currency.Currencies `json:"baseCurrencies"` CurrencyPairs *currency.PairsManager `json:"currencyPairs"` API APIConfig `json:"api"` Features *FeaturesConfig `json:"features"` BankAccounts []banking.Account `json:"bankAccounts,omitempty"` Orderbook Orderbook `json:"orderbook"` // Deprecated settings which will be removed in a future update AvailablePairs *currency.Pairs `json:"availablePairs,omitempty"` EnabledPairs *currency.Pairs `json:"enabledPairs,omitempty"` AssetTypes *string `json:"assetTypes,omitempty"` PairsLastUpdated *int64 `json:"pairsLastUpdated,omitempty"` ConfigCurrencyPairFormat *currency.PairFormat `json:"configCurrencyPairFormat,omitempty"` RequestCurrencyPairFormat *currency.PairFormat `json:"requestCurrencyPairFormat,omitempty"` AuthenticatedAPISupport *bool `json:"authenticatedApiSupport,omitempty"` AuthenticatedWebsocketAPISupport *bool `json:"authenticatedWebsocketApiSupport,omitempty"` APIKey *string `json:"apiKey,omitempty"` APISecret *string `json:"apiSecret,omitempty"` APIAuthPEMKeySupport *bool `json:"apiAuthPemKeySupport,omitempty"` APIAuthPEMKey *string `json:"apiAuthPemKey,omitempty"` APIURL *string `json:"apiUrl,omitempty"` APIURLSecondary *string `json:"apiUrlSecondary,omitempty"` ClientID *string `json:"clientId,omitempty"` SupportsAutoPairUpdates *bool `json:"supportsAutoPairUpdates,omitempty"` Websocket *bool `json:"websocket,omitempty"` WebsocketURL *string `json:"websocketUrl,omitempty"` }
Exchange holds all the information needed for each enabled Exchange.
type FeaturesConfig ¶
type FeaturesConfig struct { Supports FeaturesSupportedConfig `json:"supports"` Enabled FeaturesEnabledConfig `json:"enabled"` Subscriptions []*subscription.Subscription `json:"subscriptions,omitempty"` }
FeaturesConfig stores the exchanges supported and enabled features
type FeaturesEnabledConfig ¶
type FeaturesEnabledConfig struct { AutoPairUpdates bool `json:"autoPairUpdates"` Websocket bool `json:"websocketAPI"` SaveTradeData bool `json:"saveTradeData"` TradeFeed bool `json:"tradeFeed"` FillsFeed bool `json:"fillsFeed"` }
FeaturesEnabledConfig stores the exchanges enabled features
type FeaturesSupportedConfig ¶
type FeaturesSupportedConfig struct { REST bool `json:"restAPI"` RESTCapabilities protocol.Features `json:"restCapabilities,omitempty"` Websocket bool `json:"websocketAPI"` WebsocketCapabilities protocol.Features `json:"websocketCapabilities,omitempty"` }
FeaturesSupportedConfig stores the exchanges supported features
type GRPCConfig ¶
type GRPCConfig struct { Enabled bool `json:"enabled"` ListenAddress string `json:"listenAddress"` GRPCProxyEnabled bool `json:"grpcProxyEnabled"` GRPCProxyListenAddress string `json:"grpcProxyListenAddress"` GRPCAllowBotShutdown bool `json:"grpcAllowBotShutdown"` TimeInNanoSeconds bool `json:"timeInNanoSeconds"` }
GRPCConfig stores the gRPC settings
type NTPClientConfig ¶
type NTPClientConfig struct { Level int `json:"enabled"` Pool []string `json:"pool"` AllowedDifference *time.Duration `json:"allowedDifference"` AllowedNegativeDifference *time.Duration `json:"allowedNegativeDifference"` }
NTPClientConfig defines a network time protocol configuration to allow for positive and negative differences
type OrderManager ¶
type OrderManager struct { Enabled *bool `json:"enabled"` Verbose bool `json:"verbose"` ActivelyTrackFuturesPositions bool `json:"activelyTrackFuturesPositions"` FuturesTrackingSeekDuration time.Duration `json:"futuresTrackingSeekDuration"` RespectOrderHistoryLimits *bool `json:"respectOrderHistoryLimits"` CancelOrdersOnShutdown bool `json:"cancelOrdersOnShutdown"` }
OrderManager holds settings used for the order manager
type Orderbook ¶
type Orderbook struct { VerificationBypass bool `json:"verificationBypass"` WebsocketBufferLimit int `json:"websocketBufferLimit"` WebsocketBufferEnabled bool `json:"websocketBufferEnabled"` // PublishPeriod here is a pointer because we want to distinguish // between zeroed out and missing. PublishPeriod *time.Duration `json:"publishPeriod"` }
Orderbook stores the orderbook configuration variables
type Profiler ¶
type Profiler struct { Enabled bool `json:"enabled"` MutexProfileFraction int `json:"mutex_profile_fraction"` }
Profiler defines the profiler configuration to enable pprof
type RemoteControlConfig ¶
type RemoteControlConfig struct { Username string `json:"username"` Password string `json:"password"` GRPC GRPCConfig `json:"gRPC"` DeprecatedRPC DepcrecatedRPCConfig `json:"deprecatedRPC"` WebsocketRPC WebsocketRPCConfig `json:"websocketRPC"` }
RemoteControlConfig stores the RPC services config
type SyncManagerConfig ¶
type SyncManagerConfig struct { Enabled bool `json:"enabled"` SynchronizeTicker bool `json:"synchronizeTicker"` SynchronizeOrderbook bool `json:"synchronizeOrderbook"` SynchronizeTrades bool `json:"synchronizeTrades"` SynchronizeContinuously bool `json:"synchronizeContinuously"` TimeoutREST time.Duration `json:"timeoutREST"` TimeoutWebsocket time.Duration `json:"timeoutWebsocket"` NumWorkers int `json:"numWorkers"` FiatDisplayCurrency currency.Code `json:"fiatDisplayCurrency"` PairFormatDisplay *currency.PairFormat `json:"pairFormatDisplay,omitempty"` // log events Verbose bool `json:"verbose"` LogSyncUpdateEvents bool `json:"logSyncUpdateEvents"` LogSwitchProtocolEvents bool `json:"logSwitchProtocolEvents"` LogInitialSyncEvents bool `json:"logInitialSyncEvents"` }
SyncManagerConfig stores the currency pair synchronization manager config
func GetDefaultSyncManagerConfig ¶
func GetDefaultSyncManagerConfig() SyncManagerConfig
GetDefaultSyncManagerConfig returns a config with default values
type WebserverConfig ¶
type WebserverConfig struct { Enabled bool `json:"enabled"` AdminUsername string `json:"adminUsername"` AdminPassword string `json:"adminPassword"` ListenAddress string `json:"listenAddress"` WebsocketConnectionLimit int `json:"websocketConnectionLimit"` WebsocketMaxAuthFailures int `json:"websocketMaxAuthFailures"` WebsocketAllowInsecureOrigin bool `json:"websocketAllowInsecureOrigin"` }
WebserverConfig stores the old webserver config
type WebsocketRPCConfig ¶
type WebsocketRPCConfig struct { Enabled bool `json:"enabled"` ListenAddress string `json:"listenAddress"` ConnectionLimit int `json:"connectionLimit"` MaxAuthFailures int `json:"maxAuthFailures"` AllowInsecureOrigin bool `json:"allowInsecureOrigin"` }
WebsocketRPCConfig stores the websocket config info