Documentation ¶
Index ¶
- Constants
- Variables
- func Bootstrap(ctx context.Context, b IBotExchange) error
- func GetDefaultConfig(ctx context.Context, exch IBotExchange) (*config.Exchange, error)
- func IsSupported(exchangeName string) bool
- type API
- type AccountManagement
- type AssetWebsocketSupport
- type Base
- func (b *Base) AddTradesToBuffer(trades ...trade.Data) error
- func (b *Base) AreCredentialsValid(ctx context.Context) bool
- func (b *Base) AuthenticateWebsocket(_ context.Context) error
- func (b *Base) Bootstrap(_ context.Context) (continueBootstrap bool, err error)
- func (b *Base) CalculatePNL(context.Context, *futures.PNLCalculatorRequest) (*futures.PNLResult, error)
- func (b *Base) CalculateTotalCollateral(_ context.Context, _ *futures.TotalCollateralCalculator) (*futures.TotalCollateralResponse, error)
- func (b *Base) CanUseAuthenticatedWebsocketEndpoints() bool
- func (b *Base) ChangePositionMargin(_ context.Context, _ *margin.PositionChangeRequest) (*margin.PositionChangeResponse, error)
- func (b *Base) CheckCredentials(creds *account.Credentials, isContext bool) error
- func (b *Base) CheckTransientError(err error) error
- func (b *Base) DisableAssetWebsocketSupport(aType asset.Item) error
- func (b *Base) DisableRateLimiter() error
- func (b *Base) EnableRateLimiter() error
- func (b *Base) EnsureOnePairEnabled() error
- func (b *Base) FlushWebsocketChannels() error
- func (b *Base) FormatExchangeCurrencies(pairs []currency.Pair, assetType asset.Item) (string, error)
- func (b *Base) FormatExchangeCurrency(p currency.Pair, assetType asset.Item) (currency.Pair, error)
- func (b *Base) FormatExchangeKlineInterval(in kline.Interval) string
- func (b *Base) FormatSymbol(pair currency.Pair, assetType asset.Item) (string, error)
- func (b *Base) FormatWithdrawPermissions() string
- func (b *Base) GetAssetTypes(enabled bool) asset.Items
- func (b *Base) GetAvailablePairs(assetType asset.Item) (currency.Pairs, error)
- func (b *Base) GetAvailableTransferChains(_ context.Context, _ currency.Code) ([]string, error)
- func (b *Base) GetBase() *Base
- func (b *Base) GetCachedOpenInterest(_ context.Context, k ...key.PairAsset) ([]futures.OpenInterest, error)
- func (b *Base) GetClientBankAccounts(exchangeName, withdrawalCurrency string) (*banking.Account, error)
- func (b *Base) GetCollateralCurrencyForContract(_ asset.Item, _ currency.Pair) (currency.Code, asset.Item, error)
- func (b *Base) GetCollateralMode(_ context.Context, _ asset.Item) (collateral.Mode, error)
- func (b *Base) GetCredentials(ctx context.Context) (*account.Credentials, error)
- func (b *Base) GetCurrencyForRealisedPNL(_ asset.Item, _ currency.Pair) (currency.Code, asset.Item, error)
- func (b *Base) GetCurrencyTradeURL(context.Context, asset.Item, currency.Pair) (string, error)
- func (b *Base) GetDefaultCredentials() *account.Credentials
- func (b *Base) GetEnabledFeatures() FeaturesEnabled
- func (b *Base) GetEnabledPairs(a asset.Item) (currency.Pairs, error)
- func (b *Base) GetExchangeBankAccounts(id, depositCurrency string) (*banking.Account, error)
- func (b *Base) GetFuturesPositionOrders(context.Context, *futures.PositionsRequest) ([]futures.PositionResponse, error)
- func (b *Base) GetFuturesPositionSummary(context.Context, *futures.PositionSummaryRequest) (*futures.PositionSummary, error)
- func (b *Base) GetFuturesPositions(context.Context, *futures.PositionsRequest) ([]futures.PositionDetails, error)
- func (b *Base) GetHistoricalFundingRates(context.Context, *fundingrate.HistoricalRatesRequest) (*fundingrate.HistoricalRates, error)
- func (b *Base) GetKlineExtendedRequest(pair currency.Pair, a asset.Item, interval kline.Interval, ...) (*kline.ExtendedRequest, error)
- func (b *Base) GetKlineRequest(pair currency.Pair, a asset.Item, interval kline.Interval, ...) (*kline.Request, error)
- func (b *Base) GetLastPairsUpdateTime() int64
- func (b *Base) GetLeverage(_ context.Context, _ asset.Item, _ currency.Pair, _ margin.Type, _ order.Side) (float64, error)
- func (b *Base) GetMarginRatesHistory(context.Context, *margin.RateHistoryRequest) (*margin.RateHistoryResponse, error)
- func (b *Base) GetName() string
- func (b *Base) GetOpenInterest(context.Context, ...key.PairAsset) ([]futures.OpenInterest, error)
- func (b *Base) GetPairAndAssetTypeRequestFormatted(symbol string) (currency.Pair, asset.Item, error)
- func (b *Base) GetPairAssetType(c currency.Pair) (asset.Item, error)
- func (b *Base) GetPairFormat(a asset.Item, r bool) (currency.PairFormat, error)
- func (b *Base) GetPositionSummary(context.Context, *futures.PositionSummaryRequest) (*futures.PositionSummary, error)
- func (b *Base) GetRequestFormattedPairAndAssetType(p string) (currency.Pair, asset.Item, error)
- func (b *Base) GetStandardConfig() (*config.Exchange, error)
- func (b *Base) GetSubscriptionTemplate(*subscription.Subscription) (*template.Template, error)
- func (b *Base) GetSubscriptions() (subscription.List, error)
- func (b *Base) GetSupportedFeatures() FeaturesSupported
- func (b *Base) GetTradingRequirements() protocol.TradingRequirements
- func (b *Base) GetWebsocket() (*stream.Websocket, error)
- func (b *Base) GetWithdrawPermissions() uint32
- func (b *Base) HasAssetTypeAccountSegregation() bool
- func (b *Base) IsEnabled() bool
- func (b *Base) IsFillsFeedEnabled() bool
- func (b *Base) IsPairEnabled(pair currency.Pair, a asset.Item) (bool, error)
- func (b *Base) IsPerpetualFutureCurrency(asset.Item, currency.Pair) (bool, error)
- func (b *Base) IsRESTAuthenticationSupported() bool
- func (b *Base) IsSaveTradeDataEnabled() bool
- func (b *Base) IsTradeFeedEnabled() bool
- func (b *Base) IsVerbose() bool
- func (b *Base) IsWebsocketAuthenticationSupported() bool
- func (b *Base) IsWebsocketEnabled() bool
- func (b *Base) MatchSymbolCheckEnabled(symbol string, a asset.Item, hasDelimiter bool) (pair currency.Pair, enabled bool, err error)
- func (b *Base) MatchSymbolWithAvailablePairs(symbol string, a asset.Item, hasDelimiter bool) (currency.Pair, error)
- func (b *Base) NewEndpoints() *Endpoints
- func (b *Base) ParallelChanOp(channels subscription.List, m func(subscription.List) error, batchSize int) error
- func (b *Base) PrintEnabledPairs()
- func (b *Base) ScaleCollateral(context.Context, *futures.CollateralCalculator) (*collateral.ByCurrency, error)
- func (b *Base) SetAPICredentialDefaults()
- func (b *Base) SetAPIURL() error
- func (b *Base) SetClientProxyAddress(addr string) error
- func (b *Base) SetCollateralMode(_ context.Context, _ asset.Item, _ collateral.Mode) error
- func (b *Base) SetConfigPairs() error
- func (b *Base) SetCredentials(apiKey, apiSecret, clientID, subaccount, pemKey, oneTimePassword string)
- func (b *Base) SetCurrencyPairFormat() error
- func (b *Base) SetEnabled(enabled bool)
- func (b *Base) SetFeatureDefaults()
- func (b *Base) SetFillsFeedStatus(enabled bool)
- func (b *Base) SetGlobalPairsManager(request, config *currency.PairFormat, assets ...asset.Item) error
- func (b *Base) SetLeverage(_ context.Context, _ asset.Item, _ currency.Pair, _ margin.Type, _ float64, ...) error
- func (b *Base) SetMarginType(_ context.Context, _ asset.Item, _ currency.Pair, _ margin.Type) error
- func (b *Base) SetPairs(pairs currency.Pairs, assetType asset.Item, enabled bool) error
- func (b *Base) SetRequester(r *request.Requester) error
- func (b *Base) SetSaveTradeDataStatus(enabled bool)
- func (b *Base) SetSubscriptionsFromConfig()
- func (b *Base) SetTradeFeedStatus(enabled bool)
- func (b *Base) SetupDefaults(exch *config.Exchange) error
- func (b *Base) Shutdown() error
- func (b *Base) StoreAssetPairFormat(a asset.Item, f currency.PairStore) error
- func (b *Base) SubscribeToWebsocketChannels(channels subscription.List) error
- func (b *Base) SupportsAsset(a asset.Item) bool
- func (b *Base) SupportsAutoPairUpdates() bool
- func (b *Base) SupportsPair(p currency.Pair, enabledPairs bool, assetType asset.Item) error
- func (b *Base) SupportsREST() bool
- func (b *Base) SupportsRESTTickerBatchUpdates() bool
- func (b *Base) SupportsWebsocket() bool
- func (b *Base) SupportsWithdrawPermissions(permissions uint32) bool
- func (b *Base) UnsubscribeToWebsocketChannels(channels subscription.List) error
- func (b *Base) UpdateCurrencyStates(_ context.Context, _ asset.Item) error
- func (b *Base) UpdatePairs(incoming currency.Pairs, a asset.Item, enabled, force bool) error
- func (b *Base) ValidateKline(pair currency.Pair, a asset.Item, interval kline.Interval) error
- func (b *Base) VerifyAPICredentials(creds *account.Credentials) error
- type CurrencyStateManagement
- type Endpoints
- type Features
- type FeaturesEnabled
- type FeaturesSupported
- type FeeBuilder
- type FeeType
- type FunctionalityChecker
- type FundingHistory
- type FuturesCapabilities
- type FuturesManagement
- type IBotExchange
- type InternationalBankTransactionType
- type MarginCapabilities
- type MarginManagement
- type OpenInterestSupport
- type OrderManagement
- type URL
- type WithdrawalHistory
Constants ¶
const ( // DefaultHTTPTimeout is the default HTTP/HTTPS Timeout for exchange requests DefaultHTTPTimeout = time.Second * 15 // DefaultWebsocketResponseCheckTimeout is the default delay in checking for an expected websocket response DefaultWebsocketResponseCheckTimeout = time.Millisecond * 50 // DefaultWebsocketResponseMaxLimit is the default max wait for an expected websocket response before a timeout DefaultWebsocketResponseMaxLimit = time.Second * 7 // DefaultWebsocketOrderbookBufferLimit is the maximum number of orderbook updates that get stored before being applied DefaultWebsocketOrderbookBufferLimit = 5 )
const ( // Repeated exchange strings // FeeType custom type for calculating fees based on method WireTransfer InternationalBankTransactionType = iota PerfectMoney Neteller AdvCash Payeer Skrill Simplex SEPA Swift RapidTransfer MisterTangoSEPA Qiwi VisaMastercard WebMoney Capitalist WesternUnion MoneyGram Contact // Const declarations for fee types BankFee FeeType = iota InternationalBankDepositFee InternationalBankWithdrawalFee CryptocurrencyTradeFee CryptocurrencyDepositFee CryptocurrencyWithdrawalFee OfflineTradeFee // Definitions for each type of withdrawal method for a given exchange NoAPIWithdrawalMethods uint32 = 0 NoAPIWithdrawalMethodsText string = "NONE, WEBSITE ONLY" AutoWithdrawCrypto uint32 = (1 << 0) AutoWithdrawCryptoWithAPIPermission uint32 = (1 << 1) AutoWithdrawCryptoWithSetup uint32 = (1 << 2) AutoWithdrawCryptoText string = "AUTO WITHDRAW CRYPTO" AutoWithdrawCryptoWithAPIPermissionText string = "AUTO WITHDRAW CRYPTO WITH API PERMISSION" AutoWithdrawCryptoWithSetupText string = "AUTO WITHDRAW CRYPTO WITH SETUP" WithdrawCryptoWith2FA uint32 = (1 << 3) WithdrawCryptoWithSMS uint32 = (1 << 4) WithdrawCryptoWithEmail uint32 = (1 << 5) WithdrawCryptoWithWebsiteApproval uint32 = (1 << 6) WithdrawCryptoWithAPIPermission uint32 = (1 << 7) WithdrawCryptoWith2FAText string = "WITHDRAW CRYPTO WITH 2FA" WithdrawCryptoWithSMSText string = "WITHDRAW CRYPTO WITH SMS" WithdrawCryptoWithEmailText string = "WITHDRAW CRYPTO WITH EMAIL" WithdrawCryptoWithWebsiteApprovalText string = "WITHDRAW CRYPTO WITH WEBSITE APPROVAL" WithdrawCryptoWithAPIPermissionText string = "WITHDRAW CRYPTO WITH API PERMISSION" AutoWithdrawFiat uint32 = (1 << 8) AutoWithdrawFiatWithAPIPermission uint32 = (1 << 9) AutoWithdrawFiatWithSetup uint32 = (1 << 10) AutoWithdrawFiatText string = "AUTO WITHDRAW FIAT" AutoWithdrawFiatWithAPIPermissionText string = "AUTO WITHDRAW FIAT WITH API PERMISSION" AutoWithdrawFiatWithSetupText string = "AUTO WITHDRAW FIAT WITH SETUP" WithdrawFiatWith2FA uint32 = (1 << 11) WithdrawFiatWithSMS uint32 = (1 << 12) WithdrawFiatWithEmail uint32 = (1 << 13) WithdrawFiatWithWebsiteApproval uint32 = (1 << 14) WithdrawFiatWithAPIPermission uint32 = (1 << 15) WithdrawFiatWith2FAText string = "WITHDRAW FIAT WITH 2FA" WithdrawFiatWithSMSText string = "WITHDRAW FIAT WITH SMS" WithdrawFiatWithEmailText string = "WITHDRAW FIAT WITH EMAIL" WithdrawFiatWithWebsiteApprovalText string = "WITHDRAW FIAT WITH WEBSITE APPROVAL" WithdrawFiatWithAPIPermissionText string = "WITHDRAW FIAT WITH API PERMISSION" WithdrawCryptoViaWebsiteOnly uint32 = (1 << 16) WithdrawFiatViaWebsiteOnly uint32 = (1 << 17) WithdrawCryptoViaWebsiteOnlyText string = "WITHDRAW CRYPTO VIA WEBSITE ONLY" WithdrawFiatViaWebsiteOnlyText string = "WITHDRAW FIAT VIA WEBSITE ONLY" NoFiatWithdrawals uint32 = (1 << 18) NoFiatWithdrawalsText string = "NO FIAT WITHDRAWAL" UnknownWithdrawalTypeText string = "UNKNOWN" )
Endpoint authentication types
Variables ¶
var ( // ErrAuthenticationSupportNotEnabled defines an error when // authenticatedSupport and authenticatedWebsocketApiSupport are set to // false in config.json ErrAuthenticationSupportNotEnabled = errors.New("REST or Websocket authentication support is not enabled") // ErrCredentialsAreEmpty defines an error for when the credentials are // completely empty but an attempt at retrieving credentials was made to // undertake an authenticated HTTP request. ErrCredentialsAreEmpty = errors.New("credentials are empty") )
var ( ErrExchangeNameIsEmpty = errors.New("exchange name is empty") ErrSymbolCannotBeMatched = errors.New("symbol cannot be matched") )
Public Errors
var Exchanges = []string{
"binance",
"binanceus",
"bitfinex",
"bithumb",
"bitflyer",
"bitmex",
"bitstamp",
"btc markets",
"btse",
"bybit",
"coinbasepro",
"coinut",
"deribit",
"exmo",
"gateio",
"gemini",
"hitbtc",
"huobi",
"kraken",
"kucoin",
"lbank",
"okx",
"poloniex",
"yobit",
}
Exchanges stores a list of supported exchanges
Functions ¶
func Bootstrap ¶
func Bootstrap(ctx context.Context, b IBotExchange) error
Bootstrap function allows for exchange authors to supplement or override common startup actions If exchange.Bootstrap returns false or error it will not perform any other actions. If it returns true, or is not implemented by the exchange, it will: * Print debug startup information * UpdateOrderExecutionLimits * UpdateTradablePairs
func GetDefaultConfig ¶
GetDefaultConfig returns a default exchange config
func IsSupported ¶
IsSupported returns whether or not a specific exchange is supported
Types ¶
type API ¶
type API struct { AuthenticatedSupport bool AuthenticatedWebsocketSupport bool PEMKeySupport bool Endpoints *Endpoints CredentialsValidator config.APICredentialsValidatorConfig // contains filtered or unexported fields }
API stores the exchange API settings
func (*API) SetClientID ¶
SetClientID sets new clientID for the default credentials
func (*API) SetSubAccount ¶
SetSubAccount sets sub account for the default credentials
type AccountManagement ¶
type AccountManagement interface { UpdateAccountInfo(ctx context.Context, a asset.Item) (account.Holdings, error) FetchAccountInfo(ctx context.Context, a asset.Item) (account.Holdings, error) HasAssetTypeAccountSegregation() bool }
AccountManagement defines functionality for exchange account management
type AssetWebsocketSupport ¶
type AssetWebsocketSupport struct {
// contains filtered or unexported fields
}
AssetWebsocketSupport defines the availability of websocket functionality to the specific asset type. TODO: Deprecate as this is a temp item to address certain limitations quickly.
func (*AssetWebsocketSupport) IsAssetWebsocketSupported ¶
func (a *AssetWebsocketSupport) IsAssetWebsocketSupported(aType asset.Item) bool
IsAssetWebsocketSupported checks to see if the supplied asset type is supported by websocket.
type Base ¶
type Base struct { Name string Enabled bool Verbose bool LoadedByConfig bool SkipAuthCheck bool API API BaseCurrencies currency.Currencies CurrencyPairs currency.PairsManager Features Features HTTPTimeout time.Duration HTTPRecording bool HTTPDebugging bool BypassConfigFormatUpgrades bool WebsocketResponseCheckTimeout time.Duration WebsocketResponseMaxLimit time.Duration WebsocketOrderbookBufferLimit int64 Websocket *stream.Websocket *request.Requester Config *config.Exchange // CanVerifyOrderbook determines if the orderbook verification can be bypassed, // increasing potential update speed but decreasing confidence in orderbook // integrity. CanVerifyOrderbook bool order.ExecutionLimits AssetWebsocketSupport *currencystate.States // contains filtered or unexported fields }
Base stores the individual exchange information
func (*Base) AddTradesToBuffer ¶
AddTradesToBuffer is a helper function that will only add trades to the buffer if it is allowed
func (*Base) AreCredentialsValid ¶
AreCredentialsValid returns if the supplied credentials are valid.
func (*Base) AuthenticateWebsocket ¶
AuthenticateWebsocket sends an authentication message to the websocket
func (*Base) Bootstrap ¶
Bootstrap is a fallback method for exchange startup actions Exchange authors should override this if they wish to customise startup actions Return true or an error to all default Bootstrap actions to occur afterwards or false to signal that no further bootstrapping should occur
func (*Base) CalculatePNL ¶
func (b *Base) CalculatePNL(context.Context, *futures.PNLCalculatorRequest) (*futures.PNLResult, error)
CalculatePNL is an overridable function to allow PNL to be calculated on an open position It will also determine whether the position is considered to be liquidated For live trading, an overriding function may wish to confirm the liquidation by requesting the status of the asset
func (*Base) CalculateTotalCollateral ¶
func (b *Base) CalculateTotalCollateral(_ context.Context, _ *futures.TotalCollateralCalculator) (*futures.TotalCollateralResponse, error)
CalculateTotalCollateral takes in n collateral calculators to determine an overall standing in a singular currency
func (*Base) CanUseAuthenticatedWebsocketEndpoints ¶
CanUseAuthenticatedWebsocketEndpoints calls b.Websocket.CanUseAuthenticatedEndpoints Used to avoid import cycles on stream.websocket
func (*Base) ChangePositionMargin ¶
func (b *Base) ChangePositionMargin(_ context.Context, _ *margin.PositionChangeRequest) (*margin.PositionChangeResponse, error)
ChangePositionMargin changes the margin type for a position
func (*Base) CheckCredentials ¶
func (b *Base) CheckCredentials(creds *account.Credentials, isContext bool) error
CheckCredentials checks to see if the required fields have been set before sending an authenticated API request
func (*Base) CheckTransientError ¶
CheckTransientError catches transient errors and returns nil if found, used for validation of API credentials
func (*Base) DisableAssetWebsocketSupport ¶
DisableAssetWebsocketSupport disables websocket functionality for the supplied asset item. In the case that websocket functionality has not yet been implemented for that specific asset type. This is a base method to check availability of asset type.
func (*Base) DisableRateLimiter ¶
DisableRateLimiter disables the rate limiting system for the exchange
func (*Base) EnableRateLimiter ¶
EnableRateLimiter enables the rate limiting system for the exchange
func (*Base) EnsureOnePairEnabled ¶
EnsureOnePairEnabled not all assets have pairs, eg options search for an asset that does and enable one if none are enabled error if no currency pairs found for an entire exchange
func (*Base) FlushWebsocketChannels ¶
FlushWebsocketChannels refreshes websocket channel subscriptions based on websocket features. Used in the event of a pair/asset or subscription change.
func (*Base) FormatExchangeCurrencies ¶
func (b *Base) FormatExchangeCurrencies(pairs []currency.Pair, assetType asset.Item) (string, error)
FormatExchangeCurrencies returns a string containing the exchanges formatted currency pairs
func (*Base) FormatExchangeCurrency ¶
FormatExchangeCurrency is a method that formats and returns a currency pair based on the user currency display preferences
func (*Base) FormatExchangeKlineInterval ¶
FormatExchangeKlineInterval returns Interval to string Exchanges can override this if they require custom formatting
func (*Base) FormatSymbol ¶
FormatSymbol formats the given pair to a string suitable for exchange API requests
func (*Base) FormatWithdrawPermissions ¶
FormatWithdrawPermissions will return each of the exchange's compatible withdrawal methods in readable form
func (*Base) GetAssetTypes ¶
GetAssetTypes returns the either the enabled or available asset types for an individual exchange
func (*Base) GetAvailablePairs ¶
GetAvailablePairs is a method that returns the available currency pairs of the exchange by asset type
func (*Base) GetAvailableTransferChains ¶
GetAvailableTransferChains returns a list of supported transfer chains based on the supplied cryptocurrency
func (*Base) GetCachedOpenInterest ¶
func (b *Base) GetCachedOpenInterest(_ context.Context, k ...key.PairAsset) ([]futures.OpenInterest, error)
GetCachedOpenInterest returns open interest data if the exchange supports open interest in ticker data
func (*Base) GetClientBankAccounts ¶
func (b *Base) GetClientBankAccounts(exchangeName, withdrawalCurrency string) (*banking.Account, error)
GetClientBankAccounts returns banking details associated with a client for withdrawal purposes
func (*Base) GetCollateralCurrencyForContract ¶
func (b *Base) GetCollateralCurrencyForContract(_ asset.Item, _ currency.Pair) (currency.Code, asset.Item, error)
GetCollateralCurrencyForContract returns the collateral currency for an asset and contract pair
func (*Base) GetCollateralMode ¶
GetCollateralMode returns the account's collateral mode for the asset type
func (*Base) GetCredentials ¶
GetCredentials checks and validates current credentials, context credentials override default credentials, if no credentials found, will return an error.
func (*Base) GetCurrencyForRealisedPNL ¶
func (b *Base) GetCurrencyForRealisedPNL(_ asset.Item, _ currency.Pair) (currency.Code, asset.Item, error)
GetCurrencyForRealisedPNL returns where to put realised PNL example 1: Bybit universal margin PNL is paid out in USD to your spot wallet example 2: Binance coin margined futures pays returns using the same currency eg BTC
func (*Base) GetCurrencyTradeURL ¶
GetCurrencyTradeURL returns the URL to the exchange's trade page for the given asset and currency pair
func (*Base) GetDefaultCredentials ¶
func (b *Base) GetDefaultCredentials() *account.Credentials
GetDefaultCredentials returns the exchange.Base api credentials loaded by config.json
func (*Base) GetEnabledFeatures ¶
func (b *Base) GetEnabledFeatures() FeaturesEnabled
GetEnabledFeatures returns the exchanges enabled features
func (*Base) GetEnabledPairs ¶
GetEnabledPairs is a method that returns the enabled currency pairs of the exchange by asset type, if the asset type is disabled this will return no enabled pairs
func (*Base) GetExchangeBankAccounts ¶
GetExchangeBankAccounts returns banking details associated with an exchange for funding purposes
func (*Base) GetFuturesPositionOrders ¶
func (b *Base) GetFuturesPositionOrders(context.Context, *futures.PositionsRequest) ([]futures.PositionResponse, error)
GetFuturesPositionOrders returns futures positions orders
func (*Base) GetFuturesPositionSummary ¶
func (b *Base) GetFuturesPositionSummary(context.Context, *futures.PositionSummaryRequest) (*futures.PositionSummary, error)
GetFuturesPositionSummary returns stats for a future position
func (*Base) GetFuturesPositions ¶
func (b *Base) GetFuturesPositions(context.Context, *futures.PositionsRequest) ([]futures.PositionDetails, error)
GetFuturesPositions returns futures positions for all currencies
func (*Base) GetHistoricalFundingRates ¶
func (b *Base) GetHistoricalFundingRates(context.Context, *fundingrate.HistoricalRatesRequest) (*fundingrate.HistoricalRates, error)
GetHistoricalFundingRates returns historical funding rates for a future
func (*Base) GetKlineExtendedRequest ¶
func (b *Base) GetKlineExtendedRequest(pair currency.Pair, a asset.Item, interval kline.Interval, start, end time.Time) (*kline.ExtendedRequest, error)
GetKlineExtendedRequest returns a helper for the fetching of candle/kline data for a *multi* request within a pre-determined time window. This has extended functionality to also break down calls to fetch total history.
func (*Base) GetKlineRequest ¶
func (b *Base) GetKlineRequest(pair currency.Pair, a asset.Item, interval kline.Interval, start, end time.Time, fixedAPICandleLength bool) (*kline.Request, error)
GetKlineRequest returns a helper for the fetching of candle/kline data for a single request within a pre-determined time window.
func (*Base) GetLastPairsUpdateTime ¶
GetLastPairsUpdateTime returns the unix timestamp of when the exchanges currency pairs were last updated
func (*Base) GetLeverage ¶
func (b *Base) GetLeverage(_ context.Context, _ asset.Item, _ currency.Pair, _ margin.Type, _ order.Side) (float64, error)
GetLeverage gets the account's initial leverage for the asset type and pair
func (*Base) GetMarginRatesHistory ¶
func (b *Base) GetMarginRatesHistory(context.Context, *margin.RateHistoryRequest) (*margin.RateHistoryResponse, error)
GetMarginRatesHistory returns the margin rate history for the supplied currency
func (*Base) GetOpenInterest ¶
GetOpenInterest returns the open interest rate for a given asset pair
func (*Base) GetPairAndAssetTypeRequestFormatted ¶
func (b *Base) GetPairAndAssetTypeRequestFormatted(symbol string) (currency.Pair, asset.Item, error)
GetPairAndAssetTypeRequestFormatted returns the pair and the asset type when there is distinct differentiation between exchange request symbols asset types. e.g. "BTC-USD" Spot and "BTC_USD" PERP request formatted.
func (*Base) GetPairAssetType ¶
GetPairAssetType returns the associated asset type for the currency pair This method is only useful for exchanges that have pair names with multiple delimiters (BTC-USD-0626) Helpful if the exchange has only a single asset type but in that case the asset type can be hard coded
func (*Base) GetPairFormat ¶
GetPairFormat returns the pair format based on the exchange and asset type
func (*Base) GetPositionSummary ¶
func (b *Base) GetPositionSummary(context.Context, *futures.PositionSummaryRequest) (*futures.PositionSummary, error)
GetPositionSummary returns stats for a future position
func (*Base) GetRequestFormattedPairAndAssetType ¶
GetRequestFormattedPairAndAssetType is a method that returns the enabled currency pair of along with its asset type. Only use when there is no chance of the same name crossing over
func (*Base) GetStandardConfig ¶
GetStandardConfig returns a standard default exchange config. Set defaults must populate base struct with exchange specific defaults before calling this function.
func (*Base) GetSubscriptionTemplate ¶
func (b *Base) GetSubscriptionTemplate(*subscription.Subscription) (*template.Template, error)
GetSubscriptionTemplate returns a template for a given subscription; See exchange/subscription/README.md for more information
func (*Base) GetSubscriptions ¶
func (b *Base) GetSubscriptions() (subscription.List, error)
GetSubscriptions returns a copied list of subscriptions
func (*Base) GetSupportedFeatures ¶
func (b *Base) GetSupportedFeatures() FeaturesSupported
GetSupportedFeatures returns the exchanges supported features
func (*Base) GetTradingRequirements ¶
func (b *Base) GetTradingRequirements() protocol.TradingRequirements
GetTradingRequirements returns the exchange's trading requirements.
func (*Base) GetWebsocket ¶
GetWebsocket returns a pointer to the exchange websocket
func (*Base) GetWithdrawPermissions ¶
GetWithdrawPermissions passes through the exchange's withdraw permissions
func (*Base) HasAssetTypeAccountSegregation ¶
HasAssetTypeAccountSegregation returns if the accounts are divided into asset types instead of just being denoted as spot holdings.
func (*Base) IsFillsFeedEnabled ¶
IsFillsFeedEnabled checks the state of FillsFeed in a concurrent-friendly manner
func (*Base) IsPairEnabled ¶
IsPairEnabled checks if a pair is enabled for an enabled asset type. TODO: Optimisation map for enabled pair matching, instead of linear traversal.
func (*Base) IsPerpetualFutureCurrency ¶
IsPerpetualFutureCurrency ensures a given asset and currency is a perpetual future differs by exchange
func (*Base) IsRESTAuthenticationSupported ¶
IsRESTAuthenticationSupported returns whether the exchange supports REST authenticated API requests
func (*Base) IsSaveTradeDataEnabled ¶
IsSaveTradeDataEnabled checks the state of SaveTradeData in a concurrent-friendly manner
func (*Base) IsTradeFeedEnabled ¶
IsTradeFeedEnabled checks the state of TradeFeed in a concurrent-friendly manner
func (*Base) IsWebsocketAuthenticationSupported ¶
IsWebsocketAuthenticationSupported returns whether the exchange supports websocket authenticated API requests
func (*Base) IsWebsocketEnabled ¶
IsWebsocketEnabled returns whether or not the exchange has its websocket client enabled
func (*Base) MatchSymbolCheckEnabled ¶
func (b *Base) MatchSymbolCheckEnabled(symbol string, a asset.Item, hasDelimiter bool) (pair currency.Pair, enabled bool, err error)
MatchSymbolCheckEnabled returns a currency pair based on the supplied symbol and asset type against the available pairs list. If the string is expected to have a delimiter this will attempt to screen it out. It will also check if the pair is enabled.
func (*Base) MatchSymbolWithAvailablePairs ¶
func (b *Base) MatchSymbolWithAvailablePairs(symbol string, a asset.Item, hasDelimiter bool) (currency.Pair, error)
MatchSymbolWithAvailablePairs returns a currency pair based on the supplied symbol and asset type. If the string is expected to have a delimiter this will attempt to screen it out.
func (*Base) NewEndpoints ¶
NewEndpoints declares default and running URLs maps
func (*Base) ParallelChanOp ¶
func (b *Base) ParallelChanOp(channels subscription.List, m func(subscription.List) error, batchSize int) error
ParallelChanOp performs a single method call in parallel across streams and waits to return any errors
func (*Base) PrintEnabledPairs ¶
func (b *Base) PrintEnabledPairs()
PrintEnabledPairs prints the exchanges enabled asset pairs
func (*Base) ScaleCollateral ¶
func (b *Base) ScaleCollateral(context.Context, *futures.CollateralCalculator) (*collateral.ByCurrency, error)
ScaleCollateral is an overridable function to determine how much collateral is usable in futures positions
func (*Base) SetAPICredentialDefaults ¶
func (b *Base) SetAPICredentialDefaults()
SetAPICredentialDefaults sets the API Credential validator defaults
func (*Base) SetClientProxyAddress ¶
SetClientProxyAddress sets a proxy address for REST and websocket requests
func (*Base) SetCollateralMode ¶
SetCollateralMode sets the account's collateral mode for the asset type
func (*Base) SetConfigPairs ¶
SetConfigPairs sets the exchanges currency pairs to the pairs set in the config
func (*Base) SetCredentials ¶
func (b *Base) SetCredentials(apiKey, apiSecret, clientID, subaccount, pemKey, oneTimePassword string)
SetCredentials is a method that sets the current API keys for the exchange
func (*Base) SetCurrencyPairFormat ¶
SetCurrencyPairFormat checks the exchange request and config currency pair formats and syncs it with the exchanges SetDefault settings
func (*Base) SetEnabled ¶
SetEnabled is a method that sets if the exchange is enabled
func (*Base) SetFeatureDefaults ¶
func (b *Base) SetFeatureDefaults()
SetFeatureDefaults sets the exchanges default feature support set
func (*Base) SetFillsFeedStatus ¶
SetFillsFeedStatus locks and sets the status of the config and the exchange's setting for FillsFeed
func (*Base) SetGlobalPairsManager ¶
func (b *Base) SetGlobalPairsManager(request, config *currency.PairFormat, assets ...asset.Item) error
SetGlobalPairsManager sets defined asset and pairs management system with global formatting
func (*Base) SetLeverage ¶
func (b *Base) SetLeverage(_ context.Context, _ asset.Item, _ currency.Pair, _ margin.Type, _ float64, _ order.Side) error
SetLeverage sets the account's initial leverage for the asset type and pair
func (*Base) SetMarginType ¶
SetMarginType sets the account's margin type for the asset type
func (*Base) SetPairs ¶
SetPairs sets the exchange currency pairs for either enabledPairs or availablePairs
func (*Base) SetRequester ¶
SetRequester sets the instance of the requester
func (*Base) SetSaveTradeDataStatus ¶
SetSaveTradeDataStatus locks and sets the status of the config and the exchange's setting for SaveTradeData
func (*Base) SetSubscriptionsFromConfig ¶
func (b *Base) SetSubscriptionsFromConfig()
SetSubscriptionsFromConfig sets the subscriptions from config If the subscriptions config is empty then Config will be updated from the exchange subscriptions, allowing e.SetDefaults to set default subscriptions for an exchange to update user's config Subscriptions not Enabled are skipped, meaning that e.Features.Subscriptions only contains Enabled subscriptions
func (*Base) SetTradeFeedStatus ¶
SetTradeFeedStatus locks and sets the status of the config and the exchange's setting for TradeFeed
func (*Base) SetupDefaults ¶
SetupDefaults sets the exchange settings based on the supplied config
func (*Base) Shutdown ¶
Shutdown closes active websocket connections if available and then cleans up a REST requester instance.
func (*Base) StoreAssetPairFormat ¶
StoreAssetPairFormat initialises and stores a defined asset format
func (*Base) SubscribeToWebsocketChannels ¶
func (b *Base) SubscribeToWebsocketChannels(channels subscription.List) error
SubscribeToWebsocketChannels appends to ChannelsToSubscribe which lets websocket.manageSubscriptions handle subscribing
func (*Base) SupportsAsset ¶
SupportsAsset whether or not the supplied asset is supported by the exchange
func (*Base) SupportsAutoPairUpdates ¶
SupportsAutoPairUpdates returns whether or not the exchange supports auto currency pair updating
func (*Base) SupportsPair ¶
SupportsPair returns true or not whether a currency pair exists in the exchange available currencies or not
func (*Base) SupportsREST ¶
SupportsREST returns whether or not the exchange supports REST
func (*Base) SupportsRESTTickerBatchUpdates ¶
SupportsRESTTickerBatchUpdates returns whether or not the exchange supports REST batch ticker fetching
func (*Base) SupportsWebsocket ¶
SupportsWebsocket returns whether or not the exchange supports websocket
func (*Base) SupportsWithdrawPermissions ¶
SupportsWithdrawPermissions compares the supplied permissions with the exchange's to verify they're supported
func (*Base) UnsubscribeToWebsocketChannels ¶
func (b *Base) UnsubscribeToWebsocketChannels(channels subscription.List) error
UnsubscribeToWebsocketChannels removes from ChannelsToSubscribe which lets websocket.manageSubscriptions handle unsubscribing
func (*Base) UpdateCurrencyStates ¶
UpdateCurrencyStates updates currency states
func (*Base) UpdatePairs ¶
UpdatePairs updates the exchange currency pairs for either enabledPairs or availablePairs
func (*Base) ValidateKline ¶
ValidateKline confirms that the requested pair, asset & interval are supported and/or enabled by the requested exchange.
func (*Base) VerifyAPICredentials ¶
func (b *Base) VerifyAPICredentials(creds *account.Credentials) error
VerifyAPICredentials verifies the exchanges API credentials
type CurrencyStateManagement ¶
type CurrencyStateManagement interface { GetCurrencyStateSnapshot() ([]currencystate.Snapshot, error) UpdateCurrencyStates(ctx context.Context, a asset.Item) error CanTradePair(p currency.Pair, a asset.Item) error CanTrade(c currency.Code, a asset.Item) error CanWithdraw(c currency.Code, a asset.Item) error CanDeposit(c currency.Code, a asset.Item) error }
CurrencyStateManagement defines functionality for currency state management
type Endpoints ¶
type Endpoints struct { Exchange string // contains filtered or unexported fields }
Endpoints stores running url endpoints for exchanges
func (*Endpoints) GetURLMap ¶
GetURLMap gets all urls for either running or default map based on the bool value supplied
func (*Endpoints) SetDefaultEndpoints ¶
SetDefaultEndpoints declares and sets the default URLs map
func (*Endpoints) SetRunning ¶
SetRunning populates running URLs map
type Features ¶
type Features struct { Supports FeaturesSupported Enabled FeaturesEnabled Subscriptions subscription.List CurrencyTranslations currency.Translations TradingRequirements protocol.TradingRequirements }
Features stores the supported and enabled features for the exchange
type FeaturesEnabled ¶
type FeaturesEnabled struct { AutoPairUpdates bool Kline kline.ExchangeCapabilitiesEnabled SaveTradeData bool TradeFeed bool FillsFeed bool }
FeaturesEnabled stores the exchange enabled features
type FeaturesSupported ¶
type FeaturesSupported struct { REST bool RESTCapabilities protocol.Features Websocket bool WebsocketCapabilities protocol.Features WithdrawPermissions uint32 Kline kline.ExchangeCapabilitiesSupported MaximumOrderHistory time.Duration FuturesCapabilities FuturesCapabilities OfflineFuturesCapabilities FuturesCapabilities }
FeaturesSupported stores the exchanges supported features
type FeeBuilder ¶
type FeeBuilder struct { FeeType FeeType // Used for calculating crypto trading fees, deposits & withdrawals Pair currency.Pair IsMaker bool // Fiat currency used for bank deposits & withdrawals FiatCurrency currency.Code BankTransactionType InternationalBankTransactionType // Used to multiply for fee calculations PurchasePrice float64 Amount float64 }
FeeBuilder is the type which holds all parameters required to calculate a fee for an exchange
type FeeType ¶
type FeeType uint8
FeeType is the type for holding a custom fee type (International withdrawal fee)
type FunctionalityChecker ¶
type FunctionalityChecker interface { IsEnabled() bool IsAssetWebsocketSupported(a asset.Item) bool SupportsAsset(assetType asset.Item) bool SupportsREST() bool SupportsWithdrawPermissions(permissions uint32) bool SupportsRESTTickerBatchUpdates() bool IsWebsocketEnabled() bool SupportsWebsocket() bool SupportsAutoPairUpdates() bool IsWebsocketAuthenticationSupported() bool IsRESTAuthenticationSupported() bool }
FunctionalityChecker defines functionality for retrieving exchange support/enabled features
type FundingHistory ¶
type FundingHistory struct { ExchangeName string Status string TransferID string Description string Timestamp time.Time Currency string Amount float64 Fee float64 TransferType string CryptoToAddress string CryptoFromAddress string CryptoTxID string CryptoChain string BankTo string BankFrom string }
FundingHistory holds exchange funding history data
type FuturesCapabilities ¶
type FuturesCapabilities struct { FundingRates bool MaximumFundingRateHistory time.Duration FundingRateBatching map[asset.Item]bool SupportedFundingRateFrequencies map[kline.Interval]bool Positions bool OrderManagerPositionTracking bool Collateral bool CollateralMode bool Leverage bool OpenInterest OpenInterestSupport }
FuturesCapabilities stores the exchange's futures capabilities
type FuturesManagement ¶
type FuturesManagement interface { GetOpenInterest(context.Context, ...key.PairAsset) ([]futures.OpenInterest, error) ScaleCollateral(ctx context.Context, calculator *futures.CollateralCalculator) (*collateral.ByCurrency, error) GetPositionSummary(context.Context, *futures.PositionSummaryRequest) (*futures.PositionSummary, error) CalculateTotalCollateral(context.Context, *futures.TotalCollateralCalculator) (*futures.TotalCollateralResponse, error) GetFuturesPositions(context.Context, *futures.PositionsRequest) ([]futures.PositionDetails, error) GetHistoricalFundingRates(context.Context, *fundingrate.HistoricalRatesRequest) (*fundingrate.HistoricalRates, error) GetLatestFundingRates(context.Context, *fundingrate.LatestRateRequest) ([]fundingrate.LatestRateResponse, error) IsPerpetualFutureCurrency(asset.Item, currency.Pair) (bool, error) GetCollateralCurrencyForContract(asset.Item, currency.Pair) (currency.Code, asset.Item, error) GetFuturesPositionSummary(context.Context, *futures.PositionSummaryRequest) (*futures.PositionSummary, error) GetFuturesPositionOrders(context.Context, *futures.PositionsRequest) ([]futures.PositionResponse, error) SetCollateralMode(ctx context.Context, item asset.Item, mode collateral.Mode) error GetCollateralMode(ctx context.Context, item asset.Item) (collateral.Mode, error) SetLeverage(ctx context.Context, item asset.Item, pair currency.Pair, marginType margin.Type, amount float64, orderSide order.Side) error GetLeverage(ctx context.Context, item asset.Item, pair currency.Pair, marginType margin.Type, orderSide order.Side) (float64, error) }
FuturesManagement manages futures orders, pnl and collateral calculations
type IBotExchange ¶
type IBotExchange interface { Setup(exch *config.Exchange) error Bootstrap(context.Context) (continueBootstrap bool, err error) SetDefaults() Shutdown() error GetName() string SetEnabled(bool) GetEnabledFeatures() FeaturesEnabled GetSupportedFeatures() FeaturesSupported // GetTradingRequirements returns trading requirements for the exchange GetTradingRequirements() protocol.TradingRequirements FetchTicker(ctx context.Context, p currency.Pair, a asset.Item) (*ticker.Price, error) UpdateTicker(ctx context.Context, p currency.Pair, a asset.Item) (*ticker.Price, error) UpdateTickers(ctx context.Context, a asset.Item) error FetchOrderbook(ctx context.Context, p currency.Pair, a asset.Item) (*orderbook.Base, error) UpdateOrderbook(ctx context.Context, p currency.Pair, a asset.Item) (*orderbook.Base, error) FetchTradablePairs(ctx context.Context, a asset.Item) (currency.Pairs, error) UpdateTradablePairs(ctx context.Context, forceUpdate bool) error GetEnabledPairs(a asset.Item) (currency.Pairs, error) GetAvailablePairs(a asset.Item) (currency.Pairs, error) SetPairs(pairs currency.Pairs, a asset.Item, enabled bool) error GetAssetTypes(enabled bool) asset.Items GetRecentTrades(ctx context.Context, p currency.Pair, a asset.Item) ([]trade.Data, error) GetHistoricTrades(ctx context.Context, p currency.Pair, a asset.Item, startTime, endTime time.Time) ([]trade.Data, error) GetFeeByType(ctx context.Context, f *FeeBuilder) (float64, error) GetLastPairsUpdateTime() int64 GetWithdrawPermissions() uint32 FormatWithdrawPermissions() string GetAccountFundingHistory(ctx context.Context) ([]FundingHistory, error) GetDepositAddress(ctx context.Context, cryptocurrency currency.Code, accountID, chain string) (*deposit.Address, error) GetAvailableTransferChains(ctx context.Context, cryptocurrency currency.Code) ([]string, error) GetWithdrawalsHistory(ctx context.Context, code currency.Code, a asset.Item) ([]WithdrawalHistory, error) WithdrawCryptocurrencyFunds(ctx context.Context, withdrawRequest *withdraw.Request) (*withdraw.ExchangeResponse, error) WithdrawFiatFunds(ctx context.Context, withdrawRequest *withdraw.Request) (*withdraw.ExchangeResponse, error) WithdrawFiatFundsToInternationalBank(ctx context.Context, withdrawRequest *withdraw.Request) (*withdraw.ExchangeResponse, error) SetHTTPClientUserAgent(ua string) error GetHTTPClientUserAgent() (string, error) SetClientProxyAddress(addr string) error GetBase() *Base GetHistoricCandles(ctx context.Context, pair currency.Pair, a asset.Item, interval kline.Interval, start, end time.Time) (*kline.Item, error) GetHistoricCandlesExtended(ctx context.Context, pair currency.Pair, a asset.Item, interval kline.Interval, start, end time.Time) (*kline.Item, error) DisableRateLimiter() error EnableRateLimiter() error GetServerTime(ctx context.Context, ai asset.Item) (time.Time, error) GetWebsocket() (*stream.Websocket, error) SubscribeToWebsocketChannels(channels subscription.List) error UnsubscribeToWebsocketChannels(channels subscription.List) error GetSubscriptions() (subscription.List, error) GetSubscriptionTemplate(*subscription.Subscription) (*template.Template, error) FlushWebsocketChannels() error AuthenticateWebsocket(ctx context.Context) error CanUseAuthenticatedWebsocketEndpoints() bool GetOrderExecutionLimits(a asset.Item, cp currency.Pair) (order.MinMaxLevel, error) CheckOrderExecutionLimits(a asset.Item, cp currency.Pair, price, amount float64, orderType order.Type) error UpdateOrderExecutionLimits(ctx context.Context, a asset.Item) error GetCredentials(ctx context.Context) (*account.Credentials, error) EnsureOnePairEnabled() error PrintEnabledPairs() IsVerbose() bool GetCurrencyTradeURL(ctx context.Context, a asset.Item, cp currency.Pair) (string, error) // ValidateAPICredentials function validates the API keys by sending an // authenticated REST request. See exchange specific wrapper implementation. ValidateAPICredentials(ctx context.Context, a asset.Item) error // VerifyAPICredentials determines if the credentials supplied have unset // required values. See exchanges/credentials.go Base method for // implementation. VerifyAPICredentials(creds *account.Credentials) error // GetDefaultCredentials returns the exchange.Base api credentials loaded by // config.json. See exchanges/credentials.go Base method for implementation. GetDefaultCredentials() *account.Credentials FunctionalityChecker AccountManagement OrderManagement CurrencyStateManagement FuturesManagement MarginManagement // MatchSymbolWithAvailablePairs returns a currency pair based on the supplied // symbol and asset type. If the string is expected to have a delimiter this // will attempt to screen it out. MatchSymbolWithAvailablePairs(symbol string, a asset.Item, hasDelimiter bool) (currency.Pair, error) // MatchSymbolCheckEnabled returns a currency pair based on the supplied symbol // and asset type against the available pairs list. If the string is expected to // have a delimiter this will attempt to screen it out. It will also check if // the pair is enabled. MatchSymbolCheckEnabled(symbol string, a asset.Item, hasDelimiter bool) (pair currency.Pair, enabled bool, err error) // IsPairEnabled checks if a pair is enabled for an enabled asset type IsPairEnabled(pair currency.Pair, a asset.Item) (bool, error) }
IBotExchange enforces standard functions for all exchanges supported in GoCryptoTrader
type InternationalBankTransactionType ¶
type InternationalBankTransactionType uint8
InternationalBankTransactionType custom type for calculating fees based on fiat transaction types
type MarginCapabilities ¶
type MarginCapabilities struct { SetMarginType bool ChangePositionMargin bool GetMarginRateHistory bool }
MarginCapabilities stores the exchange's margin capabilities
type MarginManagement ¶
type MarginManagement interface { SetMarginType(ctx context.Context, item asset.Item, pair currency.Pair, tp margin.Type) error ChangePositionMargin(ctx context.Context, change *margin.PositionChangeRequest) (*margin.PositionChangeResponse, error) GetMarginRatesHistory(context.Context, *margin.RateHistoryRequest) (*margin.RateHistoryResponse, error) futures.PNLCalculation GetFuturesContractDetails(ctx context.Context, item asset.Item) ([]futures.Contract, error) }
MarginManagement manages margin positions and rates
type OpenInterestSupport ¶
OpenInterestSupport helps breakdown a feature and how it is supported
type OrderManagement ¶
type OrderManagement interface { SubmitOrder(ctx context.Context, s *order.Submit) (*order.SubmitResponse, error) ModifyOrder(ctx context.Context, action *order.Modify) (*order.ModifyResponse, error) CancelOrder(ctx context.Context, o *order.Cancel) error CancelBatchOrders(ctx context.Context, o []order.Cancel) (*order.CancelBatchResponse, error) CancelAllOrders(ctx context.Context, orders *order.Cancel) (order.CancelAllResponse, error) GetOrderInfo(ctx context.Context, orderID string, pair currency.Pair, assetType asset.Item) (*order.Detail, error) GetActiveOrders(ctx context.Context, getOrdersRequest *order.MultiOrderRequest) (order.FilteredOrders, error) GetOrderHistory(ctx context.Context, getOrdersRequest *order.MultiOrderRequest) (order.FilteredOrders, error) }
OrderManagement defines functionality for order management
type URL ¶
type URL uint16
URL stores uint conversions
type WithdrawalHistory ¶
type WithdrawalHistory struct { Status string TransferID string Description string Timestamp time.Time Currency string Amount float64 Fee float64 TransferType string CryptoToAddress string CryptoTxID string CryptoChain string BankTo string }
WithdrawalHistory holds exchange Withdrawal history data
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package gemini exchange documentation can be found at https://docs.sandbox.gemini.com
|
Package gemini exchange documentation can be found at https://docs.sandbox.gemini.com |