Documentation ¶
Index ¶
- type AccountBalance
- type BTCMarkets
- func (b *BTCMarkets) CancelOrder(orderID []int64) (bool, error)
- func (b *BTCMarkets) GetAccountBalance() ([]AccountBalance, error)
- func (b *BTCMarkets) GetExchangeAccountInfo() (exchange.AccountInfo, error)
- func (b *BTCMarkets) GetExchangeHistory(p pair.CurrencyPair, assetType string) ([]exchange.TradeHistory, error)
- func (b *BTCMarkets) GetFee() float64
- func (b *BTCMarkets) GetOrderDetail(orderID []int64) ([]Order, error)
- func (b *BTCMarkets) GetOrderbook(firstPair, secondPair string) (Orderbook, error)
- func (b *BTCMarkets) GetOrderbookEx(p pair.CurrencyPair, assetType string) (orderbook.Base, error)
- func (b *BTCMarkets) GetOrders(currency, instrument string, limit, since int64, historic bool) ([]Order, error)
- func (b *BTCMarkets) GetTicker(firstPair, secondPair string) (Ticker, error)
- func (b *BTCMarkets) GetTickerPrice(p pair.CurrencyPair, assetType string) (ticker.Price, error)
- func (b *BTCMarkets) GetTrades(firstPair, secondPair string, values url.Values) ([]Trade, error)
- func (b *BTCMarkets) NewOrder(currency, instrument string, price, amount int64, ...) (int, error)
- func (b *BTCMarkets) Run()
- func (b *BTCMarkets) SendAuthenticatedRequest(reqType, path string, data interface{}, result interface{}) (err error)
- func (b *BTCMarkets) SendHTTPRequest(path string, result interface{}) error
- func (b *BTCMarkets) SetDefaults()
- func (b *BTCMarkets) Setup(exch config.ExchangeConfig)
- func (b *BTCMarkets) Start()
- func (b *BTCMarkets) UpdateOrderbook(p pair.CurrencyPair, assetType string) (orderbook.Base, error)
- func (b *BTCMarkets) UpdateTicker(p pair.CurrencyPair, assetType string) (ticker.Price, error)
- func (b *BTCMarkets) WithdrawAUD(accountName, accountNumber, bankName, bsbNumber, currency string, amount int64) (string, error)
- func (b *BTCMarkets) WithdrawCrypto(amount int64, currency, address string) (string, error)
- type Order
- type OrderToGo
- type Orderbook
- type Response
- type Ticker
- type Trade
- type TradeResponse
- type WithdrawRequestAUD
- type WithdrawRequestCrypto
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountBalance ¶
type AccountBalance struct { Balance float64 `json:"balance"` PendingFunds float64 `json:"pendingFunds"` Currency string `json:"currency"` }
AccountBalance holds account balance details
type BTCMarkets ¶
BTCMarkets is the overarching type across the BTCMarkets package
func (*BTCMarkets) CancelOrder ¶
func (b *BTCMarkets) CancelOrder(orderID []int64) (bool, error)
CancelOrder cancels an order by its ID orderID - id for order example "1337"
func (*BTCMarkets) GetAccountBalance ¶
func (b *BTCMarkets) GetAccountBalance() ([]AccountBalance, error)
GetAccountBalance returns the full account balance
func (*BTCMarkets) GetExchangeAccountInfo ¶
func (b *BTCMarkets) GetExchangeAccountInfo() (exchange.AccountInfo, error)
GetExchangeAccountInfo retrieves balances for all enabled currencies for the BTCMarkets exchange
func (*BTCMarkets) GetExchangeHistory ¶
func (b *BTCMarkets) GetExchangeHistory(p pair.CurrencyPair, assetType string) ([]exchange.TradeHistory, error)
GetExchangeHistory returns historic trade data since exchange opening.
func (*BTCMarkets) GetFee ¶
func (b *BTCMarkets) GetFee() float64
GetFee returns the BTCMarkets fee on transactions
func (*BTCMarkets) GetOrderDetail ¶
func (b *BTCMarkets) GetOrderDetail(orderID []int64) ([]Order, error)
GetOrderDetail returns order information an a specific order orderID - example "1337"
func (*BTCMarkets) GetOrderbook ¶
func (b *BTCMarkets) GetOrderbook(firstPair, secondPair string) (Orderbook, error)
GetOrderbook returns current orderbook symbol - example "btc" or "ltc"
func (*BTCMarkets) GetOrderbookEx ¶
func (b *BTCMarkets) GetOrderbookEx(p pair.CurrencyPair, assetType string) (orderbook.Base, error)
GetOrderbookEx returns orderbook base on the currency pair
func (*BTCMarkets) GetOrders ¶
func (b *BTCMarkets) GetOrders(currency, instrument string, limit, since int64, historic bool) ([]Order, error)
GetOrders returns current order information on the exchange currency - example "AUD" instrument - example "BTC" limit - example "10" since - since a time example "33434568724" historic - if false just normal Orders open
func (*BTCMarkets) GetTicker ¶
func (b *BTCMarkets) GetTicker(firstPair, secondPair string) (Ticker, error)
GetTicker returns a ticker symbol - example "btc" or "ltc"
func (*BTCMarkets) GetTickerPrice ¶
func (b *BTCMarkets) GetTickerPrice(p pair.CurrencyPair, assetType string) (ticker.Price, error)
GetTickerPrice returns the ticker for a currency pair
func (*BTCMarkets) GetTrades ¶
GetTrades returns executed trades on the exchange symbol - example "btc" or "ltc" values - optional paramater "since" example values.Set(since, "59868345231")
func (*BTCMarkets) NewOrder ¶
func (b *BTCMarkets) NewOrder(currency, instrument string, price, amount int64, orderSide, orderType, clientReq string) (int, error)
NewOrder requests a new order and returns an ID currency - example "AUD" instrument - example "BTC" price - example 13000000000 (i.e x 100000000) amount - example 100000000 (i.e x 100000000) orderside - example "Bid" or "Ask" orderType - example "limit" clientReq - example "abc-cdf-1000"
func (*BTCMarkets) SendAuthenticatedRequest ¶
func (b *BTCMarkets) SendAuthenticatedRequest(reqType, path string, data interface{}, result interface{}) (err error)
SendAuthenticatedRequest sends an authenticated HTTP request
func (*BTCMarkets) SendHTTPRequest ¶
func (b *BTCMarkets) SendHTTPRequest(path string, result interface{}) error
SendHTTPRequest sends an unauthenticated HTTP request
func (*BTCMarkets) Setup ¶
func (b *BTCMarkets) Setup(exch config.ExchangeConfig)
Setup takes in an exchange configuration and sets all parameters
func (*BTCMarkets) UpdateOrderbook ¶
func (b *BTCMarkets) UpdateOrderbook(p pair.CurrencyPair, assetType string) (orderbook.Base, error)
UpdateOrderbook updates and returns the orderbook for a currency pair
func (*BTCMarkets) UpdateTicker ¶
func (b *BTCMarkets) UpdateTicker(p pair.CurrencyPair, assetType string) (ticker.Price, error)
UpdateTicker updates and returns the ticker for a currency pair
func (*BTCMarkets) WithdrawAUD ¶
func (b *BTCMarkets) WithdrawAUD(accountName, accountNumber, bankName, bsbNumber, currency string, amount int64) (string, error)
WithdrawAUD withdraws AUD into a designated bank address Does not return a TxID!
func (*BTCMarkets) WithdrawCrypto ¶
func (b *BTCMarkets) WithdrawCrypto(amount int64, currency, address string) (string, error)
WithdrawCrypto withdraws cryptocurrency into a designated address
type Order ¶
type Order struct { ID int64 `json:"id"` Currency string `json:"currency"` Instrument string `json:"instrument"` OrderSide string `json:"orderSide"` OrderType string `json:"ordertype"` CreationTime float64 `json:"creationTime"` Status string `json:"status"` ErrorMessage string `json:"errorMessage"` Price float64 `json:"price"` Volume float64 `json:"volume"` OpenVolume float64 `json:"openVolume"` ClientRequestID string `json:"clientRequestId"` Trades []TradeResponse `json:"trades"` }
Order holds order information
type OrderToGo ¶
type OrderToGo struct { Currency string `json:"currency"` Instrument string `json:"instrument"` Price int64 `json:"price"` Volume int64 `json:"volume"` OrderSide string `json:"orderSide"` OrderType string `json:"ordertype"` ClientRequestID string `json:"clientRequestId"` }
OrderToGo holds order information to be sent to the exchange
type Orderbook ¶
type Orderbook struct { Currency string `json:"currency"` Instrument string `json:"instrument"` Timestamp int64 `json:"timestamp"` Asks [][]float64 `json:"asks"` Bids [][]float64 `json:"bids"` }
Orderbook holds current orderbook information returned from the exchange
type Response ¶
type Response struct { Success bool `json:"success"` ErrorCode int `json:"errorCode"` ErrorMessage string `json:"errorMessage"` ID int `json:"id"` Responses []struct { Success bool `json:"success"` ErrorCode int `json:"errorCode"` ErrorMessage string `json:"errorMessage"` ID int64 `json:"id"` } ClientRequestID string `json:"clientRequestId"` Orders []Order `json:"orders"` Status string `json:"status"` }
Response is the genralized response type
type Ticker ¶
type Ticker struct { BestBID float64 `json:"bestBid"` BestAsk float64 `json:"bestAsk"` LastPrice float64 `json:"lastPrice"` Currency string `json:"currency"` Instrument string `json:"instrument"` Timestamp int64 `json:"timestamp"` Volume float64 `json:"volume24h"` }
Ticker holds ticker information
type Trade ¶
type Trade struct { TradeID int64 `json:"tid"` Amount float64 `json:"amount"` Price float64 `json:"price"` Date int64 `json:"date"` }
Trade holds trade information
type TradeResponse ¶
type TradeResponse struct { ID int64 `json:"id"` CreationTime float64 `json:"creationTime"` Description string `json:"description"` Price float64 `json:"price"` Volume float64 `json:"volume"` Fee float64 `json:"fee"` }
TradeResponse holds trade information
type WithdrawRequestAUD ¶
type WithdrawRequestAUD struct { Amount int64 `json:"amount"` Currency string `json:"currency"` AccountName string `json:"accountName"` AccountNumber string `json:"accountNumber"` BankName string `json:"bankName"` BSBNumber string `json:"bsbNumber"` }
WithdrawRequestAUD is a generalized withdraw request type
type WithdrawRequestCrypto ¶
type WithdrawRequestCrypto struct { Amount int64 `json:"amount"` Currency string `json:"currency"` Address string `json:"address"` }
WithdrawRequestCrypto is a generalized withdraw request type