Documentation ¶
Index ¶
- func GetRateLimit() request.RateLimitDefinitions
- type AccountFees
- type BTSE
- func (b *BTSE) CancelAllAfter(ctx context.Context, timeout int) error
- func (b *BTSE) CancelAllOrders(ctx context.Context, orderCancellation *order.Cancel) (order.CancelAllResponse, error)
- func (b *BTSE) CancelBatchOrders(_ context.Context, _ []order.Cancel) (*order.CancelBatchResponse, error)
- func (b *BTSE) CancelExistingOrder(ctx context.Context, orderID, symbol, clOrderID string) (CancelOrder, error)
- func (b *BTSE) CancelOrder(ctx context.Context, o *order.Cancel) error
- func (b *BTSE) CreateOrder(ctx context.Context, clOrderID string, deviation float64, postOnly bool, ...) ([]Order, error)
- func (b *BTSE) CreateWalletAddress(ctx context.Context, currency string) (WalletAddress, error)
- func (b *BTSE) FetchAccountInfo(ctx context.Context, assetType asset.Item) (account.Holdings, error)
- func (b *BTSE) FetchFundingHistory(ctx context.Context, symbol string) (map[string][]FundingHistoryData, error)
- func (b *BTSE) FetchOrderBook(ctx context.Context, symbol string, group, limitBids, limitAsks int, spot bool) (*Orderbook, error)
- func (b *BTSE) FetchOrderBookL2(ctx context.Context, symbol string, depth int) (*Orderbook, error)
- func (b *BTSE) FetchOrderbook(ctx context.Context, p currency.Pair, assetType asset.Item) (*orderbook.Base, error)
- func (b *BTSE) FetchTicker(ctx context.Context, p currency.Pair, assetType asset.Item) (*ticker.Price, error)
- func (b *BTSE) FetchTradablePairs(ctx context.Context, a asset.Item) (currency.Pairs, error)
- func (b *BTSE) FormatExchangeKlineInterval(in kline.Interval) string
- func (b *BTSE) GetAccountFundingHistory(_ context.Context) ([]exchange.FundingHistory, error)
- func (b *BTSE) GetActiveOrders(ctx context.Context, req *order.MultiOrderRequest) (order.FilteredOrders, error)
- func (b *BTSE) GetCurrencyTradeURL(_ context.Context, a asset.Item, cp currency.Pair) (string, error)
- func (b *BTSE) GetCurrentServerTime(ctx context.Context) (*ServerTime, error)
- func (b *BTSE) GetDepositAddress(ctx context.Context, c currency.Code, _, _ string) (*deposit.Address, error)
- func (b *BTSE) GetFee(ctx context.Context, feeBuilder *exchange.FeeBuilder) (float64, error)
- func (b *BTSE) GetFeeByType(ctx context.Context, feeBuilder *exchange.FeeBuilder) (float64, error)
- func (b *BTSE) GetFeeInformation(ctx context.Context, symbol string) ([]AccountFees, error)
- func (b *BTSE) GetFuturesContractDetails(ctx context.Context, item asset.Item) ([]futures.Contract, error)
- func (b *BTSE) GetHistoricCandles(ctx context.Context, pair currency.Pair, a asset.Item, interval kline.Interval, ...) (*kline.Item, error)
- func (b *BTSE) GetHistoricCandlesExtended(ctx context.Context, pair currency.Pair, a asset.Item, interval kline.Interval, ...) (*kline.Item, error)
- func (b *BTSE) GetHistoricTrades(_ context.Context, _ currency.Pair, _ asset.Item, _, _ time.Time) ([]trade.Data, error)
- func (b *BTSE) GetLatestFundingRates(ctx context.Context, r *fundingrate.LatestRateRequest) ([]fundingrate.LatestRateResponse, error)
- func (b *BTSE) GetMarketSummary(ctx context.Context, symbol string, spot bool) (MarketSummary, error)
- func (b *BTSE) GetOHLCV(ctx context.Context, symbol string, start, end time.Time, resolution int, ...) (OHLCV, error)
- func (b *BTSE) GetOpenInterest(ctx context.Context, k ...key.PairAsset) ([]futures.OpenInterest, error)
- func (b *BTSE) GetOrderHistory(ctx context.Context, getOrdersRequest *order.MultiOrderRequest) (order.FilteredOrders, error)
- func (b *BTSE) GetOrderInfo(ctx context.Context, orderID string, _ currency.Pair, _ asset.Item) (*order.Detail, error)
- func (b *BTSE) GetOrders(ctx context.Context, symbol, orderID, clOrderID string) ([]OpenOrder, error)
- func (b *BTSE) GetPrice(ctx context.Context, symbol string) (Price, error)
- func (b *BTSE) GetRawMarketSummary(ctx context.Context, symbol string, spot bool) (MarketSummary, error)
- func (b *BTSE) GetRecentTrades(ctx context.Context, p currency.Pair, assetType asset.Item) ([]trade.Data, error)
- func (b *BTSE) GetServerTime(ctx context.Context, _ asset.Item) (time.Time, error)
- func (b *BTSE) GetSubscriptionTemplate(_ *subscription.Subscription) (*template.Template, error)
- func (b *BTSE) GetTrades(ctx context.Context, symbol string, start, end time.Time, ...) ([]Trade, error)
- func (b *BTSE) GetWalletAddress(ctx context.Context, currency string) (WalletAddress, error)
- func (b *BTSE) GetWalletHistory(ctx context.Context, symbol string, start, end time.Time, count int) (WalletHistory, error)
- func (b *BTSE) GetWalletInformation(ctx context.Context) ([]CurrencyBalance, error)
- func (b *BTSE) GetWithdrawalsHistory(_ context.Context, _ currency.Code, _ asset.Item) ([]exchange.WithdrawalHistory, error)
- func (b *BTSE) IndexOrderPeg(ctx context.Context, clOrderID string, deviation float64, postOnly bool, ...) ([]Order, error)
- func (b *BTSE) IsPerpetualFutureCurrency(a asset.Item, p currency.Pair) (bool, error)
- func (b *BTSE) ModifyOrder(_ context.Context, _ *order.Modify) (*order.ModifyResponse, error)
- func (b *BTSE) SendAuthenticatedHTTPRequest(ctx context.Context, ep exchange.URL, method, endpoint string, isSpot bool, ...) error
- func (b *BTSE) SendHTTPRequest(ctx context.Context, ep exchange.URL, method, endpoint string, ...) error
- func (b *BTSE) SetDefaults()
- func (b *BTSE) Setup(exch *config.Exchange) error
- func (b *BTSE) SubmitOrder(ctx context.Context, s *order.Submit) (*order.SubmitResponse, error)
- func (b *BTSE) Subscribe(subs subscription.List) error
- func (b *BTSE) TradeHistory(ctx context.Context, symbol string, start, end time.Time, ...) (TradeHistory, error)
- func (b *BTSE) Unsubscribe(subs subscription.List) error
- func (b *BTSE) UpdateAccountInfo(ctx context.Context, assetType asset.Item) (account.Holdings, error)
- func (b *BTSE) UpdateOrderExecutionLimits(ctx context.Context, a asset.Item) error
- func (b *BTSE) UpdateOrderbook(ctx context.Context, p currency.Pair, assetType asset.Item) (*orderbook.Base, error)
- func (b *BTSE) UpdateTicker(ctx context.Context, p currency.Pair, a asset.Item) (*ticker.Price, error)
- func (b *BTSE) UpdateTickers(ctx context.Context, a asset.Item) error
- func (b *BTSE) UpdateTradablePairs(ctx context.Context, forceUpdate bool) error
- func (b *BTSE) ValidateAPICredentials(ctx context.Context, assetType asset.Item) error
- func (b *BTSE) WalletWithdrawal(ctx context.Context, currency, address, tag, amount string) (WithdrawalResponse, error)
- func (b *BTSE) WithdrawCryptocurrencyFunds(ctx context.Context, withdrawRequest *withdraw.Request) (*withdraw.ExchangeResponse, error)
- func (b *BTSE) WithdrawFiatFunds(_ context.Context, _ *withdraw.Request) (*withdraw.ExchangeResponse, error)
- func (b *BTSE) WithdrawFiatFundsToInternationalBank(_ context.Context, _ *withdraw.Request) (*withdraw.ExchangeResponse, error)
- func (b *BTSE) WsAuthenticate(ctx context.Context) error
- func (b *BTSE) WsConnect() error
- type CancelOrder
- type CurrencyBalance
- type ErrorResponse
- type FundingHistoryData
- type FuturesMarket
- type MarketPair
- type MarketStatistics
- type MarketSummary
- type OHLCV
- type OpenOrder
- type Order
- type Orderbook
- type Price
- type QuoteData
- type ServerTime
- type SpotMarket
- type Ticker
- type Trade
- type TradeHistory
- type WalletAddress
- type WalletHistory
- type WithdrawalResponse
- type WsLoginAcknowledgement
- type WsSubscriptionAcknowledgement
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetRateLimit ¶
func GetRateLimit() request.RateLimitDefinitions
GetRateLimit returns the rate limit for the exchange
Types ¶
type AccountFees ¶
type AccountFees struct { MakerFee float64 `json:"makerFee"` Symbol string `json:"symbol"` TakerFee float64 `json:"takerFee"` }
AccountFees stores fee for each currency pair
type BTSE ¶
BTSE is the overarching type across this package
func (*BTSE) CancelAllAfter ¶
CancelAllAfter cancels all orders after timeout
func (*BTSE) CancelAllOrders ¶
func (b *BTSE) CancelAllOrders(ctx context.Context, orderCancellation *order.Cancel) (order.CancelAllResponse, error)
CancelAllOrders cancels all orders associated with a currency pair If product ID is sent, all orders of that specified market will be cancelled If not specified, all orders of all markets will be cancelled
func (*BTSE) CancelBatchOrders ¶
func (b *BTSE) CancelBatchOrders(_ context.Context, _ []order.Cancel) (*order.CancelBatchResponse, error)
CancelBatchOrders cancels an orders by their corresponding ID numbers
func (*BTSE) CancelExistingOrder ¶
func (b *BTSE) CancelExistingOrder(ctx context.Context, orderID, symbol, clOrderID string) (CancelOrder, error)
CancelExistingOrder cancels an order
func (*BTSE) CancelOrder ¶
CancelOrder cancels an order by its corresponding ID number
func (*BTSE) CreateOrder ¶
func (b *BTSE) CreateOrder(ctx context.Context, clOrderID string, deviation float64, postOnly bool, price float64, side string, size, stealth, stopPrice float64, symbol, timeInForce string, trailValue, triggerPrice float64, txType, orderType string) ([]Order, error)
CreateOrder creates an order
func (*BTSE) CreateWalletAddress ¶
CreateWalletAddress create new deposit address for requested currency
func (*BTSE) FetchAccountInfo ¶
func (b *BTSE) FetchAccountInfo(ctx context.Context, assetType asset.Item) (account.Holdings, error)
FetchAccountInfo retrieves balances for all enabled currencies
func (*BTSE) FetchFundingHistory ¶
func (b *BTSE) FetchFundingHistory(ctx context.Context, symbol string) (map[string][]FundingHistoryData, error)
FetchFundingHistory gets funding history
func (*BTSE) FetchOrderBook ¶
func (b *BTSE) FetchOrderBook(ctx context.Context, symbol string, group, limitBids, limitAsks int, spot bool) (*Orderbook, error)
FetchOrderBook gets orderbook data for a given pair
func (*BTSE) FetchOrderBookL2 ¶
FetchOrderBookL2 retrieve level 2 orderbook for requested symbol and depth
func (*BTSE) FetchOrderbook ¶
func (b *BTSE) FetchOrderbook(ctx context.Context, p currency.Pair, assetType asset.Item) (*orderbook.Base, error)
FetchOrderbook returns orderbook base on the currency pair
func (*BTSE) FetchTicker ¶
func (b *BTSE) FetchTicker(ctx context.Context, p currency.Pair, assetType asset.Item) (*ticker.Price, error)
FetchTicker returns the ticker for a currency pair
func (*BTSE) FetchTradablePairs ¶
FetchTradablePairs returns a list of the exchanges tradable pairs
func (*BTSE) FormatExchangeKlineInterval ¶
FormatExchangeKlineInterval formats kline interval to exchange requested type
func (*BTSE) GetAccountFundingHistory ¶
GetAccountFundingHistory returns funding history, deposits and withdrawals
func (*BTSE) GetActiveOrders ¶
func (b *BTSE) GetActiveOrders(ctx context.Context, req *order.MultiOrderRequest) (order.FilteredOrders, error)
GetActiveOrders retrieves any orders that are active/open
func (*BTSE) GetCurrencyTradeURL ¶
func (b *BTSE) GetCurrencyTradeURL(_ context.Context, a asset.Item, cp currency.Pair) (string, error)
GetCurrencyTradeURL returns the URL to the exchange's trade page for the given asset and currency pair
func (*BTSE) GetCurrentServerTime ¶
func (b *BTSE) GetCurrentServerTime(ctx context.Context) (*ServerTime, error)
GetCurrentServerTime returns the exchanges server time
func (*BTSE) GetDepositAddress ¶
func (b *BTSE) GetDepositAddress(ctx context.Context, c currency.Code, _, _ string) (*deposit.Address, error)
GetDepositAddress returns a deposit address for a specified currency
func (*BTSE) GetFeeByType ¶
GetFeeByType returns an estimate of fee based on type of transaction
func (*BTSE) GetFeeInformation ¶
GetFeeInformation retrieve fee's (maker/taker) for requested symbol
func (*BTSE) GetFuturesContractDetails ¶
func (b *BTSE) GetFuturesContractDetails(ctx context.Context, item asset.Item) ([]futures.Contract, error)
GetFuturesContractDetails returns details about futures contracts
func (*BTSE) GetHistoricCandles ¶
func (b *BTSE) GetHistoricCandles(ctx context.Context, pair currency.Pair, a asset.Item, interval kline.Interval, start, end time.Time) (*kline.Item, error)
GetHistoricCandles returns candles between a time period for a set time interval
func (*BTSE) GetHistoricCandlesExtended ¶
func (b *BTSE) GetHistoricCandlesExtended(ctx context.Context, pair currency.Pair, a asset.Item, interval kline.Interval, start, end time.Time) (*kline.Item, error)
GetHistoricCandlesExtended returns candles between a time period for a set time interval
func (*BTSE) GetHistoricTrades ¶
func (b *BTSE) GetHistoricTrades(_ context.Context, _ currency.Pair, _ asset.Item, _, _ time.Time) ([]trade.Data, error)
GetHistoricTrades returns historic trade data within the timeframe provided
func (*BTSE) GetLatestFundingRates ¶
func (b *BTSE) GetLatestFundingRates(ctx context.Context, r *fundingrate.LatestRateRequest) ([]fundingrate.LatestRateResponse, error)
GetLatestFundingRates returns the latest funding rates data
func (*BTSE) GetMarketSummary ¶
func (b *BTSE) GetMarketSummary(ctx context.Context, symbol string, spot bool) (MarketSummary, error)
GetMarketSummary returns filtered market pair details; Specifically:
- Pairs which aren't active are removed
- Pairs which don't have liquidity are removed
- OTC pairs only traded on web UI are removed
- Pairs with an exponent counterpart pair are removed BTSE lists M_ symbols for very small pairs, in millions. For those listings, we want to take the M_ listing in preference to the native listing, since they're often going to appear as locked markets due to size (bid == ask, e.g. 0.0000000003)
func (*BTSE) GetOHLCV ¶
func (b *BTSE) GetOHLCV(ctx context.Context, symbol string, start, end time.Time, resolution int, a asset.Item) (OHLCV, error)
GetOHLCV retrieve and return OHLCV candle data for requested symbol
func (*BTSE) GetOpenInterest ¶
func (b *BTSE) GetOpenInterest(ctx context.Context, k ...key.PairAsset) ([]futures.OpenInterest, error)
GetOpenInterest returns the open interest rate for a given asset pair
func (*BTSE) GetOrderHistory ¶
func (b *BTSE) GetOrderHistory(ctx context.Context, getOrdersRequest *order.MultiOrderRequest) (order.FilteredOrders, error)
GetOrderHistory retrieves account order information Can Limit response to specific order status
func (*BTSE) GetOrderInfo ¶
func (b *BTSE) GetOrderInfo(ctx context.Context, orderID string, _ currency.Pair, _ asset.Item) (*order.Detail, error)
GetOrderInfo returns order information based on order ID
func (*BTSE) GetOrders ¶
func (b *BTSE) GetOrders(ctx context.Context, symbol, orderID, clOrderID string) ([]OpenOrder, error)
GetOrders returns all pending orders
func (*BTSE) GetRawMarketSummary ¶
func (b *BTSE) GetRawMarketSummary(ctx context.Context, symbol string, spot bool) (MarketSummary, error)
GetRawMarketSummary returns an unfiltered list of market pairs Consider using the wrapper function GetMarketSummary instead
func (*BTSE) GetRecentTrades ¶
func (b *BTSE) GetRecentTrades(ctx context.Context, p currency.Pair, assetType asset.Item) ([]trade.Data, error)
GetRecentTrades returns the most recent trades for a currency and asset
func (*BTSE) GetServerTime ¶
GetServerTime returns the current exchange server time.
func (*BTSE) GetSubscriptionTemplate ¶
func (b *BTSE) GetSubscriptionTemplate(_ *subscription.Subscription) (*template.Template, error)
GetSubscriptionTemplate returns a subscription channel template
func (*BTSE) GetTrades ¶
func (b *BTSE) GetTrades(ctx context.Context, symbol string, start, end time.Time, beforeSerialID, afterSerialID, count int, includeOld, spot bool) ([]Trade, error)
GetTrades returns a list of trades for the specified symbol
func (*BTSE) GetWalletAddress ¶
GetWalletAddress returns the users account balance
func (*BTSE) GetWalletHistory ¶
func (b *BTSE) GetWalletHistory(ctx context.Context, symbol string, start, end time.Time, count int) (WalletHistory, error)
GetWalletHistory returns the users account balance
func (*BTSE) GetWalletInformation ¶
func (b *BTSE) GetWalletInformation(ctx context.Context) ([]CurrencyBalance, error)
GetWalletInformation returns the users account balance
func (*BTSE) GetWithdrawalsHistory ¶
func (b *BTSE) GetWithdrawalsHistory(_ context.Context, _ currency.Code, _ asset.Item) ([]exchange.WithdrawalHistory, error)
GetWithdrawalsHistory returns previous withdrawals data
func (*BTSE) IndexOrderPeg ¶
func (b *BTSE) IndexOrderPeg(ctx context.Context, clOrderID string, deviation float64, postOnly bool, price float64, side string, size, stealth, stopPrice float64, symbol, timeInForce string, trailValue, triggerPrice float64, txType, orderType string) ([]Order, error)
IndexOrderPeg create peg order that will track a certain percentage above/below the index price
func (*BTSE) IsPerpetualFutureCurrency ¶
IsPerpetualFutureCurrency ensures a given asset and currency is a perpetual future
func (*BTSE) ModifyOrder ¶
ModifyOrder will allow of changing orderbook placement and limit to market conversion
func (*BTSE) SendAuthenticatedHTTPRequest ¶
func (b *BTSE) SendAuthenticatedHTTPRequest(ctx context.Context, ep exchange.URL, method, endpoint string, isSpot bool, values url.Values, req map[string]interface{}, result interface{}, f request.EndpointLimit) error
SendAuthenticatedHTTPRequest sends an authenticated HTTP request to the desired endpoint
func (*BTSE) SendHTTPRequest ¶
func (b *BTSE) SendHTTPRequest(ctx context.Context, ep exchange.URL, method, endpoint string, result interface{}, spotEndpoint bool, f request.EndpointLimit) error
SendHTTPRequest sends an HTTP request to the desired endpoint
func (*BTSE) SetDefaults ¶
func (b *BTSE) SetDefaults()
SetDefaults sets the basic defaults for BTSE
func (*BTSE) SubmitOrder ¶
SubmitOrder submits a new order
func (*BTSE) Subscribe ¶
func (b *BTSE) Subscribe(subs subscription.List) error
Subscribe sends a websocket message to receive data from a list of channels
func (*BTSE) TradeHistory ¶
func (b *BTSE) TradeHistory(ctx context.Context, symbol string, start, end time.Time, beforeSerialID, afterSerialID, count int, includeOld bool, clOrderID, orderID string) (TradeHistory, error)
TradeHistory returns previous trades on exchange
func (*BTSE) Unsubscribe ¶
func (b *BTSE) Unsubscribe(subs subscription.List) error
Unsubscribe sends a websocket message to stop receiving data from a list of channels
func (*BTSE) UpdateAccountInfo ¶
func (b *BTSE) UpdateAccountInfo(ctx context.Context, assetType asset.Item) (account.Holdings, error)
UpdateAccountInfo retrieves balances for all enabled currencies for the BTSE exchange
func (*BTSE) UpdateOrderExecutionLimits ¶
UpdateOrderExecutionLimits updates order execution limits
func (*BTSE) UpdateOrderbook ¶
func (b *BTSE) UpdateOrderbook(ctx context.Context, p currency.Pair, assetType asset.Item) (*orderbook.Base, error)
UpdateOrderbook updates and returns the orderbook for a currency pair
func (*BTSE) UpdateTicker ¶
func (b *BTSE) UpdateTicker(ctx context.Context, p currency.Pair, a asset.Item) (*ticker.Price, error)
UpdateTicker updates and returns the ticker for a currency pair
func (*BTSE) UpdateTickers ¶
UpdateTickers updates the ticker for all currency pairs of a given asset type
func (*BTSE) UpdateTradablePairs ¶
UpdateTradablePairs updates the exchanges available pairs and stores them in the exchanges config
func (*BTSE) ValidateAPICredentials ¶
ValidateAPICredentials validates current credentials used for wrapper functionality
func (*BTSE) WalletWithdrawal ¶
func (b *BTSE) WalletWithdrawal(ctx context.Context, currency, address, tag, amount string) (WithdrawalResponse, error)
WalletWithdrawal submit request to withdraw crypto currency
func (*BTSE) WithdrawCryptocurrencyFunds ¶
func (b *BTSE) WithdrawCryptocurrencyFunds(ctx context.Context, withdrawRequest *withdraw.Request) (*withdraw.ExchangeResponse, error)
WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is submitted
func (*BTSE) WithdrawFiatFunds ¶
func (b *BTSE) WithdrawFiatFunds(_ context.Context, _ *withdraw.Request) (*withdraw.ExchangeResponse, error)
WithdrawFiatFunds returns a withdrawal ID when a withdrawal is submitted
func (*BTSE) WithdrawFiatFundsToInternationalBank ¶
func (b *BTSE) WithdrawFiatFundsToInternationalBank(_ context.Context, _ *withdraw.Request) (*withdraw.ExchangeResponse, error)
WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a withdrawal is submitted
func (*BTSE) WsAuthenticate ¶
WsAuthenticate Send an authentication message to receive auth data
type CurrencyBalance ¶
type CurrencyBalance struct { Currency string `json:"currency"` Total float64 `json:"total"` Available float64 `json:"available"` }
CurrencyBalance stores the account info data
type ErrorResponse ¶
type ErrorResponse struct { ErrorCode int `json:"errorCode"` Message string `json:"message"` Status int `json:"status"` }
ErrorResponse contains errors received from API
type FundingHistoryData ¶
type FundingHistoryData struct { Time int64 `json:"time"` Rate float64 `json:"rate"` Symbol string `json:"symbol"` }
FundingHistoryData stores funding history data
type FuturesMarket ¶
type FuturesMarket struct { Symbol string `json:"symbol"` Last float64 `json:"last"` LowestAsk float64 `json:"lowestAsk"` HighestBid float64 `json:"highestBid"` OpenInterest float64 `json:"openInterest"` OpenInterestUSD float64 `json:"openInterestUSD"` PercentageChange float64 `json:"percentageChange"` Volume float64 `json:"volume"` High24Hr float64 `json:"high24Hr"` Low24Hr float64 `json:"low24Hr"` Base string `json:"base"` Quote string `json:"quote"` ContractStart int64 `json:"contractStart"` ContractEnd int64 `json:"contractEnd"` Active bool `json:"active"` TimeBasedContract bool `json:"timeBasedContract"` OpenTime int64 `json:"openTime"` CloseTime int64 `json:"closeTime"` StartMatching int64 `json:"startMatching"` InactiveTime int64 `json:"inactiveTime"` FundingRate float64 `json:"fundingRate"` ContractSize float64 `json:"contractSize"` MaxPosition int64 `json:"maxPosition"` MinValidPrice float64 `json:"minValidPrice"` MinPriceIncrement float64 `json:"minPriceIncrement"` MinOrderSize int32 `json:"minOrderSize"` MaxOrderSize int32 `json:"maxOrderSize"` MinRiskLimit int32 `json:"minRiskLimit"` MaxRiskLimit int32 `json:"maxRiskLimit"` MinSizeIncrement float64 `json:"minSizeIncrement"` AvailableSettlement []string `json:"availableSettlement"` }
FuturesMarket stores market data
type MarketPair ¶
type MarketPair struct { Symbol string `json:"symbol"` Last float64 `json:"last"` LowestAsk float64 `json:"lowestAsk"` HighestBid float64 `json:"highestBid"` PercentageChange float64 `json:"percentageChange"` Volume float64 `json:"volume"` High24Hr float64 `json:"high24Hr"` Low24Hr float64 `json:"low24Hr"` Base string `json:"base"` Quote string `json:"quote"` Active bool `json:"active"` Size float64 `json:"size"` MinValidPrice float64 `json:"minValidPrice"` MinPriceIncrement float64 `json:"minPriceIncrement"` MinOrderSize float64 `json:"minOrderSize"` MaxOrderSize float64 `json:"maxOrderSize"` MinSizeIncrement float64 `json:"minSizeIncrement"` OpenInterest float64 `json:"openInterest"` OpenInterestUSD float64 `json:"openInterestUSD"` ContractStart int64 `json:"contractStart"` ContractEnd int64 `json:"contractEnd"` TimeBasedContract bool `json:"timeBasedContract"` OpenTime int64 `json:"openTime"` CloseTime int64 `json:"closeTime"` StartMatching int64 `json:"startMatching"` InactiveTime int64 `json:"inactiveTime"` FundingRate float64 `json:"fundingRate"` ContractSize float64 `json:"contractSize"` MaxPosition int64 `json:"maxPosition"` MinRiskLimit int `json:"minRiskLimit"` MaxRiskLimit int `json:"maxRiskLimit"` AvailableSettlement []string `json:"availableSettlement"` Futures bool `json:"futures"` IsMarketOpenToSpot bool `json:"isMarketOpenToSpot"` IsMarketOpenToOTC bool `json:"isMarketOpenToOtc"` }
MarketPair is a single pair in Market Summary
func (*MarketPair) HasLiquidity ¶
func (m *MarketPair) HasLiquidity() bool
HasLiquidity returns if a market pair has a bid or ask != 0
func (*MarketPair) Pair ¶
func (m *MarketPair) Pair() (currency.Pair, error)
Pair returns the currency Pair for a MarketPair
func (*MarketPair) StripExponent ¶
func (m *MarketPair) StripExponent() (string, error)
StripExponent returns the symbol without a exponent prefix; e.g. B_, M_, K_ Returns an empty string if no exponent prefix is found Errors if there's too many underscores, or if the exponent is not recognised
type MarketStatistics ¶
type MarketStatistics struct { Open float64 `json:"open,string"` Low float64 `json:"low,string"` High float64 `json:"high,string"` Close float64 `json:"close,string"` Volume float64 `json:"volume,string"` Time time.Time `json:"time"` }
MarketStatistics stores market statistics for a particular product
type MarketSummary ¶
type MarketSummary []*MarketPair
MarketSummary response data
func (*MarketSummary) ExponentPairs ¶
func (m *MarketSummary) ExponentPairs() (map[string]bool, error)
ExponentPairs returns a map of symbol names which have a Exponent equivalent e.g. PIT-USD will be returned if M_PIT-USD exists, and SATS-USD if K_SATS-USD exists
type OpenOrder ¶
type OpenOrder struct { AverageFillPrice float64 `json:"averageFillPrice"` CancelDuration int64 `json:"cancelDuration"` ClOrderID string `json:"clOrderID"` FillSize float64 `json:"fillSize"` FilledSize float64 `json:"filledSize"` OrderID string `json:"orderID"` OrderState string `json:"orderState"` OrderType int `json:"orderType"` OrderValue float64 `json:"orderValue"` PegPriceDeviation float64 `json:"pegPriceDeviation"` PegPriceMax float64 `json:"pegPriceMax"` PegPriceMin float64 `json:"pegPriceMin"` Price float64 `json:"price"` Side string `json:"side"` Size float64 `json:"size"` Symbol string `json:"symbol"` Timestamp int64 `json:"timestamp"` TrailValue float64 `json:"trailValue"` TriggerOrder bool `json:"triggerOrder"` TriggerOrderType int `json:"triggerOrderType"` TriggerOriginalPrice float64 `json:"triggerOriginalPrice"` TriggerPrice float64 `json:"triggerPrice"` TriggerStopPrice float64 `json:"triggerStopPrice"` TriggerTrailingStopDeviation float64 `json:"triggerTrailingStopDeviation"` Triggered bool `json:"triggered"` }
OpenOrder stores an open order info
type Order ¶
type Order struct { AverageFillPrice float64 `json:"averageFillPrice"` ClOrderID string `json:"clOrderID"` Deviation float64 `json:"deviation"` FillSize float64 `json:"fillSize"` Message string `json:"message"` OrderID string `json:"orderID"` OrderType int `json:"orderType"` Price float64 `json:"price"` Side string `json:"side"` Size float64 `json:"size"` Status int `json:"status"` Stealth float64 `json:"stealth"` StopPrice float64 `json:"stopPrice"` Symbol string `json:"symbol"` Timestamp int64 `json:"timestamp"` Trigger bool `json:"trigger"` TriggerPrice float64 `json:"triggerPrice"` }
Order stores information for a single order
type Orderbook ¶
type Orderbook struct { BuyQuote []QuoteData `json:"buyQuote"` SellQuote []QuoteData `json:"sellQuote"` Symbol string `json:"symbol"` Timestamp int64 `json:"timestamp"` }
Orderbook stores orderbook info
type Price ¶
type Price []struct { IndexPrice float64 `json:"indexPrice"` LastPrice float64 `json:"lastPrice"` MarkPrice float64 `json:"markPrice"` Symbol string `json:"symbol"` }
Price stores last price for requested symbol
type ServerTime ¶
ServerTime stores the server time data
type SpotMarket ¶
type SpotMarket struct { Symbol string `json:"symbol"` ID string `json:"id"` BaseCurrency string `json:"base_currency"` QuoteCurrency string `json:"quote_currency"` BaseMinSize float64 `json:"base_min_size"` BaseMaxSize float64 `json:"base_max_size"` BaseIncrementSize float64 `json:"base_increment_size"` QuoteMinPrice float64 `json:"quote_min_price"` QuoteIncrement float64 `json:"quote_increment"` Status string `json:"status"` }
SpotMarket stores market data
type Ticker ¶
type Ticker struct { Price float64 `json:"price,string"` Size float64 `json:"size,string"` Bid float64 `json:"bid,string"` Ask float64 `json:"ask,string"` Volume float64 `json:"volume,string"` Time string `json:"time"` }
Ticker stores the ticker data
type Trade ¶
type Trade struct { SerialID int64 `json:"serialId"` Symbol string `json:"symbol"` Price float64 `json:"price"` Amount float64 `json:"size"` Time int64 `json:"timestamp"` Side string `json:"side"` Type string `json:"type"` }
Trade stores trade data
type TradeHistory ¶
type TradeHistory []struct { Base string `json:"base"` ClOrderID string `json:"clOrderID"` FeeAmount float64 `json:"feeAmount"` FeeCurrency string `json:"feeCurrency"` FilledPrice float64 `json:"filledPrice"` FilledSize float64 `json:"filledSize"` OrderID string `json:"orderId"` OrderType int `json:"orderType"` Price float64 `json:"price"` Quote string `json:"quote"` RealizedPnl float64 `json:"realizedPnl"` SerialID int64 `json:"serialId"` Side string `json:"side"` Size float64 `json:"size"` Symbol string `json:"symbol"` Timestamp string `json:"timestamp"` Total float64 `json:"total"` TradeID string `json:"tradeId"` TriggerPrice float64 `json:"triggerPrice"` TriggerType int `json:"triggerType"` Username string `json:"username"` Wallet string `json:"wallet"` }
TradeHistory stores user trades for exchange
type WalletAddress ¶
WalletAddress stores address for crypto deposit's
type WalletHistory ¶
type WalletHistory []struct { Amount float64 `json:"amount"` Currency string `json:"currency"` Description string `json:"description"` Fees float64 `json:"fees"` OrderID string `json:"orderId"` Status string `json:"status"` Timestamp int64 `json:"timestamp"` Type string `json:"type"` Username string `json:"username"` Wallet string `json:"wallet"` }
WalletHistory stores account funding history
type WithdrawalResponse ¶
type WithdrawalResponse struct {
WithdrawID string `json:"withdraw_id"`
}
WithdrawalResponse response received when submitting a crypto withdrawal request
type WsLoginAcknowledgement ¶
WsLoginAcknowledgement contains whether authentication was successful
type WsSubscriptionAcknowledgement ¶
type WsSubscriptionAcknowledgement struct { Channel []string `json:"channel"` Event string `json:"event"` }
WsSubscriptionAcknowledgement contains successful subscription messages