-
-
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] integrate QueryMarkets, QueryTicker and QueryAccount api #1280
Conversation
Welcome back! @c9s, This pull request may get 366 BBG. |
Re-estimated karma: this pull request may get 371 BBG |
Codecov Report
@@ Coverage Diff @@
## main #1280 +/- ##
=======================================
Coverage 21.58% 21.58%
=======================================
Files 540 540
Lines 37435 37435
=======================================
Hits 8082 8082
Misses 28769 28769
Partials 584 584
Continue to review full report in Codecov by Sentry.
|
Re-estimated karma: this pull request may get 389 BBG |
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.
Everything else LGTM
} | ||
|
||
func (e *Exchange) QueryMarkets(ctx context.Context) (types.MarketMap, error) { | ||
// TODO implement me |
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.
rm comments
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.
Or write "TODO: " for color highlight
|
||
func (e *Exchange) QueryMarkets(ctx context.Context) (types.MarketMap, error) { | ||
// TODO implement me | ||
req := e.client.NewGetSymbolsRequest() |
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.
add rate limiter?
@@ -86,8 +86,23 @@ func (e *Exchange) QueryMarkets(ctx context.Context) (types.MarketMap, error) { | |||
} | |||
|
|||
func (e *Exchange) QueryTicker(ctx context.Context, symbol string) (*types.Ticker, error) { | |||
// TODO implement me | |||
panic("implement me") | |||
req := e.client.NewGetTickerRequest() |
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.
rate limiter?
@@ -116,8 +116,21 @@ func (e *Exchange) QueryKLines(ctx context.Context, symbol string, interval type | |||
} | |||
|
|||
func (e *Exchange) QueryAccount(ctx context.Context) (*types.Account, error) { | |||
// TODO implement me | |||
panic("implement me") | |||
req := e.client.NewGetAccountAssetsRequest() |
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.
rate limiter?
resp, err := req.Do(ctx) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
bals := types.BalanceMap{} | ||
for _, asset := range resp { | ||
b := toGlobalBalance(asset) | ||
bals[asset.CoinName] = b | ||
} |
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.
Perhaps you can move this implementation to QueryAccountBalances, and then QueryAccount can utilize it.
|
||
func (e *Exchange) QueryKLines(ctx context.Context, symbol string, interval types.Interval, options types.KLineQueryOptions) ([]types.KLine, error) { | ||
// TODO implement me | ||
panic("implement me") |
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.
Please mark in document that bitget is not ready for backtesting
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.
Just suggestion. Users should also be able to find this on their own
Hi @c9s, Well done! 474 BBG has been sent to your polygon wallet. Please check the following tx: https://polygonscan.com/tx/0x367f00eb843429a531152d6874ba18c33f3db716272603d25cd8e9d59216d5ec Thank you for your contribution! |
No description provided.