-
-
Notifications
You must be signed in to change notification settings - Fork 269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FEATURE: [bybit] to periodically fetch the fee rate #1397
Conversation
Welcome back! @bailantaotao, This pull request may get 696 BBG. |
Codecov Report
@@ Coverage Diff @@
## main #1397 +/- ##
=======================================
Coverage 21.12% 21.13%
=======================================
Files 568 569 +1
Lines 40956 41008 +52
=======================================
+ Hits 8653 8668 +15
- Misses 31667 31703 +36
- Partials 636 637 +1
Continue to review full report in Codecov by Sentry.
|
} | ||
|
||
stream.SetEndpointCreator(stream.createEndpoint) | ||
stream.SetParser(stream.parseWebSocketEvent) | ||
stream.SetDispatcher(stream.dispatchEvent) | ||
stream.SetHeartBeat(stream.ping) | ||
stream.SetBeforeConnect(stream.getAllFeeRates) | ||
stream.SetBeforeConnect(func(ctx context.Context) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one question, is it BeforeConnect or BeforeStart? because we trigger OnStart only once, and OnConnect many times (disconnect and reconnect)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We call the BeforeConnect before DialAndConnect
// Connect starts the stream and create the websocket connection
func (s *StandardStream) Connect(ctx context.Context) error {
if s.beforeConnect != nil {
if err := s.beforeConnect(ctx); err != nil {
return err
}
}
err := s.DialAndConnect(ctx)
if err != nil {
return err
}
// start one re-connector goroutine with the base context
// reconnector goroutine does not exit when the connection is closed
go s.reconnector(ctx)
s.EmitStart()
return nil
}
Hi @bailantaotao, Well done! 726 BBG has been sent to your polygon wallet. Please check the following tx: https://polygonscan.com/tx/0xc70b45efc0c6005b875971f142588e59fdd94ef49e152137f18b63ee2947a08c Thank you for your contribution! |
To periodically fetch the fee rate.
The
feeRatePoller.getAllFeeRates
are copied fromstream.getAllFeeRates