Install
openclaw skills install @psyb0t/go-btseWrites Go code with go-btse (github.com/psyb0t/go-btse), an unofficial BTSE client generated from its public OpenAPI and AsyncAPI specifications. REST packages btse (spot), futures, markets, wallet, earn and otc cover spot and futures orders, account fees, positions, public markets, wallets, transfers, withdrawals, earn products and OTC quotes; auth signs private requests with HMAC-SHA384; ws/spot, ws/futures and ws/otc cover WebSocket messages. Use when Go code needs BTSE API access or already imports github.com/psyb0t/go-btse.
openclaw skills install @psyb0t/go-btseUnofficial typed Go client for BTSE. The root btse package covers spot REST operations. Other products have separate packages to keep their schemas and operation names distinct.
See references/setup.md for installation, product base URLs, responses and generation details.
BTSE_API_KEY and BTSE_API_SECRET. Never hardcode, commit or log them, or print signed request headers. Public market data does not require credentials.https://testapi.btse.io. Production requests use https://api.btse.com. Select the service prefix from the table in the setup reference, and use credentials for that environment.github.com/psyb0t/go-btse or one of its product packages.AGENTS.md for that workflow.The examples below cover a few calls. Every operation in the specs has a generated method, and the spec's descriptions are on them as Go doc comments. Look names and fields up instead of guessing. After go get github.com/psyb0t/go-btse, from inside your module:
go doc github.com/psyb0t/go-btse ClientWithResponsesInterface # every spot endpoint method
go doc github.com/psyb0t/go-btse GetAccountFeesParams # one method, params type or model
go doc -all github.com/psyb0t/go-btse # the whole spot package
go doc github.com/psyb0t/go-btse/futures ClientWithResponsesInterface # same for markets, wallet, earn, otc
go doc github.com/psyb0t/go-btse/auth Signer # request signing
go doc github.com/psyb0t/go-btse/ws HeartbeatTransport # spot and futures heartbeat adapter
go doc github.com/psyb0t/go-btse/ws/spot Handler # every received message handler
go doc github.com/psyb0t/go-btse/ws/spot Client # Authenticate, Subscribe, SendPing, Run
The same documentation is at https://pkg.go.dev/github.com/psyb0t/go-btse. The ws/futures and ws/otc packages have the same Handler and Client entry points; the OTC client's send methods are Authenticate and the SubscribeQuote... methods.
Method names come from the spec's operation IDs. <OperationId>WithResponse takes the context, then the path parameters in order, then *<OperationId>Params when the operation has query or header parameters, then the request body when it has one. The JSON200 field (or JSON201 and so on, per declared status) holds the decoded body; it is nil for any other status.
Construct a signer with btseauth.NewSigner(key, secret). Handle its error, then pass btse.WithRequestEditorFn(signer.RequestEditor) to btse.NewClientWithResponses("https://testapi.btse.io/spot", opts...). For another product, use that package's constructor and WithRequestEditorFn option with its base URL.
For example, client.GetAccountFeesWithResponse(ctx, &btse.GetAccountFeesParams{}) fetches spot maker and taker fees. The complete compiling example is example_test.go, also shown in the README.
The signer sets request-api, an increasing millisecond request-nonce, and the lowercase hexadecimal HMAC-SHA384 request-sign. Register it after editors that change the URL or body. Share one signer per API key. It signs the API path without the query, strips /spot or /futures only before /api/, and preserves the exact body bytes.
The Go error covers transport and decoding failures. Check StatusCode() and the expected response field before dereferencing it. A non-2xx API result can return a nil Go error. Most generated fields are pointers. JSON number fields use float64; fields declared as strings stay strings.
Method names come from each product's operation IDs. CreateOrderWithResponse exists in both the root spot package and the futures package, with different request types. Keep those types in their owning package.