Skip to content

Commit

Permalink
Merge branch 'bybit_multi_out' into bybit_multi_out_requests
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan O'Hara-Reid committed Dec 10, 2024
2 parents 471a324 + af9b89b commit c316397
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions exchanges/bybit/bybit_wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -348,18 +348,15 @@ func (by *Bybit) Setup(exch *config.Exchange) error {

// Private - Dedicated private connection for all inbound private data.
return by.Websocket.SetupNewConnection(&stream.ConnectionSetup{
URL: websocketPrivate,
ResponseCheckTimeout: exch.WebsocketResponseCheckTimeout,
ResponseMaxLimit: exch.WebsocketResponseMaxLimit,
RateLimit: request.NewWeightedRateLimitByDuration(time.Microsecond),
Connector: by.WsConnect,
GenerateSubscriptions: by.generateAuthSubscriptions,
Subscriber: by.authSubscribe,
Unsubscriber: by.authUnsubscribe,
// Private websocket data is handled by the same function as the public data. Intentionally set asset as asset.All.
// As all asset type order execution, wallet and other data is centralised through the private websocket connection.
// TODO: Handle private websocket data to be asset specific.
Handler: func(ctx context.Context, resp []byte) error { return by.wsHandleData(ctx, resp, asset.All) },
URL: websocketPrivate,
ResponseCheckTimeout: exch.WebsocketResponseCheckTimeout,
ResponseMaxLimit: exch.WebsocketResponseMaxLimit,
RateLimit: request.NewWeightedRateLimitByDuration(time.Microsecond),
Connector: by.WsConnect,
GenerateSubscriptions: by.generateAuthSubscriptions,
Subscriber: by.authSubscribe,
Unsubscriber: by.authUnsubscribe,
Handler: by.wsHandleAuthenticated,
BespokeGenerateMessageID: by.bespokeWebsocketRequestID,
Authenticate: by.WebsocketAuthenticatePrivateConnection,
MessageFilter: InboundPrivateConnection,
Expand Down

0 comments on commit c316397

Please sign in to comment.