Documentation ¶
Index ¶
- type AccountBalance
- type BTSE
- func (b *BTSE) AuthenticateWebsocket() error
- func (b *BTSE) CancelAllOrders(orderCancellation *exchange.OrderCancellation) (exchange.CancelAllOrdersResponse, error)
- func (b *BTSE) CancelExistingOrder(orderID, productID string) (*CancelOrder, error)
- func (b *BTSE) CancelOrder(order *exchange.OrderCancellation) error
- func (b *BTSE) CancelOrders(productID string) (*CancelOrder, error)
- func (b *BTSE) CreateOrder(amount, price float64, side, orderType, symbol, timeInForce, tag string) (*string, error)
- func (b *BTSE) GenerateDefaultSubscriptions()
- func (b *BTSE) GetAccountBalance() (*AccountBalance, error)
- func (b *BTSE) GetAccountInfo() (exchange.AccountInfo, error)
- func (b *BTSE) GetActiveOrders(getOrdersRequest *exchange.GetOrdersRequest) ([]exchange.OrderDetail, error)
- func (b *BTSE) GetDepositAddress(cryptocurrency currency.Code, accountID string) (string, error)
- func (b *BTSE) GetExchangeHistory(p currency.Pair, assetType string) ([]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, productID, before, after, limit string) (*FilledOrders, error)
- func (b *BTSE) GetFundingHistory() ([]exchange.FundHistory, error)
- func (b *BTSE) GetMarketStatistics(symbol string) (*MarketStatistics, error)
- func (b *BTSE) GetMarkets() (*Markets, error)
- func (b *BTSE) GetOrderHistory(getOrdersRequest *exchange.GetOrdersRequest) ([]exchange.OrderDetail, error)
- func (b *BTSE) GetOrderInfo(orderID string) (exchange.OrderDetail, error)
- func (b *BTSE) GetOrderbookEx(p currency.Pair, assetType string) (orderbook.Base, error)
- func (b *BTSE) GetOrders(productID string) (*OpenOrders, error)
- func (b *BTSE) GetServerTime() (*ServerTime, error)
- func (b *BTSE) GetSubscriptions() ([]wshandler.WebsocketChannelSubscription, error)
- func (b *BTSE) GetTicker(symbol string) (*Ticker, error)
- func (b *BTSE) GetTickerPrice(p currency.Pair, assetType string) (ticker.Price, error)
- func (b *BTSE) GetTrades(symbol string) (*Trades, error)
- func (b *BTSE) GetWebsocket() (*wshandler.Websocket, error)
- func (b *BTSE) ModifyOrder(action *exchange.ModifyOrder) (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{}) error
- func (b *BTSE) SetDefaults()
- func (b *BTSE) Setup(exch *config.ExchangeConfig)
- func (b *BTSE) Start(wg *sync.WaitGroup)
- func (b *BTSE) SubmitOrder(p currency.Pair, side exchange.OrderSide, orderType exchange.OrderType, ...) (exchange.SubmitOrderResponse, error)
- func (b *BTSE) Subscribe(channelToSubscribe wshandler.WebsocketChannelSubscription) error
- func (b *BTSE) SubscribeToWebsocketChannels(channels []wshandler.WebsocketChannelSubscription) error
- func (b *BTSE) Unsubscribe(channelToSubscribe wshandler.WebsocketChannelSubscription) error
- func (b *BTSE) UnsubscribeToWebsocketChannels(channels []wshandler.WebsocketChannelSubscription) error
- func (b *BTSE) UpdateOrderbook(p currency.Pair, assetType string) (orderbook.Base, error)
- func (b *BTSE) UpdateTicker(p currency.Pair, assetType string) (ticker.Price, error)
- func (b *BTSE) WithdrawCryptocurrencyFunds(withdrawRequest *exchange.WithdrawRequest) (string, error)
- func (b *BTSE) WithdrawFiatFunds(withdrawRequest *exchange.WithdrawRequest) (string, error)
- func (b *BTSE) WithdrawFiatFundsToInternationalBank(withdrawRequest *exchange.WithdrawRequest) (string, error)
- func (b *BTSE) WsConnect() error
- func (b *BTSE) WsHandleData()
- type CancelOrder
- type CurrencyBalance
- type FilledOrder
- type FilledOrders
- type Market
- type MarketStatistics
- type Markets
- type OpenOrder
- type OpenOrders
- type Order
- type ServerTime
- type Ticker
- type Trade
- type Trades
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountBalance ¶
type AccountBalance []CurrencyBalance
AccountBalance stores an array of currency balances
type BTSE ¶
type BTSE struct { exchange.Base WebsocketConn *wshandler.WebsocketConnection }
BTSE is the overarching type across this package
func (*BTSE) AuthenticateWebsocket ¶
AuthenticateWebsocket sends an authentication message to the websocket
func (*BTSE) CancelAllOrders ¶
func (b *BTSE) CancelAllOrders(orderCancellation *exchange.OrderCancellation) (exchange.CancelAllOrdersResponse, 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) CancelExistingOrder ¶
func (b *BTSE) CancelExistingOrder(orderID, productID string) (*CancelOrder, error)
CancelExistingOrder cancels an order
func (*BTSE) CancelOrder ¶
func (b *BTSE) CancelOrder(order *exchange.OrderCancellation) error
CancelOrder cancels an order by its corresponding ID number
func (*BTSE) CancelOrders ¶
func (b *BTSE) CancelOrders(productID string) (*CancelOrder, error)
CancelOrders cancels all orders productID optional. 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) CreateOrder ¶
func (b *BTSE) CreateOrder(amount, price float64, side, orderType, symbol, timeInForce, tag string) (*string, error)
CreateOrder creates an order
func (*BTSE) GenerateDefaultSubscriptions ¶
func (b *BTSE) GenerateDefaultSubscriptions()
GenerateDefaultSubscriptions Adds default subscriptions to websocket to be handled by ManageSubscriptions()
func (*BTSE) GetAccountBalance ¶
func (b *BTSE) GetAccountBalance() (*AccountBalance, error)
GetAccountBalance returns the users account balance
func (*BTSE) GetAccountInfo ¶
func (b *BTSE) GetAccountInfo() (exchange.AccountInfo, error)
GetAccountInfo retrieves balances for all enabled currencies for the BTSE exchange
func (*BTSE) GetActiveOrders ¶
func (b *BTSE) GetActiveOrders(getOrdersRequest *exchange.GetOrdersRequest) ([]exchange.OrderDetail, error)
GetActiveOrders retrieves any orders that are active/open
func (*BTSE) GetDepositAddress ¶
GetDepositAddress returns a deposit address for a specified currency
func (*BTSE) GetExchangeHistory ¶
func (b *BTSE) GetExchangeHistory(p currency.Pair, assetType string) ([]exchange.TradeHistory, error)
GetExchangeHistory returns historic trade data since exchange opening.
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, productID, before, after, limit string) (*FilledOrders, 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) GetMarketStatistics ¶
func (b *BTSE) GetMarketStatistics(symbol string) (*MarketStatistics, error)
GetMarketStatistics gets market statistics for a specificed market
func (*BTSE) GetMarkets ¶
GetMarkets returns a list of markets available on BTSE
func (*BTSE) GetOrderHistory ¶
func (b *BTSE) GetOrderHistory(getOrdersRequest *exchange.GetOrdersRequest) ([]exchange.OrderDetail, error)
GetOrderHistory retrieves account order information Can Limit response to specific order status
func (*BTSE) GetOrderInfo ¶
func (b *BTSE) GetOrderInfo(orderID string) (exchange.OrderDetail, error)
GetOrderInfo returns information on a current open order
func (*BTSE) GetOrderbookEx ¶
GetOrderbookEx returns orderbook base on the currency pair
func (*BTSE) GetOrders ¶
func (b *BTSE) GetOrders(productID string) (*OpenOrders, error)
GetOrders returns all pending orders
func (*BTSE) GetServerTime ¶
func (b *BTSE) GetServerTime() (*ServerTime, error)
GetServerTime returns the exchanges server time
func (*BTSE) GetSubscriptions ¶
func (b *BTSE) GetSubscriptions() ([]wshandler.WebsocketChannelSubscription, error)
GetSubscriptions returns a copied list of subscriptions
func (*BTSE) GetTickerPrice ¶
GetTickerPrice returns the ticker for a currency pair
func (*BTSE) GetWebsocket ¶
GetWebsocket returns a pointer to the exchange websocket
func (*BTSE) ModifyOrder ¶
func (b *BTSE) ModifyOrder(action *exchange.ModifyOrder) (string, error)
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{}) error
SendAuthenticatedHTTPRequest sends an authenticated HTTP request to the desired endpoint
func (*BTSE) SendHTTPRequest ¶
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)
Setup takes in the supplied exchange configuration details and sets params
func (*BTSE) SubmitOrder ¶
func (b *BTSE) SubmitOrder(p currency.Pair, side exchange.OrderSide, orderType exchange.OrderType, amount, price float64, clientID string) (exchange.SubmitOrderResponse, error)
SubmitOrder submits a new order
func (*BTSE) Subscribe ¶
func (b *BTSE) Subscribe(channelToSubscribe wshandler.WebsocketChannelSubscription) error
Subscribe sends a websocket message to receive data from the channel
func (*BTSE) SubscribeToWebsocketChannels ¶
func (b *BTSE) SubscribeToWebsocketChannels(channels []wshandler.WebsocketChannelSubscription) error
SubscribeToWebsocketChannels appends to ChannelsToSubscribe which lets websocket.manageSubscriptions handle subscribing
func (*BTSE) Unsubscribe ¶
func (b *BTSE) Unsubscribe(channelToSubscribe wshandler.WebsocketChannelSubscription) error
Unsubscribe sends a websocket message to stop receiving data from the channel
func (*BTSE) UnsubscribeToWebsocketChannels ¶
func (b *BTSE) UnsubscribeToWebsocketChannels(channels []wshandler.WebsocketChannelSubscription) error
UnsubscribeToWebsocketChannels removes from ChannelsToSubscribe which lets websocket.manageSubscriptions handle unsubscribing
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) WithdrawCryptocurrencyFunds ¶
func (b *BTSE) WithdrawCryptocurrencyFunds(withdrawRequest *exchange.WithdrawRequest) (string, error)
WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is submitted
func (*BTSE) WithdrawFiatFunds ¶
func (b *BTSE) WithdrawFiatFunds(withdrawRequest *exchange.WithdrawRequest) (string, error)
WithdrawFiatFunds returns a withdrawal ID when a withdrawal is submitted
func (*BTSE) WithdrawFiatFundsToInternationalBank ¶
func (b *BTSE) WithdrawFiatFundsToInternationalBank(withdrawRequest *exchange.WithdrawRequest) (string, error)
WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a withdrawal is submitted
func (*BTSE) WsHandleData ¶
func (b *BTSE) WsHandleData()
WsHandleData handles read data from websocket connection
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"` ProductID string `json:"product_id"` OrderID string `json:"order_id"` CreatedAt string `json:"created_at"` }
FilledOrder stores filled order data
type Market ¶
type Market struct { 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"` BaseIncremementSize float64 `json:"base_increment_size"` QuoteMinPrice float64 `json:"quote_min_price"` QuoteIncrement float64 `json:"quote_increment"` Status string `json:"status"` }
Market stores market 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 string `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"` ProductID string `json:"product_id"` CreatedAt string `json:"created_at"` }
Order stores the order info
type ServerTime ¶
ServerTime stores the server time 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