Documentation ¶
Index ¶
- Constants
- type COINUT
- func (c *COINUT) CancelOrder(instrumentID, orderID int) (bool, error)
- func (c *COINUT) CancelOrders(orders []CoinutCancelOrders) (CoinutCancelOrdersResponse, error)
- func (c *COINUT) GetDerivativeInstruments(secType string) (interface{}, error)
- func (c *COINUT) GetExchangeAccountInfo() (exchange.AccountInfo, error)
- func (c *COINUT) GetIndexTicker(asset string) (CoinutIndexTicker, error)
- func (c *COINUT) GetInstrumentOrderbook(instrumentID, limit int) (CoinutOrderbook, error)
- func (c *COINUT) GetInstrumentTicker(instrumentID int) (CoinutTicker, error)
- func (c *COINUT) GetInstruments() (CoinutInstruments, error)
- func (c *COINUT) GetOpenOrders(instrumentID int) ([]CoinutOrdersResponse, error)
- func (c *COINUT) GetOpenPosition(instrumentID int) ([]CoinutOpenPosition, error)
- func (c *COINUT) GetOptionChain(asset, secType string, expiry int64) (CoinutOptionChainResponse, error)
- func (c *COINUT) GetOrderbookEx(p pair.CurrencyPair, assetType string) (orderbook.Base, error)
- func (c *COINUT) GetPositionHistory(secType string, start, limit int) (CoinutPositionHistory, error)
- func (c *COINUT) GetTickerPrice(p pair.CurrencyPair, assetType string) (ticker.Price, error)
- func (c *COINUT) GetTradeHistory(instrumentID, start, limit int) (CoinutTradeHistory, error)
- func (c *COINUT) GetTrades(instrumentID int) (CoinutTrades, error)
- func (c *COINUT) GetUserBalance() (CoinutUserBalance, error)
- func (c *COINUT) NewOrder(instrumentID int, quantity, price float64, buy bool, orderID uint32) (interface{}, error)
- func (c *COINUT) NewOrders(orders []CoinutOrder) ([]CoinutOrdersBase, error)
- func (c *COINUT) Run()
- func (c *COINUT) SendAuthenticatedHTTPRequest(apiRequest string, params map[string]interface{}, result interface{}) (err error)
- func (c *COINUT) SetDefaults()
- func (c *COINUT) Setup(exch config.ExchangeConfig)
- func (c *COINUT) Start()
- func (c *COINUT) UpdateOrderbook(p pair.CurrencyPair, assetType string) (orderbook.Base, error)
- func (c *COINUT) UpdateTicker(p pair.CurrencyPair, assetType string) (ticker.Price, error)
- func (c *COINUT) WebsocketClient()
- type CoinutCancelOrders
- type CoinutCancelOrdersResponse
- type CoinutCommission
- type CoinutGenericResponse
- type CoinutIndexTicker
- type CoinutInstrumentBase
- type CoinutInstruments
- type CoinutOpenPosition
- type CoinutOption
- type CoinutOptionChainResponse
- type CoinutOptionChainUpdate
- type CoinutOrder
- type CoinutOrderFilledResponse
- type CoinutOrderRejectResponse
- type CoinutOrderResponse
- type CoinutOrderbook
- type CoinutOrderbookBase
- type CoinutOrdersBase
- type CoinutOrdersResponse
- type CoinutPositionHistory
- type CoinutTicker
- type CoinutTradeBase
- type CoinutTradeHistory
- type CoinutTrades
- type CoinutUserBalance
Constants ¶
View Source
const COINUT_WEBSOCKET_URL = "wss://wsapi.coinut.com"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type COINUT ¶
COINUT is the overarching type across the coinut package
func (*COINUT) CancelOrders ¶
func (c *COINUT) CancelOrders(orders []CoinutCancelOrders) (CoinutCancelOrdersResponse, error)
func (*COINUT) GetDerivativeInstruments ¶
func (*COINUT) GetExchangeAccountInfo ¶
GetExchangeAccountInfo retrieves balances for all enabled currencies for the COINUT exchange
func (*COINUT) GetIndexTicker ¶
func (c *COINUT) GetIndexTicker(asset string) (CoinutIndexTicker, error)
func (*COINUT) GetInstrumentOrderbook ¶
func (c *COINUT) GetInstrumentOrderbook(instrumentID, limit int) (CoinutOrderbook, error)
func (*COINUT) GetInstrumentTicker ¶
func (c *COINUT) GetInstrumentTicker(instrumentID int) (CoinutTicker, error)
func (*COINUT) GetInstruments ¶
func (c *COINUT) GetInstruments() (CoinutInstruments, error)
GetInstruments returns instruments
func (*COINUT) GetOpenOrders ¶
func (c *COINUT) GetOpenOrders(instrumentID int) ([]CoinutOrdersResponse, error)
func (*COINUT) GetOpenPosition ¶
func (c *COINUT) GetOpenPosition(instrumentID int) ([]CoinutOpenPosition, error)
func (*COINUT) GetOptionChain ¶
func (c *COINUT) GetOptionChain(asset, secType string, expiry int64) (CoinutOptionChainResponse, error)
func (*COINUT) GetOrderbookEx ¶
GetOrderbookEx returns orderbook base on the currency pair
func (*COINUT) GetPositionHistory ¶
func (c *COINUT) GetPositionHistory(secType string, start, limit int) (CoinutPositionHistory, error)
func (*COINUT) GetTickerPrice ¶
GetTickerPrice returns the ticker for a currency pair
func (*COINUT) GetTradeHistory ¶
func (c *COINUT) GetTradeHistory(instrumentID, start, limit int) (CoinutTradeHistory, error)
func (*COINUT) GetUserBalance ¶
func (c *COINUT) GetUserBalance() (CoinutUserBalance, error)
func (*COINUT) NewOrders ¶
func (c *COINUT) NewOrders(orders []CoinutOrder) ([]CoinutOrdersBase, error)
func (*COINUT) SendAuthenticatedHTTPRequest ¶
func (*COINUT) Setup ¶
func (c *COINUT) Setup(exch config.ExchangeConfig)
Setup sets the current exchange configuration
func (*COINUT) UpdateOrderbook ¶
UpdateOrderbook updates and returns the orderbook for a currency pair
func (*COINUT) UpdateTicker ¶
UpdateTicker updates and returns the ticker for a currency pair
func (*COINUT) WebsocketClient ¶
func (c *COINUT) WebsocketClient()
type CoinutCancelOrders ¶
type CoinutCancelOrdersResponse ¶
type CoinutCancelOrdersResponse struct { CoinutGenericResponse Results []struct { OrderID int64 `json:"order_id"` Status string `json:"status"` InstrumentID int `json:"inst_id"` } `json:"results"` }
type CoinutCommission ¶
type CoinutGenericResponse ¶
type CoinutIndexTicker ¶
type CoinutInstrumentBase ¶
type CoinutInstruments ¶
type CoinutInstruments struct {
Instruments map[string][]CoinutInstrumentBase `json:"SPOT"`
}
type CoinutOpenPosition ¶
type CoinutOpenPosition struct { PositionID int `json:"position_id"` Commission CoinutCommission `json:"commission"` OpenPrice float64 `json:"open_price,string"` RealizedPL float64 `json:"realized_pl,string"` Quantity float64 `json:"qty,string"` OpenTimestamp int64 `json:"open_timestamp"` InstrumentID int `json:"inst_id"` }
type CoinutOption ¶
type CoinutOptionChainResponse ¶
type CoinutOptionChainResponse struct { ExpiryTime int64 `json:"expiry_time"` SecurityType string `json:"sec_type"` Asset string `json:"asset"` Entries []struct { Call CoinutOption `json:"call"` Put CoinutOption `json:"put"` Strike float64 `json:"strike,string"` } }
type CoinutOptionChainUpdate ¶
type CoinutOptionChainUpdate struct { CoinutOption CoinutGenericResponse Asset string `json:"asset"` ExpiryTime int64 `json:"expiry_time"` SecurityType string `json:"sec_type"` Volume float64 `json:"volume,string"` }
type CoinutOrder ¶
type CoinutOrderFilledResponse ¶
type CoinutOrderFilledResponse struct { CoinutGenericResponse Commission CoinutCommission `json:"commission"` FillPrice float64 `json:"fill_price,string"` FillQuantity float64 `json:"fill_qty,string"` Order CoinutOrderResponse `json:"order"` }
type CoinutOrderRejectResponse ¶
type CoinutOrderRejectResponse struct { CoinutOrderResponse Reasons []string `json:"reasons"` }
type CoinutOrderResponse ¶
type CoinutOrderResponse struct { OrderID int64 `json:"order_id"` OpenQuantity float64 `json:"open_qty,string"` Price float64 `json:"price,string"` Quantity float64 `json:"qty,string"` InstrumentID int64 `json:"inst_id"` ClientOrderID int64 `json:"client_ord_id"` Timestamp int64 `json:"timestamp"` OrderPrice float64 `json:"order_price,string"` Side string `json:"side"` }
type CoinutOrderbook ¶
type CoinutOrderbook struct { Buy []CoinutOrderbookBase `json:"buy"` Sell []CoinutOrderbookBase `json:"sell"` InstrumentID int `json:"inst_id"` TotalBuy float64 `json:"total_buy,string"` TotalSell float64 `json:"total_sell,string"` TransID int64 `json:"trans_id"` }
type CoinutOrderbookBase ¶
type CoinutOrdersBase ¶
type CoinutOrdersBase struct { CoinutGenericResponse CoinutOrderResponse }
type CoinutOrdersResponse ¶
type CoinutOrdersResponse struct {
Data []CoinutOrdersBase
}
type CoinutPositionHistory ¶
type CoinutPositionHistory struct { Positions []struct { PositionID int `json:"position_id"` Records []struct { Commission CoinutCommission `json:"commission"` FillPrice float64 `json:"fill_price,string,omitempty"` TransactionID int `json:"trans_id"` FillQuantity float64 `json:"fill_qty,omitempty"` Position struct { Commission CoinutCommission `json:"commission"` Timestamp int64 `json:"timestamp"` OpenPrice float64 `json:"open_price,string"` RealizedPL float64 `json:"realized_pl,string"` Quantity float64 `json:"qty,string"` } `json:"position"` AssetAtExpiry float64 `json:"asset_at_expiry,string,omitempty"` } `json:"records"` Instrument struct { ExpiryTime int64 `json:"expiry_time"` ContractSize float64 `json:"contract_size,string"` ConversionRate float64 `json:"conversion_rate,string"` OptionType string `json:"option_type"` InstrumentID int `json:"inst_id"` SecType string `json:"sec_type"` Asset string `json:"asset"` Strike float64 `json:"strike,string"` } `json:"inst"` OpenTimestamp int64 `json:"open_timestamp"` } `json:"positions"` TotalNumber int `json:"total_number"` }
type CoinutTicker ¶
type CoinutTicker struct { HighestBuy float64 `json:"highest_buy,string"` InstrumentID int `json:"inst_id"` Last float64 `json:"last,string"` LowestSell float64 `json:"lowest_sell,string"` OpenInterest float64 `json:"open_interest,string"` Timestamp float64 `json:"timestamp"` TransID int64 `json:"trans_id"` Volume float64 `json:"volume,string"` Volume24 float64 `json:"volume24,string"` }
type CoinutTradeBase ¶
type CoinutTradeHistory ¶
type CoinutTradeHistory struct { TotalNumber int64 `json:"total_number"` Trades []CoinutOrderFilledResponse `json:"trades"` }
type CoinutTrades ¶
type CoinutTrades struct {
Trades []CoinutTradeBase `json:"trades"`
}
type CoinutUserBalance ¶
type CoinutUserBalance struct { BTC float64 `json:"btc,string"` ETC float64 `json:"etc,string"` ETH float64 `json:"eth,string"` LTC float64 `json:"ltc,string"` Equity float64 `json:"equity,string,string"` InitialMargin float64 `json:"initial_margin,string"` MaintenanceMargin float64 `json:"maintenance_margin,string"` RealizedPL float64 `json:"realized_pl,string"` TransID int64 `json:"trans_id"` UnrealizedPL float64 `json:"unrealized_pl,string"` }
Click to show internal directories.
Click to hide internal directories.