gocryptotrader
gocryptotrader copied to clipboard
exchanges: Add Binance.us support
PR Description
This pull request Included a code implementation for the Binance US exchange; with REST and Websocket support. All the Websocket and Wrapper functions are tested. My code follows the style guidelines of other exchanges of GCT. Fixed some errors with the help of golangci-lint. Endpoint methods that have no support from the GCT wrapper are also implemented for future use.
Fixes # (issue)
Type of change
Please delete options that are not relevant and add an x
in []
as item is complete.
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ X]
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.
- [ ] go test ./... -race
- [ ] golangci-lint run
- [ ] Test X
Checklist
- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ X]
- [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
Okay, I can add it or amend it after you do that.
On Tue, May 17, 2022, 12:39 AM shazbert @.***> wrote:
@.**** commented on this pull request.
In exchanges/binanceus/binanceus_wrapper.go https://github.com/thrasher-corp/gocryptotrader/pull/949#discussion_r874180460 :
- if er != nil {
return nil, er
- }
- bi.appendOptionalDelimiter(&fpairs)
- tickerNew, err := ticker.GetTicker(bi.Name, p, assetType)
- if err != nil {
return bi.UpdateTicker(ctx, p, assetType)
- }
- return tickerNew, nil +}
+// appendOptionalDelimiter ensures that a delimiter is +// present for long character currencies +func (b *Binanceus) appendOptionalDelimiter(p *currency.Pair) {
- if len(p.Quote.String()) > 3 ||
I was thinking of adding a length() or Len()method to currency.Code type, when I get some time to start going over this trello card: here https://trello.com/c/54eizOIo/143-currency-package-upgrades. But for now other priorities. It's out of scope for your PR.
— Reply to this email directly, view it on GitHub https://github.com/thrasher-corp/gocryptotrader/pull/949#discussion_r874180460, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJOJSZ75QIXSDNIGLIB3EQLVKK6BXANCNFSM5VTTG2TA . You are receiving this because you were assigned.Message ID: @.***>
Thanks a lot!