Refactor/comprehensive api improvements#253
Open
wanth1997 wants to merge 9 commits intobitfinexcom:masterfrom
Open
Refactor/comprehensive api improvements#253wanth1997 wants to merge 9 commits intobitfinexcom:masterfrom
wanth1997 wants to merge 9 commits intobitfinexcom:masterfrom
Conversation
- Fix nil pointer dereference in v2/rest/transport.go (error check order) - Fix heartbeat causing loop exit in v1/websocket.go (return -> continue) - Add safe type assertions (comma-ok) in v1/websocket.go, v2/rest/platform_status.go, v2/rest/status.go, v2/rest/tickers.go, v2/rest/derivatives.go - Protect downstream channel send with select in v2/websocket/transport.go - Add sync.Once to prevent double-close panic in v2/websocket/client.go - Add read/write deadlines to v1 websocket (90s read, 10s write) - Fix PermissionRead -> PermissionWrite in derivatives.go SetCollateral - Add nil protection to v1 WebSocketService.Close()
- Fix sign() returning nil instead of err on failure - Add fmt.Errorf %w wrapping to sign(), NewAuthenticatedRequestWithData() - Register new services (Account, Movements, Alerts, etc.) in Client
- Update go.mod to Go 1.21 - Replace ioutil.ReadAll with io.ReadAll in v1/client.go - Replace ioutil.NopCloser with io.NopCloser in all test files - Run go mod tidy to clean up dependencies
- Replace time.Sleep loop with time.Ticker + select in control() - Add sync.WaitGroup to track control goroutine - Close() now waits for goroutine exit via wg.Wait() - Fixes up to 7.5s delay on Close() caused by sleeping goroutine
Rename 37 exported functions across 18 v1 service files to include V1 prefix for explicit version identification. Update all call sites in tests, integration tests, and examples accordingly.
New services: Account (6 methods), Movements (2), Alerts (3), Settings (3), Liquidations (1), Rankings (1). Extended: Positions (+5), Funding (+4), Derivatives (+1), Status (+1), Orders (+1). Coverage ~57% -> ~95%.
- transport_test.go: error check order, wrapping, invalid URL - client_sign_test.go: sign function correctness - client_close_test.go: double-close protection, connected socket close - subscriptions_test.go: goroutine lifecycle, add/lookup, reset - websocket_safety_test.go: malformed payload, unmapped channel, nil close
- docs/work-log.md: detailed changelog of all modifications - docs/project-brief.md: project overview, architecture, current status
- Remove dead Travis CI badge - Fix broken quickstart code (wrong variable name, missing imports) - Add complete service table listing all 22 REST V2 services - Add V1 API usage note explaining V1 prefix convention - Update installation to modern Go modules style - Fix typo "depreciated" -> legacy - Simplify FAQ section - Update contributing section with conventional commit format
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
...
Breaking changes:
New features:
Fixes:
PR status: