Documentation ¶
Index ¶
- type BTSE
- func (b *BTSE) CancelAllOrders(orderCancellation *order.Cancel) (order.CancelAllResponse, error)
- func (b *BTSE) CancelExistingOrder(orderID, symbol string) (*CancelOrder, error)
- func (b *BTSE) CancelOrder(order *order.Cancel) error
- func (b *BTSE) CreateOrder(amount, price float64, side, orderType, symbol, timeInForce, tag string) (*string, error)
- func (b *BTSE) FetchAccountInfo() (account.Holdings, error)
- func (b *BTSE) FetchOrderBook(symbol string) (*Orderbook, error)
- func (b *BTSE) FetchOrderbook(p currency.Pair, assetType asset.Item) (*orderbook.Base, error)
- func (b *BTSE) FetchTicker(p currency.Pair, assetType asset.Item) (*ticker.Price, error)
- func (b *BTSE) FetchTradablePairs(a asset.Item) ([]string, error)
- func (b *BTSE) GenerateDefaultSubscriptions() ([]stream.ChannelSubscription, error)
- func (b *BTSE) GetAccountBalance() ([]CurrencyBalance, error)
- func (b *BTSE) GetActiveOrders(req *order.GetOrdersRequest) ([]order.Detail, error)
- func (b *BTSE) GetDefaultConfig() (*config.ExchangeConfig, error)
- func (b *BTSE) GetDepositAddress(cryptocurrency currency.Code, accountID string) (string, error)
- func (b *BTSE) GetExchangeHistory(p currency.Pair, assetType asset.Item, timestampStart, timestampEnd time.Time) ([]exchange.TradeHistory, error)
- func (b *BTSE) GetFee(feeBuilder *exchange.FeeBuilder) (float64, error)
- func (b *BTSE) GetFeeByType(feeBuilder *exchange.FeeBuilder) (float64, error)
- func (b *BTSE) GetFills(orderID, symbol, before, after, limit, username string) ([]FilledOrder, error)
- func (b *BTSE) GetFundingHistory() ([]exchange.FundHistory, error)
- func (b *BTSE) GetFuturesMarkets() ([]FuturesMarket, error)
- func (b *BTSE) GetHistoricCandles(pair currency.Pair, a asset.Item, start, end time.Time, ...) (kline.Item, error)
- func (b *BTSE) GetHistoricCandlesExtended(pair currency.Pair, a asset.Item, start, end time.Time, ...) (kline.Item, error)
- func (b *BTSE) GetMarketStatistics(symbol string) (*MarketStatistics, error)
- func (b *BTSE) GetMarketsSummary() (*HighLevelMarketData, error)
- func (b *BTSE) GetOrderHistory(getOrdersRequest *order.GetOrdersRequest) ([]order.Detail, error)
- func (b *BTSE) GetOrderInfo(orderID string) (order.Detail, error)
- func (b *BTSE) GetOrders(symbol string) ([]OpenOrder, error)
- func (b *BTSE) GetServerTime() (*ServerTime, error)
- func (b *BTSE) GetSpotMarkets() ([]SpotMarket, error)
- func (b *BTSE) GetTicker(symbol string) (*Ticker, error)
- func (b *BTSE) GetTrades(symbol string) ([]Trade, error)
- func (b *BTSE) ModifyOrder(action *order.Modify) (string, error)
- func (b *BTSE) Run()
- func (b *BTSE) SendAuthenticatedHTTPRequest(method, endpoint string, req map[string]interface{}, result interface{}, ...) error
- func (b *BTSE) SendHTTPRequest(method, endpoint string, result interface{}, spotEndpoint bool) error
- func (b *BTSE) SetDefaults()
- func (b *BTSE) Setup(exch *config.ExchangeConfig) error
- func (b *BTSE) Start(wg *sync.WaitGroup)
- func (b *BTSE) SubmitOrder(s *order.Submit) (order.SubmitResponse, error)
- func (b *BTSE) Subscribe(channelsToSubscribe []stream.ChannelSubscription) error
- func (b *BTSE) Unsubscribe(channelsToUnsubscribe []stream.ChannelSubscription) error
- func (b *BTSE) UpdateAccountInfo() (account.Holdings, error)
- func (b *BTSE) UpdateOrderbook(p currency.Pair, assetType asset.Item) (*orderbook.Base, error)
- func (b *BTSE) UpdateTicker(p currency.Pair, assetType asset.Item) (*ticker.Price, error)
- func (b *BTSE) UpdateTradablePairs(forceUpdate bool) error
- func (b *BTSE) ValidateCredentials() error
- func (b *BTSE) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.Request) (*withdraw.ExchangeResponse, error)
- func (b *BTSE) WithdrawFiatFunds(withdrawRequest *withdraw.Request) (*withdraw.ExchangeResponse, error)
- func (b *BTSE) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.Request) (*withdraw.ExchangeResponse, error)
- func (b *BTSE) WsAuthenticate() error
- func (b *BTSE) WsConnect() error
- type CancelOrder
- type CurrencyBalance
- type FilledOrder
- type FuturesMarket
- type HighLevelMarketData
- type MarketStatistics
- type OpenOrder
- type Order
- type Orderbook
- type OverviewData
- type QuoteData
- type ServerTime
- type SpotMarket
- type Ticker
- type Trade
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BTSE ¶
BTSE is the overarching type across this package
func (*BTSE) CancelAllOrders ¶
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) CancelExistingOrder ¶
func (b *BTSE) CancelExistingOrder(orderID, symbol 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(amount, price float64, side, orderType, symbol, timeInForce, tag string) (*string, error)
CreateOrder creates an order
func (*BTSE) FetchAccountInfo ¶
FetchAccountInfo retrieves balances for all enabled currencies
func (*BTSE) FetchOrderBook ¶
FetchOrderBook gets orderbook data for a given pair
func (*BTSE) FetchOrderbook ¶
FetchOrderbook returns orderbook base on the currency pair
func (*BTSE) FetchTicker ¶
FetchTicker returns the ticker for a currency pair
func (*BTSE) FetchTradablePairs ¶
FetchTradablePairs returns a list of the exchanges tradable pairs
func (*BTSE) GenerateDefaultSubscriptions ¶
func (b *BTSE) GenerateDefaultSubscriptions() ([]stream.ChannelSubscription, error)
GenerateDefaultSubscriptions Adds default subscriptions to websocket to be handled by ManageSubscriptions()
func (*BTSE) GetAccountBalance ¶
func (b *BTSE) GetAccountBalance() ([]CurrencyBalance, error)
GetAccountBalance returns the users account balance
func (*BTSE) GetActiveOrders ¶
GetActiveOrders retrieves any orders that are active/open
func (*BTSE) GetDefaultConfig ¶
func (b *BTSE) GetDefaultConfig() (*config.ExchangeConfig, error)
GetDefaultConfig returns a default exchange config
func (*BTSE) GetDepositAddress ¶
GetDepositAddress returns a deposit address for a specified currency
func (*BTSE) GetExchangeHistory ¶
func (b *BTSE) GetExchangeHistory(p currency.Pair, assetType asset.Item, timestampStart, timestampEnd time.Time) ([]exchange.TradeHistory, error)
GetExchangeHistory returns historic trade data within the timeframe provided.
func (*BTSE) GetFee ¶
func (b *BTSE) GetFee(feeBuilder *exchange.FeeBuilder) (float64, error)
GetFee returns an estimate of fee based on type of transaction
func (*BTSE) GetFeeByType ¶
func (b *BTSE) GetFeeByType(feeBuilder *exchange.FeeBuilder) (float64, error)
GetFeeByType returns an estimate of fee based on type of transaction
func (*BTSE) GetFills ¶
func (b *BTSE) GetFills(orderID, symbol, before, after, limit, username string) ([]FilledOrder, error)
GetFills gets all filled orders
func (*BTSE) GetFundingHistory ¶
func (b *BTSE) GetFundingHistory() ([]exchange.FundHistory, error)
GetFundingHistory returns funding history, deposits and withdrawals
func (*BTSE) GetFuturesMarkets ¶
func (b *BTSE) GetFuturesMarkets() ([]FuturesMarket, error)
GetFuturesMarkets returns a list of futures markets available on BTSE
func (*BTSE) GetHistoricCandles ¶
func (b *BTSE) GetHistoricCandles(pair currency.Pair, a asset.Item, start, end time.Time, interval kline.Interval) (kline.Item, error)
GetHistoricCandles returns candles between a time period for a set time interval
func (*BTSE) GetHistoricCandlesExtended ¶
func (b *BTSE) GetHistoricCandlesExtended(pair currency.Pair, a asset.Item, start, end time.Time, interval kline.Interval) (kline.Item, error)
GetHistoricCandlesExtended returns candles between a time period for a set time interval
func (*BTSE) GetMarketStatistics ¶
func (b *BTSE) GetMarketStatistics(symbol string) (*MarketStatistics, error)
GetMarketStatistics gets market statistics for a specificed market
func (*BTSE) GetMarketsSummary ¶
func (b *BTSE) GetMarketsSummary() (*HighLevelMarketData, error)
GetMarketsSummary stores market summary data
func (*BTSE) GetOrderHistory ¶
GetOrderHistory retrieves account order information Can Limit response to specific order status
func (*BTSE) GetOrderInfo ¶
GetOrderInfo returns information on a current open order
func (*BTSE) GetServerTime ¶
func (b *BTSE) GetServerTime() (*ServerTime, error)
GetServerTime returns the exchanges server time
func (*BTSE) GetSpotMarkets ¶
func (b *BTSE) GetSpotMarkets() ([]SpotMarket, error)
GetSpotMarkets returns a list of spot markets available on BTSE
func (*BTSE) ModifyOrder ¶
ModifyOrder will allow of changing orderbook placement and limit to market conversion
func (*BTSE) SendAuthenticatedHTTPRequest ¶
func (b *BTSE) SendAuthenticatedHTTPRequest(method, endpoint string, req map[string]interface{}, result interface{}, spotEndpoint bool) error
SendAuthenticatedHTTPRequest sends an authenticated HTTP request to the desired endpoint
func (*BTSE) SendHTTPRequest ¶
func (b *BTSE) SendHTTPRequest(method, endpoint string, result interface{}, spotEndpoint bool) 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) Setup ¶
func (b *BTSE) Setup(exch *config.ExchangeConfig) error
Setup takes in the supplied exchange configuration details and sets params
func (*BTSE) SubmitOrder ¶
SubmitOrder submits a new order
func (*BTSE) Subscribe ¶
func (b *BTSE) Subscribe(channelsToSubscribe []stream.ChannelSubscription) error
Subscribe sends a websocket message to receive data from the channel
func (*BTSE) Unsubscribe ¶
func (b *BTSE) Unsubscribe(channelsToUnsubscribe []stream.ChannelSubscription) error
Unsubscribe sends a websocket message to stop receiving data from the channel
func (*BTSE) UpdateAccountInfo ¶
UpdateAccountInfo retrieves balances for all enabled currencies for the BTSE exchange
func (*BTSE) UpdateOrderbook ¶
UpdateOrderbook updates and returns the orderbook for a currency pair
func (*BTSE) UpdateTicker ¶
UpdateTicker updates and returns the ticker for a currency pair
func (*BTSE) UpdateTradablePairs ¶
UpdateTradablePairs updates the exchanges available pairs and stores them in the exchanges config
func (*BTSE) ValidateCredentials ¶
ValidateCredentials validates current credentials used for wrapper functionality
func (*BTSE) WithdrawCryptocurrencyFunds ¶
func (b *BTSE) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.Request) (*withdraw.ExchangeResponse, error)
WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is submitted
func (*BTSE) WithdrawFiatFunds ¶
func (b *BTSE) WithdrawFiatFunds(withdrawRequest *withdraw.Request) (*withdraw.ExchangeResponse, error)
WithdrawFiatFunds returns a withdrawal ID when a withdrawal is submitted
func (*BTSE) WithdrawFiatFundsToInternationalBank ¶
func (b *BTSE) WithdrawFiatFundsToInternationalBank(withdrawRequest *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 CancelOrder ¶
CancelOrder stores the cancel order response data
type CurrencyBalance ¶
type CurrencyBalance struct { Currency string `json:"currency"` Total float64 `json:"total,string"` Available float64 `json:"available,string"` }
CurrencyBalance stores the account info data
type FilledOrder ¶
type FilledOrder struct { Price float64 `json:"price"` Amount float64 `json:"amount"` Fee float64 `json:"fee"` Side string `json:"side"` Tag string `json:"tag"` ID int64 `json:"id"` TradeID string `json:"trade_id"` Symbol string `json:"symbol"` OrderID string `json:"order_id"` CreatedAt string `json:"created_at"` }
FilledOrder stores filled order 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 HighLevelMarketData ¶
type HighLevelMarketData map[string]OverviewData
HighLevelMarketData stores market overview data
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 Order ¶
type Order struct { ID string `json:"id"` Type string `json:"type"` Side string `json:"side"` Price float64 `json:"price"` Amount float64 `json:"amount"` Tag string `json:"tag"` Symbol string `json:"symbol"` CreatedAt string `json:"created_at"` }
Order stores the order info
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 OverviewData ¶
type OverviewData struct { High24Hr float64 `json:"high24hr,string"` HighestBid float64 `json:"highestbid,string"` Last float64 `json:"last,string"` Low24Hr float64 `json:"low24hr,string"` LowestAsk float64 `json:"lowest_ask,string"` PercentageChange float64 `json:"percent_change,string"` Volume float64 `json:"volume,string"` }
OverviewData stores market overview data
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