Documentation ¶
Index ¶
- Constants
- func CompareCurrencyPairFormats(pair1 config.CurrencyPairFormatConfig, pair2 *config.CurrencyPairFormatConfig) bool
- func FormatCurrency(p pair.CurrencyPair) string
- func FormatExchangeCurrency(exchName string, p pair.CurrencyPair) string
- func GetAndFormatExchangeCurrencies(exchName string, pairs []pair.CurrencyPair) (string, error)
- func GetExchangeAssetTypes(exchName string) ([]string, error)
- func GetExchangeFormatCurrencySeperator(exchName string) bool
- type AccountCurrencyInfo
- type AccountInfo
- type Base
- func (e *Base) GetAuthenticatedAPISupport() bool
- func (e *Base) GetAvailableCurrencies() []pair.CurrencyPair
- func (e *Base) GetEnabledCurrencies() []pair.CurrencyPair
- func (e *Base) GetHTTPClient() *http.Client
- func (e *Base) GetLastPairsUpdateTime() int64
- func (e *Base) GetName() string
- func (e *Base) IsEnabled() bool
- func (e *Base) SetAPIKeys(APIKey, APISecret, ClientID string, b64Decode bool)
- func (e *Base) SetAssetTypes() error
- func (e *Base) SetAutoPairDefaults() error
- func (e *Base) SetCurrencies(pairs []pair.CurrencyPair, enabledPairs bool) error
- func (e *Base) SetCurrencyPairFormat() error
- func (e *Base) SetEnabled(enabled bool)
- func (e *Base) SetHTTPClient(h *http.Client)
- func (e *Base) SetHTTPClientTimeout(t time.Duration)
- func (e *Base) SupportsAutoPairUpdates() bool
- func (e *Base) SupportsCurrency(p pair.CurrencyPair, enabledPairs bool) bool
- func (e *Base) SupportsRESTTickerBatchUpdates() bool
- func (e *Base) UpdateCurrencies(exchangeProducts []string, enabled, force bool) error
- type EnabledExchangeCurrencies
- type IBotExchange
- type TradeHistory
Constants ¶
const ( // WarningAuthenticatedRequestWithoutCredentialsSet error message for authenticated request without credentials set WarningAuthenticatedRequestWithoutCredentialsSet = "WARNING -- Exchange %s authenticated HTTP request called but not supported due to unset/default API keys." // ErrExchangeNotFound is a constant for an error message ErrExchangeNotFound = "Exchange not found in dataset." // DefaultHTTPTimeout is the default HTTP/HTTPS Timeout for exchange requests DefaultHTTPTimeout = time.Second * 15 )
Variables ¶
This section is empty.
Functions ¶
func CompareCurrencyPairFormats ¶
func CompareCurrencyPairFormats(pair1 config.CurrencyPairFormatConfig, pair2 *config.CurrencyPairFormatConfig) bool
CompareCurrencyPairFormats checks and returns whether or not the two supplied config currency pairs match
func FormatCurrency ¶
func FormatCurrency(p pair.CurrencyPair) string
FormatCurrency is a method that formats and returns a currency pair based on the user currency display preferences
func FormatExchangeCurrency ¶
func FormatExchangeCurrency(exchName string, p pair.CurrencyPair) string
FormatExchangeCurrency is a method that formats and returns a currency pair based on the user currency display preferences
func GetAndFormatExchangeCurrencies ¶
func GetAndFormatExchangeCurrencies(exchName string, pairs []pair.CurrencyPair) (string, error)
GetAndFormatExchangeCurrencies returns a string string containing the exchanges formatted currency pairs
func GetExchangeAssetTypes ¶
GetExchangeAssetTypes returns the asset types the exchange supports (SPOT, binary, futures)
func GetExchangeFormatCurrencySeperator ¶
GetExchangeFormatCurrencySeperator returns whether or not a specific exchange contains a separator used for API requests
Types ¶
type AccountCurrencyInfo ¶
AccountCurrencyInfo is a sub type to store currency name and value
type AccountInfo ¶
type AccountInfo struct { ExchangeName string Currencies []AccountCurrencyInfo }
AccountInfo is a Generic type to hold each exchange's holdings in all enabled currencies
type Base ¶
type Base struct { Name string Enabled bool Verbose bool Websocket bool RESTPollingDelay time.Duration AuthenticatedAPISupport bool APISecret, APIKey, ClientID string Nonce nonce.Nonce TakerFee, MakerFee, Fee float64 BaseCurrencies []string AvailablePairs []string EnabledPairs []string AssetTypes []string PairsLastUpdated int64 SupportsAutoPairUpdating bool SupportsRESTTickerBatching bool HTTPTimeout time.Duration WebsocketURL string APIUrl string RequestCurrencyPairFormat config.CurrencyPairFormatConfig ConfigCurrencyPairFormat config.CurrencyPairFormatConfig *request.Requester }
Base stores the individual exchange information
func (*Base) GetAuthenticatedAPISupport ¶
GetAuthenticatedAPISupport returns whether the exchange supports authenticated API requests
func (*Base) GetAvailableCurrencies ¶
func (e *Base) GetAvailableCurrencies() []pair.CurrencyPair
GetAvailableCurrencies is a method that returns the available currency pairs of the exchange base
func (*Base) GetEnabledCurrencies ¶
func (e *Base) GetEnabledCurrencies() []pair.CurrencyPair
GetEnabledCurrencies is a method that returns the enabled currency pairs of the exchange base
func (*Base) GetHTTPClient ¶
GetHTTPClient gets the exchanges HTTP client
func (*Base) GetLastPairsUpdateTime ¶
GetLastPairsUpdateTime returns the unix timestamp of when the exchanges currency pairs were last updated
func (*Base) SetAPIKeys ¶
SetAPIKeys is a method that sets the current API keys for the exchange
func (*Base) SetAssetTypes ¶
SetAssetTypes checks the exchange asset types (whether it supports SPOT, Binary or Futures) and sets it to a default setting if it doesn't exist
func (*Base) SetAutoPairDefaults ¶
SetAutoPairDefaults sets the default values for whether or not the exchange supports auto pair updating or not
func (*Base) SetCurrencies ¶
func (e *Base) SetCurrencies(pairs []pair.CurrencyPair, enabledPairs bool) error
SetCurrencies sets the exchange currency pairs for either enabledPairs or availablePairs
func (*Base) SetCurrencyPairFormat ¶
SetCurrencyPairFormat checks the exchange request and config currency pair formats and sets it to a default setting if it doesn't exist
func (*Base) SetEnabled ¶
SetEnabled is a method that sets if the exchange is enabled
func (*Base) SetHTTPClient ¶
SetHTTPClient sets exchanges HTTP client
func (*Base) SetHTTPClientTimeout ¶
SetHTTPClientTimeout sets the timeout value for the exchanges HTTP Client
func (*Base) SupportsAutoPairUpdates ¶
SupportsAutoPairUpdates returns whether or not the exchange supports auto currency pair updating
func (*Base) SupportsCurrency ¶
func (e *Base) SupportsCurrency(p pair.CurrencyPair, enabledPairs bool) bool
SupportsCurrency returns true or not whether a currency pair exists in the exchange available currencies or not
func (*Base) SupportsRESTTickerBatchUpdates ¶
SupportsRESTTickerBatchUpdates returns whether or not the exhange supports REST batch ticker fetching
type EnabledExchangeCurrencies ¶
type EnabledExchangeCurrencies struct { ExchangeName string `json:"exchangeName"` ExchangeValues []ticker.Price `json:"exchangeValues"` }
EnabledExchangeCurrencies is a sub type for singular exchanges and respective currencies
type IBotExchange ¶
type IBotExchange interface { Setup(exch config.ExchangeConfig) Start(wg *sync.WaitGroup) SetDefaults() GetName() string IsEnabled() bool SetEnabled(bool) GetTickerPrice(currency pair.CurrencyPair, assetType string) (ticker.Price, error) UpdateTicker(currency pair.CurrencyPair, assetType string) (ticker.Price, error) GetOrderbookEx(currency pair.CurrencyPair, assetType string) (orderbook.Base, error) UpdateOrderbook(currency pair.CurrencyPair, assetType string) (orderbook.Base, error) GetEnabledCurrencies() []pair.CurrencyPair GetAvailableCurrencies() []pair.CurrencyPair GetExchangeAccountInfo() (AccountInfo, error) GetAuthenticatedAPISupport() bool SetCurrencies(pairs []pair.CurrencyPair, enabledPairs bool) error GetExchangeHistory(pair.CurrencyPair, string) ([]TradeHistory, error) SupportsAutoPairUpdates() bool GetLastPairsUpdateTime() int64 SupportsRESTTickerBatchUpdates() bool SubmitExchangeOrder(p pair.CurrencyPair, side string, orderType int, amount, price float64) (int64, error) ModifyExchangeOrder(p pair.CurrencyPair, orderID, action int64) (int64, error) CancelExchangeOrder(p pair.CurrencyPair, orderID int64) (int64, error) CancelAllExchangeOrders(p pair.CurrencyPair) error GetExchangeOrderInfo(orderID int64) (float64, error) GetExchangeDepositAddress(p pair.CurrencyPair) (string, error) WithdrawExchangeFunds(address string, p pair.CurrencyPair, amount float64) (string, error) }
IBotExchange enforces standard functions for all exchanges supported in GoCryptoTrader
Directories ¶
Path | Synopsis |
---|---|
Package ticker is a generated protocol buffer package.
|
Package ticker is a generated protocol buffer package. |