Troubleshooting
Public request works but account read fails
Check apiKey, apiSecret, key permissions, IP restrictions and the server clock. Confirm the keys belong to the selected live or TestNet environment. Never paste credentials into an issue or screenshot.
TestNet request reaches live services
Set useTestnet: true on every client, not testnet or demoTrading. Check for baseUrl or baseUrlKey overrides on REST clients, because they take precedence. The private examples read GATEIO_USE_TESTNET from the shared credential helper.
No private updates after connecting
Check each subscription acknowledgement. Private subscriptions are signed individually; an authenticated event is not required for ordinary subscriptions. Confirm the connection key, topic and payload match the product. A healthy account stream can be quiet when no activity occurs.
Reconnected but state is stale
The SDK restores connections and subscriptions, not missed trades or your local store. Reconcile balances, open orders, finished orders and fills while buffering new events. Preserve newer terminal states when merging older REST results.
Order command timed out
Treat the result as unknown. Check private events, then query with saved order identifiers. Use the exchange order ID for durable lookups, since custom text lookups have retention limits after completion. Do not submit a replacement until the original outcome is resolved.
Browser or mobile request fails
Keep private operations on a server. Check CORS, network access and the full configuration in the runtime guide. Do not expose API secrets or disable transport security to work around a connection failure.
Proxy or connection problem
Check REST and WebSocket routes independently, including the proxy agent, TLS trust and egress IP allowlist. Leave SDK keepAlive disabled when providing a custom agent. See Proxies.
Reporting a problem
Include the SDK version, runtime or framework version, client, exchange environment and method. For failed requests, include the HTTP status and exchange error code. Add a minimal request example or, for streams, the topic and connection events. Remove credentials, signatures and private account data before sharing.
TypeScript checks
The SDK works with both JavaScript and TypeScript. TypeScript is optional, but we strongly recommend it for SDK integrations: the included types help catch invalid method names, parameter shapes and response assumptions at build time, before requests reach the exchange. If you choose TypeScript, follow the TypeScript setup and run npx tsc --noEmit during development and CI. Type checking does not replace runtime validation or exchange-side checks.
Some runtimes can execute TypeScript directly. For example, Node.js type stripping supports erasable TypeScript syntax without a separate compiler, but does not check types. If your runtime cannot execute the syntax used by a TypeScript example, compile that example to JavaScript or use a compatible TypeScript runner. Examples with local .js imports that refer to TypeScript source files can use the compiler-based setup above. Plain JavaScript usage does not need any TypeScript tooling.