Closed ngocthanh1389 closed 1 year ago
chatgpt
Code Review: This pull request adds two new services to the Binance API client: SimpleEarnService
and SubTransferHistoryService
.
The SimpleEarnService
service allows users to query their lending account history for subscription, redemption, and interest.
The SubTransferHistoryService
service allows sub-account owners to query their sub-account asset transfer history.
Both services seem to be useful additions that provide more functionality to users of the Binance API client, so the changes seem good.
chatgpt: please tell me if there is any improvement for the code:
${file:v2/simple_earn_service.go}
AI Code Review:
The code seems okay but there is one possible improvement that can be made. The Size method is setting the size
parameter to *s.current
instead of *s.size
. This could be a typo and should be corrected to avoid errors in the future.
The correct implementation should be:
func (s *SimpleEarnService) Size(size int64) *SimpleEarnService {
s.size = &size
return s
}
Another suggestion is to add error handling in case the endpoint is not set correctly in the switch statement. This would ensure that the code handles unexpected cases and returns a meaningful error message.
chatgpt: please tell me if there is any improvement in following code:
${file:v2/subaccount_service.go}
AI Code Review:
I cannot determine if there are any bugs in this code as it is only a code snippet and does not include any information about the variables or functions it interacts with.
AI Code Review:
The code looks good, but here are a few minor suggestions:
TransferType
should be TransferType
.Do
method of SubTransferHistoryService
to avoid copying the struct unnecessarily:func (s *SubTransferHistoryService) Do(ctx context.Context) ([]*SubTransfer, error) {
Other than that, the code seems to follow Go's idiomatic style and is well-structured.
What is the problem? Need to add new API to get transfer history
https://binance-docs.github.io/apidocs/spot/en/#transfer-to-master-for-sub-account