Skip to content

Commit

Permalink
Release: v1.0.12-alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
amir-the-h committed Sep 29, 2021
1 parent 6ab32ef commit 33061f3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@ Changelog
=========
All notable changes to this project will be documented in this file.

v1.0.12-alpha
------------

### Changed

- Fixed invalid channel name on `private.Order`

v1.0.11-alpha
------------

Expand Down
8 changes: 4 additions & 4 deletions api/ws/private.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ func (c *Private) UBalanceAndPosition(rCh ...bool) error {
// Order
// Retrieve position information. Initial snapshot will be pushed according to subscription granularity. Data will be pushed when triggered by events such as placing/canceling order, and will also be pushed in regular interval according to subscription granularity.
//
// https://www.okex.com/docs-v5/en/#websocket-api-private-channel-positions-channel
// https://www.okex.com/docs-v5/en/#websocket-api-private-channel-order-channel
func (c *Private) Order(req requests.Order, ch ...chan *private.Order) error {
m := okex.S2M(req)
if len(ch) > 0 {
Expand All @@ -131,12 +131,12 @@ func (c *Private) Order(req requests.Order, ch ...chan *private.Order) error {
return err
}
c.waitForAuthorization()
return c.Subscribe(true, []okex.ChannelName{"positions"}, m)
return c.Subscribe(true, []okex.ChannelName{"orders"}, m)
}

// UOrder
//
// https://www.okex.com/docs-v5/en/#websocket-api-private-channel-positions-channel
// https://www.okex.com/docs-v5/en/#websocket-api-private-channel-order-channel
func (c *Private) UOrder(req requests.Order, rCh ...bool) error {
m := okex.S2M(req)
if len(rCh) > 0 && rCh[0] {
Expand All @@ -147,7 +147,7 @@ func (c *Private) UOrder(req requests.Order, rCh ...bool) error {
return err
}
c.waitForAuthorization()
return c.Unsubscribe(true, []okex.ChannelName{"positions"}, m)
return c.Unsubscribe(true, []okex.ChannelName{"orders"}, m)
}

func (c *Private) Process(data []byte, e *events.Basic) bool {
Expand Down

0 comments on commit 33061f3

Please sign in to comment.