Documentation ¶
Index ¶
- type COINUT
- func (c *COINUT) AuthenticateWebsocket() error
- func (c *COINUT) CancelAllOrders(details *order.Cancel) (order.CancelAllResponse, error)
- func (c *COINUT) CancelExistingOrder(instrumentID, orderID int64) (bool, error)
- func (c *COINUT) CancelOrder(o *order.Cancel) error
- func (c *COINUT) CancelOrders(orders []CancelOrders) (CancelOrdersResponse, error)
- func (c *COINUT) FetchAccountInfo() (account.Holdings, error)
- func (c *COINUT) FetchOrderbook(p currency.Pair, assetType asset.Item) (*orderbook.Base, error)
- func (c *COINUT) FetchTicker(p currency.Pair, assetType asset.Item) (*ticker.Price, error)
- func (c *COINUT) FetchTradablePairs(asset asset.Item) ([]string, error)
- func (c *COINUT) GenerateDefaultSubscriptions() ([]stream.ChannelSubscription, error)
- func (c *COINUT) GetActiveOrders(req *order.GetOrdersRequest) ([]order.Detail, error)
- func (c *COINUT) GetDefaultConfig() (*config.ExchangeConfig, error)
- func (c *COINUT) GetDepositAddress(cryptocurrency currency.Code, accountID string) (string, error)
- func (c *COINUT) GetDerivativeInstruments(secType string) (interface{}, error)
- func (c *COINUT) GetExchangeHistory(p currency.Pair, assetType asset.Item, timestampStart, timestampEnd time.Time) ([]exchange.TradeHistory, error)
- func (c *COINUT) GetFee(feeBuilder *exchange.FeeBuilder) (float64, error)
- func (c *COINUT) GetFeeByType(feeBuilder *exchange.FeeBuilder) (float64, error)
- func (c *COINUT) GetFundingHistory() ([]exchange.FundHistory, error)
- func (c *COINUT) GetHistoricCandles(pair currency.Pair, a asset.Item, start, end time.Time, ...) (kline.Item, error)
- func (c *COINUT) GetHistoricCandlesExtended(pair currency.Pair, a asset.Item, start, end time.Time, ...) (kline.Item, error)
- func (c *COINUT) GetIndexTicker(asset string) (IndexTicker, error)
- func (c *COINUT) GetInstrumentOrderbook(instrumentID, limit int64) (Orderbook, error)
- func (c *COINUT) GetInstrumentTicker(instrumentID int64) (Ticker, error)
- func (c *COINUT) GetInstruments() (Instruments, error)
- func (c *COINUT) GetOpenOrders(instrumentID int64) (GetOpenOrdersResponse, error)
- func (c *COINUT) GetOpenPositions(instrumentID int) ([]OpenPosition, error)
- func (c *COINUT) GetOptionChain(asset, secType string) (OptionChainResponse, error)
- func (c *COINUT) GetOrderHistory(req *order.GetOrdersRequest) ([]order.Detail, error)
- func (c *COINUT) GetOrderInfo(orderID string) (order.Detail, error)
- func (c *COINUT) GetPositionHistory(secType string, start, limit int) (PositionHistory, error)
- func (c *COINUT) GetTradeHistory(instrumentID, start, limit int64) (TradeHistory, error)
- func (c *COINUT) GetTrades(instrumentID int) (Trades, error)
- func (c *COINUT) GetUserBalance() (*UserBalance, error)
- func (c *COINUT) ModifyOrder(action *order.Modify) (string, error)
- func (c *COINUT) NewOrder(instrumentID int64, quantity, price float64, buy bool, orderID uint32) (interface{}, error)
- func (c *COINUT) NewOrders(orders []Order) ([]OrdersBase, error)
- func (c *COINUT) Run()
- func (c *COINUT) SeedInstruments() error
- func (c *COINUT) SendHTTPRequest(apiRequest string, params map[string]interface{}, authenticated bool, ...) (err error)
- func (c *COINUT) SetDefaults()
- func (c *COINUT) Setup(exch *config.ExchangeConfig) error
- func (c *COINUT) Start(wg *sync.WaitGroup)
- func (c *COINUT) SubmitOrder(o *order.Submit) (order.SubmitResponse, error)
- func (c *COINUT) Subscribe(channelsToSubscribe []stream.ChannelSubscription) error
- func (c *COINUT) Unsubscribe(channelToUnsubscribe []stream.ChannelSubscription) error
- func (c *COINUT) UpdateAccountInfo() (account.Holdings, error)
- func (c *COINUT) UpdateOrderbook(p currency.Pair, assetType asset.Item) (*orderbook.Base, error)
- func (c *COINUT) UpdateTicker(p currency.Pair, assetType asset.Item) (*ticker.Price, error)
- func (c *COINUT) UpdateTradablePairs(forceUpdate bool) error
- func (c *COINUT) ValidateCredentials() error
- func (c *COINUT) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.Request) (*withdraw.ExchangeResponse, error)
- func (c *COINUT) WithdrawFiatFunds(withdrawRequest *withdraw.Request) (*withdraw.ExchangeResponse, error)
- func (c *COINUT) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.Request) (*withdraw.ExchangeResponse, error)
- func (c *COINUT) WsConnect() error
- func (c *COINUT) WsGetInstruments() (Instruments, error)
- func (c *COINUT) WsProcessOrderbookSnapshot(ob *WsOrderbookSnapshot) error
- func (c *COINUT) WsProcessOrderbookUpdate(update *WsOrderbookUpdate) error
- type CancelOrders
- type CancelOrdersResponse
- type Commission
- type GenericResponse
- type GetOpenOrdersResponse
- type IndexTicker
- type InstrumentBase
- type Instruments
- type OpenPosition
- type Option
- type OptionChainResponse
- type OptionChainUpdate
- type Order
- type OrderFilledResponse
- type OrderRejectResponse
- type OrderResponse
- type Orderbook
- type OrderbookBase
- type OrdersBase
- type OrdersResponse
- type PositionHistory
- type Ticker
- type TradeBase
- type TradeHistory
- type Trades
- type UserBalance
- type WsCancelOrderParameters
- type WsCancelOrderRequest
- type WsCancelOrderResponse
- type WsCancelOrdersRequest
- type WsCancelOrdersRequestEntry
- type WsCancelOrdersResponse
- type WsCancelOrdersResponseData
- type WsGetAccountBalanceResponse
- type WsGetOpenOrdersRequest
- type WsInstrumentList
- type WsLoginResponse
- type WsNewOrderResponse
- type WsOrderAcceptedResponse
- type WsOrderData
- type WsOrderFilledCommissionData
- type WsOrderFilledResponse
- type WsOrderRejectedResponse
- type WsOrderbookData
- type WsOrderbookSnapshot
- type WsOrderbookUpdate
- type WsRequest
- type WsSubmitOrderParameters
- type WsSubmitOrderRequest
- type WsSubmitOrdersRequest
- type WsSubmitOrdersRequestData
- type WsSupportedCurrency
- type WsTicker
- type WsTradeData
- type WsTradeHistoryCommissionData
- type WsTradeHistoryRequest
- type WsTradeHistoryResponse
- type WsTradeHistoryTradeData
- type WsTradeSnapshot
- type WsTradeUpdate
- type WsUserBalanceResponse
- type WsUserOpenOrdersResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type COINUT ¶
COINUT is the overarching type across the coinut package
func (*COINUT) AuthenticateWebsocket ¶
AuthenticateWebsocket sends an authentication message to the websocket
func (*COINUT) CancelAllOrders ¶
CancelAllOrders cancels all orders associated with a currency pair
func (*COINUT) CancelExistingOrder ¶
CancelExistingOrder cancels a specific order and returns if it was actioned
func (*COINUT) CancelOrder ¶
CancelOrder cancels an order by its corresponding ID number
func (*COINUT) CancelOrders ¶
func (c *COINUT) CancelOrders(orders []CancelOrders) (CancelOrdersResponse, error)
CancelOrders cancels multiple orders
func (*COINUT) FetchAccountInfo ¶
FetchAccountInfo retrieves balances for all enabled currencies
func (*COINUT) FetchOrderbook ¶
FetchOrderbook returns orderbook base on the currency pair
func (*COINUT) FetchTicker ¶
FetchTicker returns the ticker for a currency pair
func (*COINUT) FetchTradablePairs ¶
FetchTradablePairs returns a list of the exchanges tradable pairs
func (*COINUT) GenerateDefaultSubscriptions ¶
func (c *COINUT) GenerateDefaultSubscriptions() ([]stream.ChannelSubscription, error)
GenerateDefaultSubscriptions Adds default subscriptions to websocket to be handled by ManageSubscriptions()
func (*COINUT) GetActiveOrders ¶
GetActiveOrders retrieves any orders that are active/open
func (*COINUT) GetDefaultConfig ¶
func (c *COINUT) GetDefaultConfig() (*config.ExchangeConfig, error)
GetDefaultConfig returns a default exchange config
func (*COINUT) GetDepositAddress ¶
GetDepositAddress returns a deposit address for a specified currency
func (*COINUT) GetDerivativeInstruments ¶
GetDerivativeInstruments returns a list of derivative instruments
func (*COINUT) GetExchangeHistory ¶
func (c *COINUT) GetExchangeHistory(p currency.Pair, assetType asset.Item, timestampStart, timestampEnd time.Time) ([]exchange.TradeHistory, error)
GetExchangeHistory returns historic trade data within the timeframe provided.
func (*COINUT) GetFee ¶
func (c *COINUT) GetFee(feeBuilder *exchange.FeeBuilder) (float64, error)
GetFee returns an estimate of fee based on type of transaction
func (*COINUT) GetFeeByType ¶
func (c *COINUT) GetFeeByType(feeBuilder *exchange.FeeBuilder) (float64, error)
GetFeeByType returns an estimate of fee based on type of transaction
func (*COINUT) GetFundingHistory ¶
func (c *COINUT) GetFundingHistory() ([]exchange.FundHistory, error)
GetFundingHistory returns funding history, deposits and withdrawals
func (*COINUT) GetHistoricCandles ¶
func (c *COINUT) 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 (*COINUT) GetHistoricCandlesExtended ¶
func (c *COINUT) 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 (*COINUT) GetIndexTicker ¶
func (c *COINUT) GetIndexTicker(asset string) (IndexTicker, error)
GetIndexTicker returns the index ticker for an asset
func (*COINUT) GetInstrumentOrderbook ¶
GetInstrumentOrderbook returns the orderbooks for a specific instrument
func (*COINUT) GetInstrumentTicker ¶
GetInstrumentTicker returns a ticker for a specific instrument
func (*COINUT) GetInstruments ¶
func (c *COINUT) GetInstruments() (Instruments, error)
GetInstruments returns instruments
func (*COINUT) GetOpenOrders ¶
func (c *COINUT) GetOpenOrders(instrumentID int64) (GetOpenOrdersResponse, error)
GetOpenOrders returns a list of open order and relevant information
func (*COINUT) GetOpenPositions ¶
func (c *COINUT) GetOpenPositions(instrumentID int) ([]OpenPosition, error)
GetOpenPositions returns all your current opened positions
func (*COINUT) GetOptionChain ¶
func (c *COINUT) GetOptionChain(asset, secType string) (OptionChainResponse, error)
GetOptionChain returns option chain
func (*COINUT) GetOrderHistory ¶
GetOrderHistory retrieves account order information Can Limit response to specific order status
func (*COINUT) GetOrderInfo ¶
GetOrderInfo returns information on a current open order
func (*COINUT) GetPositionHistory ¶
func (c *COINUT) GetPositionHistory(secType string, start, limit int) (PositionHistory, error)
GetPositionHistory returns position history
func (*COINUT) GetTradeHistory ¶
func (c *COINUT) GetTradeHistory(instrumentID, start, limit int64) (TradeHistory, error)
GetTradeHistory returns trade history for a specific instrument.
func (*COINUT) GetUserBalance ¶
func (c *COINUT) GetUserBalance() (*UserBalance, error)
GetUserBalance returns the full user balance
func (*COINUT) ModifyOrder ¶
ModifyOrder will allow of changing orderbook placement and limit to market conversion
func (*COINUT) NewOrder ¶
func (c *COINUT) NewOrder(instrumentID int64, quantity, price float64, buy bool, orderID uint32) (interface{}, error)
NewOrder places a new order on the exchange
func (*COINUT) NewOrders ¶
func (c *COINUT) NewOrders(orders []Order) ([]OrdersBase, error)
NewOrders places multiple orders on the exchange
func (*COINUT) SeedInstruments ¶
SeedInstruments seeds the instrument map
func (*COINUT) SendHTTPRequest ¶
func (c *COINUT) SendHTTPRequest(apiRequest string, params map[string]interface{}, authenticated bool, result interface{}) (err error)
SendHTTPRequest sends either an authenticated or unauthenticated HTTP request
func (*COINUT) Setup ¶
func (c *COINUT) Setup(exch *config.ExchangeConfig) error
Setup sets the current exchange configuration
func (*COINUT) SubmitOrder ¶
SubmitOrder submits a new order
func (*COINUT) Subscribe ¶
func (c *COINUT) Subscribe(channelsToSubscribe []stream.ChannelSubscription) error
Subscribe sends a websocket message to receive data from the channel
func (*COINUT) Unsubscribe ¶
func (c *COINUT) Unsubscribe(channelToUnsubscribe []stream.ChannelSubscription) error
Unsubscribe sends a websocket message to stop receiving data from the channel
func (*COINUT) UpdateAccountInfo ¶
UpdateAccountInfo retrieves balances for all enabled currencies for the COINUT exchange
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) UpdateTradablePairs ¶
UpdateTradablePairs updates the exchanges available pairs and stores them in the exchanges config
func (*COINUT) ValidateCredentials ¶
ValidateCredentials validates current credentials used for wrapper functionality
func (*COINUT) WithdrawCryptocurrencyFunds ¶
func (c *COINUT) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.Request) (*withdraw.ExchangeResponse, error)
WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is submitted
func (*COINUT) WithdrawFiatFunds ¶
func (c *COINUT) WithdrawFiatFunds(withdrawRequest *withdraw.Request) (*withdraw.ExchangeResponse, error)
WithdrawFiatFunds returns a withdrawal ID when a withdrawal is submitted
func (*COINUT) WithdrawFiatFundsToInternationalBank ¶
func (c *COINUT) WithdrawFiatFundsToInternationalBank(withdrawRequest *withdraw.Request) (*withdraw.ExchangeResponse, error)
WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a withdrawal is submitted
func (*COINUT) WsGetInstruments ¶
func (c *COINUT) WsGetInstruments() (Instruments, error)
WsGetInstruments fetches instrument list and propagates a local cache
func (*COINUT) WsProcessOrderbookSnapshot ¶
func (c *COINUT) WsProcessOrderbookSnapshot(ob *WsOrderbookSnapshot) error
WsProcessOrderbookSnapshot processes the orderbook snapshot
func (*COINUT) WsProcessOrderbookUpdate ¶
func (c *COINUT) WsProcessOrderbookUpdate(update *WsOrderbookUpdate) error
WsProcessOrderbookUpdate process an orderbook update
type CancelOrders ¶
CancelOrders holds information about a cancelled order
type CancelOrdersResponse ¶
type CancelOrdersResponse struct { GenericResponse Results []struct { OrderID int64 `json:"order_id"` Status string `json:"status"` InstrumentID int64 `json:"inst_id"` } `json:"results"` }
CancelOrdersResponse is response for a cancelled order
type Commission ¶
type Commission struct { Currency currency.Pair `json:"currency"` Amount float64 `json:"amount,string"` }
Commission holds trade commission structure
type GenericResponse ¶
type GenericResponse struct { Nonce int64 `json:"nonce"` Reply string `json:"reply"` Status []string `json:"status"` TransactionID int64 `json:"trans_id"` }
GenericResponse is the generic response you will get from coinut
type GetOpenOrdersResponse ¶
type GetOpenOrdersResponse struct { Nonce int `json:"nonce"` Orders []OrderResponse `json:"orders"` Reply string `json:"reply"` Status []string `json:"status"` TransactionID int `json:"trans_id"` }
GetOpenOrdersResponse holds all order data from GetOpenOrders request
type IndexTicker ¶
IndexTicker holds indexed ticker inforamtion
type InstrumentBase ¶
type InstrumentBase struct { Base string `json:"base"` DecimalPlaces int `json:"decimal_places"` InstrumentID int64 `json:"inst_id"` Quote string `json:"quote"` }
InstrumentBase holds information on base currency
type Instruments ¶
type Instruments struct {
Instruments map[string][]InstrumentBase `json:"SPOT"`
}
Instruments holds the full information on base currencies
type OpenPosition ¶
type OpenPosition struct { PositionID int `json:"position_id"` Commission Commission `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"` }
OpenPosition holds information on an open position
type Option ¶
type Option 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"` }
Option holds options information
type OptionChainResponse ¶
type OptionChainResponse struct { ExpiryTime int64 `json:"expiry_time"` SecurityType string `json:"sec_type"` Asset string `json:"asset"` Entries []struct { Call Option `json:"call"` Put Option `json:"put"` Strike float64 `json:"strike,string"` } }
OptionChainResponse is the response type for options
type OptionChainUpdate ¶
type OptionChainUpdate struct { Option GenericResponse Asset string `json:"asset"` ExpiryTime int64 `json:"expiry_time"` SecurityType string `json:"sec_type"` Volume float64 `json:"volume,string"` }
OptionChainUpdate contains information on the chain update options
type Order ¶
type Order struct { InstrumentID int64 `json:"inst_id"` Price float64 `json:"price,string"` Quantity float64 `json:"qty,string"` ClientOrderID int `json:"client_ord_id"` Side string `json:"side,string"` }
Order holds order information
type OrderFilledResponse ¶
type OrderFilledResponse struct { GenericResponse Commission Commission `json:"commission"` FillPrice float64 `json:"fill_price,string"` FillQuantity float64 `json:"fill_qty,string"` Order OrderResponse `json:"order"` }
OrderFilledResponse contains order filled response
type OrderRejectResponse ¶
type OrderRejectResponse struct { OrderResponse Reasons []string `json:"reasons"` }
OrderRejectResponse holds information on a rejected order
type OrderResponse ¶
type OrderResponse 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"` }
OrderResponse is a response for orders
type Orderbook ¶
type Orderbook struct { Buy []OrderbookBase `json:"buy"` Sell []OrderbookBase `json:"sell"` InstrumentID int `json:"inst_id"` TotalBuy float64 `json:"total_buy,string"` TotalSell float64 `json:"total_sell,string"` TransactionID int64 `json:"trans_id"` }
Orderbook is the full order book
type OrderbookBase ¶
type OrderbookBase struct { Count int `json:"count"` Price float64 `json:"price,string"` Quantity float64 `json:"qty,string"` }
OrderbookBase is a sub-type holding price and quantity
type OrdersBase ¶
type OrdersBase struct { GenericResponse OrderResponse }
OrdersBase contains generic response and order responses
type OrdersResponse ¶
type OrdersResponse struct {
Data []OrdersBase
}
OrdersResponse holds the full data range on orders
type PositionHistory ¶
type PositionHistory struct { Positions []struct { PositionID int `json:"position_id"` Records []struct { Commission Commission `json:"commission"` FillPrice float64 `json:"fill_price,string,omitempty"` TransactionID int `json:"trans_id"` FillQuantity float64 `json:"fill_qty,omitempty"` Position struct { Commission Commission `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"` }
PositionHistory holds the complete position history
type Ticker ¶
type Ticker struct { High24 float64 `json:"high24,string"` HighestBuy float64 `json:"highest_buy,string"` InstrumentID int `json:"inst_id"` Last float64 `json:"last,string"` Low24 float64 `json:"low24,string"` LowestSell float64 `json:"lowest_sell,string"` PreviousTransactionID int64 `json:"prev_trans_id"` PriceChange24 float64 `json:"price_change_24,string"` Reply string `json:"reply"` OpenInterest float64 `json:"open_interest,string"` Timestamp int64 `json:"timestamp"` TransactionID int64 `json:"trans_id"` Volume float64 `json:"volume,string"` Volume24 float64 `json:"volume24,string"` Volume24Quote float64 `json:"volume24_quote,string"` VolumeQuote float64 `json:"volume_quote,string"` }
Ticker holds ticker information
type TradeBase ¶
type TradeBase struct { Price float64 `json:"price,string"` Quantity float64 `json:"quantity,string"` Side string `json:"side"` Timestamp float64 `json:"timestamp"` TransactionID int64 `json:"trans_id"` }
TradeBase is a sub-type holding information on trades
type TradeHistory ¶
type TradeHistory struct { TotalNumber int64 `json:"total_number"` Trades []OrderFilledResponse `json:"trades"` }
TradeHistory holds trade history information
type Trades ¶
type Trades struct {
Trades []TradeBase `json:"trades"`
}
Trades holds the full amount of trades associated with API keys
type UserBalance ¶
type UserBalance struct { BCH float64 `json:"BCH,string"` BTC float64 `json:"BTC,string"` BTG float64 `json:"BTG,string"` CAD float64 `json:"CAD,string"` ETC float64 `json:"ETC,string"` ETH float64 `json:"ETH,string"` LCH float64 `json:"LCH,string"` LTC float64 `json:"LTC,string"` MYR float64 `json:"MYR,string"` SGD float64 `json:"SGD,string"` USD float64 `json:"USD,string"` USDT float64 `json:"USDT,string"` XMR float64 `json:"XMR,string"` ZEC float64 `json:"ZEC,string"` Nonce int64 `json:"nonce"` Reply string `json:"reply"` Status []string `json:"status"` TransID int64 `json:"trans_id"` }
UserBalance holds user balances on the exchange
type WsCancelOrderParameters ¶
WsCancelOrderParameters ws request parameters
type WsCancelOrderRequest ¶
type WsCancelOrderRequest struct { InstrumentID int64 `json:"inst_id"` OrderID int64 `json:"order_id"` WsRequest }
WsCancelOrderRequest data required for cancelling an order
type WsCancelOrderResponse ¶
type WsCancelOrderResponse struct { Nonce int64 `json:"nonce"` Reply string `json:"reply"` OrderID int64 `json:"order_id"` ClientOrderID int64 `json:"client_ord_id"` Status []string `json:"status"` }
WsCancelOrderResponse contains cancelled order data
type WsCancelOrdersRequest ¶
type WsCancelOrdersRequest struct { Entries []WsCancelOrdersRequestEntry `json:"entries"` WsRequest }
WsCancelOrdersRequest ws request
type WsCancelOrdersRequestEntry ¶
type WsCancelOrdersRequestEntry struct { InstID int64 `json:"inst_id"` OrderID int64 `json:"order_id"` }
WsCancelOrdersRequestEntry ws request entry
type WsCancelOrdersResponse ¶
type WsCancelOrdersResponse struct { Nonce int64 `json:"nonce"` Reply string `json:"reply"` Results []WsCancelOrdersResponseData `json:"results"` Status []string `json:"status"` TransactionID int64 `json:"trans_id"` }
WsCancelOrdersResponse contains all cancelled order data
type WsCancelOrdersResponseData ¶
type WsCancelOrdersResponseData struct { InstrumentID int64 `json:"inst_id"` OrderID int64 `json:"order_id"` Status string `json:"status"` }
WsCancelOrdersResponseData individual cancellation response data
type WsGetAccountBalanceResponse ¶
type WsGetAccountBalanceResponse struct { BCH float64 `json:"BCH,string"` BTC float64 `json:"BTC,string"` BTG float64 `json:"BTG,string"` CAD float64 `json:"CAD,string"` ETC float64 `json:"ETC,string"` ETH float64 `json:"ETH,string"` LCH float64 `json:"LCH,string"` LTC float64 `json:"LTC,string"` MYR float64 `json:"MYR,string"` SGD float64 `json:"SGD,string"` USD float64 `json:"USD,string"` USDT float64 `json:"USDT,string"` XMR float64 `json:"XMR,string"` ZEC float64 `json:"ZEC,string"` Nonce int64 `json:"nonce"` Reply string `json:"reply"` Status []string `json:"status"` TransID int64 `json:"trans_id"` }
WsGetAccountBalanceResponse contains values of each currency
type WsGetOpenOrdersRequest ¶
WsGetOpenOrdersRequest ws request
type WsInstrumentList ¶
type WsInstrumentList struct { Spot map[string][]InstrumentBase `json:"SPOT"` Nonce int64 `json:"nonce,omitempty"` Reply string `json:"inst_list,omitempty"` Status []interface{} `json:"status,omitempty"` }
WsInstrumentList defines instrument list
type WsLoginResponse ¶
type WsLoginResponse struct { APIKey string `json:"api_key"` Country string `json:"country"` DepositEnabled bool `json:"deposit_enabled"` Deposited bool `json:"deposited"` Email string `json:"email"` FailedTimes int64 `json:"failed_times"` KycPassed bool `json:"kyc_passed"` Language string `json:"lang"` Nonce int64 `json:"nonce"` OTPEnabled bool `json:"otp_enabled"` PhoneNumber string `json:"phone_number"` ProductsEnabled []string `json:"products_enabled"` Referred bool `json:"referred"` Reply string `json:"reply"` SessionID string `json:"session_id"` Status []string `json:"status"` Timezone string `json:"timezone"` Traded bool `json:"traded"` UnverifiedEmail string `json:"unverified_email"` Username string `json:"username"` WithdrawEnabled bool `json:"withdraw_enabled"` }
WsLoginResponse ws response data
type WsNewOrderResponse ¶
type WsNewOrderResponse struct { Message string `json:"msg"` Nonce int64 `json:"nonce"` Reply string `json:"reply"` Status []string `json:"status"` }
WsNewOrderResponse returns if new_order response failes
type WsOrderAcceptedResponse ¶
type WsOrderAcceptedResponse struct { Nonce int64 `json:"nonce"` Status []string `json:"status"` OrderID int64 `json:"order_id"` OpenQuantity float64 `json:"open_qty,string"` InstrumentID int64 `json:"inst_id"` Quantity float64 `json:"qty,string"` ClientOrderID int64 `json:"client_ord_id"` OrderPrice float64 `json:"order_price,string"` Reply string `json:"reply"` Side string `json:"side"` TransactionID int64 `json:"trans_id"` }
WsOrderAcceptedResponse ws response
type WsOrderData ¶
type WsOrderData struct { ClientOrderID int64 `json:"client_ord_id"` InstrumentID int64 `json:"inst_id"` OpenQuantity float64 `json:"open_qty,string"` OrderID int64 `json:"order_id"` Price float64 `json:"price,string"` Quantity float64 `json:"qty,string"` Side string `json:"side"` Timestamp int64 `json:"timestamp"` Status []string `json:"status"` }
WsOrderData ws response data
type WsOrderFilledCommissionData ¶
type WsOrderFilledCommissionData struct { Amount float64 `json:"amount,string"` Currency currency.Pair `json:"currency"` }
WsOrderFilledCommissionData ws response data
type WsOrderFilledResponse ¶
type WsOrderFilledResponse struct { Commission WsOrderFilledCommissionData `json:"commission"` FillPrice float64 `json:"fill_price,string"` FillQuantity float64 `json:"fill_qty,string"` Nonce int64 `json:"nonce"` Order WsOrderData `json:"order"` Reply string `json:"reply"` Status []string `json:"status"` Timestamp int64 `json:"timestamp"` TransactionID int64 `json:"trans_id"` }
WsOrderFilledResponse ws response
type WsOrderRejectedResponse ¶
type WsOrderRejectedResponse struct { Nonce int64 `json:"nonce"` Status []string `json:"status"` OrderID int64 `json:"order_id"` OpenQuantity float64 `json:"open_qty,string"` Price float64 `json:"price,string"` InstrumentID int64 `json:"inst_id"` Reasons []string `json:"reasons"` ClientOrderID int64 `json:"client_ord_id"` Timestamp int64 `json:"timestamp"` Reply string `json:"reply"` Quantity float64 `json:"qty,string"` Side string `json:"side"` TransactionID int64 `json:"trans_id"` }
WsOrderRejectedResponse ws response
type WsOrderbookData ¶
type WsOrderbookData struct { Count int64 `json:"count"` Price float64 `json:"price,string"` Volume float64 `json:"qty,string"` }
WsOrderbookData defines singular orderbook data
type WsOrderbookSnapshot ¶
type WsOrderbookSnapshot struct { Buy []WsOrderbookData `json:"buy"` Sell []WsOrderbookData `json:"sell"` InstID int64 `json:"inst_id"` Nonce int64 `json:"nonce"` TotalBuy float64 `json:"total_buy,string"` TotalSell float64 `json:"total_sell,string"` Reply string `json:"reply"` Status []interface{} `json:"status"` }
WsOrderbookSnapshot defines the resp for orderbook snapshot updates from the websocket connection
type WsOrderbookUpdate ¶
type WsOrderbookUpdate struct { Count int64 `json:"count"` InstID int64 `json:"inst_id"` Price float64 `json:"price,string"` Volume float64 `json:"qty,string"` TotalBuy float64 `json:"total_buy,string"` Reply string `json:"reply"` Side string `json:"side"` TransID int64 `json:"trans_id"` }
WsOrderbookUpdate defines orderbook update response from the websocket connection
type WsSubmitOrderParameters ¶
type WsSubmitOrderParameters struct { Currency currency.Pair Side order.Side Amount, Price float64 OrderID int64 }
WsSubmitOrderParameters ws request parameters
type WsSubmitOrderRequest ¶
type WsSubmitOrderRequest struct { InstrumentID int64 `json:"inst_id"` Price float64 `json:"price,string"` Quantity float64 `json:"qty,string"` OrderID int64 `json:"client_ord_id"` Side string `json:"side"` WsRequest }
WsSubmitOrderRequest ws request
type WsSubmitOrdersRequest ¶
type WsSubmitOrdersRequest struct { Orders []WsSubmitOrdersRequestData `json:"orders"` WsRequest }
WsSubmitOrdersRequest ws request
type WsSubmitOrdersRequestData ¶
type WsSubmitOrdersRequestData struct { InstrumentID int64 `json:"inst_id"` Price float64 `json:"price,string"` Quantity float64 `json:"qty,string"` ClientOrderID int `json:"client_ord_id"` Side string `json:"side"` }
WsSubmitOrdersRequestData ws request data
type WsSupportedCurrency ¶
type WsSupportedCurrency struct { Base string `json:"base"` InstID int64 `json:"inst_id"` DecimalPlaces int64 `json:"decimal_places"` Quote string `json:"quote"` }
WsSupportedCurrency defines supported currency on the exchange
type WsTicker ¶
type WsTicker struct { High24 float64 `json:"high24,string"` HighestBuy float64 `json:"highest_buy,string"` InstID int64 `json:"inst_id"` Last float64 `json:"last,string"` Low24 float64 `json:"low24,string"` LowestSell float64 `json:"lowest_sell,string"` Nonce int64 `json:"nonce"` PrevTransID int64 `json:"prev_trans_id"` PriceChange24 float64 `json:"price_change_24,string"` Reply string `json:"reply"` Status []string `json:"status"` Timestamp int64 `json:"timestamp"` TransID int64 `json:"trans_id"` Volume float64 `json:"volume,string"` Volume24 float64 `json:"volume24,string"` Volume24Quote float64 `json:"volume24_quote,string"` VolumeQuote float64 `json:"volume_quote,string"` }
WsTicker defines the resp for ticker updates from the websocket connection
type WsTradeData ¶
type WsTradeData struct { Price float64 `json:"price,string"` Volume float64 `json:"qty,string"` Side string `json:"side"` Timestamp int64 `json:"timestamp"` TransID int64 `json:"trans_id"` }
WsTradeData defines market trade data
type WsTradeHistoryCommissionData ¶
type WsTradeHistoryCommissionData struct { Amount float64 `json:"amount,string"` Currency currency.Pair `json:"currency"` }
WsTradeHistoryCommissionData ws response data
type WsTradeHistoryRequest ¶
type WsTradeHistoryRequest struct { InstID int64 `json:"inst_id"` Start int64 `json:"start,omitempty"` Limit int64 `json:"limit,omitempty"` WsRequest }
WsTradeHistoryRequest ws request
type WsTradeHistoryResponse ¶
type WsTradeHistoryResponse struct { Nonce int64 `json:"nonce"` Reply string `json:"reply"` Status []string `json:"status"` TotalNumber int64 `json:"total_number"` Trades []WsOrderData `json:"trades"` }
WsTradeHistoryResponse ws response
type WsTradeHistoryTradeData ¶
type WsTradeHistoryTradeData struct { Commission WsTradeHistoryCommissionData `json:"commission"` Order WsOrderData `json:"order"` FillPrice float64 `json:"fill_price,string"` FillQuantity float64 `json:"fill_qty,string"` Timestamp int64 `json:"timestamp"` TransactionID int64 `json:"trans_id"` }
WsTradeHistoryTradeData ws response data
type WsTradeSnapshot ¶
type WsTradeSnapshot struct { Nonce int64 `json:"nonce"` Reply string `json:"reply"` Status []interface{} `json:"status"` Trades []WsTradeData `json:"trades"` }
WsTradeSnapshot defines Market trade response from the websocket connection
type WsTradeUpdate ¶
type WsTradeUpdate struct { InstID int64 `json:"inst_id"` Price float64 `json:"price,string"` Reply string `json:"reply"` Side string `json:"side"` Timestamp int64 `json:"timestamp"` TransID int64 `json:"trans_id"` }
WsTradeUpdate defines trade update response from the websocket connection
type WsUserBalanceResponse ¶
type WsUserBalanceResponse struct { Nonce int64 `json:"nonce"` Status []string `json:"status"` Btc float64 `json:"BTC,string"` Ltc float64 `json:"LTC,string"` Etc float64 `json:"ETC,string"` Eth float64 `json:"ETH,string"` FloatingProfitLoss float64 `json:"floating_pl,string"` InitialMargin float64 `json:"initial_margin,string"` RealisedProfitLoss float64 `json:"realized_pl,string"` MaintenanceMargin float64 `json:"maintenance_margin,string"` Equity float64 `json:"equity,string"` Reply string `json:"reply"` TransactionID int64 `json:"trans_id"` }
WsUserBalanceResponse ws response
type WsUserOpenOrdersResponse ¶
type WsUserOpenOrdersResponse struct { Nonce int64 `json:"nonce"` Reply string `json:"reply"` Status []string `json:"status"` Orders []WsOrderData `json:"orders"` }
WsUserOpenOrdersResponse ws response