-
-
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: [bitget] support market trade stream #1347
FEATURE: [bitget] support market trade stream #1347
Conversation
Welcome back! @bailantaotao, This pull request may get 1225 BBG. |
8dfba09
to
997cbf0
Compare
Re-estimated karma: this pull request may get 1230 BBG |
Codecov Report
@@ Coverage Diff @@
## main #1347 +/- ##
==========================================
+ Coverage 20.76% 20.81% +0.05%
==========================================
Files 566 566
Lines 40357 40454 +97
==========================================
+ Hits 8380 8422 +42
- Misses 31368 31421 +53
- Partials 609 611 +2
Continue to review full report in Codecov by Sentry.
|
pkg/exchange/bitget/stream_test.go
Outdated
{ | ||
Asks: []types.PriceVolume{ | ||
{ | ||
Price: fixedpoint.NewFromFloat(28350.78), |
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.
you can check the number() function, I think you can make a copy here for writing the tests
it helps you to create fixedpoint value object with just number(3200.0) or number("3200.0"
pkg/types/stream.go
Outdated
@@ -523,6 +523,7 @@ const ( | |||
DepthLevelMedium Depth = "MEDIUM" | |||
DepthLevel1 Depth = "1" | |||
DepthLevel5 Depth = "5" | |||
DepthLevel15 Depth = "15" |
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.
I guess it's time to define the supported depth function for each exchange
|
||
type MarketTradeSlice []MarketTrade | ||
|
||
func (m *MarketTradeSlice) UnmarshalJSON(b []byte) 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.
How about adding a guard to avoid m==nil
?
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.
Great! I have added it . Avoid stepping on landmines in the future.
pkg/exchange/bitget/types.go
Outdated
Type ActionType | ||
InstId string |
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.
Is it possible make these two fields private (starting with lowercase)?
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.
Others LGTM
997cbf0
to
a18b1be
Compare
Re-estimated karma: this pull request may get 657 BBG |
Hi @bailantaotao, Well done! 662 BBG has been sent to your polygon wallet. Please check the following tx: https://polygonscan.com/tx/0x7c7fa64eea2232527e011a644de0d7bb40726f9b10b1994d9c22d0c2d27fe122 Thank you for your contribution! |
https://bitgetlimited.github.io/apidoc/en/spot/#trades-channel