Skip to content

Commit

Permalink
feat: added getter for parameters of request (for testing needs) (#636)
Browse files Browse the repository at this point in the history
* feat: added getter for parameters of request (for testing needs)

* fix: keep alive needed flag in conn state

---------

Co-authored-by: Artur Abelian <[email protected]>
  • Loading branch information
vigodsky and Artur Abelian authored Nov 27, 2024
1 parent 0d0d7ba commit 4fd0ba3
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions v2/common/websocket/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@ func NewConnection(
lastResponseMu: sync.Mutex{},
initUnderlyingWsConnFn: initUnderlyingWsConnFn,
keepaliveTimeout: keepaliveTimeout,
isKeepAliveNeeded: isKeepAliveNeeded,
}

if isKeepAliveNeeded {
Expand Down
4 changes: 4 additions & 0 deletions v2/futures/order_cancel_service_ws.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ func (s *OrderCancelRequest) OrigClientOrderID(origClientOrderID string) *OrderC
return s
}

func (r *OrderCancelRequest) GetParams() map[string]interface{} {
return r.buildParams()
}

// buildParams builds params
func (s *OrderCancelRequest) buildParams() params {
m := params{
Expand Down
4 changes: 4 additions & 0 deletions v2/futures/order_place_service_ws.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,10 @@ type CreateOrderWsResponse struct {
Error *common.APIError `json:"error,omitempty"`
}

func (r *OrderPlaceWsRequest) GetParams() map[string]interface{} {
return r.buildParams()
}

// buildParams builds params
func (s *OrderPlaceWsRequest) buildParams() params {
m := params{
Expand Down
4 changes: 4 additions & 0 deletions v2/order_service_ws_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ func NewOrderCreateWsRequest() *OrderCreateWsRequest {
return &OrderCreateWsRequest{}
}

func (s *OrderCreateWsRequest) GetParams() map[string]interface{} {
return s.buildParams()
}

// buildParams builds params
func (s *OrderCreateWsRequest) buildParams() params {
m := params{
Expand Down

0 comments on commit 4fd0ba3

Please sign in to comment.