gocryptotrader icon indicating copy to clipboard operation
gocryptotrader copied to clipboard

exchanges: Okx Update

Open samuael opened this issue 1 year ago • 3 comments

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.

  • [x] Bug fix (non-breaking change which fixes an issue)
  • [x] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [ ] This change requires a documentation update

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.

  • [x] go test ./... -race
  • [x] golangci-lint run
  • [x] Test X

Checklist

  • [x] My code follows the style guidelines of this project
  • [x] I have performed a self-review of my code
  • [x] I have commented on my code, particularly in hard-to-understand areas
  • [ ] I have made corresponding changes to the documentation and regenerated documentation via the documentation tool
  • [x] My changes generate no new warnings
  • [x] I have added tests that prove my fix is effective or that my feature works
  • [ ] New and existing unit tests pass locally and on Github Actions/AppVeyor with my changes
  • [ ] Any dependent changes have been merged and published in downstream modules

samuael avatar Dec 11 '23 19:12 samuael

@samuael To switch over to types.Number

perl -pi -E 's{convert.StringToFloat64}{types.Number}g' exchanges/**/*.go
git status -s | sed 's/...//' | xargs goimports -w

gbjk avatar Dec 22 '23 06:12 gbjk

Thank you boss @gbjk. I will apply the change accordingly.

samuael avatar Dec 22 '23 06:12 samuael

I did add unit tests for endpoints accessing the handleIncomingData section. https://github.com/thrasher-corp/gocryptotrader/pull/1420#discussion_r1491803323

  • Have I addressed what you were asking, boss?

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

samuael avatar Feb 19 '24 21:02 samuael