---
title: "What an Exchange SDK Handles"
description: "Separate SDK request signing and typed clients from application responsibilities such as pacing, pagination, order retries, and account recovery."
canonical: "https://siebly.io/blog/typescript-sdk-vs-raw-exchange-api"
---

# What an Exchange SDK Handles

Separate SDK request signing and typed clients from application responsibilities such as pacing, pagination, order retries, and account recovery.

## Technical Disclaimer

These articles are software engineering references for exchange API integrations. They are not financial, investment, legal, tax, compliance, or trading advice. Use public data, demo, testnet, or paper workflows first. Keep API credentials out of frontend code and disable withdrawal permissions for automation keys.

## Request Construction {#signing-errors-and-time}

A signed request can succeed while the application handles its result incorrectly. A timeout can occur after an order was accepted. A reconnect can restore a subscription while leaving a hole in the recorded trades. Moving transport code into an SDK does not resolve those application decisions.

The Siebly SDKs provide exchange-specific clients. A [Bybit client](/sdk/bybit/javascript/tutorial) accepts Bybit categories and request fields; a [Binance client](/sdk/binance/javascript/tutorial) exposes its own product-specific methods. Their interfaces remain different because the underlying APIs are different.

<span id="short-answer"></span><span id="raw-request-cost"></span><span id="sdk-vs-raw-table"></span><span id="websocket-lifecycle"></span><span id="when-raw-is-right"></span><span id="testing-implications"></span><span id="release-maintenance"></span><span id="practical-default"></span><span id="security-and-pitfalls"></span><span id="faq"></span>

The client serializes parameters, signs private requests, and sends the headers expected by the endpoint. TypeScript declarations describe supported inputs and responses. Public calls can be made without adding credentials:

```ts title="A typed public request"
import { RestClientV5 } from 'bybit-api';

const client = new RestClientV5();
const response = await client.getTickers({
  category: 'linear',
  symbol: 'BTCUSDT',
});

if (response.retCode !== 0) throw new Error(response.retMsg);
console.log(response.result.list);
```

The category is checked during TypeScript development. The returned JSON still crosses a runtime boundary. An external payload is not made trustworthy merely because a declaration describes its expected shape. [Validate the fields the application consumes](/blog/websocket-data-parsing-in-javascript-a-practical-engineering-guide).

<span id="types-are-not-decoration"></span>

## Application Responsibilities {#what-not-to-hide}

| Concern             | Client behaviour                                             | Application work                                                                          |
| ------------------- | ------------------------------------------------------------ | ----------------------------------------------------------------------------------------- |
| Request signing     | Applies the endpoint's authentication scheme.                | Select the correct credentials, environment, and permissions.                             |
| REST results        | Exposes methods and exchange responses.                      | Check business acceptance and preserve useful error details.                              |
| Request volume      | Some clients expose rate-limit feedback.                     | Share a request budget across the processes counted together.                             |
| Pagination          | Exposes the endpoint's cursor and parameters.                | Iterate, detect stalled cursors, and save progress with the records.                      |
| WebSocket lifecycle | Handles supported heartbeats, reconnects, and subscriptions. | Repair missed history and application state.                                              |
| Order submission    | Sends the requested command.                                 | Persist identity, handle unknown outcomes, and decide whether another attempt is allowed. |

These clients do not automatically throttle REST traffic or provide a general failed-order retry policy. A [shared request budget](/blog/handling-crypto-exchange-api-rate-limits-in-javascript-and-nodejs) and [order-state handling](/blog/mastering-crypto-order-state-management-in-nodejs-and-typescript) belong above the client.

## Keep a Small Connector {#implementation-pattern}

A connector can translate the native response into the fields one application needs while retaining the original identifiers. It should also expose unsupported operations rather than silently changing their meaning. A venue without the required order type cannot be made equivalent by renaming a field.

[Integration tests](/blog/crypto-trading-bot-unit-testing-a-developer-guide-for-nodejs-and-typescript) should exercise that boundary. Mocking a method can test application decisions, but it cannot prove that real credentials, routing, signing, or event subscriptions work.

Raw requests remain reasonable for a small experiment or an unsupported endpoint. The cost changes when several services each maintain their own signer and connection lifecycle. An SDK moves that repeated protocol code into a maintained dependency; the connector keeps application behaviour reviewable.

## Related articles

- [Choosing a JavaScript Exchange SDK](/blog/choose-javascript-crypto-exchange-sdk)
- [Using Siebly Skills with a Coding Agent](/blog/siebly-ai-skills-for-trading-developer-setup-guide)
- [WebSocket Reconnects and Backfill](/blog/crypto-websocket-reliability-account-state)


## Related Siebly Resources

- [Validate the fields the application consumes](/blog/websocket-data-parsing-in-javascript-a-practical-engineering-guide)
- [shared request budget](/blog/handling-crypto-exchange-api-rate-limits-in-javascript-and-nodejs)
- [order-state handling](/blog/mastering-crypto-order-state-management-in-nodejs-and-typescript)
