diff --git a/CHANGELOG.md b/CHANGELOG.md index 1942c5a..5fc00d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ Changelog ========= All notable changes to this project will be documented in this file. +v1.0.33-alpha +------------- + +### Changed + +- Added WS trade requests + v1.0.32-alpha ------------- diff --git a/README.md b/README.md index 130cba4..9818a27 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ Installation ----------------- ```bash -go get github.com/amir-the-h/okex@v1.0.31-alpha +go get github.com/amir-the-h/okex@v1.0.33-alpha ``` Usage diff --git a/api/ws/trade.go b/api/ws/trade.go index 71c8a6e..9d8dff7 100644 --- a/api/ws/trade.go +++ b/api/ws/trade.go @@ -2,7 +2,7 @@ package ws import ( "github.com/amir-the-h/okex" - requests "github.com/amir-the-h/okex/requests/rest/trade" + requests "github.com/amir-the-h/okex/requests/ws/trade" ) // Trade diff --git a/requests/ws/trade/trade_requests.go b/requests/ws/trade/trade_requests.go new file mode 100644 index 0000000..c76714e --- /dev/null +++ b/requests/ws/trade/trade_requests.go @@ -0,0 +1,37 @@ +package trade + +import "github.com/amir-the-h/okex" + +type ( + PlaceOrder struct { + ID string `json:"-"` + InstID string `json:"instId"` + Ccy string `json:"ccy,omitempty"` + ClOrdID string `json:"clOrdId,omitempty"` + Tag string `json:"tag,omitempty"` + ReduceOnly bool `json:"reduceOnly,omitempty"` + Sz float64 `json:"sz,string"` + Px float64 `json:"px,omitempty,string"` + TdMode okex.TradeMode `json:"tdMode"` + Side okex.OrderSide `json:"side"` + PosSide okex.PositionSide `json:"posSide,omitempty"` + OrdType okex.OrderType `json:"ordType"` + TgtCcy okex.QuantityType `json:"tgtCcy,omitempty"` + } + CancelOrder struct { + ID string `json:"-"` + InstID string `json:"instId"` + OrdID string `json:"ordId,omitempty"` + ClOrdID string `json:"clOrdId,omitempty"` + } + AmendOrder struct { + ID string `json:"-"` + InstID string `json:"instId"` + OrdID string `json:"ordId,omitempty"` + ClOrdID string `json:"clOrdId,omitempty"` + ReqID string `json:"reqId,omitempty"` + NewSz int64 `json:"newSz,omitempty,string"` + NewPx float64 `json:"newPx,omitempty,string"` + CxlOnFail bool `json:"cxlOnFail,omitempty"` + } +)