Documentation ¶
Index ¶
- type BalanceHistoryParams
- type BalanceHistoryResponse
- type BalanceResponse
- type CancelAllChildOrdersRequest
- type CancelChildOrderRequest
- type ChatParams
- type ChatResponse
- type ChildOrderParams
- type ChildOrderResponse
- type CollateralResponse
- type ExecutionParams
- type ExecutionResponse
- type JSONRPC2
- type PositionParams
- type PositionResponse
- type SendChildChildOrderResponse
- type SendChildOrderRequest
- type SubscribeParams
- type TickerParams
- type TickerResponse
- type TradingCommissionParams
- type TradingCommissionResponse
- type Writer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BalanceHistoryParams ¶
type BalanceHistoryParams struct { CurrencyCode types.CurrencyCode Count int Before int After int }
BalanceHistoryParams is params for balancehistory.
func (*BalanceHistoryParams) MakeBalanceHistoryParams ¶
func (bhp *BalanceHistoryParams) MakeBalanceHistoryParams() map[string]string
MakeBalanceHistoryParams makes a balancehistoryparams.
type BalanceHistoryResponse ¶
type BalanceHistoryResponse struct { ID int `json:"id"` TradeDate string `json:"trade_date"` EventDate string `json:"event_date"` ProductCode string `json:"product_code"` CurrencyCode string `json:"currency_code"` TradeType string `json:"trade_type"` Price float64 `json:"price"` Amount float64 `json:"amount"` Quantity float64 `json:"quantity"` Commission float64 `json:"commission"` Balance float64 `json:"balance"` OrderID string `json:"order_id"` }
BalanceHistoryResponse is a response for a balancehistory.
type BalanceResponse ¶
type BalanceResponse struct { CurrencyCode string `json:"currency_code"` Amount float64 `json:"amount"` Available float64 `json:"available"` }
BalanceResponse is a response for a balance.
type CancelAllChildOrdersRequest ¶
type CancelAllChildOrdersRequest struct {
ProductCode string `json:"product_code"`
}
CancelAllChildOrdersRequest is a request for cancelallchildorders.
type CancelChildOrderRequest ¶
type CancelChildOrderRequest struct { ProductCode string `json:"product_code"` ChildOrderID string `json:"child_order_id"` }
CancelChildOrderRequest is a request for cancelchildorder
type ChatParams ¶
ChatParams is params for chat.
func (*ChatParams) MakeChatParams ¶
func (cp *ChatParams) MakeChatParams() map[string]string
MakeChatParams makes a chatparams.
type ChatResponse ¶
type ChatResponse struct { Nickname string `json:"nickname"` Message string `json:"message"` Date string `json:"date"` }
ChatResponse is a response for a chat.
type ChildOrderParams ¶
type ChildOrderParams struct { ProductCode types.ProductCode Count int Before int After int ChildOrderState types.ChildOrderState ChildOrderID string ChildOrderAcceptanceID string ParentOrderID string }
ChildOrderParams is params for child order.
func (*ChildOrderParams) MakeChildOrderParams ¶
func (op *ChildOrderParams) MakeChildOrderParams() map[string]string
MakeChildOrderParams makes a childorderparams.
type ChildOrderResponse ¶
type ChildOrderResponse struct { ID int `json:"id"` ChildOrderID string `json:"child_order_id"` ProductCode string `json:"product_code"` Side string `json:"side"` ChildOrderType string `json:"child_order_type"` Price float64 `json:"price"` AveragePrice float64 `json:"average_price"` Size float64 `json:"size"` ChildOrderState string `json:"child_order_state"` ExpireDate string `json:"expire_date"` ChildOrderDate string `json:"child_order_date"` ChildOrderAcceptanceID string `json:"child_order_acceptance_id"` OutstandingSize float64 `json:"outstanding_size"` CancelSize float64 `json:"cancel_size"` ExecutedSize float64 `json:"executed_size"` TotalCommission float64 `json:"total_commission"` }
ChildOrderResponse is a response for a child order.
type CollateralResponse ¶
type CollateralResponse struct { Collateral float64 `json:"collateral"` OpenPositionPnl float64 `json:"open_position_pnl"` RequireCollateral float64 `json:"require_collateral"` KeepRate float64 `json:"keep_rate"` }
CollateralResponse is a response for collateral.
type ExecutionParams ¶
type ExecutionParams struct { ProductCode types.ProductCode Count int Before int After int ChildOrderID string ChildOrderAcceptanceID string }
ExecutionParams is params for executions.
func (*ExecutionParams) MakeExecutionParams ¶
func (ep *ExecutionParams) MakeExecutionParams() map[string]string
MakeExecutionParams makes an executionsparams.
type ExecutionResponse ¶
type ExecutionResponse struct { ID int `json:"id"` ChildOrderID string `json:"child_order_id"` Side string `json:"side"` Price float64 `json:"price"` Size float64 `json:"size"` Commission float64 `json:"commission"` ExecDate string `json:"exec_date"` ChildOrderAcceptanceID string `json:"child_order_acceptance_id"` }
ExecutionResponse is a response for an execution.
type JSONRPC2 ¶
type JSONRPC2 struct { Version string `json:"jsonrpc"` Method string `json:"method"` Params interface{} `json:"params"` Result interface{} `json:"result,omitempty"` ID *int `json:"id,omitempty"` }
JSONRPC2 is a jsonrpc2
type PositionParams ¶
type PositionParams struct {
ProductCode types.ProductCode
}
PositionParams is params for positions.
func (*PositionParams) MakePositionParams ¶
func (pp *PositionParams) MakePositionParams() map[string]string
MakePositionParams makes an positionsparams.
type PositionResponse ¶
type PositionResponse struct { ProductCode string `json:"product_code"` Side string `json:"side"` Price float64 `json:"price"` Size float64 `json:"size"` Commission float64 `json:"commission"` SwapPointAccumulate float64 `json:"swap_point_accumulate"` RequireCollateral float64 `json:"require_collateral"` OpenDate string `json:"open_date"` Leverage float64 `json:"leverage"` Pnl float64 `json:"pnl"` Sfd float64 `json:"sfd"` }
PositionResponse is a response for an position.
type SendChildChildOrderResponse ¶
type SendChildChildOrderResponse struct {
ChildOrderAcceptanceID string `json:"child_order_acceptance_id"`
}
SendChildChildOrderResponse is a response forr sendchildorder.
type SendChildOrderRequest ¶
type SendChildOrderRequest struct { ProductCode string `json:"product_code"` ChildOrderType string `json:"child_order_type"` Side string `json:"side"` Price float64 `json:"price"` Size float64 `json:"size"` MinuteToExpires int `json:"minute_to_expire"` TimeInForce string `json:"time_in_force"` }
SendChildOrderRequest is a request for sendchildorder.
type SubscribeParams ¶
type SubscribeParams struct {
Channel string `json:"channel"`
}
SubscribeParams is a subscribeparams.
type TickerParams ¶
type TickerParams struct {
ProductCode types.ProductCode
}
TickerParams is params for ticker.
func (*TickerParams) MakeTickerParams ¶
func (tp *TickerParams) MakeTickerParams() map[string]string
MakeTickerParams makes a tickerparams.
type TickerResponse ¶
type TickerResponse struct { ProductCode string `json:"product_code"` Timestamp string `json:"timestamp"` TickID int `json:"tick_id"` BestBid float64 `json:"best_bid"` BestAsk float64 `json:"best_ask"` BestBidSize float64 `json:"best_bid_size"` BestAskSize float64 `json:"best_ask_size"` TotalBidDepth float64 `json:"total_bid_depth"` TotalAskDepth float64 `json:"total_ask_depth"` MarketBidSize float64 `json:"market_bid_size"` MarketAskSize float64 `json:"market_ask_size"` Ltp float64 `json:"ltp"` Volume float64 `json:"volume"` VolumeByProduct float64 `json:"volume_by_product"` }
TickerResponse is a response for ticker.
func (*TickerResponse) GetMidPrice ¶
func (t *TickerResponse) GetMidPrice() float64
GetMidPrice gets mid price.
type TradingCommissionParams ¶
type TradingCommissionParams struct {
ProductCode types.ProductCode
}
TradingCommissionParams is params for ticker.
func (*TradingCommissionParams) MakeTradingCommissionParams ¶
func (tp *TradingCommissionParams) MakeTradingCommissionParams() map[string]string
MakeTradingCommissionParams makes a tradingcommissionparams.
type TradingCommissionResponse ¶
type TradingCommissionResponse struct {
CommissionRate float64 `json:"commission_rate"`
}
TradingCommissionResponse is a response for tradingcommission.
type Writer ¶
type Writer struct { Channel types.Channel Method types.ServerMethod ChannelTicker chan TickerResponse }
Writer is a writer for websocket.