Repository navigation
Releases: tigusigalpa/bitget-go
Release list
Bitget Go SDK v1.2.0
Bitget Go SDK v1.2.0
This release adds the official UTA deep candle-history route and immutable HTTP
response evidence for historical market consumers. Recent candles, recent public
fills, funding history and injected HTTP transports retain their existing APIs.
Added
Market.GetHistoryCandlescalls/api/v3/market/history-candleswith category,
symbol, interval, type, startTime, endTime and limit selectors. Requests support
at most 100 candles, independently of recentGetCandles' 1,000-candle route.
Exact numeric strings, provider ordering and extra early candles from documented
end-time rounding are preserved.GetHistoryCandlesWithReceiptandGetLiquidationsWithReceiptreturn immutable
models.RESTReceiptevidence: exact bounded response-body bytes, HTTP status,
local receipt time before decoding and allowlisted request metadata without
credentials/headers/host. Accessors copy mutable values. Receipts retain at
most 10 MiB; oversize/interrupted bodies fail with an incomplete receipt, and
HTTP/API/decoding errors retain the response whenever one was received.Market.GetLiquidationsreturnsmodels.PartialLiquidationswith exact amount,
price and event-time strings and opaque cursor pagination. These are delayed
observations from the last three days, not a complete liquidation history:
stable event identity, amount units and REST aggregation are not guaranteed
by the audited contract. No synthetic identity or unit conversion is added.- A public history example, source-linked synthetic fixtures, contract audit and
boundary/error/cancellation/pagination/immutability regression tests.
Coverage boundaries
The UTA market catalog documents only recent public fills. Private
/api/v3/trade/fills is account history, and Classic v2 public history uses a
different API. This release does not substitute either for an undocumented UTA
public historical fills route.
History time selectors are forwarded unchanged. The provider does not explicitly
guarantee equality at the start/end boundaries; the SDK preserves inclusive and
exclusive responses and does not infer complete coverage from page size. A full
receipt means complete HTTP bytes, not complete market history.
Upgrade and validation
go get github.com/tigusigalpa/bitget-go@v1.2.0Go 1.21 remains supported. Normal/race tests, vet, build and module verification
passed on Go 1.21 in Linux; Windows normal/race and module checks also passed.
golangci-lint v2.14.0 reports no issues. All fixtures are classified synthetic
inputs, not live exchange captures; live boundary behaviour is not asserted.
See README, endpoint map and
source audit for examples and limitations.
v1.1.0
Bitget Go SDK v1.1.0
v1.1.0 makes the SDK more useful for production integrations with public market-data endpoints, observable WebSocket lifecycle events, and safer runnable examples.
What’s new
- New public market-data methods:
- Candles via
Market.GetCandles - Recent trades via
Market.GetPublicFills - Funding-rate history via
Market.GetFundingRateHistory
- Candles via
- Prices, quantities, and timestamps remain strings, avoiding implicit
float64rounding. - New lossless WebSocket raw-frame observer with:
- Exact payload before JSON decoding
- Local receipt time
- Connection generation after reconnects
- WebSocket lifecycle events for connections, subscriptions, ACKs, provider errors, and terminal failures.
- Subscriptions can now be considered ready only after a
WSSubscribedacknowledgment for the current connection generation. - Added demo-only account and private WebSocket examples, plus clearer README guides for REST, subscription readiness, and raw-frame handling.
- Improved CI and code quality: HTTP/WebSocket close errors are handled, and
golangci-lint v2.14.0reports0 issues.
Compatibility
This is an additive release. Existing REST and WebSocket APIs remain compatible.
The regular WSPush channel still uses a bounded buffer. If message loss is unacceptable, use WithRawFrameHandler and either process frames synchronously or hand them off to your own durable queue.
Validation
go test ./...go test -race ./...go vet ./...golangci-lint v2.14.0—0 issues
See [`
v1.0.4
v1.0.3
v1.0.2
v1.0.2
Fixed
WebSocket
- Serialized all outgoing WebSocket writes — login, subscribe, unsubscribe, ping, and resubscribe — to prevent
concurrent write to websocket connectionpanics. - Fixed a race between push delivery and
Unsubscribethat could cause asend on closed channelpanic. - Corrected the automatic reconnection lifecycle:
Close()now cancels pending reconnection attempts;- closed clients no longer reconnect in the background;
- reconnects no longer create duplicate ping loops.
- WebSocket authentication failures now return Bitget’s error code and message immediately instead of waiting for the login timeout.
- Added heartbeat monitoring: if no
pongis received before the timeout, the stale connection is closed and automatically reconnected. - Added a 10 MiB limit for incoming WebSocket messages.
- Connections are now properly released when login fails or a connection is lost.
REST
- Added a 10 MiB limit for HTTP response bodies.
- Improved non-success HTTP status handling:
4xxand5xxresponses can no longer be treated as successful API calls, including malformed responses or formally successful JSON envelopes returned by upstream infrastructure.
Tests
Added regression coverage for:
- immediate WebSocket login error handling;
- concurrent subscriptions;
- safe subscription-channel closing;
- HTTP
500responses containing a successful API envelope; - oversized HTTP responses.
Verification
go test -count=1 ./...— passedgo vet ./...— passedgit diff --check— passed
v1.0.0
Bitget Go SDK v1.0.0 — Phase 1 stable release
We’re happy to announce the first stable release of bitget-go, a clean, idiomatic Go SDK for the Bitget Unified Trading Account (UTA) API v3.
What's included
REST API coverage (Phase 1)
- Market —
GetInstruments,GetTickers,GetOrderBook - Account —
GetAssets,GetSettings,SetLeverage - Trade —
PlaceOrder,ModifyOrder,CancelOrder,GetOpenOrders,GetOrderHistory,GetPositions
Every endpoint uses typed models.BitgetResponse[T] envelopes and returns prices, quantities, PnL, and fees as string to avoid floating-point rounding errors.
WebSocket
- Public and private reconnecting clients built on
gorilla/websocket - Automatic reconnection with exponential backoff (1 s → 60 s cap)
- Auto-resubscription to every previously active channel after reconnect
- Private
fast-fillchannel implemented; other channels decode through the sameSubscribeAPI
Developer experience
context.Contexton every network call- Injectable
*http.Clientfor proxies, custom transports, or test doubles - Functional options:
WithHTTPClient,WithBaseURL,WithDemoTrading(),WithTimeout,WithLogger,WithLocale - Sentinel errors and typed
*BitgetErrorviaerrors.Is/errors.As - Only one required runtime dependency:
gorilla/websocket
Safety
- Demo trading support through
WithDemoTrading()and Demo WebSocket URLs - The trading example requires both
BITGET_DEMO=1andBITGET_ENABLE_TRADING=1before placing an order - API keys, secrets, and signatures are never logged
Installation
go get github.com/tigusigalpa/bitget-go@v1.0.0Requirements
- Go 1.21 or newer
Known limitations
- This is Phase 1, so not every UTA v3 endpoint is covered yet. See
docs/endpoints.mdfor the current mapping. - WebSocket channels other than
fast-fillare delivered as raw payloads; decode them frompush.Datauntil typed models land.
Useful links
Security
If you discover a vulnerability, please email sovletig@gmail.com directly rather than opening a public issue.
Thanks for trying out bitget-go. Trade safe, and test on demo first.