Gate JavaScript SDK
Build with the Gate REST API & WebSockets with our JavaScript SDK, TypeScript-first package declarations, and Node.js-compatible runtime patterns. Discover installation, common examples, a detailed endpoint-to-function map, and the REST API/WebSocket patterns shared across our Siebly SDK family.
Use the same TypeScript-first REST API and WebSocket clients from plain JavaScript or TypeScript in Node.js-compatible runtimes.
Package surfaces
Explore the following API capabilities are covered by our Gate SDK:
- Spot
- Futures
- WebSockets
- WebSocket clients with:
- Built-in heartbeats.
- Automatic reconnection.
- Automatic reauthentication and resubscribe where the exchange supports it.
- Typed requests and responses for Node.js, JavaScript, and TypeScript IDEs.
- Framework-neutral JavaScript snippets that stay approachable in Node.js-compatible runtimes.
- TypeScript-first package declarations for stricter services, shared libraries, and editor-assisted integrations.
Install Gate SDK
# Via your favourite package manager, e.g. npm:
npm install gateio-api
# or pnpm:
pnpm install gateio-api
# or yarn:
yarn add gateio-apiQuickstart Examples with the Gate JavaScript SDK
Get started with just a few lines of JavaScript. TypeScript, while not required, is absolutely recommended. TypeScript declarations are included with all our SDKs and provide convenient definitions on request & response fields, WebSocket payloads, and generally safer integrations.
REST walkthrough
Easily start calling Gate's futures REST APIs in JavaScript.
- Install the Gate.com (previously Gate.io) JavaScript SDK via NPM:
npm install gateio-api. - Import the RestClient class (REST API wrapper for Gate's APIs).
- Create an authenticated RestClient instance with your API credentials.
- Call REST API methods as functions and await the promise containing the response.
In this example, we:
- Create both a REST client and authenticated WebSocket client.
- Subscribe to private futures balance and user trade topics.
- Query futures account balance for
usdtsettlement. - Calculate 50% of available balance and submit a market futures order on
BTC_USDT. - Log API and stream responses for visibility.
This setup demonstrates a practical flow where private WebSocket subscriptions provide live account updates while REST handles account queries and order submission.
For a full map of available REST API methods, check out the endpoint reference below.
/** * This example demonstrates a simple commented workflow of: * - initialising the RestClient and WebsocketClient for Gate.io exchange * - connecting to an accountโs private websockets (to receive updates asynchronously) * - checking if connection is successful * - fetching available futures balance * - placing an order using 50% of the available balance **/import { RestClient, WebsocketClient } from 'gateio-api'; // Define the account object with API key and secretconst account = { // Replace 'yourApiHere' with your actual API key or use environment variables key: process.env.API_KEY || 'yourApiHere', // Replace 'yourSecretHere' with your actual API secret or use environment variables secret: process.env.API_SECRET || 'yourSecretHere',}; // Initialize the RestClient with the API credentialsconst gateRestClient = new RestClient({ apiKey: account.key, apiSecret: account.secret,}); // initialise websocket client - if you want only public data, you can initialise the client without the apiKey and apiSecret, just WebsocketClient()const gateWSClient = new WebsocketClient({ apiKey: account.key, apiSecret: account.secret,}); // Data receivedgateWSClient.on('update', (data) => { console.info('data received: ', JSON.stringify(data));}); async function subscribePrivateWs() { try { // Enter your user ID here const myUserID = '20011'; //sub to balances updates const userBalances = { topic: 'futures.balances', payload: [myUserID], }; //sub to trades updates const userTrades = { topic: 'futures.usertrades', payload: [myUserID, '!all'], }; /** * Either send one topic (with params) at a time */ // client.subscribe({ // topic: 'futures.usertrades', // payload: [myUserID, '!all'], // }, 'perpFuturesUSDTV4'); /** * Or send multiple topics in a batch (grouped by ws connection (WsKey)) * You can also use strings for topics that don't have any parameters, even if you mix multiple requests into one function call: */ gateWSClient.subscribe([userBalances, userTrades], 'perpFuturesUSDTV4'); return true; } catch (e) { console.error('Req error: ', e); throw e; }} async function main() { try { await subscribePrivateWs(); console.log('Subscribed to privateWs topics!'); // Get futures account balance via REST const balances = await gateRestClient.getFuturesAccount({ settle: 'usdt' }); // total usdt balance // const usdtBalance = Number(balances.total); // available usdt balance const availableBalance = Number(balances.available); // submit market order with 50% of the balance const orderAmount = availableBalance * 0.5; // Submit a market order with 50% of the balance const marketOrder = await gateRestClient.submitFuturesOrder({ settle: 'usdt', // Specify the settlement currency contract: 'BTC_USDT', // Specify the contract size: orderAmount, // Order size: positive for long, negative for short, in USDT price: '0', // Market order, so price is set to '0' tif: 'ioc', // Time in force: 'ioc' (Immediate Or Cancel) }); console.log('Order submitted:', marketOrder); } catch (e) { console.error(e); throw e; }} main(); // for more detailed ws connection, you can use a lot more listeners like below: gateWSClient.on('open', (data) => { console.log('connected ', data?.wsKey);}); // Something happened, attempting to reconnectgateWSClient.on('reconnect', (data) => { console.log('reconnect: ', data);}); // Reconnect successfulgateWSClient.on('reconnected', (data) => { console.log('reconnected: ', data);}); // Connection closed. If unexpected, expect reconnect -> reconnected.gateWSClient.on('close', (data) => { console.error('close: ', data);}); // Reply to a request, e.g. "subscribe"/"unsubscribe"/"authenticate"gateWSClient.on('response', (data) => { console.info('server reply: ', JSON.stringify(data), '\n');}); gateWSClient.on('exception', (data) => { console.error('exception: ', data);}); gateWSClient.on('authenticated', (data) => { console.error('authenticated: ', data);});WebSocket walkthrough
Connecting to Gate's private spot WebSocket streams is straightforward with the WebsocketClient.
- Install the Gate JavaScript SDK via NPM:
npm install gateio-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,authenticated, andexception. - Subscribe to private spot topics and process incoming updates in real time.
In this example, we:
- Subscribe to private spot topics including balances, orders, user trades, and price orders.
- Demonstrate both single-topic and batched multi-topic subscription patterns.
- Show that duplicate subscriptions are filtered by the client.
This setup lets you track account-level spot activity without polling REST endpoints.
/* eslint-disable @typescript-eslint/no-unused-vars */import { LogParams, WebsocketClient, WsTopicRequest } from 'gateio-api'; // eslint-disable-next-line @typescript-eslint/no-unused-varsconst account = { key: process.env.API_KEY || 'apiKeyHere', secret: process.env.API_SECRET || 'apiSecretHere',}; // Define a custom logger object to handle logging at different levelsconst customLogger = { // Trace level logging: used for detailed debugging information trace: (...params: LogParams): void => { // Uncomment the line below to enable trace logging // console.log(new Date(), 'trace', ...params); }, // Info level logging: used for general informational messages info: (...params: LogParams): void => { console.log(new Date(), 'info', ...params); }, // Error level logging: used for error messages error: (...params: LogParams): void => { console.error(new Date(), 'error', ...params); },}; async function start() { const client = new WebsocketClient( { apiKey: account.key, apiSecret: account.secret, }, customLogger, ); // console.log('auth with: ', account); client.on('open', (data) => { console.log('connected ', data?.wsKey); }); // Data received client.on('update', (data) => { console.info('data received: ', JSON.stringify(data)); }); // Something happened, attempting to reconnect 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('server reply: ', JSON.stringify(data), '\n'); }); client.on('exception', (data) => { console.error('exception: ', data); }); client.on('authenticated', (data) => { console.error('authenticated: ', data); }); try { // client.subscribe(topics, 'spotV4'); const topicWithoutParamsAsString = 'spot.balances'; // This has the same effect as above, it's just a different way of messaging which topic this is for // const topicWithoutParamsAsObject: WsTopicRequest = { // topic: 'spot.balances', // }; const userOrders: WsTopicRequest = { topic: 'spot.orders', payload: ['BTC_USDT', 'ETH_USDT', 'MATIC_USDT'], }; const userTrades: WsTopicRequest = { topic: 'spot.usertrades', payload: ['BTC_USDT', 'ETH_USDT', 'MATIC_USDT'], }; const userPriceOrders: WsTopicRequest = { topic: 'spot.priceorders', payload: ['!all'], }; /** * Either send one topic (with optional params) at a time */ // client.subscribe(topicWithoutParamsAsObject, 'spotV4'); /** * Or send multiple topics in a batch (grouped by ws connection (WsKey)) * You can also use strings for topics that don't have any parameters, even if you mix multiple requests into one function call: */ client.subscribe( [topicWithoutParamsAsString, userOrders, userTrades, userPriceOrders], 'spotV4', ); /** * You can also subscribe in separate function calls as you wish. * * Any duplicate requests should get filtered out (e.g. here we subscribed to "spot.balances" twice, but the WS client will filter this out) */ client.subscribe( [ 'spot.balances', 'spot.margin_balances', 'spot.funding_balances', 'spot.cross_balances', ], 'spotV4', ); } catch (e) { console.error('Req error: ', e); }} start();WebSocket API walkthrough
Gate's WebSocket API (WS-API) lets you send trading commands over a persistent authenticated WebSocket connection, reducing request 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 Gate JavaScript SDK via NPM:
npm install gateio-api. - Import the dedicated WebsocketAPIClient.
- Create an authenticated WebsocketAPIClient instance with your API credentials.
- Optionally pre-authenticate with
connectWSAPI()to avoid cold-start latency. - Call dedicated WS-API methods and await their responses.
In this example, we:
- Run spot WS-API commands for placing, cancelling, amending, and querying orders.
- Run futures WS-API commands for placing, batch placing, cancelling, amending, listing, and checking order status.
- Use
WS_KEY_MAP.perpFuturesUSDTV4to route futures requests to the correct futures WS connection group.
Note that:
- Different futures product groups use different WS keys.
- Results are logged per operation with shared error handling around the full workflow.
import { WebsocketAPIClient, WS_KEY_MAP } from 'gateio-api'; const account = { key: process.env.API_KEY || 'insert_key_here', secret: process.env.API_SECRET || 'insert_secret_here',}; async function start() { const client = new WebsocketAPIClient({ apiKey: account.key, apiSecret: account.secret, reauthWSAPIOnReconnect: true, }); try { /** * Optional: authenticate in advance. This will prepare and authenticate a connection. * Useful to save time for the first request but completely optional. It will also happen automatically when you make your first request. */ // console.log(new Date(), 'Authenticating in advance...'); // await client.getWSClient().connectWSAPI('spotV4'); // console.log(new Date(), 'Authenticating in advance...OK!'); /* ============ SPOT TRADING EXAMPLES ============ */ // SPOT ORDER PLACE - Submit a new spot order const newOrder = await client.submitNewSpotOrder({ text: 't-my-custom-id', currency_pair: 'BTC_USDT', type: 'limit', account: 'spot', side: 'buy', amount: '1', price: '10000', }); console.log(new Date(), 'Result of the order:', newOrder.data); // SPOT ORDER CANCEL - Cancel a specific spot order const cancelOrder = await client.cancelSpotOrder({ order_id: '1700664330', currency_pair: 'BTC_USDT', account: 'spot', }); console.log(new Date(), 'Cancel order result:', cancelOrder.data); // SPOT ORDER CANCEL BY IDS - Cancel orders by ID list const cancelOrdersByIds = await client.cancelSpotOrderById([ { currency_pair: 'BTC_USDT', id: '1700664343', account: 'spot', }, ]); console.log( new Date(), 'Cancel orders by IDs result:', cancelOrdersByIds.data, ); // SPOT ORDER CANCEL BY CURRENCY PAIR - Cancel all orders for a currency pair const cancelOrdersByCurrencyPair = await client.cancelSpotOrderForSymbol({ currency_pair: 'BTC_USDT', side: 'buy', account: 'spot', }); console.log( new Date(), 'Cancel orders by currency pair result:', cancelOrdersByCurrencyPair.data, ); // SPOT ORDER AMEND - Update an existing spot order const amendOrder = await client.updateSpotOrder({ order_id: '1700664330', currency_pair: 'BTC_USDT', price: '12000', amount: '0.002', amend_text: 'price-update', }); console.log(new Date(), 'Amend order result:', amendOrder.data); // SPOT ORDER STATUS - Get status of a specific spot order const orderStatus = await client.getSpotOrderStatus({ order_id: '1700664330', currency_pair: 'BTC_USDT', account: 'spot', }); console.log(new Date(), 'Order status result:', orderStatus.data); // SPOT ORDER LIST - Get list of spot orders const getOrders = await client.getSpotOrders({ currency_pair: 'BTC_USDT', status: 'open', page: 1, limit: 10, account: 'spot', side: 'buy', }); console.log(new Date(), 'Result of the orders:', getOrders.data); /* ============ FUTURES TRADING EXAMPLES ============ */ /** * Gate has different websocket groups depending on the futures product. * * This affects which connection your command is sent to, so make sure to pass one matching your request. Look at WS_KEY_MAP (or the examples below) for details on the available product groups. */ const FUTURES_CONNECTION_GROUP_WS_KEY = WS_KEY_MAP.perpFuturesUSDTV4; /** * Also optional, as for spot. Keep in mind the first parameter (wsKey) might vary depending on which WS URL is needed. */ // console.log(new Date(), 'Authenticating in advance...'); // await client.getWSClient().connectWSAPI(futuresConnectionGroup); // await client.getWSClient().connectWSAPI('perpFuturesUSDTV4'); // await client.getWSClient().connectWSAPI('perpFuturesBTCV4'); // await client.getWSClient().connectWSAPI('deliveryFuturesUSDTV4'); // await client.getWSClient().connectWSAPI('perpFuturesBTCV4'); // console.log(new Date(), 'Authenticating in advance...OK!'); // FUTURES ORDER PLACE - Submit a new futures order const newFuturesOrder = await client.submitNewFuturesOrder( { contract: 'BTC_USDT', size: 10, price: '31503.28', tif: 'gtc', text: 't-my-custom-id', iceberg: 0, close: false, reduce_only: false, auto_size: undefined, stp_act: 'cn', }, FUTURES_CONNECTION_GROUP_WS_KEY, ); console.log(new Date(), 'New futures order result:', newFuturesOrder.data); // FUTURES ORDER BATCH PLACE - Submit multiple futures orders const batchFuturesOrders = await client.submitNewFuturesBatchOrder( [ { contract: 'BTC_USDT', size: 10, price: '31403.18', tif: 'gtc', text: 't-my-custom-id-1', }, { contract: 'ETH_USDT', size: 20, price: '2500.50', tif: 'gtc', text: 't-my-custom-id-2', }, ], FUTURES_CONNECTION_GROUP_WS_KEY, ); console.log( new Date(), 'Batch futures orders result:', batchFuturesOrders.data, ); // FUTURES ORDER CANCEL - Cancel a specific futures order const cancelFuturesOrder = await client.cancelFuturesOrder( { order_id: '74046514', }, FUTURES_CONNECTION_GROUP_WS_KEY, ); console.log( new Date(), 'Cancel futures order result:', cancelFuturesOrder.data, ); // FUTURES ORDER CANCEL BY IDS - Cancel futures orders by ID list const cancelFuturesOrdersByIds = await client.cancelFuturesOrderById( ['1694883366', '123'], FUTURES_CONNECTION_GROUP_WS_KEY, ); console.log( new Date(), 'Cancel futures orders by IDs result:', cancelFuturesOrdersByIds.data, ); // FUTURES ORDER CANCEL ALL - Cancel all open futures orders const cancelAllFuturesOrders = await client.cancelFuturesAllOpenOrders( { contract: 'BTC_USDT', side: 'bid', }, FUTURES_CONNECTION_GROUP_WS_KEY, ); console.log( new Date(), 'Cancel all futures orders result:', cancelAllFuturesOrders.data, ); // FUTURES ORDER AMEND - Update an existing futures order const amendFuturesOrder = await client.updateFuturesOrder( { order_id: '74046543', price: '31303.18', size: 15, amend_text: 'price-and-size-update', }, FUTURES_CONNECTION_GROUP_WS_KEY, ); console.log( new Date(), 'Amend futures order result:', amendFuturesOrder.data, ); // FUTURES ORDER LIST - Get list of futures orders const getFuturesOrders = await client.getFuturesOrders( { contract: 'BTC_USDT', status: 'open', limit: 10, offset: 0, last_id: undefined, count_total: 0, }, FUTURES_CONNECTION_GROUP_WS_KEY, ); console.log( new Date(), 'Futures orders list result:', getFuturesOrders.data, ); // FUTURES ORDER STATUS - Get status of a specific futures order const futuresOrderStatus = await client.getFuturesOrderStatus( { order_id: '74046543', }, FUTURES_CONNECTION_GROUP_WS_KEY, ); console.log( new Date(), 'Futures order status result:', futuresOrderStatus.data, ); } catch (e) { console.error(new Date(), 'Error:', e); }} start();Common Gate implementation tasks
Start from the behavior you need, not just from REST or WebSocket as a transport. Market-data driven systems should be event driven. Backfill via the REST API once and let WebSockets passively stream new data to you, as it becomes available.
REST API hydration or backfill
Start from the REST API quickstart and endpoint reference, then normalize exchange-specific IDs, timestamps, symbols, and product scope.
Open endpoint referenceWebSocket consumer
Start from the WebSocket quickstart that matches the task boundary, verify subscription acknowledgement semantics, and keep reconnect handling explicit.
Open WebSocket quickstartAgent prompt recipe
Use the AI prompt generator when the task combines REST API hydration, live streams, in-memory state, operational outputs, or strategy code.
Build an agent promptFor coding agents
Give these files to an agent before implementation so it can find the package, examples, task guidance, and safety rules from the normal SDK-page flow.
AI prompt framework
Prompt generator and task recipes for exchange API projects.
llms.txt
Compact discovery file for agents choosing where to start.
llms-full.txt
Full route and implementation guidance index for machine readers.
SDK catalog
Machine-readable package, docs, examples, and task guidance.
Agent skill
Reusable workflow rules for coding agents using exchange APIs.
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.
RestClient.ts
This table includes all endpoints from the official Exchange API docs and corresponding SDK functions for each endpoint that are found in RestClient.ts.
| Function | AUTH | HTTP Method | Endpoint |
|---|---|---|---|
| getSystemMaintenanceStatus() | GET | /v1/public/system_info | |
| submitWithdrawal() | ๐ | POST | /withdrawals |
| submitSpotMainAccountTransfer() | ๐ | POST | /withdrawals/push |
| cancelWithdrawal() | ๐ | DELETE | /withdrawals/{withdrawal_id} |
| getCurrencyChains() | GET | /wallet/currency_chains | |
| createDepositAddress() | ๐ | GET | /wallet/deposit_address |
| getWithdrawalRecords() | ๐ | GET | /wallet/withdrawals |
| getDepositRecords() | ๐ | GET | /wallet/deposits |
| submitTransfer() | ๐ | POST | /wallet/transfers |
| submitMainSubTransfer() | ๐ | POST | /wallet/sub_account_transfers |
| getMainSubTransfers() | ๐ | GET | /wallet/sub_account_transfers |
| submitSubToSubTransfer() | ๐ | POST | /wallet/sub_account_to_sub_account |
| getTransferStatus() | ๐ | GET | /wallet/order_status |
| getWithdrawalStatus() | ๐ | GET | /wallet/withdraw_status |
| getSubBalance() | ๐ | GET | /wallet/sub_account_balances |
| getSubMarginBalances() | ๐ | GET | /wallet/sub_account_margin_balances |
| getSubFuturesBalances() | ๐ | GET | /wallet/sub_account_futures_balances |
| getSubCrossMarginBalances() | ๐ | GET | /wallet/sub_account_cross_margin_balances |
| getSavedAddresses() | ๐ | GET | /wallet/saved_address |
| getTradingFees() | ๐ | GET | /wallet/fee |
| getBalances() | ๐ | GET | /wallet/total_balance |
| getSmallBalances() | ๐ | GET | /wallet/small_balance |
| convertSmallBalance() | ๐ | POST | /wallet/small_balance |
| getSmallBalanceHistory() | ๐ | GET | /wallet/small_balance_history |
| getPushOrders() | ๐ | GET | /wallet/push |
| getLowCapExchangeList() | ๐ | GET | /wallet/getLowCapExchangeList |
| createSubAccount() | ๐ | POST | /sub_accounts |
| getSubAccounts() | ๐ | GET | /sub_accounts |
| getSubAccount() | ๐ | GET | /sub_accounts/{user_id} |
| createSubAccountApiKey() | ๐ | POST | /sub_accounts/{user_id}/keys |
| getSubAccountApiKeys() | ๐ | GET | /sub_accounts/{user_id}/keys |
| updateSubAccountApiKey() | ๐ | PUT | /sub_accounts/{user_id}/keys/{key} |
| deleteSubAccountApiKey() | ๐ | DELETE | /sub_accounts/{user_id}/keys/{key} |
| getSubAccountApiKey() | ๐ | GET | /sub_accounts/{user_id}/keys/{key} |
| lockSubAccount() | ๐ | POST | /sub_accounts/{user_id}/lock |
| unlockSubAccount() | ๐ | POST | /sub_accounts/{user_id}/unlock |
| getSubAccountMode() | ๐ | GET | /sub_accounts/unified_mode |
| getUnifiedAccountInfo() | ๐ | GET | /unified/accounts |
| getUnifiedMaxBorrow() | ๐ | GET | /unified/borrowable |
| getUnifiedMaxTransferable() | ๐ | GET | /unified/transferable |
| getUnifiedMaxTransferables() | ๐ | GET | /unified/transferables |
| getUnifiedBatchMaxBorrowable() | ๐ | GET | /unified/batch_borrowable |
| submitUnifiedBorrowOrRepay() | ๐ | POST | /unified/loans |
| getUnifiedLoans() | ๐ | GET | /unified/loans |
| getUnifiedLoanRecords() | ๐ | GET | /unified/loan_records |
| getUnifiedInterestRecords() | ๐ | GET | /unified/interest_records |
| getUnifiedRiskUnitDetails() | ๐ | GET | /unified/risk_units |
| setUnifiedAccountMode() | ๐ | PUT | /unified/unified_mode |
| getUnifiedAccountMode() | ๐ | GET | /unified/unified_mode |
| getUnifiedEstimateRate() | ๐ | GET | /unified/estimate_rate |
| getUnifiedCurrencyDiscountTiers() | GET | /unified/currency_discount_tiers | |
| getLoanMarginTiers() | GET | /unified/loan_margin_tiers | |
| portfolioMarginCalculate() | POST | /unified/portfolio_calculator | |
| getUserCurrencyLeverageConfig() | ๐ | GET | /unified/leverage/user_currency_config |
| getUserCurrencyLeverageSettings() | ๐ | GET | /unified/leverage/user_currency_setting |
| updateUserCurrencyLeverage() | ๐ | POST | /unified/leverage/user_currency_setting |
| getUnifiedLoanCurrencies() | ๐ | GET | /unified/currencies |
| getHistoricalLendingRates() | ๐ | GET | /unified/history_loan_rate |
| submitUnifiedLoanRepay() | ๐ | POST | /unified/loans/repay |
| getEstimatedQuickRepayment() | ๐ | GET | /unified/estimated_quick_repayment |
| createQuickRepayment() | ๐ | POST | /unified/quick_repayment |
| setUnifiedDeltaNeutral() | ๐ | POST | /unified/delta_neutral |
| getUnifiedDeltaNeutral() | ๐ | GET | /unified/delta_neutral |
| getSpotCurrencies() | GET | /spot/currencies | |
| getSpotCurrency() | GET | /spot/currencies/{currency} | |
| getSpotCurrencyPairs() | GET | /spot/currency_pairs | |
| getSpotCurrencyPair() | GET | /spot/currency_pairs/{currency_pair} | |
| getSpotTicker() | GET | /spot/tickers | |
| getSpotOrderBook() | GET | /spot/order_book | |
| getSpotTrades() | GET | /spot/trades | |
| getSpotCandles() | GET | /spot/candlesticks | |
| getSpotFeeRates() | ๐ | GET | /spot/fee |
| getSpotBatchFeeRates() | ๐ | GET | /spot/batch_fee |
| getSpotAccounts() | ๐ | GET | /spot/accounts |
| getSpotAccountBook() | ๐ | GET | /spot/account_book |
| submitSpotBatchOrders() | ๐ | POST | /spot/batch_orders |
| getSpotOpenOrders() | ๐ | GET | /spot/open_orders |
| submitSpotClosePosCrossDisabled() | ๐ | POST | /spot/cross_liquidate_orders |
| submitSpotOrder() | ๐ | POST | /spot/orders |
| getSpotOrders() | ๐ | GET | /spot/orders |
| cancelSpotOpenOrders() | ๐ | DELETE | /spot/orders |
| batchCancelSpotOrders() | ๐ | POST | /spot/cancel_batch_orders |
| getSpotOrder() | ๐ | GET | /spot/orders/{order_id} |
| updateSpotOrder() | ๐ | PATCH | /spot/orders/{order_id} |
| cancelSpotOrder() | ๐ | DELETE | /spot/orders/{order_id} |
| getSpotTradingHistory() | ๐ | GET | /spot/my_trades |
| submitSpotCountdownOrders() | ๐ | POST | /spot/countdown_cancel_all |
| batchUpdateSpotOrders() | ๐ | POST | /spot/amend_batch_orders |
| getSpotInsuranceHistory() | ๐ | GET | /spot/insurance_history |
| submitSpotPriceTriggerOrder() | ๐ | POST | /spot/price_orders |
| getSpotAutoOrders() | ๐ | GET | /spot/price_orders |
| cancelAllOpenSpotOrders() | ๐ | DELETE | /spot/price_orders |
| getPriceTriggeredOrder() | ๐ | GET | /spot/price_orders/{order_id} |
| cancelSpotTriggeredOrder() | ๐ | DELETE | /spot/price_orders/{order_id} |
| setCollateralCurrency() | ๐ | POST | /unified/collateral_currencies |
| getMarginAccounts() | ๐ | GET | /margin/accounts |
| getMarginBalanceHistory() | ๐ | GET | /margin/account_book |
| getFundingAccounts() | ๐ | GET | /margin/funding_accounts |
| updateAutoRepaymentSetting() | ๐ | POST | /margin/auto_repay |
| getAutoRepaymentSetting() | ๐ | GET | /margin/auto_repay |
| getMarginTransferableAmount() | ๐ | GET | /margin/transferable |
| getCrossMarginCurrencies() | GET | /margin/cross/currencies | |
| getCrossMarginCurrency() | GET | /margin/cross/currencies/{currency} | |
| getCrossMarginAccount() | ๐ | GET | /margin/cross/accounts |
| getCrossMarginAccountHistory() | ๐ | GET | /margin/cross/account_book |
| submitCrossMarginBorrowLoan() | ๐ | POST | /margin/cross/loans |
| getCrossMarginBorrowHistory() | ๐ | GET | /margin/cross/loans |
| getCrossMarginBorrowLoan() | ๐ | GET | /margin/cross/loans/{loan_id} |
| submitCrossMarginRepayment() | ๐ | POST | /margin/cross/repayments |
| getCrossMarginRepayments() | ๐ | GET | /margin/cross/repayments |
| getCrossMarginInterestRecords() | ๐ | GET | /margin/cross/interest_records |
| getCrossMarginTransferableAmount() | ๐ | GET | /margin/cross/transferable |
| getEstimatedInterestRates() | ๐ | GET | /margin/cross/estimate_rate |
| getCrossMarginBorrowableAmount() | ๐ | GET | /margin/cross/borrowable |
| getMarginUserLoanTiers() | ๐ | GET | /margin/user/loan_margin_tiers |
| getMarginPublicLoanTiers() | GET | /margin/loan_margin_tiers | |
| setMarginUserLeverage() | ๐ | POST | /margin/leverage/user_market_setting |
| getMarginUserAccounts() | ๐ | GET | /margin/user/account |
| getLendingMarkets() | GET | /margin/uni/currency_pairs | |
| getLendingMarket() | GET | /margin/uni/currency_pairs/{currency_pair} | |
| getEstimatedInterestRate() | ๐ | GET | /margin/uni/estimate_rate |
| submitMarginUNIBorrowOrRepay() | ๐ | POST | /margin/uni/loans |
| getMarginUNILoans() | ๐ | GET | /margin/uni/loans |
| getMarginUNILoanRecords() | ๐ | GET | /margin/uni/loan_records |
| getMarginUNIInterestRecords() | ๐ | GET | /margin/uni/interest_records |
| getMarginUNIMaxBorrow() | ๐ | GET | /margin/uni/borrowable |
| getFlashSwapCurrencyPairs() | GET | /flash_swap/currency_pairs | |
| submitFlashSwapOrder() | ๐ | POST | /flash_swap/orders |
| getFlashSwapOrders() | ๐ | GET | /flash_swap/orders |
| getFlashSwapOrder() | ๐ | GET | /flash_swap/orders/{order_id} |
| submitFlashSwapOrderPreview() | ๐ | POST | /flash_swap/orders/preview |
| getFuturesContracts() | GET | /futures/{settle}/contracts | |
| getFuturesContract() | GET | /futures/{settle}/contracts/{contract} | |
| getFuturesOrderBook() | GET | /futures/{settle}/order_book | |
| getFuturesTrades() | GET | /futures/{settle}/trades | |
| getFuturesCandles() | GET | /futures/{settle}/candlesticks | |
| getPremiumIndexKLines() | GET | /futures/{settle}/premium_index | |
| getFuturesTickers() | GET | /futures/{settle}/tickers | |
| getFundingRates() | GET | /futures/{settle}/funding_rate | |
| getBatchFundingRates() | POST | /futures/{settle}/funding_rates | |
| getFuturesInsuranceBalanceHistory() | GET | /futures/{settle}/insurance | |
| getFuturesStats() | GET | /futures/{settle}/contract_stats | |
| getIndexConstituents() | GET | /futures/{settle}/index_constituents/{index} | |
| getLiquidationHistory() | GET | /futures/{settle}/liq_orders | |
| getRiskLimitTiers() | GET | /futures/{settle}/risk_limit_tiers | |
| getFuturesAccount() | ๐ | GET | /futures/{settle}/accounts |
| getFuturesAccountBook() | ๐ | GET | /futures/{settle}/account_book |
| getFuturesPositions() | ๐ | GET | /futures/{settle}/positions |
| getFuturesPosition() | ๐ | GET | /futures/{settle}/positions/{contract} |
| updateFuturesMargin() | ๐ | POST | /futures/{settle}/positions/{contract}/margin |
| updateFuturesLeverage() | ๐ | POST | /futures/{settle}/positions/{contract}/leverage |
| getFuturesContractLeverage() | ๐ | GET | /futures/{settle}/get_leverage/{contract} |
| updateFuturesPositionMode() | ๐ | POST | /futures/{settle}/positions/cross_mode |
| updatePositionRiskLimit() | ๐ | POST | /futures/{settle}/positions/{contract}/risk_limit |
| updateFuturesDualMode() | ๐ | POST | /futures/{settle}/dual_mode |
| getDualModePosition() | ๐ | GET | /futures/{settle}/dual_comp/positions/{contract} |
| updateDualModePositionMargin() | ๐ | POST | /futures/{settle}/dual_comp/positions/{contract}/margin |
| updateDualModePositionLeverage() | ๐ | POST | /futures/{settle}/dual_comp/positions/{contract}/leverage |
| updateDualModePositionRiskLimit() | ๐ | POST | /futures/{settle}/dual_comp/positions/{contract}/risk_limit |
| submitFuturesOrder() | ๐ | POST | /futures/{settle}/orders |
| getFuturesOrders() | ๐ | GET | /futures/{settle}/orders |
| cancelAllFuturesOrders() | ๐ | DELETE | /futures/{settle}/orders |
| getFuturesOrdersByTimeRange() | ๐ | GET | /futures/{settle}/orders_timerange |
| submitFuturesBatchOrders() | ๐ | POST | /futures/{settle}/batch_orders |
| getFuturesOrder() | ๐ | GET | /futures/{settle}/orders/{order_id} |
| cancelFuturesOrder() | ๐ | DELETE | /futures/{settle}/orders/{order_id} |
| updateFuturesOrder() | ๐ | PUT | /futures/{settle}/orders/{order_id} |
| getFuturesTradingHistory() | ๐ | GET | /futures/{settle}/my_trades |
| getFuturesTradingHistoryByTimeRange() | ๐ | GET | /futures/{settle}/my_trades_timerange |
| getFuturesPositionHistory() | ๐ | GET | /futures/{settle}/position_close |
| getFuturesLiquidationHistory() | ๐ | GET | /futures/{settle}/liquidates |
| getFuturesAutoDeleveragingHistory() | ๐ | GET | /futures/{settle}/auto_deleverages |
| setFuturesOrderCancelCountdown() | ๐ | POST | /futures/{settle}/countdown_cancel_all |
| getFuturesUserTradingFees() | ๐ | GET | /futures/{settle}/fee |
| batchCancelFuturesOrders() | ๐ | POST | /futures/{settle}/batch_cancel_orders |
| batchUpdateFuturesOrders() | ๐ | POST | /futures/{settle}/batch_amend_orders |
| getRiskLimitTable() | GET | /futures/{settle}/risk_limit_table | |
| submitFuturesPriceTriggeredOrder() | ๐ | POST | /futures/{settle}/price_orders |
| getFuturesAutoOrders() | ๐ | GET | /futures/{settle}/price_orders |
| cancelAllOpenFuturesOrders() | ๐ | DELETE | /futures/{settle}/price_orders |
| getFuturesPriceTriggeredOrder() | ๐ | GET | /futures/{settle}/price_orders/{order_id} |
| cancelFuturesPriceTriggeredOrder() | ๐ | DELETE | /futures/{settle}/price_orders/{order_id} |
| updateFuturesPriceTriggeredOrder() | ๐ | PUT | /futures/{settle}/price_orders/amend |
| createTrailOrder() | ๐ | POST | /futures/{settle}/autoorder/v1/trail/create |
| terminateTrailOrder() | ๐ | POST | /futures/{settle}/autoorder/v1/trail/stop |
| batchTerminateTrailOrders() | ๐ | POST | /futures/{settle}/autoorder/v1/trail/stop_all |
| getTrailOrderList() | ๐ | GET | /futures/{settle}/autoorder/v1/trail/list |
| getTrailOrderDetail() | ๐ | GET | /futures/{settle}/autoorder/v1/trail/detail |
| updateTrailOrder() | ๐ | POST | /futures/{settle}/autoorder/v1/trail/update |
| getTrailOrderChangeLog() | ๐ | GET | /futures/{settle}/autoorder/v1/trail/change_log |
| createChaseOrder() | ๐ | POST | /futures/{settle}/autoorder/v1/chase/create |
| stopChaseOrder() | ๐ | POST | /futures/{settle}/autoorder/v1/chase/stop |
| stopAllChaseOrders() | ๐ | POST | /futures/{settle}/autoorder/v1/chase/stop_all |
| getChaseOrders() | ๐ | GET | /futures/{settle}/autoorder/v1/chase/list |
| getChaseOrderDetail() | ๐ | GET | /futures/{settle}/autoorder/v1/chase/detail |
| getFuturesPositionCloseHistory() | ๐ | GET | /futures/{settle}/position_close_history |
| getFuturesInsuranceHistory() | ๐ | GET | /futures/{settle}/insurance |
| getAllDeliveryContracts() | GET | /delivery/{settle}/contracts | |
| getDeliveryContract() | GET | /delivery/{settle}/contracts/{contract} | |
| getDeliveryOrderBook() | GET | /delivery/{settle}/order_book | |
| getDeliveryTrades() | GET | /delivery/{settle}/trades | |
| getDeliveryCandles() | GET | /delivery/{settle}/candlesticks | |
| getDeliveryTickers() | GET | /delivery/{settle}/tickers | |
| getDeliveryInsuranceBalanceHistory() | GET | /delivery/{settle}/insurance | |
| getDeliveryAccount() | ๐ | GET | /delivery/{settle}/accounts |
| getDeliveryBook() | ๐ | GET | /delivery/{settle}/account_book |
| getDeliveryPositions() | ๐ | GET | /delivery/{settle}/positions |
| getDeliveryPosition() | ๐ | GET | /delivery/{settle}/positions/{contract} |
| updateDeliveryMargin() | ๐ | POST | /delivery/{settle}/positions/{contract}/margin |
| updateDeliveryLeverage() | ๐ | POST | /delivery/{settle}/positions/{contract}/leverage |
| updateDeliveryRiskLimit() | ๐ | POST | /delivery/{settle}/positions/{contract}/risk_limit |
| submitDeliveryOrder() | ๐ | POST | /delivery/{settle}/orders |
| getDeliveryOrders() | ๐ | GET | /delivery/{settle}/orders |
| cancelAllDeliveryOrders() | ๐ | DELETE | /delivery/{settle}/orders |
| getDeliveryOrder() | ๐ | GET | /delivery/{settle}/orders/{order_id} |
| cancelDeliveryOrder() | ๐ | DELETE | /delivery/{settle}/orders/{order_id} |
| getDeliveryTradingHistory() | ๐ | GET | /delivery/{settle}/my_trades |
| getDeliveryClosedPositions() | ๐ | GET | /delivery/{settle}/position_close |
| getDeliveryLiquidationHistory() | ๐ | GET | /delivery/{settle}/liquidates |
| getDeliverySettlementHistory() | ๐ | GET | /delivery/{settle}/settlements |
| submitDeliveryTriggeredOrder() | ๐ | POST | /delivery/{settle}/price_orders |
| getDeliveryAutoOrders() | ๐ | GET | /delivery/{settle}/price_orders |
| cancelAllOpenDeliveryOrders() | ๐ | DELETE | /delivery/{settle}/price_orders |
| getDeliveryTriggeredOrder() | ๐ | GET | /delivery/{settle}/price_orders/{order_id} |
| cancelTriggeredDeliveryOrder() | ๐ | DELETE | /delivery/{settle}/price_orders/{order_id} |
| getOptionsUnderlyings() | GET | /options/underlyings | |
| getOptionsExpirationTimes() | GET | /options/expirations | |
| getOptionsContracts() | GET | /options/contracts | |
| getOptionsContract() | GET | /options/contracts/{contract} | |
| getOptionsSettlementHistory() | GET | /options/settlements | |
| getOptionsContractSettlement() | GET | /options/settlements/{contract} | |
| getOptionsMySettlements() | ๐ | GET | /options/my_settlements |
| getOptionsOrderBook() | GET | /options/order_book | |
| getOptionsTickers() | GET | /options/tickers | |
| getOptionsUnderlyingTicker() | GET | /options/underlying/tickers/{underlying} | |
| getOptionsCandles() | GET | /options/candlesticks | |
| getOptionsUnderlyingCandles() | GET | /options/underlying/candlesticks | |
| getOptionsTrades() | GET | /options/trades | |
| getOptionsAccount() | ๐ | GET | /options/accounts |
| getOptionsAccountChange() | ๐ | GET | /options/account_book |
| getOptionsPositionsUnderlying() | ๐ | GET | /options/positions |
| getOptionsPositionContract() | ๐ | GET | /options/positions/{contract} |
| getOptionsLiquidation() | ๐ | GET | /options/position_close |
| submitOptionsOrder() | ๐ | POST | /options/orders |
| getOptionsOrders() | ๐ | GET | /options/orders |
| cancelAllOpenOptionsOrders() | ๐ | DELETE | /options/orders |
| getOptionsOrder() | ๐ | GET | /options/orders/{order_id} |
| amendOptionsOrder() | ๐ | PUT | /options/orders/{order_id} |
| cancelOptionsOrder() | ๐ | DELETE | /options/orders/{order_id} |
| submitOptionsCountdownCancel() | ๐ | POST | /options/countdown_cancel_all |
| getOptionsPersonalHistory() | ๐ | GET | /options/my_trades |
| setOptionsMMPSettings() | ๐ | POST | /options/mmp |
| getOptionsMMPSettings() | ๐ | GET | /options/mmp |
| resetOptionsMMPSettings() | ๐ | POST | /options/mmp/reset |
| getLendingCurrencies() | GET | /earn/uni/currencies | |
| getLendingCurrency() | GET | /earn/uni/currencies/{currency} | |
| submitLendOrRedeemOrder() | ๐ | POST | /earn/uni/lends |
| getLendingOrders() | ๐ | GET | /earn/uni/lends |
| updateLendingOrder() | ๐ | PATCH | /earn/uni/lends |
| getLendingRecords() | ๐ | GET | /earn/uni/lend_records |
| getLendingTotalInterest() | ๐ | GET | /earn/uni/interests/{currency} |
| getLendingInterestRecords() | ๐ | GET | /earn/uni/interest_records |
| updateInterestReinvestment() | ๐ | PUT | /earn/uni/interest_reinvest |
| getLendingInterestStatus() | ๐ | GET | /earn/uni/interest_status/{currency} |
| getLendingAnnualizedTrendChart() | ๐ | GET | /earn/uni/chart |
| getLendingEstimatedRates() | ๐ | GET | /earn/uni/rate |
| submitMultiLoanOrder() | ๐ | POST | /loan/multi_collateral/orders |
| getMultiLoanOrders() | ๐ | GET | /loan/multi_collateral/orders |
| getMultiLoanOrder() | ๐ | GET | /loan/multi_collateral/orders/{order_id} |
| repayMultiLoan() | ๐ | POST | /loan/multi_collateral/repay |
| getMultiLoanRepayRecords() | ๐ | GET | /loan/multi_collateral/repay |
| updateMultiLoan() | ๐ | POST | /loan/multi_collateral/mortgage |
| getMultiLoanAdjustmentRecords() | ๐ | GET | /loan/multi_collateral/mortgage |
| getMultiLoanCurrencyQuota() | ๐ | GET | /loan/multi_collateral/currency_quota |
| getMultiLoanSupportedCurrencies() | GET | /loan/multi_collateral/currencies | |
| getMultiLoanRatio() | GET | /loan/multi_collateral/ltv | |
| getMultiLoanFixedRates() | GET | /loan/multi_collateral/fixed_rate | |
| getMultiLoanCurrentRates() | GET | /loan/multi_collateral/current_rate | |
| getDualInvestmentProducts() | GET | /earn/dual/investment_plan | |
| getDualInvestmentOrders() | ๐ | GET | /earn/dual/orders |
| submitDualInvestmentOrder() | ๐ | POST | /earn/dual/orders |
| getDualOrderRefundPreview() | ๐ | GET | /earn/dual/order-refund-preview |
| submitDualOrderRefund() | ๐ | POST | /earn/dual/order-refund |
| updateDualOrderReinvest() | ๐ | POST | /earn/dual/modify-order-reinvest |
| getDualProjectRecommend() | ๐ | GET | /earn/dual/project-recommend |
| getEarnFixedTermProducts() | GET | /earn/fixed-term/product | |
| getEarnFixedTermProductsByAsset() | GET | /earn/fixed-term/product/{asset}/list | |
| createEarnFixedTermLend() | ๐ | POST | /earn/fixed-term/user/lend |
| getEarnFixedTermLends() | ๐ | GET | /earn/fixed-term/user/lend |
| createEarnFixedTermPreRedeem() | ๐ | POST | /earn/fixed-term/user/pre-redeem |
| getEarnFixedTermHistory() | ๐ | GET | /earn/fixed-term/user/history |
| createAutoInvestPlan() | ๐ | POST | /earn/autoinvest/plans/create |
| updateAutoInvestPlan() | ๐ | POST | /earn/autoinvest/plans/update |
| stopAutoInvestPlan() | ๐ | POST | /earn/autoinvest/plans/stop |
| addAutoInvestPlanPosition() | ๐ | POST | /earn/autoinvest/plans/add_position |
| getAutoInvestCoins() | ๐ | GET | /earn/autoinvest/coins |
| getAutoInvestMinAmount() | ๐ | POST | /earn/autoinvest/min_invest_amount |
| getAutoInvestPlanRecords() | ๐ | GET | /earn/autoinvest/plans/records |
| getAutoInvestOrders() | ๐ | GET | /earn/autoinvest/orders |
| getAutoInvestConfig() | ๐ | GET | /earn/autoinvest/config |
| getAutoInvestPlanDetail() | ๐ | GET | /earn/autoinvest/plans/detail |
| getAutoInvestPlans() | ๐ | GET | /earn/autoinvest/plans/list_info |
| getStakingCoins() | ๐ | GET | /earn/staking/coins |
| submitStakingSwap() | ๐ | POST | /earn/staking/swap |
| getAccountDetail() | ๐ | GET | /account/detail |
| getAccountRateLimit() | ๐ | GET | /account/rate_limit |
| createStpGroup() | ๐ | POST | /account/stp_groups |
| getStpGroups() | ๐ | GET | /account/stp_groups |
| getStpGroupUsers() | ๐ | GET | /account/stp_groups/{stp_id}/users |
| addUsersToStpGroup() | ๐ | POST | /account/stp_groups/{stp_id}/users |
| deleteUserFromStpGroup() | ๐ | DELETE | /account/stp_groups/{stp_id}/users |
| setGTDeduction() | ๐ | POST | /account/debit_fee |
| getGTDeduction() | ๐ | GET | /account/debit_fee |
| getAccountMainKeys() | ๐ | GET | /account/main_keys |
| getAgencyTransactionHistory() | ๐ | GET | /rebate/agency/transaction_history |
| getAgencyCommissionHistory() | ๐ | GET | /rebate/agency/commission_history |
| getPartnerTransactionHistory() | ๐ | GET | /rebate/partner/transaction_history |
| getPartnerCommissionHistory() | ๐ | GET | /rebate/partner/commission_history |
| getPartnerSubordinateList() | ๐ | GET | /rebate/partner/sub_list |
| getPartnerAgentDataAggregated() | ๐ | GET | /rebate/partner/data/aggregated |
| getBrokerCommissionHistory() | ๐ | GET | /rebate/broker/commission_history |
| getBrokerTransactionHistory() | ๐ | GET | /rebate/broker/transaction_history |
| getUserRebateInfo() | ๐ | GET | /rebate/user/info |
| createOTCQuote() | ๐ | POST | /otc/quote |
| createOTCFiatOrder() | ๐ | POST | /otc/order/create |
| createOTCStablecoinOrder() | ๐ | POST | /otc/stable_coin/order/create |
| getOTCBankList() | ๐ | GET | /otc/bank/list |
| getOTCBankListLegacy() | ๐ | GET | /otc/bank_list |
| createOTCBank() | ๐ | POST | /otc/bank/delete |
| deleteOTCBank() | ๐ | POST | /otc/bank/delete |
| setDefaultOTCBank() | ๐ | POST | /otc/bank/set_default |
| getOTCBankSupplementChecklist() | ๐ | GET | /otc/bank/bank_supplement_checklist |
| submitOTCBankPersonalSupplement() | ๐ | POST | /otc/order/paid |
| submitOTCBankEnterpriseSupplement() | ๐ | POST | /otc/order/paid |
| markOTCOrderAsPaid() | ๐ | POST | /otc/order/paid |
| cancelOTCOrder() | ๐ | POST | /otc/order/cancel |
| getOTCFiatOrderList() | ๐ | GET | /otc/order/list |
| getOTCStablecoinOrderList() | ๐ | GET | /otc/stable_coin/order/list |
| getOTCFiatOrderDetail() | ๐ | GET | /otc/order/detail |
| getP2PMerchantUserInfo() | ๐ | POST | /p2p/merchant/account/get_user_info |
| getP2PMerchantCounterpartyUserInfo() | ๐ | POST | /p2p/merchant/account/get_counterparty_user_info |
| getP2PMerchantMyselfPayment() | ๐ | POST | /p2p/merchant/account/get_myself_payment |
| getP2PMerchantSpotBalance() | ๐ | POST | /p2p/merchant/account/set_merchant_work_hours |
| setP2PMerchantWorkHours() | ๐ | POST | /p2p/merchant/account/set_merchant_work_hours |
| getP2PMerchantPendingTransactionList() | ๐ | POST | /p2p/merchant/transaction/get_pending_transaction_list |
| getP2PMerchantCompletedTransactionList() | ๐ | POST | /p2p/merchant/transaction/get_completed_transaction_list |
| getP2PMerchantTransactionDetails() | ๐ | POST | /p2p/merchant/transaction/get_transaction_details |
| confirmP2PMerchantPayment() | ๐ | POST | /p2p/merchant/transaction/confirm-payment |
| confirmP2PMerchantReceipt() | ๐ | POST | /p2p/merchant/transaction/confirm-receipt |
| cancelP2PMerchantTransaction() | ๐ | POST | /p2p/merchant/transaction/cancel |
| placeP2PMerchantBizPushOrder() | ๐ | POST | /p2p/merchant/books/place_biz_push_order |
| updateP2PMerchantAdsStatus() | ๐ | POST | /p2p/merchant/books/ads_update_status |
| getP2PMerchantAdsDetail() | ๐ | POST | /p2p/merchant/books/ads_detail |
| getP2PMerchantMyAdsList() | ๐ | POST | /p2p/merchant/books/my_ads_list |
| getP2PMerchantAdsList() | ๐ | POST | /p2p/merchant/books/ads_list |
| getP2PMerchantChatsList() | ๐ | POST | /p2p/merchant/chat/get_chats_list |
| sendP2PMerchantChatMessage() | ๐ | POST | /p2p/merchant/chat/send_chat_message |
| uploadP2PMerchantChatFile() | ๐ | POST | /p2p/merchant/chat/upload_chat_file |
| getCrossExSymbols() | GET | /crossex/rule/symbols | |
| getCrossExRiskLimits() | GET | /crossex/rule/risk_limits | |
| getCrossExTransferCoins() | GET | /crossex/transfers/coin | |
| createCrossExTransfer() | ๐ | POST | /crossex/transfers |
| getCrossExTransferHistory() | ๐ | GET | /crossex/transfers |
| createCrossExOrder() | ๐ | POST | /crossex/orders |
| cancelCrossExOrder() | ๐ | DELETE | /crossex/orders/{order_id} |
| modifyCrossExOrder() | ๐ | PUT | /crossex/orders/{order_id} |
| getCrossExOrder() | ๐ | GET | /crossex/orders/{order_id} |
| createCrossExConvertQuote() | ๐ | POST | /crossex/convert/quote |
| createCrossExConvertOrder() | ๐ | POST | /crossex/convert/orders |
| updateCrossExAccount() | ๐ | PUT | /crossex/accounts |
| getCrossExAccounts() | ๐ | GET | /crossex/accounts |
| setCrossExPositionLeverage() | ๐ | POST | /crossex/positions/leverage |
| getCrossExPositionLeverage() | ๐ | GET | /crossex/positions/leverage |
| setCrossExMarginPositionLeverage() | ๐ | POST | /crossex/margin_positions/leverage |
| getCrossExMarginPositionLeverage() | ๐ | GET | /crossex/margin_positions/leverage |
| closeCrossExPosition() | ๐ | POST | /crossex/position |
| getCrossExInterestRate() | ๐ | GET | /crossex/interest_rate |
| getCrossExFeeRate() | ๐ | GET | /crossex/fee |
| getCrossExPositions() | ๐ | GET | /crossex/positions |
| getCrossExMarginPositions() | ๐ | GET | /crossex/margin_positions |
| getCrossExAdlRank() | ๐ | GET | /crossex/adl_rank |
| getCrossExOpenOrders() | ๐ | GET | /crossex/open_orders |
| getCrossExHistoryOrders() | ๐ | GET | /crossex/history_orders |
| getCrossExHistoryPositions() | ๐ | GET | /crossex/history_positions |
| getCrossExHistoryMarginPositions() | ๐ | GET | /crossex/history_margin_positions |
| getCrossExHistoryMarginInterests() | ๐ | GET | /crossex/history_margin_interests |
| getCrossExHistoryTrades() | ๐ | GET | /crossex/history_trades |
| getCrossExAccountBook() | ๐ | GET | /crossex/account_book |
| getCrossExCoinDiscountRate() | ๐ | GET | /crossex/coin_discount_rate |
| getAlphaAccounts() | ๐ | GET | /alpha/accounts |
| getAlphaAccountBook() | ๐ | GET | /alpha/account_book |
| createAlphaQuote() | ๐ | POST | /alpha/quote |
| createAlphaOrder() | ๐ | POST | /alpha/orders |
| getAlphaOrders() | ๐ | GET | /alpha/orders |
| getAlphaOrder() | ๐ | GET | /alpha/order |
| getAlphaCurrencies() | GET | /alpha/currencies | |
| getAlphaTickers() | GET | /alpha/tickers | |
| getTradFiMT5Account() | ๐ | GET | /tradfi/users/mt5-account |
| getTradFiSymbolCategories() | GET | /tradfi/symbols/categories | |
| getTradFiSymbols() | GET | /tradfi/symbols | |
| getTradFiSymbolDetail() | ๐ | GET | /tradfi/symbols/detail |
| getTradFiKlines() | GET | /tradfi/symbols/{symbol}/klines | |
| getTradFiTicker() | GET | /tradfi/symbols/{symbol}/tickers | |
| createTradFiUser() | ๐ | POST | /tradfi/users |
| getTradFiAssets() | ๐ | GET | /tradfi/users/assets |
| createTradFiTransaction() | ๐ | POST | /tradfi/transactions |
| getTradFiTransactions() | ๐ | GET | /tradfi/transactions |
| createTradFiOrder() | ๐ | POST | /tradfi/orders |
| getTradFiOrders() | ๐ | GET | /tradfi/orders |
| modifyTradFiOrder() | ๐ | PUT | /tradfi/orders/{orderId} |
| cancelTradFiOrder() | ๐ | DELETE | /tradfi/orders/{orderId} |
| getTradFiOrderHistory() | ๐ | GET | /tradfi/orders/history |
| getTradFiPositions() | ๐ | GET | /tradfi/positions |
| modifyTradFiPosition() | ๐ | PUT | /tradfi/positions/{positionId} |
| closeTradFiPosition() | ๐ | POST | /tradfi/positions/{positionId}/close |
| getTradFiPositionHistory() | ๐ | GET | /tradfi/positions/history |
| getTradFiOrderLog() | ๐ | GET | /tradfi/orders/log/{log_id} |
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.
This client provides WebSocket API endpoints which allow for faster interactions with the Gate.io API via a WebSocket connection.
| Function | AUTH | HTTP Method | Endpoint |
|---|---|---|---|
| submitNewSpotOrder() | ๐ | WS | spot.order_place |
| cancelSpotOrder() | ๐ | WS | spot.order_cancel |
| cancelSpotOrderById() | ๐ | WS | spot.order_cancel_ids |
| cancelSpotOrderForSymbol() | ๐ | WS | spot.order_cancel_cp |
| updateSpotOrder() | ๐ | WS | spot.order_amend |
| getSpotOrderStatus() | ๐ | WS | spot.order_status |
| getSpotOrders() | ๐ | WS | spot.order_list |
| submitNewFuturesOrder() | ๐ | WS | futures.order_place |
| submitNewFuturesBatchOrder() | ๐ | WS | futures.order_batch_place |
| cancelFuturesOrder() | ๐ | WS | futures.order_cancel |
| cancelFuturesOrderById() | ๐ | WS | futures.order_cancel_ids |
| cancelFuturesAllOpenOrders() | ๐ | WS | futures.order_cancel_cp |
| updateFuturesOrder() | ๐ | WS | futures.order_amend |
| getFuturesOrders() | ๐ | WS | futures.order_list |
| getFuturesOrderStatus() | ๐ | WS | futures.order_status |
Gate JavaScript FAQ
What does the Gate JavaScript SDK cover?
Gate supports Spot, Futures, and WebSockets workflows. The JavaScript guide covers the main REST and WebSocket integration patterns.
How do I authenticate private Gate API calls in JavaScript?
Install gateio-api from npm & pass API credentials into the SDK client options, as shown in the Gate JavaScript examples above. The SDK handles the exchange-specific signing requirements for private requests.
Does the Gate JavaScript 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 Gate JavaScript 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 below for JavaScript and TypeScript-compatible request, authentication, WebSocket, and Node.js service patterns.