-
Notifications
You must be signed in to change notification settings - Fork 790
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
exchanges: Okx Update #1420
base: master
Are you sure you want to change the base?
exchanges: Okx Update #1420
Conversation
… into okx_update
… into okx_update
… into okx_update
… into okx_update
… into okx_update
… into okx_update
… into okx_update
… into okx_update
… into okx_update
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.
Legend. Just somethings I noticed.
// GetSCode returns a status code value | ||
func (a *OrderData) GetSCode() string { return a.SCode } | ||
|
||
// GetSMsg returns a status message value | ||
func (a *OrderData) GetSMsg() string { return a.SMessage } |
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 could probably RM these methods
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? & Why?
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 might be mistaken, but the data doesn't look like it escapes scope. Have you tested the deployment and response? Also can you please add coverage across all functions that use handleIncomingData
// GetSCode returns a status code value | ||
func (a *ResponseSuccess) GetSCode() string { return a.SCode } | ||
|
||
// GetSMsg returns a status message value | ||
func (a *ResponseSuccess) GetSMsg() string { return a.SMessage } |
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.
and here
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? & Why?
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.
Thanks for the changes, Linter needs to be resolved.
// GetSCode returns a status code value | ||
func (a *OrderData) GetSCode() string { return a.SCode } | ||
|
||
// GetSMsg returns a status message value | ||
func (a *OrderData) GetSMsg() string { return a.SMessage } |
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 might be mistaken, but the data doesn't look like it escapes scope. Have you tested the deployment and response? Also can you please add coverage across all functions that use handleIncomingData
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 a couple items left over.
exchanges/okx/okx.go
Outdated
// GetAlgoOrderDetail retrieves algo order details. | ||
func (ok *Okx) GetAlgoOrderDetail(ctx context.Context, algoID, algoClientOrderID string) (*AlgoOrderDetail, error) { | ||
if algoID == "" && algoClientOrderID == "" { | ||
return nil, fmt.Errorf("%w eiither 'algoId' or 'algoClOrdId' is required", errMissingAlgoOrderID) |
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.
} | ||
|
||
// GetSCode returns a status code value | ||
func (a *ResponseSuccess) GetSCode() string { return a.SCode } |
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.
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.
These methods are added to be used when we encounter such kind of response with a "code": "1" and the detailed sCode and sMsg are included in the data section.
We can not call the x.SCode and x.SMsg fields in ### handleIncomingData method. Since we give an input of different instance interfaces as ### dataHolder for the ### handleIncomingData method.
{
"id": "1514",
"op": "sprd-cancel-order",
"data": [
{
"clOrdId": "",
"ordId": "2510789768709120",
"sCode": "5XXXX",
"sMsg": "Order not exist"
}
],
"code": "1",
"msg": ""
}
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.
Therefore, removing these GetSCode() and GetSMsg() methods is problematic.
I did add unit tests for endpoints accessing the
If not, give me a short elaboration - I'll review it again tomorrow as I didn't have time to address this one bc of Deribit |
… into okx_update
… into okx_update
… into okx_update
… into okx_update
… into okx_update
Selam, ወንድሞች.
PR Description
This pull request incorporates modifications for the Okx exchange, encompassing changes to endpoint methods, rate limits, WebSocket subscriptions and handlers, wrapper functions, and conversion methods. Rigorous testing has been conducted on all facets of the functions to ensure their reliability. The code adheres to the GCT style standards, consistent with practices adopted by other exchanges. To enhance code quality, golangci-lint was utilized for linter testing, effectively rectifying a few errors. Furthermore, this implementation includes endpoint methods that the GCT wrapper did not initially support, ensuring compatibility for future use
The PR updated implementations for REST for trading and other endpoint methods, Web-socket streaming, and Trading through the web socket stream.
Fixes # (issue)
Type of change
Please delete options that are not relevant and add an
x
in[]
as the item is complete.How has this been tested
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration and also, consider improving test coverage whilst working on a certain feature or package.
Checklist