KuCoin TypeScript SDK
Installation and integration guidance for the KuCoin SDK in TypeScript.
TypeScript SDK Usage
Use typed requests, responses, and event flows in stricter TypeScript services and shared libraries.
In TypeScript, use the package types to check request shapes, response fields, WebSocket payloads, and refactors around exchange-specific code.
What This SDK Covers
- Complete KuCoin REST API integrations for exchange-specific workflows.
- Robust KuCoin WebSocket support for market and account stream handling.
- TypeScript-friendly usage patterns for production integration work.
- Adaptable TypeScript examples & guides under /examples for implementation reference.
- Type-rich examples that emphasize request and response shapes, editor hints, and safer refactors.
- Implementation patterns for larger TypeScript services, shared libraries, and stricter TypeScript application code.
Install Package
npm install kucoin-api
# or
pnpm install kucoin-api
yarn add kucoin-api
Quickstart REST API Walkthrough
Easily start working the Kucoin REST APIs in JavaScript.
- Install the Kucoin JavaScript SDK via NPM:
npm install kucoin-api. - Import the FuturesClient class (REST API wrapper for Kucoin futures endpoints).
- Note: If spot is preferred, use the SpotClient class intead.
- Create an authenticated FuturesClient instance with your API credentials.
- Call REST API methods as functions and await their responses.
In this example, we:
- Fetch contract metadata for
XRPUSDTMand read themultiplier. - Demonstrate how contract multiplier affects position sizing calculations.
- Provide practical order payload examples for market and limit long/short entries.
- Provide practical order payload examples for market and limit close-position requests.
- Provide practical order payload examples for stop-loss style close orders.
This script is designed as a practical futures order guide, showing how to structure different order requests and reason about contract size before submitting live orders.
For a full map of available REST API methods, check out the endpoint reference below.
Quickstart REST API Example
import { FuturesClient } from 'kucoin-api';
async function start() {
const account = {
key: 'keyHere',
secret: 'secretHere',
passphrase: 'memoHere',
};
const client = new FuturesClient({
apiKey: account.key,
apiSecret: account.secret,
apiPassphrase: account.passphrase,
});
try {
/**
* =======
* Credits for this guide go to user: @DKTradingClient / Code Nerd from the Kucoin API Telegram group!
* =======
/**
* Futures are contracts, not currencies. In the futures symbols list you will see a "multiplier" field for each of the symbols.
* Each contract equals to Multiplier x Size
* For example: https://api-futures.kucoin.com/api/v1/contracts/XRPUSDTM - see the "multiplier" value.
* */
const symbolInfo = await client.getSymbol({ symbol: 'XRPUSDTM' });
const multiplier = symbolInfo.data.multiplier;
/**
* E.g. if multiplier is 10(what you can see from the endpoint), that means each SIZE is 10 XRP. So if XRP is currently at $0.5,
* then each 1 contract (size 10) is going to cost $5.00
* size = (Funds x leverage) / (price x multiplier)
*/
const XRPPriceExample = 0.5;
const leverage = 5;
const fundsToTradeUSDT = 100;
const costOfContract = XRPPriceExample * multiplier;
const size = (fundsToTradeUSDT * leverage) / costOfContract;
console.log(`Size: ${size}`);
/**
* The trade amount indicates the amount of contract to buy or sell, and contract uses the base currency or lot as the trading unit.
* The trade amount must be no less than 1 lot for the contract and no larger than the maxOrderQty.
* It should be a multiple number of the lot, or the system will report an error when you place the order.
* E.g. 1 lot of XBTUSDTM is 0.001 Bitcoin, while 1 lot of XBTUSDM is 1 USD.
* or check the XRPUSDTM example above.
*
* Here are function examples using the Futures Create Order endpoint:
*/
// A MARKET SHORT of 2 contracts of XBT using leverage of 5:
const marketShort = client.submitOrder({
clientOid: '123456789',
leverage: 5,
side: 'sell',
size: 2,
symbol: 'XBTUSDTM',
timeInForce: 'GTC',
type: 'market',
});
console.log('Market short: ', marketShort);
// A MARKET LONG of 2 contracts of XBT using leverage of 5:
const marketLong = client.submitOrder({
clientOid: '123456789',
leverage: 5,
side: 'buy',
size: 2,
symbol: 'XBTUSDTM',
timeInForce: 'GTC',
type: 'market',
});
console.log('Market long: ', marketLong);
// A LIMIT SHORT of 2 contracts of XBT using leverage of 5:
const limitShort = client.submitOrder({
clientOid: '123456789',
leverage: 5,
price: '70300.31',
side: 'sell',
size: 2,
symbol: 'XBTUSDTM',
timeInForce: 'GTC',
type: 'limit',
});
console.log('Limit short: ', limitShort);
// A LIMIT LONG of 2 contracts of XBT using leverage of 5:
const limitLong = client.submitOrder({
clientOid: '123456789',
leverage: 5,
price: '40300.31',
side: 'buy',
size: 2,
symbol: 'XBTUSDTM',
timeInForce: 'GTC',
type: 'limit',
});
console.log('Limit long: ', limitLong);
// On any "close position" action, if you specify a SIZE=0 or leave off the SIZE parameter,
// then it will close the whole position, regardless of the size.
// If you specify a SIZE, it will close only the number of contracts you specify.
// If closeOrder is set to TRUE,
// the system will close the position and the position size will become 0.
// Side, Size and Leverage fields can be left empty and the system will determine the side and size automatically.
// A MARKET CLOSE POSITION example:
const marketClose = client.submitOrder({
clientOid: '123456789',
closeOrder: true,
symbol: 'XBTUSDTM',
timeInForce: 'GTC',
type: 'market',
side: 'sell',
size: 0,
});
console.log('Market close: ', marketClose);
// A LIMIT CLOSE of a LONG example:
const limitCloseLong = client.submitOrder({
clientOid: '123456789',
leverage: 5,
price: '70300.31',
closeOrder: true,
side: 'sell',
size: 2,
symbol: 'XBTUSDTM',
timeInForce: 'GTC',
type: 'limit',
});
console.log('Limit close long: ', limitCloseLong);
// A LIMIT CLOSE of a SHORT example:
const limitCloseShort = client.submitOrder({
clientOid: '123456789',
leverage: 5,
price: '40300.31',
closeOrder: true,
side: 'buy',
size: 2,
symbol: 'XBTUSDTM',
timeInForce: 'GTC',
type: 'limit',
});
console.log('Limit close short: ', limitCloseShort);
// A STOP LOSS example for a LONG position:
const stopLossLong = client.submitOrder({
clientOid: '123456789',
closeOrder: true,
stop: 'down',
side: 'buy',
stopPrice: '40200.31',
stopPriceType: 'TP',
symbol: 'XBTUSDTM',
timeInForce: 'GTC',
type: 'market',
});
console.log('Stoploss long: ', stopLossLong);
// A STOP LOSS example for a SHORT position:
const stopLossShort = client.submitOrder({
clientOid: '123456789',
closeOrder: true,
stop: 'up',
side: 'sell',
stopPrice: '40200.31',
stopPriceType: 'TP',
symbol: 'XBTUSDTM',
timeInForce: 'GTC',
type: 'market',
});
console.log('Stoploss short: ', stopLossShort);
} catch (e) {
console.error('Req error: ', e);
}
}
start();
Quickstart WebSocket Walkthrough
Connecting to Kucoin's private spot WebSocket streams is straightforward with the WebsocketClient.
- Install the Kucoin JavaScript SDK via NPM:
npm install kucoin-api. - Import the WebsocketClient and create an authenticated instance with your API credentials.
- Configure event handlers for key events such as
open,update,response,reconnect,reconnected,close, andexception. - Subscribe to private topics on the
spotPrivateV1connection key.
In this example, we:
- Subscribe to private spot topics such as trade order updates, balances, and advanced orders.
- Subscribe to private margin topics (including isolated margin position updates) on the same private ws key.
- Demonstrate grouped topic subscription in batched requests.
This setup lets you track private account activity in real time without polling REST endpoints.
Quickstart WebSocket Example
import { WebsocketClient } from 'kucoin-api';
async function start() {
// Optional: inject a custom logger to override internal logging behaviour
// const logger: typeof DefaultLogger = {
// ...DefaultLogger,
// trace: (...params) => {
// if (
// [
// 'Sending ping',
// // 'Sending upstream ws message: ',
// 'Received pong',
// ].includes(params[0])
// ) {
// return;
// }
// console.log('trace', JSON.stringify(params, null, 2));
// },
// };
const account = {
key: process.env.API_KEY || 'keyHere',
secret: process.env.API_SECRET || 'secretHere',
passphrase: process.env.API_PASSPHRASE || 'apiPassPhraseHere', // This is NOT your account password
};
console.log('connecting with ', account);
const client = new WebsocketClient(
{
apiKey: account.key,
apiSecret: account.secret,
apiPassphrase: account.passphrase,
},
// logger,
);
client.on('open', (data) => {
console.log('open: ', data?.wsKey);
});
// Data received
client.on('update', (data) => {
console.info('data received: ', JSON.stringify(data));
});
// Something happened, attempting to reconenct
client.on('reconnect', (data) => {
console.log('reconnect: ', data);
});
// Reconnect successful
client.on('reconnected', (data) => {
console.log('reconnected: ', data);
});
// Connection closed. If unexpected, expect reconnect -> reconnected.
client.on('close', (data) => {
console.error('close: ', data);
});
// Reply to a request, e.g. "subscribe"/"unsubscribe"/"authenticate"
client.on('response', (data) => {
console.info('response: ', data);
// throw new Error('res?');
});
client.on('exception', (data) => {
console.error('exception: ', {
msg: data.msg,
errno: data.errno,
code: data.code,
syscall: data.syscall,
hostname: data.hostname,
});
});
try {
// Optional: await a connection to be ready before subscribing (this is not necessary)
// await client.connect('spotPrivateV1');
// console.log('connected');
/**
* For more detailed usage info, refer to the ws-spot-public.ts example.
*
* Below are some examples for subscribing to private spot & margin websockets.
* Note: all "private" websocket topics should use the "spotPrivateV1" wsKey.
*/
client.subscribe(
[
'/market/match:BTC-USDT',
'/spotMarket/tradeOrders',
'/spotMarket/tradeOrdersV2',
'/account/balance',
'/spotMarket/advancedOrders',
],
'spotPrivateV1',
);
/**
* Other margin websocket topics, which also use the "spotPrivateV1" WsKey:
*/
client.subscribe(
[
'/margin/position',
'/margin/isolatedPosition:BTC-USDT',
'/spotMarket/advancedOrders',
],
'spotPrivateV1',
);
} catch (e) {
console.error('Subscribe exception: ', e);
}
}
start();
Quickstart WebSocket API Walkthrough
Kucoin's WebSocket API (WS-API) lets you send trading commands over persistent authenticated WebSocket connections, reducing overhead compared to repeatedly opening REST requests.
The SDK's WebsocketAPIClient wraps this with promise-based methods so each command can be awaited similarly to a REST call.
To use the WebSocket API:
- Install the Kucoin JavaScript SDK via NPM:
npm install kucoin-api. - Import the dedicated WebsocketAPIClient.
- Create an authenticated WebsocketAPIClient instance with your API credentials.
- Optionally customize logging with the injected logger.
- Call dedicated WS-API helper methods and await each response.
In this example, we:
- Submit, sync-submit, modify, cancel, and query spot orders.
- Submit and cancel margin orders.
- Submit, cancel, batch-submit, and batch-cancel futures orders.
Note that:
- The script is a broad capability walkthrough and includes placeholder order IDs that should be replaced for live use.
- Operations are wrapped in independent
try/catchblocks so each WS-API request can be tested separately.
Quickstart WebSocket API Example
/**
* KuCoin WebSocket API Client - Complete Example
*
* This example demonstrates all available WebSocket API operations:
* - Spot trading: submit, modify, cancel, sync operations
* - Margin trading: submit and cancel orders
* - Futures trading: submit, cancel, batch operations
*
* Usage:
* Make sure to set your API credentials in environment variables:
* - API_KEY
* - API_SECRET
* - API_PASSPHRASE
*
* or pass them as arguments to the constructor
*/
import { DefaultLogger, WebsocketAPIClient } from 'kucoin-api';
async function main() {
const customLogger = {
...DefaultLogger,
// For a more detailed view of the WebsocketClient, enable the `trace` level by uncommenting the below line:
// trace: (...params) => console.log(new Date(), 'trace', ...params),
};
const account = {
key: process.env.API_KEY || 'keyHere',
secret: process.env.API_SECRET || 'secretHere',
passphrase: process.env.API_PASSPHRASE || 'apiPassPhraseHere', // This is NOT your account password
};
const wsClient = new WebsocketAPIClient(
{
apiKey: account.key,
apiSecret: account.secret,
apiPassphrase: account.passphrase,
// If you want your own event handlers instead of the default ones with logs, disable this setting and see the `attachEventHandlers` example below:
// attachEventListeners: false
},
customLogger,
);
// Example usage for each WebSocket API operation
console.log('Starting WebSocket API examples...\n');
// 1. Submit Spot Order
try {
console.log('\n2. Testing submitNewSpotOrder...');
const spotOrderResponse = await wsClient.submitNewSpotOrder({
side: 'buy',
symbol: 'BTC-USDT',
type: 'limit',
price: '20000', // Very low price to avoid accidental execution
size: '0.0001',
});
console.log('Spot order response:', spotOrderResponse);
} catch (e) {
console.log('Spot order error:', e);
}
// 2. Submit Sync Spot Order
try {
console.log('\n3. Testing submitSyncSpotOrder...');
const syncSpotOrderResponse = await wsClient.submitSyncSpotOrder({
side: 'buy',
symbol: 'BTC-USDT',
type: 'limit',
price: '1000', // Very high price to avoid accidental execution
size: '0.01',
});
console.log('Sync spot order response:', syncSpotOrderResponse);
} catch (e) {
console.log('Sync spot order error:', e);
}
// 3. Modify Spot Order (requires existing order ID)
try {
console.log('\n4. Testing modifySpotOrder...');
const modifyResponse = await wsClient.modifySpotOrder({
symbol: 'BTC-USDT',
orderId: '68cc3476693c1c00072ef1d9', // Replace with actual order ID
newPrice: '2000',
});
console.log('Modify spot order response:', modifyResponse);
} catch (e) {
console.log('Modify spot order error:', e);
}
// 4. Cancel Spot Order
try {
console.log('\n5. Testing cancelSpotOrder...');
const cancelSpotResponse = await wsClient.cancelSpotOrder({
symbol: 'BTC-USDT',
orderId: '68cc34c6693c1c0007301929', // Replace with actual order ID
});
console.log('Cancel spot order response:', cancelSpotResponse);
} catch (e) {
console.log('Cancel spot order error:', e);
}
// 5. Cancel Sync Spot Order
try {
console.log('\n6. Testing cancelSyncSpotOrder...');
const cancelSyncResponse = await wsClient.cancelSyncSpotOrder({
symbol: 'BTC-USDT',
orderId: '68cc3530b9870a0007670294', // Replace with actual client order ID
});
console.log('Cancel sync spot order response:', cancelSyncResponse);
} catch (e) {
console.log('Cancel sync spot order error:', e);
}
// 6. Submit Margin Order
try {
console.log('\n7. Testing submitMarginOrder...');
const marginOrderResponse = await wsClient.submitMarginOrder({
clientOid: 'margin-test-' + Date.now(),
side: 'buy',
symbol: 'BTC-USDT',
type: 'limit',
price: '19000', // Very low price to avoid accidental execution
size: '0.0001',
isIsolated: false, // false for cross margin, true for isolated
});
console.log('Margin order response:', marginOrderResponse);
} catch (e) {
console.log('Margin order error:', e);
}
// 7. Cancel Margin Order
try {
console.log('\n8. Testing cancelMarginOrder...');
const cancelMarginResponse = await wsClient.cancelMarginOrder({
symbol: 'BTC-USDT',
orderId: 'your-margin-order-id-here', // Replace with actual order ID
});
console.log('Cancel margin order response:', cancelMarginResponse);
} catch (e) {
console.log('Cancel margin order error:', e);
}
// 8. Submit Futures Order
try {
console.log('\n9. Testing submitFuturesOrder...');
const futuresOrderResponse = await wsClient.submitFuturesOrder({
clientOid: 'futures-test-' + Date.now(),
side: 'buy',
symbol: 'XBTUSDTM',
marginMode: 'CROSS',
type: 'limit',
price: '1000', // Very low price to avoid accidental execution
qty: '0.01',
leverage: 10,
positionSide: 'LONG', // needed if trading two-way (hedge) position mode
});
console.log('Futures order response:', futuresOrderResponse);
} catch (e) {
console.log('Futures order error:', e);
}
// 9. Cancel Futures Order
try {
console.log('\n10. Testing cancelFuturesOrder...');
const cancelFuturesResponse = await wsClient.cancelFuturesOrder({
symbol: 'XBTUSDTM',
orderId: '358196976308797441', // Replace with actual order ID
});
console.log('Cancel futures order response:', cancelFuturesResponse);
} catch (e) {
console.log('Cancel futures order error:', e);
}
// 10. Submit Multiple Futures Orders
try {
console.log('\n11. Testing submitMultipleFuturesOrders...');
const multiFuturesResponse = await wsClient.submitMultipleFuturesOrders([
{
clientOid: 'futures-test-1-' + Date.now(),
side: 'buy',
symbol: 'XBTUSDTM',
marginMode: 'CROSS',
type: 'limit',
price: '1000', // Very low price to avoid accidental execution
qty: '0.01',
leverage: 10,
positionSide: 'LONG', // Needed if trading hedge/two-way mode. Optional in one-way mode.
},
{
clientOid: 'futures-test-2-' + Date.now(),
side: 'buy',
symbol: 'XBTUSDTM',
marginMode: 'CROSS',
type: 'limit',
price: '1010', // Very low price to avoid accidental execution
qty: '0.01',
leverage: 10,
positionSide: 'LONG',
},
]);
console.log('Multiple futures orders response:', multiFuturesResponse);
} catch (e) {
console.log('Multiple futures orders error:', e);
}
// 11. Cancel Multiple Futures Orders
try {
console.log('\n12. Testing cancelMultipleFuturesOrders...');
const cancelMultiFuturesResponse =
await wsClient.cancelMultipleFuturesOrders({
orderIdsList: ['order-id-1', 'order-id-2'], // Replace with actual order IDs
});
console.log(
'Cancel multiple futures orders response:',
cancelMultiFuturesResponse,
);
} catch (e) {
console.log('Cancel multiple futures orders error:', e);
}
console.log('\nCompleted all WebSocket API examples!');
process.exit(1);
}
// Start executing the example workflow
main();
Endpoint Function Reference
Endpoint maps
Each REST client is a JavaScript class, which provides functions individually mapped to each endpoint available in the exchange's API offering.
The following table shows all methods available in each REST client, whether the method requires authentication (automatically handled if API keys are provided), as well as the exact endpoint each method is connected to.
This can be used to easily find which method to call, once you have found which endpoint you're looking to use.
All REST clients are in the src folder. For usage examples, make sure to check the examples folder.
List of clients:
If anything is missing or wrong, please open an issue or let us know in our Node.js Traders telegram group!
How to use table
Table consists of 4 parts:
- Function name
- AUTH
- HTTP Method
- Endpoint
Function name is the name of the function that can be called through the SDK. Check examples folder in the repo for more help on how to use them!
AUTH is a boolean value that indicates if the function requires authentication - which means you need to pass your API key and secret to the SDK.
HTTP Method shows HTTP method that the function uses to call the endpoint. Sometimes endpoints can have same URL, but different HTTP method so you can use this column to differentiate between them.
Endpoint is the URL that the function uses to call the endpoint. Best way to find exact function you need for the endpoint is to search for URL in this table and find corresponding function name.
SpotClient.ts
This table includes all endpoints from the official Exchange API docs and corresponding SDK functions for each endpoint that are found in SpotClient.ts.
| Function | AUTH | HTTP Method | Endpoint |
|---|---|---|---|
| getMyIp() | GET | api/v1/ip | |
| getServiceStatus() | GET | api/v1/status | |
| getAccountSummary() | 🔐 | GET | api/v2/user-info |
| getKYCRegions() | 🔐 | GET | api/kyc/regions/v4 |
| getApikeyInfo() | 🔐 | GET | api/v1/user/api-key |
| getUserType() | 🔐 | GET | api/v1/hf/accounts/opened |
| getBalances() | 🔐 | GET | api/v1/accounts |
| getAccountDetail() | 🔐 | GET | api/v1/accounts/{accountId} |
| getMarginBalance() | 🔐 | GET | api/v3/margin/accounts |
| getIsolatedMarginBalance() | 🔐 | GET | api/v3/isolated/accounts |
| getTransactions() | 🔐 | GET | api/v1/accounts/ledgers |
| getHFTransactions() | 🔐 | GET | api/v1/hf/accounts/ledgers |
| getHFMarginTransactions() | 🔐 | GET | api/v3/hf/margin/account/ledgers |
| createSubAccount() | 🔐 | POST | api/v2/sub/user/created |
| enableSubAccountMargin() | 🔐 | POST | api/v3/sub/user/margin/enable |
| enableSubAccountFutures() | 🔐 | POST | api/v3/sub/user/futures/enable |
| getSubAccountsV2() | 🔐 | GET | api/v2/sub/user |
| getSubAccountBalance() | 🔐 | GET | api/v1/sub-accounts/{subUserId} |
| getSubAccountBalancesV2() | 🔐 | GET | api/v2/sub-accounts |
| createSubAPI() | 🔐 | POST | api/v1/sub/api-key |
| updateSubAPI() | 🔐 | POST | api/v1/sub/api-key/update |
| getSubAPIs() | 🔐 | GET | api/v1/sub/api-key |
| deleteSubAPI() | 🔐 | DELETE | api/v1/sub/api-key |
| createDepositAddressV3() | 🔐 | POST | api/v3/deposit-address/create |
| getDepositAddressesV3() | 🔐 | GET | api/v3/deposit-addresses |
| getDeposits() | 🔐 | GET | api/v1/deposits |
| getWithdrawalQuotas() | 🔐 | GET | api/v1/withdrawals/quotas |
| submitWithdrawV3() | 🔐 | POST | api/v3/withdrawals |
| cancelWithdrawal() | 🔐 | DELETE | api/v1/withdrawals/{withdrawalId} |
| getWithdrawals() | 🔐 | GET | api/v1/withdrawals |
| getWithdrawalById() | 🔐 | GET | api/v1/withdrawals/{withdrawalId} |
| getTransferable() | 🔐 | GET | api/v1/accounts/transferable |
| submitFlexTransfer() | 🔐 | POST | api/v3/accounts/universal-transfer |
| getBasicUserFee() | 🔐 | GET | api/v1/base-fee |
| getTradingPairFee() | 🔐 | GET | api/v1/trade-fees |
| getAnnouncements() | GET | api/v3/announcements | |
| getCurrency() | GET | api/v3/currencies/{currency} | |
| getCurrencies() | GET | api/v3/currencies | |
| getSymbol() | GET | api/v2/symbols/{symbol} | |
| getSymbols() | GET | api/v2/symbols | |
| getTicker() | GET | api/v1/market/orderbook/level1 | |
| getTickers() | GET | api/v1/market/allTickers | |
| getTradeHistories() | GET | api/v1/market/histories | |
| getKlines() | GET | api/v1/market/candles | |
| getOrderBookLevel20() | GET | api/v1/market/orderbook/level2_20 | |
| getOrderBookLevel100() | GET | api/v1/market/orderbook/level2_100 | |
| getFullOrderBook() | 🔐 | GET | api/v3/market/orderbook/level2 |
| getCallAuctionPartOrderBook() | GET | api/v1/market/orderbook/callauction/level2_{size} | |
| getCallAuctionInfo() | GET | api/v1/market/callauctionData | |
| getFiatPrice() | GET | api/v1/prices | |
| get24hrStats() | GET | api/v1/market/stats | |
| getMarkets() | GET | api/v1/markets | |
| submitHFOrder() | 🔐 | POST | api/v1/hf/orders |
| submitHFOrderSync() | 🔐 | POST | api/v1/hf/orders/sync |
| submitHFOrderTest() | 🔐 | POST | api/v1/hf/orders/test |
| submitHFMultipleOrders() | 🔐 | POST | api/v1/hf/orders/multi |
| submitHFMultipleOrdersSync() | 🔐 | POST | api/v1/hf/orders/multi/sync |
| cancelHFOrder() | 🔐 | DELETE | api/v1/hf/orders/{orderId} |
| cancelHFOrderSync() | 🔐 | DELETE | api/v1/hf/orders/sync/{orderId} |
| cancelHFOrderByClientOId() | 🔐 | DELETE | api/v1/hf/orders/client-order/{clientOid} |
| cancelHFOrderSyncByClientOId() | 🔐 | DELETE | api/v1/hf/orders/sync/client-order/{clientOid} |
| cancelHFOrdersNumber() | 🔐 | DELETE | api/v1/hf/orders/cancel/{orderId} |
| cancelHFAllOrdersBySymbol() | 🔐 | DELETE | api/v1/hf/orders |
| cancelHFAllOrders() | 🔐 | DELETE | api/v1/hf/orders/cancelAll |
| updateHFOrder() | 🔐 | POST | api/v1/hf/orders/alter |
| getHFOrderDetailsByOrderId() | 🔐 | GET | api/v1/hf/orders/{orderId} |
| getHFOrderDetailsByClientOid() | 🔐 | GET | api/v1/hf/orders/client-order/{clientOid} |
| getHFActiveSymbols() | 🔐 | GET | api/v1/hf/orders/active/symbols |
| getHFActiveOrders() | 🔐 | GET | api/v1/hf/orders/active |
| getHFActiveOrdersPaginated() | 🔐 | GET | api/v1/hf/orders/active/page |
| getHFCompletedOrders() | 🔐 | GET | api/v1/hf/orders/done |
| getHFFilledOrders() | 🔐 | GET | api/v1/hf/fills |
| cancelHFOrderAutoSettingQuery() | 🔐 | GET | api/v1/hf/orders/dead-cancel-all/query |
| cancelHFOrderAutoSetting() | 🔐 | POST | api/v1/hf/orders/dead-cancel-all |
| submitStopOrder() | 🔐 | POST | api/v1/stop-order |
| cancelStopOrderByClientOid() | 🔐 | DELETE | api/v1/stop-order/cancelOrderByClientOid |
| cancelStopOrderById() | 🔐 | DELETE | api/v1/stop-order/{orderId} |
| cancelStopOrders() | 🔐 | DELETE | api/v1/stop-order/cancel |
| getStopOrders() | 🔐 | GET | api/v1/stop-order |
| getStopOrderByOrderId() | 🔐 | GET | api/v1/stop-order/{orderId} |
| getStopOrderByClientOid() | 🔐 | GET | api/v1/stop-order/queryOrderByClientOid |
| submitOCOOrder() | 🔐 | POST | api/v3/oco/order |
| cancelOCOOrderById() | 🔐 | DELETE | api/v3/oco/order/{orderId} |
| cancelOCOOrderByClientOid() | 🔐 | DELETE | api/v3/oco/client-order/{clientOid} |
| cancelMultipleOCOOrders() | 🔐 | DELETE | api/v3/oco/orders |
| getOCOOrderByOrderId() | 🔐 | GET | api/v3/oco/order/{orderId} |
| getOCOOrderByClientOid() | 🔐 | GET | api/v3/oco/client-order/{clientOid} |
| getOCOOrderDetails() | 🔐 | GET | api/v3/oco/order/details/{orderId} |
| getOCOOrders() | 🔐 | GET | api/v3/oco/orders |
| getMarginActivePairsV3() | 🔐 | GET | api/v3/margin/symbols |
| getMarginConfigInfo() | GET | api/v1/margin/config | |
| getMarginLeveragedToken() | 🔐 | GET | api/v3/etf/info |
| getMarginMarkPrices() | GET | api/v3/mark-price/all-symbols | |
| getMarginMarkPrice() | GET | api/v1/mark-price/{symbol}/current | |
| getIsolatedMarginSymbolsConfig() | 🔐 | GET | api/v1/isolated/symbols |
| getMarginCollateralRatio() | GET | api/v3/margin/collateralRatio | |
| getMarketAvailableInventory() | GET | api/v3/margin/available-inventory | |
| submitHFMarginOrder() | 🔐 | POST | api/v3/hf/margin/order |
| submitHFMarginOrderTest() | 🔐 | POST | api/v3/hf/margin/order/test |
| cancelHFMarginOrder() | 🔐 | DELETE | api/v3/hf/margin/orders/{orderId} |
| cancelHFMarginOrderByClientOid() | 🔐 | DELETE | api/v3/hf/margin/orders/client-order/{clientOid} |
| cancelHFAllMarginOrders() | 🔐 | DELETE | api/v3/hf/margin/orders |
| getHFMarginOpenSymbols() | 🔐 | GET | api/v3/hf/margin/order/active/symbols |
| getHFActiveMarginOrders() | 🔐 | GET | api/v3/hf/margin/orders/active |
| getHFMarginFilledOrders() | 🔐 | GET | api/v3/hf/margin/orders/done |
| getHFMarginFills() | 🔐 | GET | api/v3/hf/margin/fills |
| getHFMarginOrderByOrderId() | 🔐 | GET | api/v3/hf/margin/orders/{orderId} |
| getHFMarginOrderByClientOid() | 🔐 | GET | api/v3/hf/margin/orders/client-order/{clientOid}?symbol={symbol} |
| addMarginStopOrder() | 🔐 | POST | api/v3/hf/margin/stop-order |
| cancelMarginStopOrderByOrderId() | 🔐 | DELETE | api/v3/hf/margin/stop-order/cancel-by-id?orderId={orderId} |
| cancelMarginStopOrderByClientOid() | 🔐 | DELETE | api/v3/hf/margin/stop-order/cancel-by-clientOid |
| batchCancelMarginStopOrder() | 🔐 | DELETE | api/v3/hf/margin/stop-order/cancel |
| getMarginStopOrdersList() | 🔐 | GET | api/v3/hf/margin/stop-orders |
| getMarginStopOrderByOrderId() | 🔐 | GET | api/v3/hf/margin/stop-order/orderId?orderId={orderId} |
| getMarginStopOrderByClientOid() | 🔐 | GET | api/v3/hf/margin/stop-order/clientOid |
| addMarginOcoOrder() | 🔐 | POST | api/v3/hf/margin/oco-order |
| cancelMarginOcoOrderByOrderId() | 🔐 | DELETE | api/v3/hf/margin/oco-order/cancel-by-id?orderId={orderId} |
| cancelMarginOcoOrderByClientOid() | 🔐 | DELETE | api/v3/hf/margin/oco-order/cancel-by-clientOid |
| batchCancelMarginOcoOrders() | 🔐 | DELETE | api/v3/hf/margin/oco-order/cancel |
| getMarginOcoOrderByClientOid() | 🔐 | GET | api/v3/hf/margin/oco-order/clientOid |
| getMarginOcoOrderDetailByOrderId() | 🔐 | GET | api/v3/hf/margin/oco-order/detail/orderId?orderId={orderId} |
| getBorrowInterestRate() | 🔐 | GET | api/v3/margin/borrowRate |
| marginBorrowV3() | 🔐 | POST | api/v3/margin/borrow |
| getMarginBorrowHistoryV3() | 🔐 | GET | api/v3/margin/borrow |
| marginRepayV3() | 🔐 | POST | api/v3/margin/repay |
| getMarginRepayHistoryV3() | 🔐 | GET | api/v3/margin/repay |
| getMarginInterestRecordsV3() | 🔐 | GET | api/v3/margin/interest |
| updateMarginLeverageV3() | 🔐 | POST | api/v3/position/update-user-leverage |
| getLendingCurrencyV3() | GET | api/v3/project/list | |
| getLendingInterestRateV3() | GET | api/v3/project/marketInterestRate | |
| submitLendingSubscriptionV3() | 🔐 | POST | api/v3/purchase |
| updateLendingSubscriptionOrdersV3() | 🔐 | POST | api/v3/lend/purchase/update |
| getLendingSubscriptionOrdersV3() | 🔐 | GET | api/v3/purchase/orders |
| submitLendingRedemptionV3() | 🔐 | POST | api/v3/redeem |
| getLendingRedemptionOrdersV3() | 🔐 | GET | api/v3/redeem/orders |
| getMarginRiskLimitConfig() | 🔐 | GET | api/v3/margin/currencies |
| getConvertSymbol() | GET | api/v1/convert/symbol | |
| getConvertCurrencies() | GET | api/v1/convert/currencies | |
| submitConvertOrder() | 🔐 | POST | api/v1/convert/order |
| getConvertQuote() | 🔐 | GET | api/v1/convert/quote |
| getConvertOrder() | 🔐 | GET | api/v1/convert/order/detail |
| getConvertOrderHistory() | 🔐 | GET | api/v1/convert/order/history |
| submitConvertLimitOrder() | 🔐 | POST | api/v1/convert/limit/order |
| getConvertLimitQuote() | 🔐 | GET | api/v1/convert/limit/quote |
| getConvertLimitOrder() | 🔐 | GET | api/v1/convert/limit/order/detail |
| getConvertLimitOrders() | 🔐 | GET | api/v1/convert/limit/orders |
| cancelConvertLimitOrder() | 🔐 | DELETE | api/v1/convert/limit/order/cancel |
| subscribeEarnFixedIncome() | 🔐 | POST | api/v1/earn/orders |
| getEarnRedeemPreview() | 🔐 | GET | api/v1/earn/redeem-preview |
| submitRedemption() | 🔐 | DELETE | api/v1/earn/orders |
| getEarnSavingsProducts() | 🔐 | GET | api/v1/earn/saving/products |
| getEarnPromotionProducts() | 🔐 | GET | api/v1/earn/promotion/products |
| getEarnFixedIncomeHoldAssets() | 🔐 | GET | api/v1/earn/hold-assets |
| getEarnStakingProducts() | 🔐 | GET | api/v1/earn/staking/products |
| getEarnKcsStakingProducts() | 🔐 | GET | api/v1/earn/kcs-staking/products |
| getEarnEthStakingProducts() | 🔐 | GET | api/v1/earn/eth-staking/products |
| submitStructuredProductPurchase() | 🔐 | POST | api/v1/struct-earn/orders |
| getDualInvestmentProducts() | GET | api/v1/struct-earn/dual/products | |
| getStructuredProductOrders() | 🔐 | GET | api/v1/struct-earn/orders |
| getDiscountRateConfigs() | 🔐 | GET | api/v1/otc-loan/discount-rate-configs |
| getOtcLoan() | 🔐 | GET | api/v1/otc-loan/loan |
| getOtcLoanAccounts() | 🔐 | GET | api/v1/otc-loan/accounts |
| getAffiliateUserRebateInfo() | 🔐 | GET | api/v2/affiliate/inviter/statistics |
| getAffiliateInvitees() | 🔐 | GET | api/v2/affiliate/queryInvitees |
| getAffiliateCommission() | 🔐 | GET | api/v2/affiliate/queryMyCommission |
| getAffiliateTradeHistory() | 🔐 | GET | api/v2/affiliate/queryTransactionByUid |
| getAffiliateTransaction() | 🔐 | GET | api/v2/affiliate/queryTransactionByTime |
| getKumining() | 🔐 | GET | api/v2/affiliate/queryKumining |
| getBrokerRebateOrderDownloadLink() | 🔐 | GET | api/v1/broker/api/rebase/download |
| getBrokerRebateOrderDownloadLinkV2() | 🔐 | GET | api/v2/broker/api/rebase/download |
| getPublicWSConnectionToken() | POST | api/v1/bullet-public | |
| getPrivateWSConnectionToken() | 🔐 | POST | api/v1/bullet-private |
| getPrivateWSConnectionTokenV2() | 🔐 | POST | api/v2/bullet-private |
| getSubAccountsV1() | 🔐 | GET | api/v1/sub/user |
| getSubAccountBalancesV1() | 🔐 | GET | api/v1/sub-accounts |
| getMarginBalances() | 🔐 | GET | api/v1/margin/account |
| createDepositAddress() | 🔐 | POST | api/v1/deposit-addresses |
| getDepositAddressesV2() | 🔐 | GET | api/v2/deposit-addresses |
| getDepositAddressV1() | 🔐 | GET | api/v1/deposit-addresses |
| getHistoricalDepositsV1() | 🔐 | GET | api/v1/hist-deposits |
| getHistoricalWithdrawalsV1() | 🔐 | GET | api/v1/hist-withdrawals |
| submitWithdraw() | 🔐 | POST | api/v1/withdrawals |
| submitTransferMasterSub() | 🔐 | POST | api/v2/accounts/sub-transfer |
| submitInnerTransfer() | 🔐 | POST | api/v2/accounts/inner-transfer |
| submitOrder() | 🔐 | POST | api/v1/orders |
| submitOrderTest() | 🔐 | POST | api/v1/orders/test |
| submitMultipleOrders() | 🔐 | POST | api/v1/orders/multi |
| cancelOrderById() | 🔐 | DELETE | api/v1/orders/{orderId} |
| cancelOrderByClientOid() | 🔐 | DELETE | api/v1/order/client-order/{clientOid} |
| cancelAllOrders() | 🔐 | DELETE | api/v1/orders |
| getOrders() | 🔐 | GET | api/v1/orders |
| getRecentOrders() | 🔐 | GET | api/v1/limit/orders |
| getOrderByOrderId() | 🔐 | GET | api/v1/orders/{orderId} |
| getOrderByClientOid() | 🔐 | GET | api/v1/order/client-order/{clientOid} |
| getFills() | 🔐 | GET | api/v1/fills |
| getRecentFills() | 🔐 | GET | api/v1/limit/fills |
| submitMarginOrder() | 🔐 | POST | api/v1/margin/order |
| submitMarginOrderTest() | 🔐 | POST | api/v1/margin/order/test |
| getIsolatedMarginAccounts() | 🔐 | GET | api/v1/isolated/accounts |
| getIsolatedMarginAccount() | 🔐 | GET | api/v1/isolated/account/{symbol} |
FuturesClient.ts
This table includes all endpoints from the official Exchange API docs and corresponding SDK functions for each endpoint that are found in FuturesClient.ts.
| Function | AUTH | HTTP Method | Endpoint |
|---|---|---|---|
| getBalance() | 🔐 | GET | api/v1/account-overview |
| getTransactions() | 🔐 | GET | api/v1/transaction-history |
| getSubBalances() | 🔐 | GET | api/v1/account-overview-all |
| getTradingPairFee() | 🔐 | GET | api/v1/trade-fees |
| getSymbol() | GET | api/v1/contracts/{symbol} | |
| getSymbols() | GET | api/v1/contracts/active | |
| getTicker() | GET | api/v1/ticker | |
| getTickers() | GET | api/v1/allTickers | |
| getFullOrderBookLevel2() | GET | api/v1/level2/snapshot | |
| getPartOrderBookLevel2Depth20() | GET | api/v1/level2/depth20 | |
| getPartOrderBookLevel2Depth100() | GET | api/v1/level2/depth100 | |
| getMarketTrades() | GET | api/v1/trade/history | |
| getKlines() | GET | api/v1/kline/query | |
| getMarkPrice() | GET | api/v1/mark-price/{symbol}/current | |
| getIndex() | GET | api/v1/index/query | |
| getInterestRates() | GET | api/v1/interest/query | |
| getPremiumIndex() | GET | api/v1/premium/query | |
| get24HourTransactionVolume() | GET | api/v1/trade-statistics | |
| getServiceStatus() | GET | api/v1/status | |
| submitOrder() | 🔐 | POST | api/v1/orders |
| submitNewOrderTest() | 🔐 | POST | api/v1/orders/test |
| submitMultipleOrders() | 🔐 | POST | api/v1/orders/multi |
| submitSLTPOrder() | 🔐 | POST | api/v1/st-orders |
| cancelOrderById() | 🔐 | DELETE | api/v1/orders/{orderId} |
| cancelOrderByClientOid() | 🔐 | DELETE | api/v1/orders/client-order/{clientOid} |
| batchCancelOrders() | 🔐 | DELETE | api/v1/orders/multi-cancel |
| cancelAllOrdersV3() | 🔐 | DELETE | api/v3/orders |
| cancelAllStopOrders() | 🔐 | DELETE | api/v1/stopOrders |
| getOrderByOrderId() | 🔐 | GET | api/v1/orders/{orderId} |
| getOrderByClientOrderId() | 🔐 | GET | api/v1/orders/byClientOid |
| getOrders() | 🔐 | GET | api/v1/orders |
| getRecentOrders() | 🔐 | GET | api/v1/recentDoneOrders |
| getStopOrders() | 🔐 | GET | api/v1/stopOrders |
| getOpenOrderStatistics() | 🔐 | GET | api/v1/openOrderStatistics |
| getRecentFills() | 🔐 | GET | api/v1/recentFills |
| getFills() | 🔐 | GET | api/v1/fills |
| getMarginMode() | 🔐 | GET | api/v2/position/getMarginMode |
| updateMarginMode() | 🔐 | POST | api/v2/position/changeMarginMode |
| batchSwitchMarginMode() | 🔐 | POST | api/v2/position/batchChangeMarginMode |
| getMaxOpenSize() | 🔐 | GET | api/v2/getMaxOpenSize |
| getPosition() | 🔐 | GET | api/v1/position |
| getPositionV2() | 🔐 | GET | api/v2/position |
| getPositions() | 🔐 | GET | api/v1/positions |
| getHistoryPositions() | 🔐 | GET | api/v1/history-positions |
| getMaxWithdrawMargin() | 🔐 | GET | api/v1/margin/maxWithdrawMargin |
| getCrossMarginLeverage() | 🔐 | GET | api/v2/getCrossUserLeverage |
| changeCrossMarginLeverage() | 🔐 | POST | api/v2/changeCrossUserLeverage |
| depositMargin() | 🔐 | POST | api/v1/position/margin/deposit-margin |
| getCrossMarginRiskLimit() | 🔐 | GET | api/v2/batchGetCrossOrderLimit |
| withdrawMargin() | 🔐 | POST | api/v1/margin/withdrawMargin |
| getCrossMarginRequirement() | 🔐 | GET | api/v2/getCrossModeMarginRequirement |
| getRiskLimitLevel() | 🔐 | GET | api/v1/contracts/risk-limit/{symbol} |
| updateRiskLimitLevel() | 🔐 | POST | api/v1/position/risk-limit-level/change |
| getPositionMode() | 🔐 | GET | api/v2/position/getPositionMode |
| updatePositionMode() | 🔐 | POST | api/v2/position/switchPositionMode |
| getFundingRate() | 🔐 | GET | api/v1/funding-rate/{symbol}/current |
| getFundingRates() | 🔐 | GET | api/v1/contract/funding-rates |
| getFundingHistory() | 🔐 | GET | api/v1/funding-history |
| submitCopyTradeOrder() | 🔐 | POST | api/v1/copy-trade/futures/orders |
| submitCopyTradeOrderTest() | 🔐 | POST | api/v1/copy-trade/futures/orders/test |
| submitCopyTradeSLTPOrder() | 🔐 | POST | api/v1/copy-trade/futures/st-orders |
| cancelCopyTradeOrderById() | 🔐 | DELETE | api/v1/copy-trade/futures/orders |
| cancelCopyTradeOrderByClientOid() | 🔐 | DELETE | api/v1/copy-trade/futures/orders/client-order |
| getCopyTradeMaxOpenSize() | 🔐 | GET | api/v1/copy-trade/futures/get-max-open-size |
| getCopyTradeMaxWithdrawMargin() | 🔐 | GET | api/v1/copy-trade/futures/position/margin/max-withdraw-margin |
| addCopyTradeIsolatedMargin() | 🔐 | POST | api/v1/copy-trade/futures/position/margin/deposit-margin |
| removeCopyTradeIsolatedMargin() | 🔐 | POST | api/v1/copy-trade/futures/position/margin/withdraw-margin |
| modifyCopyTradeRiskLimitLevel() | 🔐 | POST | api/v1/copy-trade/futures/position/risk-limit-level/change |
| updateCopyTradeAutoDepositStatus() | 🔐 | POST | api/v1/copy-trade/futures/position/margin/auto-deposit-status |
| switchCopyTradeMarginMode() | 🔐 | POST | api/v1/copy-trade/futures/position/changeMarginMode |
| updateCopyTradeCrossMarginLeverage() | 🔐 | POST | api/v2/copy-trade/futures/changeCrossUserLeverage |
| getCopyTradeCrossMarginRequirement() | 🔐 | POST | api/v2/copy-trade/getCrossModeMarginRequirement |
| switchCopyTradePositionMode() | 🔐 | POST | api/v2/copy-trade/position/switchPositionMode |
| getBrokerRebateOrderDownloadLink() | 🔐 | GET | api/v1/broker/api/rebase/download |
| getBrokerRebateOrderDownloadLinkV2() | 🔐 | GET | api/v2/broker/api/rebase/download |
| getPublicWSConnectionToken() | POST | api/v1/bullet-public | |
| getPrivateWSConnectionToken() | 🔐 | POST | api/v1/bullet-private |
| getPrivateWSConnectionTokenV2() | 🔐 | POST | api/v2/bullet-private |
| submitTransferOut() | 🔐 | POST | api/v3/transfer-out |
| submitTransferIn() | 🔐 | POST | api/v1/transfer-in |
| getTransfers() | 🔐 | GET | api/v1/transfer-list |
| updateAutoDepositStatus() | 🔐 | POST | api/v1/position/margin/auto-deposit-status |
WebsocketAPIClient.ts
This table includes all endpoints from the official Exchange API docs and corresponding SDK functions for each endpoint that are found in WebsocketAPIClient.ts.
| Function | AUTH | HTTP Method | Endpoint |
|---|---|---|---|
| submitNewSpotOrder() | 🔐 | WS | spot.order |
| modifySpotOrder() | 🔐 | WS | spot.modify |
| cancelSpotOrder() | 🔐 | WS | spot.cancel |
| submitSyncSpotOrder() | 🔐 | WS | spot.sync_order |
| cancelSyncSpotOrder() | 🔐 | WS | spot.sync_cancel |
| submitMarginOrder() | 🔐 | WS | margin.order |
| cancelMarginOrder() | 🔐 | WS | margin.cancel |
| submitFuturesOrder() | 🔐 | WS | futures.order |
| cancelFuturesOrder() | 🔐 | WS | futures.cancel |
| submitMultipleFuturesOrders() | 🔐 | WS | futures.multi_order |
| cancelMultipleFuturesOrders() | 🔐 | WS | futures.multi_cancel |
UnifiedAPIClient.ts
This table includes all endpoints from the official Exchange API docs and corresponding SDK functions for each endpoint that are found in UnifiedAPIClient.ts.
| Function | AUTH | HTTP Method | Endpoint |
|---|---|---|---|
| getAnnouncements() | GET | api/ua/v1/market/announcement | |
| getCurrency() | GET | api/ua/v1/market/currency | |
| getThirdPartyCustodyCurrencies() | GET | api/ua/v1/oes/currency | |
| getSymbols() | GET | api/ua/v1/market/instrument | |
| getTickers() | GET | api/ua/v1/market/ticker | |
| getTrades() | GET | api/ua/v1/market/trade | |
| getOrderBook() | GET | api/ua/v1/market/orderbook | |
| getKlines() | GET | api/ua/v1/market/kline | |
| getCurrentFundingRate() | GET | api/ua/v1/market/funding-rate | |
| getHistoryFundingRate() | GET | api/ua/v1/market/funding-rate-history | |
| getCrossMarginConfig() | GET | api/ua/v1/market/cross-config | |
| getBorrowableCurrencies() | GET | api/ua/v1/market/borrowable-currency | |
| getServiceStatus() | GET | api/ua/v1/server/status | |
| getClassicAccount() | 🔐 | GET | api/ua/v1/account/balance |
| getAccount() | 🔐 | GET | api/ua/v1/unified/account/balance |
| getAccountOverview() | 🔐 | GET | api/ua/v1/unified/account/overview |
| getSubAccount() | 🔐 | GET | api/ua/v1/sub-account/balance |
| getTransferQuotas() | 🔐 | GET | api/ua/v1/account/transfer-quota |
| flexTransfer() | 🔐 | POST | api/ua/v1/account/transfer |
| setSubAccountTransferPermission() | 🔐 | POST | api/ua/v1/sub-account/canTransferOut |
| getAccountMode() | 🔐 | GET | api/ua/v1/account/mode |
| setAccountMode() | 🔐 | POST | api/ua/v1/account/mode |
| getFeeRate() | 🔐 | GET | api/ua/v1/user/fee-rate |
| getAccountLedger() | 🔐 | GET | api/ua/v1/account/ledger |
| getInterestHistory() | 🔐 | GET | api/ua/v1/account/interest-history |
| getBorrowingRatesAndLimits() | 🔐 | GET | api/ua/v1/account/interest-limits |
| modifyLeverage() | 🔐 | POST | api/ua/v1/unified/account/modify-leverage |
| modifyMarginCrossLeverage() | 🔐 | POST | api/ua/v1/{accountMode}/account/modify-leverage-margin-cross |
| getLeverage() | 🔐 | GET | api/ua/v1/unified/account/leverage |
| getDepositAddress() | 🔐 | GET | api/ua/v1/asset/deposit/address |
| getThirdPartyCustodyQuota() | 🔐 | GET | api/ua/v1/oes/custody-quota |
| placeOrder() | 🔐 | GET | api/ua/v1/{accountMode}/order/detail |
| batchPlaceOrder() | 🔐 | GET | api/ua/v1/{accountMode}/order/detail |
| getOrderDetails() | 🔐 | GET | api/ua/v1/{accountMode}/order/detail |
| getOpenOrderList() | 🔐 | GET | api/ua/v1/{accountMode}/order/open-list |
| getOrderHistory() | 🔐 | GET | api/ua/v1/{accountMode}/order/history |
| getTradeHistory() | 🔐 | GET | api/ua/v1/{accountMode}/order/execution |
| cancelOrder() | 🔐 | POST | api/ua/v1/unified/order/cancel-all |
| batchCancelOrders() | 🔐 | POST | api/ua/v1/unified/order/cancel-all |
| batchCancelOrdersBySymbol() | 🔐 | POST | api/ua/v1/unified/order/cancel-all |
| setDCP() | 🔐 | POST | api/ua/v1/dcp/set |
| getDCP() | 🔐 | GET | api/ua/v1/dcp/query |
| getPositionList() | 🔐 | GET | api/ua/v1/unified/position/open-list |
| getPositionsHistory() | 🔐 | GET | api/ua/v1/position/history |
| getPrivateFundingFeeHistory() | 🔐 | GET | api/ua/v1/position/funding-history |
| getAccountPositionTiers() | 🔐 | GET | api/ua/v1/{accountMode}/position/tiers |
Source: View endpoint map source
KuCoin TypeScript FAQ
What does the KuCoin TypeScript SDK cover?
KuCoin supports Spot, Margin, Futures, Lending, and WebSockets workflows. The TypeScript guide covers the main REST and WebSocket integration patterns.
How do I authenticate private KuCoin API calls in TypeScript?
Install kucoin-api from npm & pass API credentials into the SDK client options, as shown in the KuCoin TypeScript examples above. The SDK handles the exchange-specific signing requirements for private requests.
Does the KuCoin TypeScript SDK help with WebSocket connection management?
Yes. Use the SDK WebSocket client for subscriptions, reconnect handling, and stream lifecycle management instead of building raw socket flows yourself.
Where should I start on the KuCoin TypeScript page: REST or WebSocket?
Start with the REST quick start for installation, authentication, and request and response flows. Move to the WebSocket example when you need streaming market or account updates.
Direct Example Files
Open the example files for typed patterns that translate well into shared interfaces, services, and stricter application code.
- KuCoin REST API example file (Kucoin/Rest/rest-futures-orders-guide.ts)
- KuCoin WebSocket example file (Kucoin/WebSockets/ws-spot-private.ts)
- KuCoin WebSocket API example file (Kucoin/WebSockets/WS-API/ws-api-client.ts)