Class: RestClient
Unified REST API client for all of Gate's REST APIs
Extends
BaseRestClient
Constructors
Constructor
new RestClient(restClientOptions?: RestClientOptions, requestOptions?: AxiosRequestConfig): RestClient;Parameters
| Parameter | Type |
|---|---|
restClientOptions? | RestClientOptions |
requestOptions? | AxiosRequestConfig |
Returns
RestClient
Overrides
BaseRestClient.constructor
Methods
addAutoInvestPlanPosition()
addAutoInvestPlanPosition(params: AddAutoInvestPlanPositionReq): Promise<unknown>;Add position immediately (auto invest)
Parameters
| Parameter | Type |
|---|---|
params | AddAutoInvestPlanPositionReq |
Returns
Promise<unknown>
addUsersToStpGroup()
addUsersToStpGroup(params: object): Promise<StpGroupUser[]>;Add users to the STP group
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { body: number[]; stp_id: number; } | Parameters for adding users to the STP group |
params.body | number[] | - |
params.stp_id | number | - |
Returns
Promise<StpGroupUser[]>
Promise<StpResp[]>
amendOptionsOrder()
amendOptionsOrder(params: object & AmendOptionsOrderReq): Promise<SubmitOptionsOrderResp>;Amend an options order (modify price and/or size). Only orders with status open are supported.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | object & AmendOptionsOrderReq | order_id and amendment body (contract is required) |
Returns
Promise<SubmitOptionsOrderResp>
Promise<SubmitOptionsOrderResp>
batchCancelFuturesOrders()
batchCancelFuturesOrders(params: object): Promise<DeleteFuturesBatchOrdersResp[]>;Cancel a batch of orders with an ID list
Multiple distinct order ID list can be specified. Each request can cancel a maximum of 20 records.
NOTE: The "xGateExptime" parameter will translate to the "x-gate-exptime" header.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { orderIds: string[]; settle: FuturesSettle; xGateExptime?: number; } | Parameters for cancelling a batch of orders with an ID list |
params.orderIds | string[] | - |
params.settle | FuturesSettle | - |
params.xGateExptime? | number | - |
Returns
Promise<DeleteFuturesBatchOrdersResp[]>
Promise<DeleteFuturesBatchOrdersResp[]>
batchCancelSpotOrders()
batchCancelSpotOrders(body: CancelSpotBatchOrdersReq[], params?: object): Promise<DeleteSpotBatchOrdersResp[]>;Cancel a batch of orders with an ID list
Multiple currency pairs can be specified, but maximum 20 orders are allowed per request.
NOTE: The "xGateExptime" parameter will translate to the "x-gate-exptime" header.
Parameters
| Parameter | Type | Description |
|---|---|---|
body | CancelSpotBatchOrdersReq[] | - |
params? | { xGateExptime?: number; } | Parameters for cancelling a batch of orders |
params.xGateExptime? | number | - |
Returns
Promise<DeleteSpotBatchOrdersResp[]>
Promise<DeleteSpotBatchOrdersResp[]>
batchTerminateTrailOrders()
batchTerminateTrailOrders(params: BatchTerminateTrailOrdersReq): Promise<{
code?: number;
data?: {
orders?: TrailOrder[];
};
message?: string;
timestamp?: number;
}>;Batch terminate trail orders
Parameters
| Parameter | Type | Description |
|---|---|---|
params | BatchTerminateTrailOrdersReq | settle and optional contract, related_position |
Returns
Promise<{ code?: number; data?: { orders?: TrailOrder[]; }; message?: string; timestamp?: number; }>
Promise with code, message, timestamp and data.orders
batchUpdateFuturesOrders()
batchUpdateFuturesOrders(params: object): Promise<BatchAmendOrderResp[]>;Batch modify orders with specified IDs
You can specify multiple different order IDs. You can only modify up to 10 orders in one request.
NOTE: The "xGateExptime" parameter will translate to the "x-gate-exptime" header.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { orders: BatchAmendOrderReq[]; settle: FuturesSettle; xGateExptime?: number; } | Array of BatchAmendOrderReq objects |
params.orders | BatchAmendOrderReq[] | - |
params.settle | FuturesSettle | - |
params.xGateExptime? | number | - |
Returns
Promise<BatchAmendOrderResp[]>
Promise<BatchAmendOrderResp[]>
batchUpdateSpotOrders()
batchUpdateSpotOrders(body: UpdateSpotBatchOrdersReq[], params?: object): Promise<SpotOrder[]>;Batch modification of orders
Default modification of orders for spot, portfolio, and margin accounts. To modify orders for a cross margin account, the account parameter must be specified as cross_margin. For portfolio margin accounts, the account parameter can only be specified as cross_margin. Currently, only modifications to price or quantity (choose one) are supported.
NOTE: The "xGateExptime" parameter will translate to the "x-gate-exptime" header.
Parameters
| Parameter | Type | Description |
|---|---|---|
body | UpdateSpotBatchOrdersReq[] | - |
params? | { xGateExptime?: number; } | Parameters for batch modification of orders |
params.xGateExptime? | number | - |
Returns
Promise<SpotOrder[]>
Promise<Order[]>
cancelAllDeliveryOrders()
cancelAllDeliveryOrders(params: object): Promise<FuturesOrder[]>;Cancel all open orders matched
Zero-filled order cannot be retrieved 10 minutes after order cancellation
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { contract: string; settle: "usdt"; side?: "ask" | "bid"; } | Parameters for cancelling all open orders matched |
params.contract | string | - |
params.settle | "usdt" | - |
params.side? | "ask" | "bid" | - |
Returns
Promise<FuturesOrder[]>
Promise<FuturesOrder[]>
cancelAllFuturesOrders()
cancelAllFuturesOrders(params: DeleteAllFuturesOrdersReq): Promise<FuturesOrder[]>;Cancel all open orders matched
Zero-filled order cannot be retrieved 10 minutes after order cancellation.
NOTE: The "xGateExptime" parameter will translate to the "x-gate-exptime" header.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | DeleteAllFuturesOrdersReq | Parameters for cancelling all open orders matched |
Returns
Promise<FuturesOrder[]>
Promise<FuturesOrder[]>
cancelAllOpenDeliveryOrders()
cancelAllOpenDeliveryOrders(params: object): Promise<FuturesPriceTriggeredOrder[]>;Cancel all open orders
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { contract: string; settle: "usdt"; } | Parameters for cancelling all open orders |
params.contract | string | - |
params.settle | "usdt" | - |
Returns
Promise<FuturesPriceTriggeredOrder[]>
Promise<FuturesPriceTriggeredOrder[]>
cancelAllOpenFuturesOrders()
cancelAllOpenFuturesOrders(params: object): Promise<FuturesPriceTriggeredOrder[]>;Cancel all open orders
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { contract: string; settle: FuturesSettle; } | Parameters for cancelling all open orders |
params.contract | string | - |
params.settle | FuturesSettle | - |
Returns
Promise<FuturesPriceTriggeredOrder[]>
Promise<FuturesPriceTriggeredOrder[]>
cancelAllOpenOptionsOrders()
cancelAllOpenOptionsOrders(params: object): Promise<SubmitOptionsOrderResp[]>;Cancel all open orders matched
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { contract?: string; side?: "ask" | "bid"; underlying?: string; } | Parameters for canceling all open orders matched |
params.contract? | string | - |
params.side? | "ask" | "bid" | - |
params.underlying? | string | - |
Returns
Promise<SubmitOptionsOrderResp[]>
Promise<SubmitOptionsOrderResp[]>
cancelAllOpenSpotOrders()
cancelAllOpenSpotOrders(params?: object): Promise<SpotPriceTriggeredOrder[]>;Cancel all open orders
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | { account?: "margin" | "cross_margin" | "normal"; market?: string; } | Parameters for cancelling all open orders |
params.account? | "margin" | "cross_margin" | "normal" | - |
params.market? | string | - |
Returns
Promise<SpotPriceTriggeredOrder[]>
Promise<SpotPriceTriggeredOrder[]>
cancelAllStockOrders()
cancelAllStockOrders(): Promise<StockApiResp<Record<string, never>>>;Cancel all open stock orders
Returns
Promise<StockApiResp<Record<string, never>>>
Promise with empty data on success
cancelBatchCrossExOrders()
cancelBatchCrossExOrders(params: CancelBatchCrossExOrdersReq[]): Promise<CancelBatchCrossExOrdersResp[]>;Batch cancel CrossEx orders
Cancel multiple CrossEx orders by order_id or custom text. When both are provided, order_id takes precedence. Each result reports whether the request was accepted plus any error label and message. Rate Limit: 100 requests per 10 seconds
Parameters
| Parameter | Type | Description |
|---|---|---|
params | CancelBatchCrossExOrdersReq[] | Array of cancel requests (order_id and/or text) |
Returns
Promise<CancelBatchCrossExOrdersResp[]>
Promise with array of batch cancel results
cancelCrossExOrder()
cancelCrossExOrder(order_id: string): Promise<CancelCrossExOrderResp>;Cancel Order
Cancel an order. Rate Limit: 100 requests per 10 seconds
Parameters
| Parameter | Type | Description |
|---|---|---|
order_id | string | Order ID or Text for Cancel Order |
Returns
Promise<CancelCrossExOrderResp>
Promise with cancellation confirmation
cancelDeliveryOrder()
cancelDeliveryOrder(params: object): Promise<FuturesOrder>;Cancel a single order
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { order_id: string; settle: "usdt"; } | Parameters for cancelling a single order |
params.order_id | string | - |
params.settle | "usdt" | - |
Returns
Promise<FuturesOrder>
Promise<FuturesOrder>
cancelFuturesOrder()
cancelFuturesOrder(params: object): Promise<FuturesOrder>;Cancel a single order
NOTE: The "xGateExptime" parameter will translate to the "x-gate-exptime" header.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { action_mode?: "ACK" | "RESULT" | "FULL"; order_id: string; settle: FuturesSettle; xGateExptime?: number; } | Parameters for cancelling a single order |
params.action_mode? | "ACK" | "RESULT" | "FULL" | - |
params.order_id | string | - |
params.settle | FuturesSettle | - |
params.xGateExptime? | number | - |
Returns
Promise<FuturesOrder>
Promise<FuturesOrder>
cancelFuturesPriceTriggeredOrder()
cancelFuturesPriceTriggeredOrder(params: object): Promise<FuturesPriceTriggeredOrder>;Cancel a price-triggered order
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { order_id: number; settle: FuturesSettle; } | Parameters for cancelling a price-triggered order |
params.order_id | number | - |
params.settle | FuturesSettle | - |
Returns
Promise<FuturesPriceTriggeredOrder>
Promise<FuturesPriceTriggeredOrder>
cancelOptionsOrder()
cancelOptionsOrder(params: object): Promise<SubmitOptionsOrderResp>;Cancel a single order
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { order_id: number; } | Parameters for canceling a single order |
params.order_id | number | - |
Returns
Promise<SubmitOptionsOrderResp>
Promise<SubmitOptionsOrderResp>
cancelOTCOrder()
cancelOTCOrder(params: CancelOTCOrderReq): Promise<OTCActionResp>;Fiat order cancellation
Cancel fiat order
Parameters
| Parameter | Type | Description |
|---|---|---|
params | CancelOTCOrderReq | Parameters with order_id |
Returns
Promise<OTCActionResp>
Promise with cancellation confirmation
cancelP2PMerchantTransaction()
cancelP2PMerchantTransaction(params: P2PMerchantCancelTransactionReq): Promise<P2PMerchantApiResp<Record<string, unknown>>>;Cancel order
Parameters
| Parameter | Type |
|---|---|
params | P2PMerchantCancelTransactionReq |
Returns
Promise<P2PMerchantApiResp<Record<string, unknown>>>
cancelSpotOpenOrders()
cancelSpotOpenOrders(params: object): Promise<SpotOrder[]>;Cancel all open orders in specified currency pair
If account is not set, all open orders, including spot, portfolio, margin and cross margin ones, will be cancelled. You can set account to cancel only orders within the specified account.
NOTE: The "xGateExptime" parameter will translate to the "x-gate-exptime" header.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { account?: "spot" | "margin" | "cross_margin" | "unified"; action_mode?: "ACK" | "RESULT" | "FULL"; currency_pair: string; side?: "buy" | "sell"; trade_quote?: string; xGateExptime?: number; } | Parameters for cancelling all open orders in specified currency pair |
params.account? | "spot" | "margin" | "cross_margin" | "unified" | - |
params.action_mode? | "ACK" | "RESULT" | "FULL" | - |
params.currency_pair | string | - |
params.side? | "buy" | "sell" | - |
params.trade_quote? | string | - |
params.xGateExptime? | number | - |
Returns
Promise<SpotOrder[]>
Promise<Order[]>
cancelSpotOrder()
cancelSpotOrder(params: DeleteSpotOrderReq): Promise<SpotOrder>;Cancel a single order
Spot, portfolio and margin orders are cancelled by default. If trying to cancel cross margin orders or portfolio margin account are used, account must be set to cross_margin.
NOTE: The "xGateExptime" parameter will translate to the "x-gate-exptime" header.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | DeleteSpotOrderReq | Parameters for cancelling a single order |
Returns
Promise<SpotOrder>
Promise<Order>
See
cancelSpotPovOrder()
cancelSpotPovOrder(params: object): Promise<SpotPovOrder>;Cancel a Spot POV order
Supports the order ID returned after creation, or the custom ID specified in the text field.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { order_id: string; } | Parameters containing the order ID |
params.order_id | string | - |
Returns
Promise<SpotPovOrder>
Promise<SpotPovOrder>
cancelSpotPovOrders()
cancelSpotPovOrders(params?: CancelSpotPovOrdersReq): Promise<SpotPovOrder[]>;Cancel Spot POV orders
Cancel Spot POV orders in bulk. Optionally filter by currency pair.
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | CancelSpotPovOrdersReq | Optional parameters for cancelling Spot POV orders |
Returns
Promise<SpotPovOrder[]>
Promise<SpotPovOrder[]>
cancelSpotTriggeredOrder()
cancelSpotTriggeredOrder(params: object): Promise<SpotPriceTriggeredOrder>;Cancel a price-triggered order
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { order_id: string; } | Parameters for cancelling a price-triggered order |
params.order_id | string | - |
Returns
Promise<SpotPriceTriggeredOrder>
Promise<SpotPriceTriggeredOrder>
cancelStockOrder()
cancelStockOrder(orderId: number): Promise<StockApiResp<Record<string, never>>>;Cancel a stock order
Parameters
| Parameter | Type | Description |
|---|---|---|
orderId | number | Order ID |
Returns
Promise<StockApiResp<Record<string, never>>>
Promise with empty data on success
cancelTradFiOrder()
cancelTradFiOrder(orderId: number): Promise<Record<string, never>>;Parameters
| Parameter | Type |
|---|---|
orderId | number |
Returns
Promise<Record<string, never>>
cancelTriggeredDeliveryOrder()
cancelTriggeredDeliveryOrder(params: object): Promise<FuturesPriceTriggeredOrder>;Cancel a price-triggered order
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { order_id: string; settle: "usdt"; } | Parameters for cancelling a price-triggered order |
params.order_id | string | - |
params.settle | "usdt" | - |
Returns
Promise<FuturesPriceTriggeredOrder>
Promise<FuturesPriceTriggeredOrder>
cancelWithdrawal()
cancelWithdrawal(params: object): Promise<WithdrawalRecord>;Cancel withdrawal with specified ID
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { withdrawal_id: string; } | Parameters containing the withdrawal ID |
params.withdrawal_id | string | - |
Returns
Promise<WithdrawalRecord>
Promise<WithdrawalRecord>
closeCrossExPosition()
closeCrossExPosition(params: CloseCrossExPositionReq): Promise<CloseCrossExPositionResp>;Full Close Position
Fully close a position. Rate Limit: 100 requests per day
Parameters
| Parameter | Type | Description |
|---|---|---|
params | CloseCrossExPositionReq | Position close parameters |
Returns
Promise<CloseCrossExPositionResp>
Promise with close position confirmation
closeStockPosition()
closeStockPosition(params: CloseStockPositionReq): Promise<StockApiResp<StockClosePositionResult>>;Close a stock position
Parameters
| Parameter | Type | Description |
|---|---|---|
params | CloseStockPositionReq | Close parameters (partial or full) |
Returns
Promise<StockApiResp<StockClosePositionResult>>
Promise with close order ID
closeTradFiPosition()
closeTradFiPosition(positionId: number, params: TradFiClosePositionReq): Promise<TradFiApiResp<Record<string, never>>>;Parameters
| Parameter | Type |
|---|---|
positionId | number |
params | TradFiClosePositionReq |
Returns
Promise<TradFiApiResp<Record<string, never>>>
confirmP2PMerchantPayment()
confirmP2PMerchantPayment(params: P2PMerchantConfirmPaymentReq): Promise<P2PMerchantApiResp<Record<string, unknown>>>;Confirm payment
Parameters
| Parameter | Type |
|---|---|
params | P2PMerchantConfirmPaymentReq |
Returns
Promise<P2PMerchantApiResp<Record<string, unknown>>>
confirmP2PMerchantReceipt()
confirmP2PMerchantReceipt(params: P2PMerchantConfirmReceiptReq): Promise<P2PMerchantApiResp<Record<string, unknown>>>;Confirm receipt
Parameters
| Parameter | Type |
|---|---|
params | P2PMerchantConfirmReceiptReq |
Returns
Promise<P2PMerchantApiResp<Record<string, unknown>>>
convertSmallBalance()
convertSmallBalance(params?: object): Promise<any>;Convert small balance
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | { currency?: string[]; is_all?: boolean; } | Parameters for converting small balance |
params.currency? | string[] | - |
params.is_all? | boolean | - |
Returns
Promise<any>
Promise<any>
createAlphaOrder()
createAlphaOrder(params: CreateAlphaOrderReq): Promise<CreateAlphaOrderResp>;Alpha Order API
Create an alpha order. Rate-limited at 5 requests per second per user.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | CreateAlphaOrderReq | Order parameters including quote_id |
Returns
Promise<CreateAlphaOrderResp>
Promise with order details
createAlphaQuote()
createAlphaQuote(params: CreateAlphaQuoteReq): Promise<CreateAlphaQuoteResp>;Alpha Quote API
Get a quote for alpha trading. Quote is valid for 1 minute. Rate-limited at 10 requests per second per user.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | CreateAlphaQuoteReq | Quote parameters |
Returns
Promise<CreateAlphaQuoteResp>
Promise with quote details
createAutoInvestPlan()
createAutoInvestPlan(params: CreateAutoInvestPlanReq): Promise<CreateAutoInvestPlanResp>;Create auto invest plan
Parameters
| Parameter | Type |
|---|---|
params | CreateAutoInvestPlanReq |
Returns
Promise<CreateAutoInvestPlanResp>
createChaseOrder()
createChaseOrder(params: CreateChaseOrderReq): Promise<CreateChaseOrderResp>;Create a chase limit order
Parameters
| Parameter | Type |
|---|---|
params | CreateChaseOrderReq |
Returns
Promise<CreateChaseOrderResp>
createCrossExConvertOrder()
createCrossExConvertOrder(params: CreateCrossExConvertOrderReq): Promise<CreateCrossExConvertOrderResp>;Flash Swap Transaction
Execute a flash swap transaction. Rate limit: 10 requests per 10 seconds
Parameters
| Parameter | Type | Description |
|---|---|---|
params | CreateCrossExConvertOrderReq | Parameters with quote_id |
Returns
Promise<CreateCrossExConvertOrderResp>
Promise with transaction confirmation
createCrossExConvertQuote()
createCrossExConvertQuote(params: CreateCrossExConvertQuoteReq): Promise<CreateCrossExConvertQuoteResp>;Flash Swap Inquiry
Create a flash swap quote. Rate Limit: 100 requests per day
Parameters
| Parameter | Type | Description |
|---|---|---|
params | CreateCrossExConvertQuoteReq | Quote parameters |
Returns
Promise<CreateCrossExConvertQuoteResp>
Promise with quote details
createCrossExOrder()
createCrossExOrder(params: CreateCrossExOrderReq): Promise<CreateCrossExOrderResp>;Create an order
Create an order for cross-exchange trading. Rate Limit: 100 requests per 10 seconds. Stocks and ETFs also allow 1 request per second per user, and only in cross-exchange account mode with time_in_force GTC and qty. quote_qty is not supported. Stock and ETF prices use the listing market currency (USD, HKD, KRW, JPY).
Parameters
| Parameter | Type | Description |
|---|---|---|
params | CreateCrossExOrderReq | Order parameters |
Returns
Promise<CreateCrossExOrderResp>
Promise with order creation response
createCrossExTransfer()
createCrossExTransfer(params: CreateCrossExTransferReq): Promise<CreateCrossExTransferResp>;Fund Transfer
Transfer funds between accounts. Rate limit: 10 requests per 10 seconds
Parameters
| Parameter | Type | Description |
|---|---|---|
params | CreateCrossExTransferReq | Transfer parameters |
Returns
Promise<CreateCrossExTransferResp>
Promise with transfer confirmation
createDepositAddress()
createDepositAddress(params: object): Promise<CreateDepositAddressResp>;Generate currency deposit address
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { currency: string; } | Parameters containing the currency name |
params.currency | string | - |
Returns
Promise<CreateDepositAddressResp>
Promise<CreateDepositAddressResp>
createEarnFixedTermLend()
createEarnFixedTermLend(params: CreateEarnFixedTermLendReq): Promise<CreateEarnFixedTermLendResponse>;Subscribe to a fixed-term earn product.
Parameters
| Parameter | Type |
|---|---|
params | CreateEarnFixedTermLendReq |
Returns
Promise<CreateEarnFixedTermLendResponse>
createEarnFixedTermPreRedeem()
createEarnFixedTermPreRedeem(params: EarnFixedTermPreRedeemReq): Promise<CreateEarnFixedTermPreRedeemResponse>;Early redeem a fixed-term earn order.
Parameters
| Parameter | Type |
|---|---|
params | EarnFixedTermPreRedeemReq |
Returns
Promise<CreateEarnFixedTermPreRedeemResponse>
createOTCBank()
createOTCBank(params: CreateOTCBankReq): Promise<CreateOTCBankResp>;Create / bind a bank card (multipart/form-data)
Parameters
| Parameter | Type |
|---|---|
params | CreateOTCBankReq |
Returns
Promise<CreateOTCBankResp>
createOTCFiatOrder()
createOTCFiatOrder(params: CreateOTCFiatOrderReq): Promise<OTCActionResp>;Create fiat order
Create a fiat order, supporting BUY for on-ramp and SELL for off-ramp
Parameters
| Parameter | Type | Description |
|---|---|---|
params | CreateOTCFiatOrderReq | Fiat order parameters |
Returns
Promise<OTCActionResp>
Promise with order creation confirmation
createOTCQuote()
createOTCQuote(params: CreateOTCQuoteReq): Promise<CreateOTCQuoteResp>;Fiat and stablecoin quote
Create fiat and stablecoin quotes, supporting both PAY and GET directions
Parameters
| Parameter | Type | Description |
|---|---|---|
params | CreateOTCQuoteReq | Quote parameters |
Returns
Promise<CreateOTCQuoteResp>
Promise with quote details including rate, amounts, and quote_token
createOTCStablecoinOrder()
createOTCStablecoinOrder(params: CreateOTCStablecoinOrderReq): Promise<CreateOTCStablecoinOrderResp>;Create stablecoin order
Create stablecoin order
Parameters
| Parameter | Type | Description |
|---|---|---|
params | CreateOTCStablecoinOrderReq | Stablecoin order parameters |
Returns
Promise<CreateOTCStablecoinOrderResp>
Promise with order creation confirmation
createOTCUploadPreUpload()
createOTCUploadPreUpload(params: CreateOTCUploadPreUploadReq): Promise<CreateOTCUploadPreUploadResp>;Parameters
| Parameter | Type |
|---|---|
params | CreateOTCUploadPreUploadReq |
Returns
Promise<CreateOTCUploadPreUploadResp>
createQuickRepayment()
createQuickRepayment(params: CreateQuickRepaymentReq): Promise<QuickRepaymentResp>;Execute quick repayment
Parameters
| Parameter | Type |
|---|---|
params | CreateQuickRepaymentReq |
Returns
Promise<QuickRepaymentResp>
createSpotPovOrder()
createSpotPovOrder(params: CreateSpotPovOrderReq): Promise<SpotPovOrder>;Create a Spot POV order
Create a percentage-of-volume strategy order with a target participation rate, validity period, and optional limit/trigger prices.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | CreateSpotPovOrderReq | Parameters for creating a Spot POV order |
Returns
Promise<SpotPovOrder>
Promise<SpotPovOrder>
createStockOrder()
createStockOrder(params: CreateStockOrderReq): Promise<StockApiResp<StockCreateOrderResult>>;Create a stock order
Limit orders support only the all trading session; market orders support only regular. time_in_force supports day only.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | CreateStockOrderReq | Order parameters |
Returns
Promise<StockApiResp<StockCreateOrderResult>>
Promise with created order ID
createStockTransaction()
createStockTransaction(params: CreateStockTransactionReq): Promise<StockApiResp<Record<string, never>>>;Fund transfer for stock account
Transfer funds in or out of the stock account (USDT only).
Parameters
| Parameter | Type | Description |
|---|---|---|
params | CreateStockTransactionReq | Transfer parameters including ref_id for idempotency |
Returns
Promise<StockApiResp<Record<string, never>>>
Promise with empty data on success
createStpGroup()
createStpGroup(params: CreateStpGroupReq): Promise<StpGroup>;Create STP Group
Parameters
| Parameter | Type | Description |
|---|---|---|
params | CreateStpGroupReq | Parameters for creating an STP group |
Returns
Promise<StpGroup>
Promise<CreateStpGroupResp>
createSubAccount()
createSubAccount(params: CreateSubAccountReq): Promise<SubAccount>;Create a new sub-account
Parameters
| Parameter | Type | Description |
|---|---|---|
params | CreateSubAccountReq | Parameters for creating a new sub-account |
Returns
Promise<SubAccount>
Promise<CreateSubAccountResp>
createSubAccountApiKey()
createSubAccountApiKey(params: CreateSubAccountApiKeyReq): Promise<CreatedSubAccountAPIKey>;Create API Key of the sub-account
Parameters
| Parameter | Type | Description |
|---|---|---|
params | CreateSubAccountApiKeyReq | Parameters for creating API Key of the sub-account |
Returns
Promise<CreatedSubAccountAPIKey>
Promise<CreateSubAccountApiKeyResp>
createTradFiOrder()
createTradFiOrder(params: TradFiCreateOrderReq): Promise<TradFiApiResp<TradFiCreateOrderResult>>;Parameters
| Parameter | Type |
|---|---|
params | TradFiCreateOrderReq |
Returns
Promise<TradFiApiResp<TradFiCreateOrderResult>>
createTradFiTransaction()
createTradFiTransaction(params: TradFiCreateTransactionReq): Promise<TradFiApiResp<Record<string, never>>>;Parameters
| Parameter | Type |
|---|---|
params | TradFiCreateTransactionReq |
Returns
Promise<TradFiApiResp<Record<string, never>>>
createTradFiUser()
createTradFiUser(): Promise<TradFiApiResp<TradFiCreateUserResult>>;Returns
Promise<TradFiApiResp<TradFiCreateUserResult>>
createTrailOrder()
createTrailOrder(params: CreateTrailOrderReq): Promise<{
code?: number;
data?: {
id?: string;
};
message?: string;
timestamp?: number;
}>;Create trail order
Parameters
| Parameter | Type | Description |
|---|---|---|
params | CreateTrailOrderReq | settle and trail order parameters |
Returns
Promise<{ code?: number; data?: { id?: string; }; message?: string; timestamp?: number; }>
Promise with code, message, timestamp and data.id
deleteOTCBank()
deleteOTCBank(params: OTCBankIdReq): Promise<OTCActionResp>;Delete a bank card
Parameters
| Parameter | Type |
|---|---|
params | OTCBankIdReq |
Returns
Promise<OTCActionResp>
deleteSubAccountApiKey()
deleteSubAccountApiKey(params: object): Promise<any>;Delete API key of the sub-account
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { key: string; user_id: number; } | Parameters for deleting API key of the sub-account |
params.key | string | - |
params.user_id | number | - |
Returns
Promise<any>
Promise<any>
deleteUserFromStpGroup()
deleteUserFromStpGroup(params: object): Promise<StpGroupUser[]>;Delete the user in the STP group
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { stp_id: number; user_id: number; } | Parameters for deleting users from the STP group |
params.stp_id | number | - |
params.user_id | number | - |
Returns
Promise<StpGroupUser[]>
Promise<StpResp[]>
fetchLatencySummary()
fetchLatencySummary(): Promise<any>;This method is used to get the latency and time sync between the client and the server. This is not official API endpoint and is only used for internal testing purposes. Use this method to check the latency and time sync between the client and the server. Final values might vary slightly, but it should be within few ms difference. If you have any suggestions or improvements to this measurement, please create an issue or pull request on GitHub.
Returns
Promise<any>
getAccountDetail()
getAccountDetail(): Promise<AccountDetail>;Get account detail
Returns
Promise<AccountDetail>
Promise<GetAccountDetailResp>
getAccountMainKeys()
getAccountMainKeys(): Promise<AccountMainKey[]>;Query all main account API key information
Returns
Promise<AccountMainKey[]>
Promise<AccountMainKey[]>
getAccountRateLimit()
getAccountRateLimit(): Promise<AccountRateLimit[]>;Get user transaction rate limit information
Returns
Promise<AccountRateLimit[]>
Promise<AccountRateLimit[]>
getAgencyCommissionHistory()
getAgencyCommissionHistory(params: GetAgencyCommissionHistoryReq): Promise<{
list: AgencyCommissionHistoryRecord[];
total: number;
}>;The agency obtains the commission history of the recommended user. Record time range cannot exceed 30 days.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | GetAgencyCommissionHistoryReq | Parameters for retrieving commission history |
Returns
Promise<{ list: AgencyCommissionHistoryRecord[]; total: number; }>
Promise<GetAgencyCommissionHistoryResp>
getAgencyTransactionHistory()
getAgencyTransactionHistory(params: GetAgencyTransactionHistoryReq): Promise<{
list: AgencyTransactionHistoryRecord[];
total: number;
}>;The agency obtains the transaction history of the recommended user. Record time range cannot exceed 30 days.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | GetAgencyTransactionHistoryReq | Parameters for retrieving transaction history |
Returns
Promise<{ list: AgencyTransactionHistoryRecord[]; total: number; }>
Promise<GetAgencyTransactionHistoryResp>
getAllDeliveryContracts()
getAllDeliveryContracts(params: object): Promise<FuturesDeliveryContract[]>;List all futures contracts
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { settle: "usdt"; } | Parameters for listing all futures contracts |
params.settle | "usdt" | - |
Returns
Promise<FuturesDeliveryContract[]>
Promise<DeliveryContract[]>
getAlphaAccountBook()
getAlphaAccountBook(params: GetAlphaAccountBookReq): Promise<AlphaAccountBook[]>;Query asset transactions
Query alpha account transaction history
Parameters
| Parameter | Type | Description |
|---|---|---|
params | GetAlphaAccountBookReq | Parameters with required from timestamp |
Returns
Promise<AlphaAccountBook[]>
Promise with array of transaction records
getAlphaAccounts()
getAlphaAccounts(): Promise<AlphaAccount[]>;Query position assets
Query alpha account position assets
Returns
Promise<AlphaAccount[]>
Promise with array of account balances
getAlphaCurrencies()
getAlphaCurrencies(params?: GetAlphaCurrenciesReq): Promise<AlphaCurrency[]>;Query currency information
Query alpha currency information. When currency is provided, returns specific currency info; otherwise returns paginated list.
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | GetAlphaCurrenciesReq | Optional filter parameters |
Returns
Promise<AlphaCurrency[]>
Promise with array of currency information
getAlphaOrder()
getAlphaOrder(params: GetAlphaOrderReq): Promise<AlphaOrder>;Alpha Single Order Query API
Query a single alpha order by order ID
Parameters
| Parameter | Type | Description |
|---|---|---|
params | GetAlphaOrderReq | Parameters with order_id |
Returns
Promise<AlphaOrder>
Promise with order details
getAlphaOrders()
getAlphaOrders(params?: GetAlphaOrdersReq): Promise<AlphaOrder[]>;Alpha Order List API
Query alpha order list with filters
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | GetAlphaOrdersReq | Filter parameters |
Returns
Promise<AlphaOrder[]>
Promise with array of orders
getAlphaTickers()
getAlphaTickers(params?: GetAlphaTickersReq): Promise<AlphaTicker[]>;Query currency ticker
Query alpha currency ticker. When currency is provided, returns specific ticker; otherwise returns paginated list.
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | GetAlphaTickersReq | Optional filter parameters |
Returns
Promise<AlphaTicker[]>
Promise with array of ticker information
getAutoInvestCoins()
getAutoInvestCoins(params?: GetAutoInvestCoinsReq): Promise<AutoInvestCoinItem[]>;List currencies supporting auto invest
Parameters
| Parameter | Type |
|---|---|
params? | GetAutoInvestCoinsReq |
Returns
Promise<AutoInvestCoinItem[]>
getAutoInvestConfig()
getAutoInvestConfig(): Promise<AutoInvestConfigItem[]>;List investment currency configuration
Returns
Promise<AutoInvestConfigItem[]>
getAutoInvestMinAmount()
getAutoInvestMinAmount(params: GetAutoInvestMinAmountReq): Promise<AutoInvestMinAmountResp>;Get minimum investment amount for a portfolio
Parameters
| Parameter | Type |
|---|---|
params | GetAutoInvestMinAmountReq |
Returns
Promise<AutoInvestMinAmountResp>
getAutoInvestOrders()
getAutoInvestOrders(params: GetAutoInvestOrdersReq): Promise<AutoInvestOrderItem[]>;List plan execution order details
Parameters
| Parameter | Type |
|---|---|
params | GetAutoInvestOrdersReq |
Returns
Promise<AutoInvestOrderItem[]>
getAutoInvestPlanDetail()
getAutoInvestPlanDetail(params: GetAutoInvestPlanDetailReq): Promise<AutoInvestPlanDetail>;Get auto invest plan details
Parameters
| Parameter | Type |
|---|---|
params | GetAutoInvestPlanDetailReq |
Returns
Promise<AutoInvestPlanDetail>
getAutoInvestPlanRecords()
getAutoInvestPlanRecords(params: GetAutoInvestPlanRecordsReq): Promise<AutoInvestPlanExecutionRecordsPaginated>;List plan execution records
Parameters
| Parameter | Type |
|---|---|
params | GetAutoInvestPlanRecordsReq |
Returns
Promise<AutoInvestPlanExecutionRecordsPaginated>
getAutoInvestPlans()
getAutoInvestPlans(params: GetAutoInvestPlansReq): Promise<AutoInvestPlansListResp>;List auto invest plans
Parameters
| Parameter | Type |
|---|---|
params | GetAutoInvestPlansReq |
Returns
Promise<AutoInvestPlansListResp>
getAutoRepaymentSetting()
getAutoRepaymentSetting(): Promise<{
status: "on" | "off";
}>;Retrieve user auto repayment setting
Returns
Promise<{ status: "on" | "off"; }>
Promise<{ status: 'on' | 'off' }>
getBalances()
getBalances(params?: object): Promise<GetBalancesResp>;Retrieve user's total balances
This endpoint returns an approximate sum of exchanged amount from all currencies to input currency for each account. The exchange rate and account balance could have been cached for at most 1 minute. It is not recommended to use its result for any trading calculation.
For trading calculation, use the corresponding account query endpoint for each account type. For example:
- GET /spot/accounts to query spot account balance
- GET /margin/accounts to query margin account balance
- GET /futures/{settle}/accounts to query futures account balance
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | { currency?: string; } | Parameters for retrieving total balances |
params.currency? | string | - |
Returns
Promise<GetBalancesResp>
Promise<GetBalancesResp>
getBatchFundingRates()
getBatchFundingRates(params: BatchFundingRatesReq): Promise<BatchFundingRatesResponse[]>;Batch query historical funding rate data for perpetual contracts
Parameters
| Parameter | Type | Description |
|---|---|---|
params | BatchFundingRatesReq | settle and array of contract names |
Returns
Promise<BatchFundingRatesResponse[]>
Promise<BatchFundingRatesResponse[]>
getBrokerCommissionHistory()
getBrokerCommissionHistory(params: GetBrokerCommissionHistoryReq): Promise<{
list: BrokerCommissionHistoryRecord[];
total: number;
}>;The broker obtains the user's commission rebate records. Record time range cannot exceed 30 days.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | GetBrokerCommissionHistoryReq | Parameters for retrieving commission rebate records |
Returns
Promise<{ list: BrokerCommissionHistoryRecord[]; total: number; }>
Promise<GetBrokerCommissionHistoryResp>
getBrokerTransactionHistory()
getBrokerTransactionHistory(params: GetBrokerTransactionHistoryReq): Promise<{
list: BrokerTransactionHistoryRecord[];
total: number;
}>;The broker obtains the user's trading history. Record time range cannot exceed 30 days.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | GetBrokerTransactionHistoryReq | Parameters for retrieving trading history |
Returns
Promise<{ list: BrokerTransactionHistoryRecord[]; total: number; }>
Promise<GetBrokerTransactionHistoryResp>
getChaseOrderDetail()
getChaseOrderDetail(params: GetChaseOrderDetailReq): Promise<GetChaseOrderDetailResp>;Get chase order detail
Parameters
| Parameter | Type |
|---|---|
params | GetChaseOrderDetailReq |
Returns
Promise<GetChaseOrderDetailResp>
getChaseOrders()
getChaseOrders(params: GetChaseOrdersReq): Promise<GetChaseOrdersResp>;List chase orders
Parameters
| Parameter | Type |
|---|---|
params | GetChaseOrdersReq |
Returns
Promise<GetChaseOrdersResp>
getClientType()
getClientType(): "main";Gate.io misc endpoints
Returns
"main"
Overrides
BaseRestClient.getClientType
getCrossExAccountBook()
getCrossExAccountBook(params?: GetCrossExAccountBookReq): Promise<CrossExAccountBook[]>;Query Account Asset Change History
Query account balance change history. Rate Limit: 200 requests per 10 seconds. statement_type includes SECURITY_DIVIDEND (stock or ETF dividend) and SECURITY_CORPORATE_ACTION (split or reverse split). Filter with the same values.
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | GetCrossExAccountBookReq | Optional filter parameters |
Returns
Promise<CrossExAccountBook[]>
Promise with array of account book records
getCrossExAccounts()
getCrossExAccounts(params?: GetCrossExAccountsReq): Promise<CrossExAccount>;Query Account Assets
Query account assets and balances. Rate Limit: 200 requests per 10 seconds
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | GetCrossExAccountsReq | Optional exchange_type filter |
Returns
Promise<CrossExAccount>
Promise with account information
getCrossExAdlRank()
getCrossExAdlRank(params: GetCrossExAdlRankReq): Promise<CrossExAdlRank[]>;Query ADL Position Reduction Ranking
Query ADL position reduction ranking. Rate Limit: 200 requests per 10 seconds
Parameters
| Parameter | Type | Description |
|---|---|---|
params | GetCrossExAdlRankReq | Parameters with required symbol |
Returns
Promise<CrossExAdlRank[]>
Promise with array of ADL rankings
getCrossExCoinDiscountRate()
getCrossExCoinDiscountRate(params?: GetCrossExCoinDiscountRateReq): Promise<CrossExCoinDiscountRate[]>;Query currency discount rate
Query currency discount rate (for margin currency in isolated exchange mode). Rate Limit: 200 requests per 10 seconds
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | GetCrossExCoinDiscountRateReq | Optional filter parameters |
Returns
Promise<CrossExCoinDiscountRate[]>
Promise with array of coin discount rates
getCrossExFeeRate()
getCrossExFeeRate(): Promise<CrossExFeeRate[]>;Query User Fee Rates
Query user fee rates. Rate Limit: 200 requests per 10 seconds
Returns
Promise<CrossExFeeRate[]>
Promise with fee rates per exchange
getCrossExHistoryMarginInterests()
getCrossExHistoryMarginInterests(params?: GetCrossExHistoryMarginInterestsReq): Promise<CrossExHistoryMarginInterest[]>;Query Leveraged Interest Deduction History
Query margin interest deduction history. Rate Limit: 200 requests per 10 seconds
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | GetCrossExHistoryMarginInterestsReq | Optional filter parameters |
Returns
Promise<CrossExHistoryMarginInterest[]>
Promise with array of interest deduction records
getCrossExHistoryMarginPositions()
getCrossExHistoryMarginPositions(params?: GetCrossExHistoryMarginPositionsReq): Promise<CrossExHistoryMarginPosition[]>;Query Leveraged Position History
Query margin position history. Rate Limit: 200 requests per 10 seconds
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | GetCrossExHistoryMarginPositionsReq | Optional filter parameters |
Returns
Promise<CrossExHistoryMarginPosition[]>
Promise with array of historical margin positions
getCrossExHistoryOrders()
getCrossExHistoryOrders(params?: GetCrossExHistoryOrdersReq): Promise<CrossExOrder[]>;Query order history
Query historical orders. Rate Limit: 200 requests per 10 seconds
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | GetCrossExHistoryOrdersReq | Optional filter parameters |
Returns
Promise<CrossExOrder[]>
Promise with array of historical orders
getCrossExHistoryPositions()
getCrossExHistoryPositions(params?: GetCrossExHistoryPositionsReq): Promise<CrossExHistoryPosition[]>;Query Contract Position History
Query contract position history. Rate Limit: 200 requests per 10 seconds
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | GetCrossExHistoryPositionsReq | Optional filter parameters |
Returns
Promise<CrossExHistoryPosition[]>
Promise with array of historical positions
getCrossExHistoryTrades()
getCrossExHistoryTrades(params?: GetCrossExHistoryTradesReq): Promise<CrossExHistoryTrade[]>;Query filled history
Query trade execution history. Rate Limit: 200 requests per 10 seconds
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | GetCrossExHistoryTradesReq | Optional filter parameters |
Returns
Promise<CrossExHistoryTrade[]>
Promise with array of trade records
getCrossExInterestRate()
getCrossExInterestRate(params?: GetCrossExInterestRateReq): Promise<CrossExInterestRate[]>;Query margin asset interest rates
Query interest rates for margin assets. Rate Limit: 200 requests per 10 seconds
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | GetCrossExInterestRateReq | Optional filter parameters |
Returns
Promise<CrossExInterestRate[]>
Promise with array of interest rates
getCrossExMarginPositionLeverage()
getCrossExMarginPositionLeverage(params?: GetCrossExMarginPositionLeverageReq): Promise<CrossExMarginPositionLeverage[]>;Query Leveraged Trading Pair Leverage Multiplier
Query leverage for margin trading pairs. Rate Limit: 200 requests per 10 seconds
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | GetCrossExMarginPositionLeverageReq | Optional symbols filter |
Returns
Promise<CrossExMarginPositionLeverage[]>
Promise with array of leverage information
getCrossExMarginPositions()
getCrossExMarginPositions(params?: GetCrossExMarginPositionsReq): Promise<CrossExMarginPosition[]>;Query Leveraged Positions
Query margin/leveraged positions. Rate Limit: 200 requests per 10 seconds
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | GetCrossExMarginPositionsReq | Optional filter parameters |
Returns
Promise<CrossExMarginPosition[]>
Promise with array of margin positions
getCrossExMarketFundingInfo()
getCrossExMarketFundingInfo(params?: GetCrossExMarketFundingInfoReq): Promise<CrossExMarketFundingInfo[]>;Query CrossEx market funding info
Query futures funding rates, funding intervals, and next funding timestamps across exchanges.
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | GetCrossExMarketFundingInfoReq | Optional parameters to filter symbols |
Returns
Promise<CrossExMarketFundingInfo[]>
Promise with array of funding info records
getCrossExMarketTickers()
getCrossExMarketTickers(params?: GetCrossExMarketTickersReq): Promise<CrossExMarketTicker[]>;Query CrossEx market tickers
Query exchange market tickers, optionally filtered by a comma-separated list of symbols.
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | GetCrossExMarketTickersReq | Optional parameters to filter symbols |
Returns
Promise<CrossExMarketTicker[]>
Promise with array of market tickers
getCrossExOpenOrders()
getCrossExOpenOrders(params?: GetCrossExOpenOrdersReq): Promise<CrossExOrder[]>;Query All Current Open Orders
Query all current open orders. Rate Limit: 200 requests per 10 seconds
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | GetCrossExOpenOrdersReq | Optional filter parameters |
Returns
Promise<CrossExOrder[]>
Promise with array of open orders
getCrossExOrder()
getCrossExOrder(order_id: string): Promise<CrossExOrder>;Query order details
Query order details by order ID or custom text. Rate Limit: 200 requests per 10 seconds
Parameters
| Parameter | Type | Description |
|---|---|---|
order_id | string | Order ID or custom text |
Returns
Promise<CrossExOrder>
Promise with order details
getCrossExPositionLeverage()
getCrossExPositionLeverage(params?: GetCrossExPositionLeverageReq): Promise<CrossExPositionLeverage[]>;Query Contract Trading Pair Leverage Multiplier
Query leverage for contract trading pairs. Rate Limit: 200 requests per 10 seconds
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | GetCrossExPositionLeverageReq | Optional symbols filter |
Returns
Promise<CrossExPositionLeverage[]>
Promise with array of leverage information
getCrossExPositions()
getCrossExPositions(params?: GetCrossExPositionsReq): Promise<CrossExPosition[]>;Query Contract Positions
Query contract positions. Rate Limit: 200 requests per 10 seconds
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | GetCrossExPositionsReq | Optional filter parameters |
Returns
Promise<CrossExPosition[]>
Promise with array of positions
getCrossExRiskLimits()
getCrossExRiskLimits(params: GetCrossExRiskLimitsReq): Promise<CrossExRiskLimit[]>;Query Risk Limit Information
Query risk limit information for futures/margin trading pairs
Parameters
| Parameter | Type | Description |
|---|---|---|
params | GetCrossExRiskLimitsReq | Parameters with required symbols |
Returns
Promise<CrossExRiskLimit[]>
Promise with array of risk limit information
getCrossExSecurityPositions()
getCrossExSecurityPositions(params?: GetCrossExSecurityPositionsReq): Promise<CrossExSecurityPosition[]>;List stock and ETF positions
Prices, position value, and unrealized PnL use the listing market currency (USD, HKD, KRW, JPY). Rate Limit: 200 requests per 10 seconds.
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | GetCrossExSecurityPositionsReq | Optional symbol and exchange_type (US, HK, KR, JP) |
Returns
Promise<CrossExSecurityPosition[]>
getCrossExSymbols()
getCrossExSymbols(params?: GetCrossExSymbolsReq): Promise<CrossExSymbol[]>;Query Trading Pair Information
Stock and ETF symbols use {market}_{STOCK|ETF}_{code}_USDT (US_STOCK_AAPL_USDT, HK_STOCK_00700_USDT, US_ETF_SPY_USDT). tag is required: security description, Hyperliquid DEX info, or an empty string.
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | GetCrossExSymbolsReq | Optional parameters to filter symbols |
Returns
Promise<CrossExSymbol[]>
Promise with array of symbol information
getCrossExTransferCoins()
getCrossExTransferCoins(params?: GetCrossExTransferCoinsReq): Promise<CrossExTransferCoin[]>;Query Supported Transfer Currencies
Query supported transfer currencies for cross-exchange
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | GetCrossExTransferCoinsReq | Optional currency filter |
Returns
Promise<CrossExTransferCoin[]>
Promise with array of transfer coin information
getCrossExTransferHistory()
getCrossExTransferHistory(params?: GetCrossExTransferHistoryReq): Promise<CrossExTransferHistory[]>;Query Fund Transfer History
Query fund transfer history. Rate Limit: 200 requests per 10 seconds
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | GetCrossExTransferHistoryReq | Optional filter parameters |
Returns
Promise<CrossExTransferHistory[]>
Promise with array of transfer history records
getCrossMarginAccount()
getCrossMarginAccount(): Promise<CrossMarginAccount>;Returns
Promise<CrossMarginAccount>
Promise<GetCrossMarginAccountResp>
Deprecated
as of 2025-02-10 Retrieve cross margin account
getCrossMarginAccountHistory()
getCrossMarginAccountHistory(params?: GetCrossMarginAccountHistoryReq): Promise<CrossMarginAccountHistoryRecord[]>;Parameters
| Parameter | Type | Description |
|---|---|---|
params? | GetCrossMarginAccountHistoryReq | Parameters for retrieving cross margin account change history |
Returns
Promise<CrossMarginAccountHistoryRecord[]>
Promise<GetCrossMarginAccountHistoryResp[]>
Deprecated
as of 2025-02-10 Retrieve cross margin account change history
Record time range cannot exceed 30 days.
getCrossMarginBorrowableAmount()
getCrossMarginBorrowableAmount(params: object): Promise<{
amount: string;
currency: string;
}>;Parameters
| Parameter | Type | Description |
|---|---|---|
params | { currency: string; } | Parameters for retrieving the max borrowable amount |
params.currency | string | - |
Returns
Promise<{ amount: string; currency: string; }>
Promise<{ currency: string; amount: string; }>
Deprecated
as of 2025-02-10 Get the max borrowable amount for a specific cross margin currency
getCrossMarginBorrowHistory()
getCrossMarginBorrowHistory(params: GetCrossMarginBorrowHistoryReq): Promise<CrossMarginMorrowLoanRecord[]>;List cross margin borrow history
Sort by creation time in descending order by default. Set reverse=false to return ascending results.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | GetCrossMarginBorrowHistoryReq | Parameters for listing cross margin borrow history |
Returns
Promise<CrossMarginMorrowLoanRecord[]>
Promise<SubmitCrossMarginBorrowLoanResp[]>
getCrossMarginBorrowLoan()
getCrossMarginBorrowLoan(params: object): Promise<CrossMarginMorrowLoanRecord>;Parameters
| Parameter | Type | Description |
|---|---|---|
params | { loan_id: string; } | Parameters containing the borrow loan ID |
params.loan_id | string | - |
Returns
Promise<CrossMarginMorrowLoanRecord>
Promise<SubmitCrossMarginBorrowLoanResp>
Deprecated
as of 2025-02-10 Retrieve single borrow loan detail
getCrossMarginCurrencies()
getCrossMarginCurrencies(): Promise<CrossMarginCurrency[]>;Returns
Promise<CrossMarginCurrency[]>
Promise<GetCrossMarginCurrenciesResp[]>
Deprecated
as of 2025-02-10 Currencies supported by cross margin
getCrossMarginCurrency()
getCrossMarginCurrency(params: object): Promise<CrossMarginCurrency>;Parameters
| Parameter | Type | Description |
|---|---|---|
params | { currency: string; } | Parameters containing the currency name |
params.currency | string | - |
Returns
Promise<CrossMarginCurrency>
Promise<GetCrossMarginCurrenciesResp>
Deprecated
as of 2025-02-10 Retrieve detail of one single currency supported by cross margin
getCrossMarginInterestRecords()
getCrossMarginInterestRecords(params?: GetCrossMarginInterestRecordsReq): Promise<GetCrossMarginInterestRecordsReq[]>;Parameters
| Parameter | Type | Description |
|---|---|---|
params? | GetCrossMarginInterestRecordsReq | Parameters for retrieving interest records |
Returns
Promise<GetCrossMarginInterestRecordsReq[]>
Promise<GetCrossMarginInterestRecordsResp[]>
Deprecated
as of 2025-02-10 Interest records for the cross margin account
getCrossMarginRepayments()
getCrossMarginRepayments(params?: GetCrossMarginRepaymentsReq): Promise<CrossMarginAccount[]>;Parameters
| Parameter | Type | Description |
|---|---|---|
params? | GetCrossMarginRepaymentsReq | Parameters for retrieving cross margin repayments |
Returns
Promise<CrossMarginAccount[]>
Promise<GetCrossMarginRepaymentsResp[]>
Deprecated
as of 2025-02-10 Retrieve cross margin repayments
Sort by creation time in descending order by default. Set reverse=false to return ascending results.
getCrossMarginTransferableAmount()
getCrossMarginTransferableAmount(params: object): Promise<{
amount: string;
currency: string;
}>;Parameters
| Parameter | Type | Description |
|---|---|---|
params | { currency: string; } | Parameters for retrieving the max transferable amount |
params.currency | string | - |
Returns
Promise<{ amount: string; currency: string; }>
Promise<{ currency: string; amount: string; }>
Deprecated
as of 2025-02-10 Get the max transferable amount for a specific cross margin currency
getCurrencyChains()
getCurrencyChains(params: object): Promise<CurrencyChain[]>;List chains supported for specified currency
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { currency: string; } | Parameters containing the currency name |
params.currency | string | - |
Returns
Promise<CurrencyChain[]>
Promise<CurrencyChain[]>
getDeliveryAccount()
getDeliveryAccount(params: object): Promise<DeliveryAccount>;Query futures account
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { settle: "usdt"; } | Parameters for querying futures account |
params.settle | "usdt" | - |
Returns
Promise<DeliveryAccount>
Promise<GetDeliveryAccountResp>
getDeliveryAutoOrders()
getDeliveryAutoOrders(params: GetDeliveryAutoOrdersReq): Promise<FuturesPriceTriggeredOrder[]>;List all auto orders
Parameters
| Parameter | Type | Description |
|---|---|---|
params | GetDeliveryAutoOrdersReq | Parameters for listing all auto orders |
Returns
Promise<FuturesPriceTriggeredOrder[]>
Promise<FuturesPriceTriggeredOrder[]>
getDeliveryBook()
getDeliveryBook(params: GetDeliveryBookReq): Promise<DeliveryBook[]>;Query account book
Parameters
| Parameter | Type | Description |
|---|---|---|
params | GetDeliveryBookReq | Parameters for querying account book |
Returns
Promise<DeliveryBook[]>
Promise<GetDeliveryBookResp[]>
getDeliveryCandles()
getDeliveryCandles(params: GetDeliveryCandlesReq): Promise<DeliveryCandle[]>;Get futures Candles
Return specified contract Candles. If prefix contract with mark_, the contract's mark price Candles are returned; if prefix with index_, index price Candles will be returned. Maximum of 2000 points are returned in one query. Be sure not to exceed the limit when specifying from, to and interval.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | GetDeliveryCandlesReq | Parameters for retrieving futures Candles |
Returns
Promise<DeliveryCandle[]>
Promise<GetDeliveryCandlesResp[]>
getDeliveryClosedPositions()
getDeliveryClosedPositions(params: GetDeliveryClosedPositionsReq): Promise<DeliveryClosedPosition[]>;List position close history
Parameters
| Parameter | Type | Description |
|---|---|---|
params | GetDeliveryClosedPositionsReq | Parameters for listing position close history |
Returns
Promise<DeliveryClosedPosition[]>
Promise<GetDeliveryClosedPositionsResp[]>
getDeliveryContract()
getDeliveryContract(params: object): Promise<FuturesDeliveryContract>;Get a single contract
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { contract: string; settle: "usdt"; } | Parameters for retrieving a single contract |
params.contract | string | - |
params.settle | "usdt" | - |
Returns
Promise<FuturesDeliveryContract>
Promise<DeliveryContract>
getDeliveryInsuranceBalanceHistory()
getDeliveryInsuranceBalanceHistory(params: object): Promise<object[]>;Futures insurance balance history
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { limit?: number; settle: "usdt"; } | Parameters for retrieving the futures insurance balance history |
params.limit? | number | - |
params.settle | "usdt" | - |
Returns
Promise<object[]>
Promise<{ t: number; b: string; }[]>
getDeliveryLiquidationHistory()
getDeliveryLiquidationHistory(params: GetDeliveryLiquidationHistoryReq): Promise<DeliveryLiquidationHistoryRecord[]>;List liquidation history
Parameters
| Parameter | Type | Description |
|---|---|---|
params | GetDeliveryLiquidationHistoryReq | Parameters for listing liquidation history |
Returns
Promise<DeliveryLiquidationHistoryRecord[]>
Promise<GetDeliveryLiquidationHistoryResp[]>
getDeliveryOrder()
getDeliveryOrder(params: object): Promise<FuturesOrder>;Get a single order
Zero-filled order cannot be retrieved 10 minutes after order cancellation
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { order_id: string; settle: "usdt"; } | Parameters for retrieving a single order |
params.order_id | string | - |
params.settle | "usdt" | - |
Returns
Promise<FuturesOrder>
Promise<FuturesOrder>
getDeliveryOrderBook()
getDeliveryOrderBook(params: GetDeliveryOrderBookReq): Promise<DeliveryOrderBook>;Futures order book
Bids will be sorted by price from high to low, while asks sorted reversely
Parameters
| Parameter | Type | Description |
|---|---|---|
params | GetDeliveryOrderBookReq | Parameters for retrieving the futures order book |
Returns
Promise<DeliveryOrderBook>
Promise<GetDeliveryOrderBookResp>
getDeliveryOrders()
getDeliveryOrders(params: GetDeliveryOrdersReq): Promise<FuturesOrder[]>;List futures orders
Zero-fill order cannot be retrieved 10 minutes after order cancellation.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | GetDeliveryOrdersReq | Parameters for listing futures orders |
Returns
Promise<FuturesOrder[]>
Promise<FuturesOrder[]>
getDeliveryPosition()
getDeliveryPosition(params: object): Promise<FuturesPosition>;Get single position
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { contract: string; settle: "usdt"; } | Parameters for retrieving a single position |
params.contract | string | - |
params.settle | "usdt" | - |
Returns
Promise<FuturesPosition>
Promise<Position>
getDeliveryPositions()
getDeliveryPositions(params: object): Promise<FuturesPosition[]>;List all positions of a user
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { settle: "usdt"; } | Parameters for listing all positions of a user |
params.settle | "usdt" | - |
Returns
Promise<FuturesPosition[]>
Promise<Position[]>
getDeliverySettlementHistory()
getDeliverySettlementHistory(params: GetDeliverySettlementHistoryReq): Promise<DeliverySettlementHistoryRecord[]>;List settlement history
Parameters
| Parameter | Type | Description |
|---|---|---|
params | GetDeliverySettlementHistoryReq | Parameters for listing settlement history |
Returns
Promise<DeliverySettlementHistoryRecord[]>
Promise<GetDeliverySettlementHistoryResp[]>
getDeliveryTickers()
getDeliveryTickers(params: object): Promise<DeliveryTicker[]>;List futures tickers
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { contract?: string; settle: "usdt"; } | Parameters for listing futures tickers |
params.contract? | string | - |
params.settle | "usdt" | - |
Returns
Promise<DeliveryTicker[]>
Promise<GetDeliveryTickersResp[]>
getDeliveryTrades()
getDeliveryTrades(params: GetDeliveryTradesReq): Promise<DeliveryTrade[]>;Futures trading history
Parameters
| Parameter | Type | Description |
|---|---|---|
params | GetDeliveryTradesReq | Parameters for retrieving the futures trading history |
Returns
Promise<DeliveryTrade[]>
Promise<GetDeliveryTradesResp[]>
getDeliveryTradingHistory()
getDeliveryTradingHistory(params: GetDeliveryTradingHistoryReq): Promise<DeliveryTradingHistoryRecord[]>;List personal trading history
Parameters
| Parameter | Type | Description |
|---|---|---|
params | GetDeliveryTradingHistoryReq | Parameters for listing personal trading history |
Returns
Promise<DeliveryTradingHistoryRecord[]>
Promise<GetDeliveryTradingHistoryResp[]>
getDeliveryTriggeredOrder()
getDeliveryTriggeredOrder(params: object): Promise<FuturesPriceTriggeredOrder>;Get a price-triggered order
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { order_id: string; settle: "usdt"; } | Parameters for retrieving a price-triggered order |
params.order_id | string | - |
params.settle | "usdt" | - |
Returns
Promise<FuturesPriceTriggeredOrder>
Promise<FuturesPriceTriggeredOrder>
getDepositRecords()
getDepositRecords(params?: GetWithdrawalDepositRecordsReq): Promise<DepositRecord[]>;Retrieve deposit records
Record time range cannot exceed 30 days
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | GetWithdrawalDepositRecordsReq | Parameters for filtering deposit records |
Returns
Promise<DepositRecord[]>
Promise<DepositRecord[]>
getDualInvestmentOrders()
getDualInvestmentOrders(params?: GetDualInvestmentOrdersReq): Promise<DualInvestmentOrder[]>;Dual Investment order list
Parameters
| Parameter | Type |
|---|---|
params? | GetDualInvestmentOrdersReq |
Returns
Promise<DualInvestmentOrder[]>
Promise<GetDualInvestmentOrdersResp[]>
getDualInvestmentProducts()
getDualInvestmentProducts(params?: GetDualInvestmentPlansReq): Promise<DualInvestmentProduct[]>;Dual Investment product list
type is call (sell high) or put (buy low).
Parameters
| Parameter | Type |
|---|---|
params? | GetDualInvestmentPlansReq |
Returns
Promise<DualInvestmentProduct[]>
Promise<GetDualInvestmentProductsResp[]>
getDualModePosition()
getDualModePosition(params: object): Promise<FuturesPosition[]>;Retrieve position detail in dual mode
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { contract: string; settle: FuturesSettle; } | Parameters for retrieving position detail in dual mode |
params.contract | string | - |
params.settle | FuturesSettle | - |
Returns
Promise<FuturesPosition[]>
Promise<Position[]>
getDualOrderRefundPreview()
getDualOrderRefundPreview(params: GetDualOrderRefundPreviewReq): Promise<DualOrderRefundPreview>;Dual-currency early redemption preview
Parameters
| Parameter | Type |
|---|---|
params | GetDualOrderRefundPreviewReq |
Returns
Promise<DualOrderRefundPreview>
getDualProjectRecommend()
getDualProjectRecommend(params?: GetDualProjectRecommendReq): Promise<DualProjectRecommend[]>;Dual-currency recommended projects
Parameters
| Parameter | Type |
|---|---|
params? | GetDualProjectRecommendReq |
Returns
Promise<DualProjectRecommend[]>
getDualStockBalance()
getDualStockBalance(): Promise<DualInvestmentBalance>;Stock dual investment asset statistics
Returns
Promise<DualInvestmentBalance>
getDualStockInvestmentPlans()
getDualStockInvestmentPlans(params?: GetDualStockInvestmentPlansReq): Promise<DualInvestmentProduct[]>;Stock dual investment product list
Public. Each plan includes type: call (sell high) or put (buy low).
Parameters
| Parameter | Type |
|---|---|
params? | GetDualStockInvestmentPlansReq |
Returns
Promise<DualInvestmentProduct[]>
getDualStockOrderRefundPreview()
getDualStockOrderRefundPreview(params: GetDualOrderRefundPreviewReq): Promise<DualOrderRefundPreview>;Preview redemption of a stock dual investment order
Parameters
| Parameter | Type |
|---|---|
params | GetDualOrderRefundPreviewReq |
Returns
Promise<DualOrderRefundPreview>
getDualStockOrders()
getDualStockOrders(params?: GetDualStockOrdersReq): Promise<DualInvestmentOrder[]>;Stock dual investment order list
Parameters
| Parameter | Type |
|---|---|
params? | GetDualStockOrdersReq |
Returns
Promise<DualInvestmentOrder[]>
getDualStockProjectRecommend()
getDualStockProjectRecommend(params?: GetDualProjectRecommendReq): Promise<DualProjectRecommend[]>;Stock dual investment recommendations
Public. mode normal (default) or senior. When nothing matches, Gate returns label SERVER_ERROR and message "No data".
Parameters
| Parameter | Type |
|---|---|
params? | GetDualProjectRecommendReq |
Returns
Promise<DualProjectRecommend[]>
getEarnFixedTermHistory()
getEarnFixedTermHistory(params: GetEarnFixedTermHistoryReq): Promise<GetEarnFixedTermHistoryResponse>;Fixed-term earn subscription history.
Parameters
| Parameter | Type |
|---|---|
params | GetEarnFixedTermHistoryReq |
Returns
Promise<GetEarnFixedTermHistoryResponse>
getEarnFixedTermLends()
getEarnFixedTermLends(params: GetEarnFixedTermLendsReq): Promise<GetEarnFixedTermLendsResponse>;List fixed-term earn subscriptions.
Parameters
| Parameter | Type |
|---|---|
params | GetEarnFixedTermLendsReq |
Returns
Promise<GetEarnFixedTermLendsResponse>
getEarnFixedTermProducts()
getEarnFixedTermProducts(params: GetEarnFixedTermProductsReq): Promise<GetEarnFixedTermProductsResponse>;List fixed-term earn products (public).
Parameters
| Parameter | Type |
|---|---|
params | GetEarnFixedTermProductsReq |
Returns
Promise<GetEarnFixedTermProductsResponse>
getEarnFixedTermProductsByAsset()
getEarnFixedTermProductsByAsset(asset: string, params?: GetEarnFixedTermProductsByAssetReq): Promise<GetEarnFixedTermProductsByAssetResponse>;List fixed-term earn products for one asset (public).
Parameters
| Parameter | Type |
|---|---|
asset | string |
params? | GetEarnFixedTermProductsByAssetReq |
Returns
Promise<GetEarnFixedTermProductsByAssetResponse>
getEstimatedInterestRate()
getEstimatedInterestRate(params: object): Promise<Record<string, string>>;Estimate interest rate
Please note that the interest rates are subject to change based on the borrowing and lending demand, and therefore, the provided rates may not be entirely accurate.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { currencies: string[]; } | Parameters for retrieving estimated interest rates |
params.currencies | string[] | - |
Returns
Promise<Record<string, string>>
Promise<Record<string, string>>
getEstimatedInterestRates()
getEstimatedInterestRates(params: object): Promise<any>;Parameters
| Parameter | Type | Description |
|---|---|---|
params | { currencies: string[]; } | Parameters for retrieving estimated interest rates |
params.currencies | string[] | - |
Returns
Promise<any>
Promise<any>
Deprecated
as of 2025-02-10 Estimated interest rates
Please note that the interest rates are subject to change based on the borrowing and lending demand, and therefore, the provided rates may not be entirely accurate.
getEstimatedQuickRepayment()
getEstimatedQuickRepayment(): Promise<QuickEstimatedRepayment>;Get estimated quick repayment data (unified account, cross-currency or portfolio margin mode)
Returns
Promise<QuickEstimatedRepayment>
getFlashSwapCurrencyPairs()
getFlashSwapCurrencyPairs(params?: object): Promise<FlashSwapCurrencyPair[]>;List All Supported Currency Pairs In Flash Swap
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | { currency?: string; limit?: number; page?: number; } | Parameters for retrieving data of the specified currency |
params.currency? | string | - |
params.limit? | number | - |
params.page? | number | - |
Returns
Promise<FlashSwapCurrencyPair[]>
Promise<GetFlashSwapCurrencyPairsResp[]>
getFlashSwapOrder()
getFlashSwapOrder(params: object): Promise<FlashSwapOrder>;Get a single flash swap order's detail
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { order_id: number; } | Parameters containing the flash swap order ID |
params.order_id | number | - |
Returns
Promise<FlashSwapOrder>
Promise<GetFlashSwapOrderResp>
getFlashSwapOrders()
getFlashSwapOrders(params?: GetFlashSwapOrdersReq): Promise<FlashSwapOrder[]>;List all flash swap orders
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | GetFlashSwapOrdersReq | Parameters for listing flash swap orders |
Returns
Promise<FlashSwapOrder[]>
Promise<GetFlashSwapOrdersResp[]>
getFundingAccounts()
getFundingAccounts(params?: object): Promise<object[]>;Funding account list
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | { currency?: string; } | Parameters for listing funding accounts |
params.currency? | string | - |
Returns
Promise<object[]>
Promise<{ currency: string; available: string; locked: string; lent: string; total_lent: string; }[]>
getFundingRates()
getFundingRates(params: GetFundingRatesReq): Promise<object[]>;Funding rate history
Parameters
| Parameter | Type | Description |
|---|---|---|
params | GetFundingRatesReq | Parameters for retrieving funding rate history |
Returns
Promise<object[]>
Promise<{ t: number; r: string; }[]>
getFuturesAccount()
getFuturesAccount(params: object): Promise<FuturesAccount>;Query futures account
Query account information for classic future account and unified account
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { settle: FuturesSettle; } | Parameters for querying futures account |
params.settle | FuturesSettle | - |
Returns
Promise<FuturesAccount>
Promise<GetFuturesAccountResp>
getFuturesAccountBook()
getFuturesAccountBook(params: GetFuturesAccountBookReq): Promise<FuturesAccountBookRecord[]>;Query account book
If the contract field is provided, it can only filter records that include this field after 2023-10-30.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | GetFuturesAccountBookReq | Parameters for querying account book |
Returns
Promise<FuturesAccountBookRecord[]>
Promise<GetFuturesAccountBookResp[]>
getFuturesAutoDeleveragingHistory()
getFuturesAutoDeleveragingHistory(params: GetFuturesLiquidationHistoryReq): Promise<FuturesAutoDeleveragingHistoryRecord[]>;List Auto-Deleveraging History
Parameters
| Parameter | Type | Description |
|---|---|---|
params | GetFuturesLiquidationHistoryReq | Parameters for listing auto-deleveraging history |
Returns
Promise<FuturesAutoDeleveragingHistoryRecord[]>
Promise<GetFuturesAutoDeleveragingHistoryResp[]>
getFuturesAutoOrders()
getFuturesAutoOrders(params: GetFuturesAutoOrdersReq): Promise<FuturesPriceTriggeredOrder[]>;List all auto orders
Parameters
| Parameter | Type | Description |
|---|---|---|
params | GetFuturesAutoOrdersReq | Parameters for listing all auto orders |
Returns
Promise<FuturesPriceTriggeredOrder[]>
Promise<FuturesPriceTriggeredOrder[]>
getFuturesCandles()
getFuturesCandles(params: GetFuturesCandlesReq): Promise<FuturesCandle[]>;Get futures Candles
Return specified contract Candles. If prefix contract with mark_, the contract's mark price Candles are returned; if prefix with index_, index price Candles will be returned.
Maximum of 2000 points are returned in one query. Be sure not to exceed the limit when specifying from, to and interval.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | GetFuturesCandlesReq | Parameters for retrieving futures Candles |
Returns
Promise<FuturesCandle[]>
Promise<GetFuturesCandlesResp[]>
getFuturesContract()
getFuturesContract(params: object): Promise<FuturesContract>;Get a single contract
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { contract: string; settle: FuturesSettle; } | Parameters for retrieving a single contract |
params.contract | string | - |
params.settle | FuturesSettle | - |
Returns
Promise<FuturesContract>
Promise<Contract>
getFuturesContractLeverage()
getFuturesContractLeverage(params: GetFuturesContractLeverageReq): Promise<FuturesContractLeverageInfo>;Get leverage for a contract in split / dual-side mode (requires pos_margin_mode and dual_side).
Parameters
| Parameter | Type | Description |
|---|---|---|
params | GetFuturesContractLeverageReq | settle, contract, pos_margin_mode, dual_side |
Returns
Promise<FuturesContractLeverageInfo>
Promise<FuturesContractLeverageInfo> — response field Lever is the leverage string
getFuturesContracts()
getFuturesContracts(params: object): Promise<FuturesContract[]>;List all futures contracts
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { limit?: number; offset?: number; settle: FuturesSettle; } | Parameters for listing futures contracts |
params.limit? | number | - |
params.offset? | number | - |
params.settle | FuturesSettle | - |
Returns
Promise<FuturesContract[]>
Promise<Contract[]>
getFuturesInsuranceBalanceHistory()
getFuturesInsuranceBalanceHistory(params: object): Promise<object[]>;Futures insurance balance history
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { limit?: number; settle: FuturesSettle; } | Parameters for retrieving futures insurance balance history |
params.limit? | number | - |
params.settle | FuturesSettle | - |
Returns
Promise<object[]>
Promise<{ t: number; b: string; }[]>
getFuturesInsuranceHistory()
getFuturesInsuranceHistory(params: GetFuturesInsuranceReq): Promise<FuturesInsuranceHistory[]>;Parameters
| Parameter | Type |
|---|---|
params | GetFuturesInsuranceReq |
Returns
Promise<FuturesInsuranceHistory[]>
getFuturesLiquidationHistory()
getFuturesLiquidationHistory(params: GetFuturesLiquidationHistoryReq): Promise<FuturesLiquidationHistoryRecord[]>;List liquidation history
Parameters
| Parameter | Type | Description |
|---|---|---|
params | GetFuturesLiquidationHistoryReq | Parameters for listing liquidation history |
Returns
Promise<FuturesLiquidationHistoryRecord[]>
Promise<GetFuturesLiquidationHistoryResp[]>
getFuturesOrder()
getFuturesOrder(params: object): Promise<FuturesOrder>;Get a single order
Zero-fill order cannot be retrieved for 10 minutes after cancellation. Historical orders, by default, only data within the past 6 months is supported.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { order_id: string; settle: FuturesSettle; } | - |
params.order_id | string | Exchange order id (numeric), or the order's custom client id from the text field — same path segment as in GET /futures/{settle}/orders/{order_id}. |
params.settle | FuturesSettle | - |
Returns
Promise<FuturesOrder>
Promise<FuturesOrder>
getFuturesOrderBook()
getFuturesOrderBook(params: GetFuturesOrderBookReq): Promise<FuturesOrderBook>;Futures order book
Bids will be sorted by price from high to low, while asks sorted reversely.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | GetFuturesOrderBookReq | Parameters for retrieving the futures order book |
Returns
Promise<FuturesOrderBook>
Promise<GetFuturesOrderBookResp>
getFuturesOrders()
getFuturesOrders(params: GetFuturesOrdersReq): Promise<FuturesOrder[]>;List futures orders
Zero-fill order cannot be retrieved for 10 minutes after cancellation. Historical orders, by default, only data within the past 6 months is supported. If you need to query data for a longer period, please use GET /futures/{settle}/orders_timerange.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | GetFuturesOrdersReq | Parameters for listing futures orders |
Returns
Promise<FuturesOrder[]>
Promise<FuturesOrder[]>
getFuturesOrdersByTimeRange()
getFuturesOrdersByTimeRange(params: GetFuturesOrdersByTimeRangeReq): Promise<FuturesOrderTimerange[]>;List Futures Orders By Time Range
Parameters
| Parameter | Type | Description |
|---|---|---|
params | GetFuturesOrdersByTimeRangeReq | Parameters for listing futures orders by time range |
Returns
Promise<FuturesOrderTimerange[]>
Promise<FuturesOrderTimerange[]>
getFuturesPosition()
getFuturesPosition(params: object): Promise<FuturesPosition>;Get single position
Clarifies dual-position query method when holding both long and short positions in the same contract market
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { contract: string; settle: FuturesSettle; } | Parameters for retrieving a single position |
params.contract | string | - |
params.settle | FuturesSettle | - |
Returns
Promise<FuturesPosition>
Promise<Position>
getFuturesPositionCloseHistory()
getFuturesPositionCloseHistory(params: GetFuturesPositionCloseHistoryReq): Promise<FuturesPositionHistoryRecord[]>;Parameters
| Parameter | Type |
|---|---|
params | GetFuturesPositionCloseHistoryReq |
Returns
Promise<FuturesPositionHistoryRecord[]>
getFuturesPositionHistory()
getFuturesPositionHistory(params: GetFuturesPositionHistoryReq): Promise<FuturesPositionHistoryRecord[]>;List position close history
Parameters
| Parameter | Type | Description |
|---|---|---|
params | GetFuturesPositionHistoryReq | Parameters for listing position close history |
Returns
Promise<FuturesPositionHistoryRecord[]>
Promise<GetFuturesPositionHistoryResp[]>
getFuturesPositions()
getFuturesPositions(params: GetFuturesPositionsReq): Promise<FuturesPosition[]>;List all positions of a user
Parameters
| Parameter | Type | Description |
|---|---|---|
params | GetFuturesPositionsReq | Parameters for listing all positions of a user |
Returns
Promise<FuturesPosition[]>
Promise<Position[]>
getFuturesPriceTriggeredOrder()
getFuturesPriceTriggeredOrder(params: object): Promise<FuturesPriceTriggeredOrder>;Get a price-triggered order
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { order_id: number; settle: FuturesSettle; } | Parameters for retrieving a price-triggered order |
params.order_id | number | - |
params.settle | FuturesSettle | - |
Returns
Promise<FuturesPriceTriggeredOrder>
Promise<FuturesPriceTriggeredOrder>
getFuturesRpiOrderBook()
getFuturesRpiOrderBook(params: GetFuturesOrderBookReq): Promise<FuturesOrderBook>;Futures RPI order book
Public. No API key. Bids are sorted by descending price, asks by ascending price. interval is the merged-depth price precision (0 means no merge). with_id returns the depth update id, which increments on each change.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | GetFuturesOrderBookReq | settle, contract, optional interval, limit, with_id |
Returns
Promise<FuturesOrderBook>
getFuturesStats()
getFuturesStats(params: GetFuturesStatsReq): Promise<FuturesStats[]>;Futures stats
Parameters
| Parameter | Type | Description |
|---|---|---|
params | GetFuturesStatsReq | Parameters for retrieving futures stats |
Returns
Promise<FuturesStats[]>
Promise<GetFuturesStatsResp[]>
getFuturesTickers()
getFuturesTickers(params: object): Promise<FuturesTicker[]>;List futures tickers
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { contract?: string; settle: FuturesSettle; } | Parameters for listing futures tickers |
params.contract? | string | - |
params.settle | FuturesSettle | - |
Returns
Promise<FuturesTicker[]>
Promise<GetFuturesTickersResp[]>
getFuturesTrades()
getFuturesTrades(params: GetFuturesTradesReq): Promise<FuturesTrade[]>;Futures trading history
Parameters
| Parameter | Type | Description |
|---|---|---|
params | GetFuturesTradesReq | Parameters for retrieving futures trading history |
Returns
Promise<FuturesTrade[]>
Promise<GetFuturesTradesResp[]>
getFuturesTradingHistory()
getFuturesTradingHistory(params: GetFuturesTradingHistoryReq): Promise<FuturesTradingHistoryRecord[]>;List personal trading history
By default, only data within the past 6 months is supported. If you need to query data for a longer period, please use GET /futures/{settle}/my_trades_timerange.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | GetFuturesTradingHistoryReq | Parameters for listing personal trading history |
Returns
Promise<FuturesTradingHistoryRecord[]>
Promise<GetFuturesTradingHistoryResp[]>
getFuturesTradingHistoryByTimeRange()
getFuturesTradingHistoryByTimeRange(params: GetFuturesTradingHistoryByTimeRangeReq): Promise<FuturesTradingHistoryRecord[]>;List personal trading history
This endpoint is for data longer than 6 months.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | GetFuturesTradingHistoryByTimeRangeReq | Parameters for listing personal trading history |
Returns
Promise<FuturesTradingHistoryRecord[]>
Promise<GetFuturesTradingHistoryResp[]>
getFuturesUserTradingFees()
getFuturesUserTradingFees(params: object): Promise<any>;Query user trading fee rates
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { contract?: string; settle: FuturesSettle; } | Parameters for querying user trading fee rates |
params.contract? | string | - |
params.settle | FuturesSettle | - |
Returns
Promise<any>
Promise<any>
getGTDeduction()
getGTDeduction(): Promise<{
enabled: boolean;
}>;Query GT deduction configuration
Query the current GT deduction configuration for the account.
Returns
Promise<{ enabled: boolean; }>
Promise<{ enabled: boolean }>
getHistoricalLendingRates()
getHistoricalLendingRates(params: GetUnifiedHistoryLendingRateReq): Promise<UnifiedHistoryLendingRate>;Get historical lending rates
Parameters
| Parameter | Type | Description |
|---|---|---|
params | GetUnifiedHistoryLendingRateReq | Parameters for retrieving historical lending rates |
Returns
Promise<UnifiedHistoryLendingRate>
Promise<UnifiedHistoryLendingRate>
getIndexConstituents()
getIndexConstituents(params: object): Promise<IndexConstituents>;Get index constituents
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { index: string; settle: FuturesSettle; } | Parameters for retrieving index constituents |
params.index | string | - |
params.settle | FuturesSettle | - |
Returns
Promise<IndexConstituents>
Promise<GetIndexConstituentsResp>
getLendingAnnualizedTrendChart()
getLendingAnnualizedTrendChart(params: object): Promise<object[]>;UniLoan currency annualized trend chart
Get the annualized interest rate trend chart data for a specific currency
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { asset: string; from: number; to: number; } | Parameters for retrieving the annualized trend chart |
params.asset | string | - |
params.from | number | - |
params.to | number | - |
Returns
Promise<object[]>
Promise<{ time: number; value: string }[]>
getLendingCurrencies()
getLendingCurrencies(): Promise<LendingCurrency[]>;List currencies for lending
Returns
Promise<LendingCurrency[]>
Promise<GetLendingCurrenciesResp[]>
getLendingCurrency()
getLendingCurrency(params: object): Promise<LendingCurrency>;Get currency detail for lending
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { currency: string; } | Parameters for retrieving currency detail for lending |
params.currency | string | - |
Returns
Promise<LendingCurrency>
Promise<GetLendingCurrenciesResp>
getLendingEstimatedRates()
getLendingEstimatedRates(): Promise<object[]>;Returns
Promise<object[]>
getLendingInterestRecords()
getLendingInterestRecords(params?: GetLendingInterestRecordsReq): Promise<LendingInterestRecord[]>;List interest records
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | GetLendingInterestRecordsReq | Parameters for listing interest records |
Returns
Promise<LendingInterestRecord[]>
Promise<GetLendingInterestRecordsResp[]>
getLendingInterestStatus()
getLendingInterestStatus(params: object): Promise<{
currency: string;
interest_status: string;
}>;Query currency interest compounding status
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { currency: string; } | Parameters for querying currency interest compounding status |
params.currency | string | - |
Returns
Promise<{ currency: string; interest_status: string; }>
Promise<{ currency: string; interest_status: string; }>
getLendingMarket()
getLendingMarket(params: object): Promise<LendingMarket>;Get detail of lending market
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { currency_pair: string; } | Parameters containing the currency pair |
params.currency_pair | string | - |
Returns
Promise<LendingMarket>
Promise<{ currency_pair: string; base_min_borrow_amount: string; quote_min_borrow_amount: string; leverage: string; }>
getLendingMarkets()
getLendingMarkets(): Promise<LendingMarket[]>;List lending markets
Returns
Promise<LendingMarket[]>
Promise<GetLendingMarketsResp[]>
getLendingOrders()
getLendingOrders(params?: GetLendingOrdersReq): Promise<LendingOrder[]>;List user's lending orders
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | GetLendingOrdersReq | Parameters for listing user's lending orders |
Returns
Promise<LendingOrder[]>
Promise<GetLendingOrdersResp[]>
getLendingRecords()
getLendingRecords(params?: GetLendingRecordsReq): Promise<LendingRecord[]>;List records of lending
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | GetLendingRecordsReq | Parameters for listing records of lending |
Returns
Promise<LendingRecord[]>
Promise<GetLendingRecordsResp[]>
getLendingTotalInterest()
getLendingTotalInterest(params: object): Promise<{
currency: string;
interest: string;
}>;Get the user's total interest income of specified currency
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { currency: string; } | Parameters for retrieving the user's total interest income of specified currency |
params.currency | string | - |
Returns
Promise<{ currency: string; interest: string; }>
Promise<{ currency: string; interest: string; }>
getLiquidationHistory()
getLiquidationHistory(params: GetLiquidationHistoryReq): Promise<LiquidationHistoryRecord[]>;Retrieve liquidation history
Interval between from and to cannot exceed 3600. Some private fields will not be returned in public endpoints. Refer to field description for detail.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | GetLiquidationHistoryReq | Parameters for retrieving liquidation history |
Returns
Promise<LiquidationHistoryRecord[]>
Promise<GetLiquidationHistoryResp[]>
getLoanMarginTiers()
getLoanMarginTiers(): Promise<object[]>;List loan margin tiers
Returns
Promise<object[]>
Promise<{ currency: string; margin_tiers: MarginTier[]; }[]>
getLowCapExchangeList()
getLowCapExchangeList(): Promise<string[]>;Retrieve the list of low-liquidity or low-cap tokens
Returns
Promise<string[]>
Promise<string[]>
getMainSubTransfers()
getMainSubTransfers(params?: GetMainSubTransfersReq): Promise<SubAccountTransferRecord[]>;Retrieve transfer records between main and sub accounts
Record time range cannot exceed 30 days
Note: only records after 2020-04-10 can be retrieved
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | GetMainSubTransfersReq | Parameters for filtering transfer records |
Returns
Promise<SubAccountTransferRecord[]>
Promise<SubAccountTransferRecordResp[]>
getMarginAccounts()
getMarginAccounts(params?: object): Promise<MarginAccount[]>;Margin account list
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | { currency_pair?: string; } | Parameters for listing margin accounts |
params.currency_pair? | string | - |
Returns
Promise<MarginAccount[]>
Promise<GetMarginAccountsResp[]>
getMarginBalanceHistory()
getMarginBalanceHistory(params?: GetMarginBalanceHistoryReq): Promise<MarginBalanceHistoryRecord[]>;List margin account balance change history
Only transferals from and to margin account are provided for now. Time range allows 30 days at most.
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | GetMarginBalanceHistoryReq | Parameters for listing margin account balance change history |
Returns
Promise<MarginBalanceHistoryRecord[]>
Promise<GetMarginBalanceHistoryResp[]>
getMarginPublicLoanTiers()
getMarginPublicLoanTiers(params: object): Promise<object[]>;Query the current market leverage lending gradient
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { currency_pair: string; } | Parameters containing currency pair to query |
params.currency_pair | string | - |
Returns
Promise<object[]>
Promise with array of market gradient information
getMarginTransferableAmount()
getMarginTransferableAmount(params: object): Promise<{
amount: string;
currency: string;
currency_pair?: string;
}>;Get the max transferable amount for a specific margin currency
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { currency: string; currency_pair?: string; } | Parameters for retrieving the max transferable amount |
params.currency | string | - |
params.currency_pair? | string | - |
Returns
Promise<{ amount: string; currency: string; currency_pair?: string; }>
Promise<{ currency: string; currency_pair?: string; amount: string; }>
getMarginUNIInterestRecords()
getMarginUNIInterestRecords(params?: GetMarginUNIInterestRecordsReq): Promise<MarginUNIInterestRecord[]>;List interest records
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | GetMarginUNIInterestRecordsReq | Parameters for listing interest records |
Returns
Promise<MarginUNIInterestRecord[]>
Promise<GetMarginUNIInterestRecordsResp[]>
getMarginUNILoanRecords()
getMarginUNILoanRecords(params?: GetMarginUNILoanRecordsReq): Promise<MarginUNILoanRecord[]>;Get loan records
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | GetMarginUNILoanRecordsReq | Parameters for retrieving loan records |
Returns
Promise<MarginUNILoanRecord[]>
Promise<GetMarginUNILoanRecordsResp[]>
getMarginUNILoans()
getMarginUNILoans(params?: GetMarginUNILoansReq): Promise<MarginUNILoan[]>;List loans
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | GetMarginUNILoansReq | Parameters for listing loans |
Returns
Promise<MarginUNILoan[]>
Promise<GetMarginUNILoansResp[]>
getMarginUNIMaxBorrow()
getMarginUNIMaxBorrow(params: GetMarginUNIMaxBorrowReq): Promise<MarginUNIMaxBorrowable>;Get maximum borrowable
Parameters
| Parameter | Type | Description |
|---|---|---|
params | GetMarginUNIMaxBorrowReq | Parameters for retrieving the maximum borrowable amount |
Returns
Promise<MarginUNIMaxBorrowable>
Promise<GetMarginUNIMaxBorrowResp>
getMarginUserAccounts()
getMarginUserAccounts(params?: object): Promise<MarginUserAccount[]>;Query the user's leverage account list
Supports querying risk rate per position account and margin rate per position account
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | { currency_pair?: string; } | Optional parameters for filtering by currency pair |
params.currency_pair? | string | - |
Returns
Promise<MarginUserAccount[]>
Promise with array of margin account details
getMarginUserLoanTiers()
getMarginUserLoanTiers(params: object): Promise<object[]>;Check the user's own leverage lending gradient in the current market
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { currency_pair: string; } | Parameters containing currency pair to query |
params.currency_pair | string | - |
Returns
Promise<object[]>
Promise with array of market gradient information
getMultiLoanAdjustmentRecords()
getMultiLoanAdjustmentRecords(params?: GetMultiLoanAdjustmentRecordsReq): Promise<MultiLoanAdjustmentRecord[]>;Query collateral adjustment records
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | GetMultiLoanAdjustmentRecordsReq | Parameters for querying collateral adjustment records |
Returns
Promise<MultiLoanAdjustmentRecord[]>
Promise<GetMultiLoanAdjustmentRecordsResp[]>
getMultiLoanCurrencyQuota()
getMultiLoanCurrencyQuota(params: object): Promise<MultiLoanCurrencyQuota[]>;List User Currency Quota
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { currency: string; type: "borrow" | "collateral"; } | Parameters for listing user currency quota |
params.currency | string | - |
params.type | "borrow" | "collateral" | - |
Returns
Promise<MultiLoanCurrencyQuota[]>
Promise<GetMultiLoanCurrencyQuotaResp[]>
getMultiLoanCurrentRates()
getMultiLoanCurrentRates(params: object): Promise<object[]>;Query the current interest rate of currencies
Query the current interest rate of currencies in the last hour. The current interest rate is updated every hour.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { currencies: string[]; vip_level?: string; } | Parameters containing currencies to query and optional VIP level |
params.currencies | string[] | - |
params.vip_level? | string | - |
Returns
Promise<object[]>
Promise<MultiLoanCurrentRate[]>
getMultiLoanFixedRates()
getMultiLoanFixedRates(): Promise<MultiLoanFixedRate[]>;Query fixed interest rates for the currency for 7 days and 30 days
Returns
Promise<MultiLoanFixedRate[]>
Promise<GetMultiLoanFixedRatesResp[]>
getMultiLoanOrder()
getMultiLoanOrder(params: object): Promise<MultiLoanOrder>;Get Multi-Collateral Order Detail
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { order_id: string; } | Parameters for retrieving a multi-collateral order detail |
params.order_id | string | - |
Returns
Promise<MultiLoanOrder>
Promise<GetMultiLoanOrdersResp>
getMultiLoanOrders()
getMultiLoanOrders(params?: GetMultiLoanOrdersReq): Promise<MultiLoanOrder[]>;List Multi-Collateral Orders
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | GetMultiLoanOrdersReq | Parameters for listing multi-collateral orders |
Returns
Promise<MultiLoanOrder[]>
Promise<GetMultiLoanOrdersResp[]>
getMultiLoanRatio()
getMultiLoanRatio(): Promise<MultiLoanRatio>;Get Multi-Collateral ratio
Returns
Promise<MultiLoanRatio>
Promise<GetMultiLoanRatioResp>
getMultiLoanRepayRecords()
getMultiLoanRepayRecords(params: GetMultiLoanRepayRecordsReq): Promise<MultiLoanRepayRecord[]>;List Multi-Collateral Repay Records
Parameters
| Parameter | Type | Description |
|---|---|---|
params | GetMultiLoanRepayRecordsReq | Parameters for listing multi-collateral repay records |
Returns
Promise<MultiLoanRepayRecord[]>
Promise<GetMultiLoanRepayRecordsResp[]>
getMultiLoanSupportedCurrencies()
getMultiLoanSupportedCurrencies(): Promise<MultiLoanSupportedCurrencies>;Query supported borrowing and collateral currencies in Multi-Collateral
Returns
Promise<MultiLoanSupportedCurrencies>
Promise<GetMultiLoanSupportedCurrenciesResp>
getOptionsAccount()
getOptionsAccount(): Promise<OptionsAccount>;List options account
Indicates support for querying both classic options accounts and unified accounts
Returns
Promise<OptionsAccount>
Promise<GetOptionsAccountResp>
getOptionsAccountChange()
getOptionsAccountChange(params?: GetOptionsAccountChangeReq): Promise<OptionsAccountChangeRecord[]>;List account changing history
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | GetOptionsAccountChangeReq | Parameters for listing account changing history |
Returns
Promise<OptionsAccountChangeRecord[]>
Promise<GetOptionsAccountChangeResp[]>
getOptionsCandles()
getOptionsCandles(params: GetOptionsCandlesReq): Promise<OptionsCandle[]>;Get options Candles
Parameters
| Parameter | Type | Description |
|---|---|---|
params | GetOptionsCandlesReq | Parameters for retrieving options Candles |
Returns
Promise<OptionsCandle[]>
Promise<GetOptionsCandlesResp[]>
getOptionsContract()
getOptionsContract(params: object): Promise<OptionsContract>;Query specified contract detail
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { contract: string; } | Parameters for querying specified contract detail |
params.contract | string | - |
Returns
Promise<OptionsContract>
Promise<GetOptionsContractsResp>
getOptionsContracts()
getOptionsContracts(params: object): Promise<OptionsContract[]>;List all the contracts with specified underlying and expiration time
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { expiration?: number; underlying: string; } | Parameters for listing contracts |
params.expiration? | number | - |
params.underlying | string | - |
Returns
Promise<OptionsContract[]>
Promise<GetOptionsContractsResp[]>
getOptionsContractSettlement()
getOptionsContractSettlement(params: object): Promise<OptionsSettlementHistoryRecord>;Get specified contract's settlement
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { at: number; contract: string; underlying: string; } | Parameters for retrieving specified contract's settlement |
params.at | number | - |
params.contract | string | - |
params.underlying | string | - |
Returns
Promise<OptionsSettlementHistoryRecord>
Promise<GetOptionsSettlementHistoryResp}>
getOptionsExpirationTimes()
getOptionsExpirationTimes(params: object): Promise<number[]>;List all expiration times
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { underlying: string; } | Parameters for listing expiration times |
params.underlying | string | - |
Returns
Promise<number[]>
Promise<number[]>
getOptionsLiquidation()
getOptionsLiquidation(params: object): Promise<GetOptionsLiquidationResp[]>;List user's liquidation history of specified underlying
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { contract?: string; underlying: string; } | Parameters for listing user's liquidation history of specified underlying |
params.contract? | string | - |
params.underlying | string | - |
Returns
Promise<GetOptionsLiquidationResp[]>
Promise<GetOptionsLiquidationResp[]>
getOptionsMMPSettings()
getOptionsMMPSettings(params?: object): Promise<OptionsMMPSettings[]>;Query MMP (Market Maker Protection) settings
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | { underlying?: string; } | Parameters for querying MMP settings |
params.underlying? | string | - |
Returns
Promise<OptionsMMPSettings[]>
Promise<OptionsMMPSetings[]>
getOptionsMySettlements()
getOptionsMySettlements(params: GetOptionsMySettlementsReq): Promise<OptionsUserSettlement[]>;List my options settlements
Parameters
| Parameter | Type | Description |
|---|---|---|
params | GetOptionsMySettlementsReq | Parameters for listing my options settlements |
Returns
Promise<OptionsUserSettlement[]>
Promise<GetOptionsMySettlementsResp[]>
getOptionsOrder()
getOptionsOrder(params: object): Promise<SubmitOptionsOrderResp>;Get a single order
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { order_id: number; } | Parameters for retrieving a single order |
params.order_id | number | - |
Returns
Promise<SubmitOptionsOrderResp>
Promise<SubmitOptionsOrderResp>
getOptionsOrderBook()
getOptionsOrderBook(params: GetOptionsOrderBookReq): Promise<OptionsOrderBook>;Options order book
Bids will be sorted by price from high to low, while asks sorted reversely
Parameters
| Parameter | Type | Description |
|---|---|---|
params | GetOptionsOrderBookReq | Parameters for retrieving options order book |
Returns
Promise<OptionsOrderBook>
Promise<GetOptionsOrderBookResp>
getOptionsOrders()
getOptionsOrders(params: GetOptionsOrdersReq): Promise<SubmitOptionsOrderResp[]>;List options orders
Parameters
| Parameter | Type | Description |
|---|---|---|
params | GetOptionsOrdersReq | Parameters for listing options orders |
Returns
Promise<SubmitOptionsOrderResp[]>
Promise<SubmitOptionsOrderResp[]>
getOptionsPersonalHistory()
getOptionsPersonalHistory(params: GetOptionsPersonalHistoryReq): Promise<OptionsUserHistoryRecord[]>;List personal trading history
Parameters
| Parameter | Type | Description |
|---|---|---|
params | GetOptionsPersonalHistoryReq | Parameters for listing personal trading history |
Returns
Promise<OptionsUserHistoryRecord[]>
Promise<GetOptionsPersonalHistoryResp[]>
getOptionsPositionContract()
getOptionsPositionContract(params: object): Promise<OptionsPositionsUnderlying>;Get specified contract position
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { contract: string; } | Parameters for retrieving specified contract position |
params.contract | string | - |
Returns
Promise<OptionsPositionsUnderlying>
Promise<GetOptionsPositionsUnderlyingResp>
getOptionsPositionsUnderlying()
getOptionsPositionsUnderlying(params: object): Promise<OptionsPositionsUnderlying[]>;List user's positions of specified underlying
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { underlying?: string; } | Parameters for listing user's positions of specified underlying |
params.underlying? | string | - |
Returns
Promise<OptionsPositionsUnderlying[]>
Promise<GetOptionsPositionsUnderlyingResp[]>
getOptionsSettlementHistory()
getOptionsSettlementHistory(params: GetOptionsSettlementHistoryReq): Promise<OptionsSettlementHistoryRecord[]>;List settlement history
Parameters
| Parameter | Type | Description |
|---|---|---|
params | GetOptionsSettlementHistoryReq | Parameters for listing settlement history |
Returns
Promise<OptionsSettlementHistoryRecord[]>
Promise<GetOptionsSettlementHistoryResp[]>
getOptionsTickers()
getOptionsTickers(params: object): Promise<OptionsTicker[]>;List tickers of options contracts
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { underlying: string; } | Parameters for listing tickers of options contracts |
params.underlying | string | - |
Returns
Promise<OptionsTicker[]>
Promise<GetOptionsTickersResp[]>
getOptionsTrades()
getOptionsTrades(params: GetOptionsTradesReq): Promise<OptionsTrade[]>;Options trade history
Parameters
| Parameter | Type | Description |
|---|---|---|
params | GetOptionsTradesReq | Parameters for retrieving options trade history |
Returns
Promise<OptionsTrade[]>
Promise<GetOptionsTradesResp[]>
getOptionsUnderlyingCandles()
getOptionsUnderlyingCandles(params: GetOptionsUnderlyingCandlesReq): Promise<OptionsUnderlyingCandle[]>;Mark price Candles of an underlying
Parameters
| Parameter | Type | Description |
|---|---|---|
params | GetOptionsUnderlyingCandlesReq | Parameters for retrieving mark price Candles of an underlying |
Returns
Promise<OptionsUnderlyingCandle[]>
Promise<GetOptionsUnderlyingCandlesResp[]>
getOptionsUnderlyings()
getOptionsUnderlyings(): Promise<object[]>;List all underlyings
Returns
Promise<object[]>
Promise<{ name: string; index_price: string }[]>
getOptionsUnderlyingTicker()
getOptionsUnderlyingTicker(params: object): Promise<{
index_price: string;
trade_call: number;
trade_put: number;
}>;Get underlying ticker
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { underlying: string; } | Parameters for retrieving underlying ticker |
params.underlying | string | - |
Returns
Promise<{ index_price: string; trade_call: number; trade_put: number; }>
Promise<{ trade_put: number; trade_call: number; index_price: string; }>
getOTCBankList()
getOTCBankList(): Promise<GetOTCBankListResp>;Get user bank card list (use is_default=1 for default card)
Returns
Promise<GetOTCBankListResp>
getOTCBankListLegacy()
getOTCBankListLegacy(): Promise<GetOTCBankListResp>;Get user bank card list (Inner-aligned alias of getOTCBankList)
Returns
Promise<GetOTCBankListResp>
getOTCBankSupplementChecklist()
getOTCBankSupplementChecklist(params: GetOTCBankSupplementChecklistReq): Promise<GetOTCBankSupplementChecklistResp>;Bank card supplement checklist
Parameters
| Parameter | Type |
|---|---|
params | GetOTCBankSupplementChecklistReq |
Returns
Promise<GetOTCBankSupplementChecklistResp>
getOTCFiatOrderDetail()
getOTCFiatOrderDetail(params: GetOTCFiatOrderDetailReq): Promise<GetOTCFiatOrderDetailResp>;Fiat order details
Query fiat order details
Parameters
| Parameter | Type | Description |
|---|---|---|
params | GetOTCFiatOrderDetailReq | Parameters with order_id |
Returns
Promise<GetOTCFiatOrderDetailResp>
Promise with fiat order details
getOTCFiatOrderList()
getOTCFiatOrderList(params?: GetOTCFiatOrderListReq): Promise<GetOTCFiatOrderListResp>;Fiat order list
Query the fiat order list with filters such as type, currency, time range, and status
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | GetOTCFiatOrderListReq | Filter parameters for fiat order list |
Returns
Promise<GetOTCFiatOrderListResp>
Promise with paginated fiat order list
getOTCStablecoinOrderList()
getOTCStablecoinOrderList(params?: GetOTCStablecoinOrderListReq): Promise<GetOTCStablecoinOrderListResp>;Stablecoin order list
Query stablecoin order list with filtering by currency, time range, status, etc.
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | GetOTCStablecoinOrderListReq | Filter parameters for stablecoin order list |
Returns
Promise<GetOTCStablecoinOrderListResp>
Promise with paginated stablecoin order list
getP2PMerchantAdsDetail()
getP2PMerchantAdsDetail(params: P2PMerchantAdsDetailReq): Promise<P2PMerchantApiResp<P2PMerchantAdsDetail>>;Get ad details
Parameters
| Parameter | Type |
|---|---|
params | P2PMerchantAdsDetailReq |
Returns
Promise<P2PMerchantApiResp<P2PMerchantAdsDetail>>
getP2PMerchantAdsList()
getP2PMerchantAdsList(params: P2PMerchantGetAdsListReq): Promise<P2PMerchantApiResp<P2PMerchantAdsListItem[]>>;Get advertisement list
Parameters
| Parameter | Type |
|---|---|
params | P2PMerchantGetAdsListReq |
Returns
Promise<P2PMerchantApiResp<P2PMerchantAdsListItem[]>>
getP2PMerchantChatsList()
getP2PMerchantChatsList(params: P2PMerchantGetChatsListReq): Promise<P2PMerchantApiResp<P2PMerchantChatsListData>>;Get chat history
Parameters
| Parameter | Type |
|---|---|
params | P2PMerchantGetChatsListReq |
Returns
Promise<P2PMerchantApiResp<P2PMerchantChatsListData>>
getP2PMerchantCompletedTransactionList()
getP2PMerchantCompletedTransactionList(params: P2PMerchantGetCompletedTransactionListReq): Promise<P2PMerchantApiResp<P2PMerchantTransactionListData>>;Get completed/historical orders
Parameters
| Parameter | Type |
|---|---|
params | P2PMerchantGetCompletedTransactionListReq |
Returns
Promise<P2PMerchantApiResp<P2PMerchantTransactionListData>>
getP2PMerchantCounterpartyUserInfo()
getP2PMerchantCounterpartyUserInfo(params: P2PMerchantGetCounterpartyUserInfoReq): Promise<P2PMerchantApiResp<P2PMerchantCounterpartyUserInfo>>;Get counterparty information
Parameters
| Parameter | Type |
|---|---|
params | P2PMerchantGetCounterpartyUserInfoReq |
Returns
Promise<P2PMerchantApiResp<P2PMerchantCounterpartyUserInfo>>
getP2PMerchantMyAdsList()
getP2PMerchantMyAdsList(params?: P2PMerchantMyAdsListReq): Promise<P2PMerchantApiResp<P2PMerchantMyAdsListData>>;Get my ads list
Parameters
| Parameter | Type |
|---|---|
params? | P2PMerchantMyAdsListReq |
Returns
Promise<P2PMerchantApiResp<P2PMerchantMyAdsListData>>
getP2PMerchantMyselfPayment()
getP2PMerchantMyselfPayment(params?: P2PMerchantGetMyselfPaymentReq): Promise<P2PMerchantApiResp<P2PMerchantPaymentMethod[]>>;Get payment method list
Parameters
| Parameter | Type |
|---|---|
params? | P2PMerchantGetMyselfPaymentReq |
Returns
Promise<P2PMerchantApiResp<P2PMerchantPaymentMethod[]>>
getP2PMerchantPendingTransactionList()
getP2PMerchantPendingTransactionList(params: P2PMerchantGetPendingTransactionListReq): Promise<P2PMerchantApiResp<P2PMerchantTransactionListData>>;Get pending orders
Parameters
| Parameter | Type |
|---|---|
params | P2PMerchantGetPendingTransactionListReq |
Returns
Promise<P2PMerchantApiResp<P2PMerchantTransactionListData>>
getP2PMerchantSpotBalance()
getP2PMerchantSpotBalance(params?: object): Promise<SpotAccount[]>;Query spot account balance for P2P merchant (v4.106.103)
Guide entry — uses Spot API GET /spot/accounts.
Parameters
| Parameter | Type |
|---|---|
params? | { currency?: string; } |
params.currency? | string |
Returns
Promise<SpotAccount[]>
getP2PMerchantTransactionDetails()
getP2PMerchantTransactionDetails(params: P2PMerchantGetTransactionDetailsReq): Promise<P2PMerchantApiResp<P2PMerchantTransactionDetails>>;Get order details
Parameters
| Parameter | Type |
|---|---|
params | P2PMerchantGetTransactionDetailsReq |
Returns
Promise<P2PMerchantApiResp<P2PMerchantTransactionDetails>>
getP2PMerchantUserInfo()
getP2PMerchantUserInfo(): Promise<P2PMerchantApiResp<P2PMerchantUserInfo>>;Get account information
Returns
Promise<P2PMerchantApiResp<P2PMerchantUserInfo>>
getPartnerAgentDataAggregated()
getPartnerAgentDataAggregated(params?: GetPartnerAgentDataAggregatedReq): Promise<PartnerDataAggregatedResponse>;Aggregated partner agent statistics (rebate amount, volume, net fee, customer count; optional trading user count by business type).
Parameters
| Parameter | Type |
|---|---|
params? | GetPartnerAgentDataAggregatedReq |
Returns
Promise<PartnerDataAggregatedResponse>
getPartnerCommissionHistory()
getPartnerCommissionHistory(params?: PartnerTransactionReq): Promise<{
list: PartnerCommission[];
total: number;
}>;Partner obtains commission records of recommended users
Record time range cannot exceed 30 days.
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | PartnerTransactionReq | Parameters for retrieving commission records |
Returns
Promise<{ list: PartnerCommission[]; total: number; }>
Promise<GetPartnerCommissionHistoryResp>
getPartnerSubordinateList()
getPartnerSubordinateList(params?: GetPartnerSubordinateListReq): Promise<{
list: PartnerSubordinate[];
total: number;
}>;Partner subordinate list
Including sub-agents, direct customers, indirect customers
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | GetPartnerSubordinateListReq | Parameters for retrieving partner subordinate list |
Returns
Promise<{ list: PartnerSubordinate[]; total: number; }>
Promise<{ total: number; list: { user_id: number; user_join_time: number; type: number; desc: string; }[]; }>
getPartnerTransactionHistory()
getPartnerTransactionHistory(params?: PartnerTransactionReq): Promise<{
list: PartnerTransaction[];
total: number;
}>;Partner obtains transaction records of recommended users
Record time range cannot exceed 30 days.
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | PartnerTransactionReq | Parameters for retrieving transaction records |
Returns
Promise<{ list: PartnerTransaction[]; total: number; }>
Promise<GetPartnerTransactionHistoryResp>
getPremiumIndexKLines()
getPremiumIndexKLines(params: GetFuturesCandlesReq): Promise<PremiumIndexKLine[]>;Premium Index K-Line
Maximum of 1000 points can be returned in a query. Be sure not to exceed the limit when specifying from, to and interval.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | GetFuturesCandlesReq | Parameters for retrieving premium index K-Line |
Returns
Promise<PremiumIndexKLine[]>
Promise<GetPremiumIndexKLineResp[]>
getPriceTriggeredOrder()
getPriceTriggeredOrder(params: object): Promise<SpotPriceTriggeredOrder>;Get a price-triggered order
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { order_id: string; } | Parameters for getting a price-triggered order |
params.order_id | string | - |
Returns
Promise<SpotPriceTriggeredOrder>
Promise<SpotPriceTriggeredOrder>
getPushOrders()
getPushOrders(params?: ListPushOrdersReq): Promise<PushOrder[]>;List push orders
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | ListPushOrdersReq | Parameters for listing push orders |
Returns
Promise<PushOrder[]>
Promise<PushOrder[]>
getRiskLimitTable()
getRiskLimitTable(params: GetRiskLimitTableReq): Promise<RiskLimitTableTier[]>;Query risk limit table by table_id
Parameters
| Parameter | Type | Description |
|---|---|---|
params | GetRiskLimitTableReq | Parameters for querying risk limit table |
Returns
Promise<RiskLimitTableTier[]>
Promise<RiskLimitTableTier[]>
getRiskLimitTiers()
getRiskLimitTiers(params: GetRiskLimitTiersReq): Promise<RiskLimitTier[]>;List risk limit tiers
When the 'contract' parameter is not passed, the default is to query the risk limits for the top 100 markets. 'Limit' and 'offset' correspond to pagination queries at the market level, not to the length of the returned array. This only takes effect when the 'contract' parameter is empty.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | GetRiskLimitTiersReq | Parameters for listing risk limit tiers |
Returns
Promise<RiskLimitTier[]>
Promise<GetRiskLimitTiersResp[]>
getSavedAddresses()
getSavedAddresses(params: GetSavedAddressReq): Promise<SavedAddress[]>;Query saved addresses
Parameters
| Parameter | Type | Description |
|---|---|---|
params | GetSavedAddressReq | Parameters for querying saved address |
Returns
Promise<SavedAddress[]>
Promise<GetSavedAddressResp[]>
getServerTime()
getServerTime(): Promise<{
server_time: number;
}>;Get server current time
Returns
Promise<{ server_time: number; }>
Promise<{ server_time: number; }>
getSignTimestampMs()
getSignTimestampMs(): number;Timestamp used to sign the request. Override this method to implement your own timestamp/sync mechanism
Returns
number
Inherited from
BaseRestClient.getSignTimestampMs
getSmallBalanceHistory()
getSmallBalanceHistory(params?: GetSmallBalanceHistoryReq): Promise<SmallBalanceHistoryRecord[]>;List small balance history
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | GetSmallBalanceHistoryReq | Parameters for listing small balance history |
Returns
Promise<SmallBalanceHistoryRecord[]>
Promise<GetSmallBalanceHistoryResp[]>
getSmallBalances()
getSmallBalances(): Promise<SmallBalanceRecord>;List small balance
Returns
Promise<SmallBalanceRecord>
Promise<GetSmallBalancesResp>
getSpotAccountBook()
getSpotAccountBook(params?: GetSpotAccountBookReq): Promise<SpotAccountBook[]>;Query account book
Record time range cannot exceed 30 days.
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | GetSpotAccountBookReq | Parameters for querying account book |
Returns
Promise<SpotAccountBook[]>
Promise<GetSpotAccountBookResp[]>
getSpotAccounts()
getSpotAccounts(params?: object): Promise<SpotAccount[]>;List spot accounts
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | { currency?: string; } | Parameters for listing spot accounts |
params.currency? | string | - |
Returns
Promise<SpotAccount[]>
Promise<GetSpotAccountsResp[]>
Example
import { client } from './authenticated-client.js';
async function main() {
console.log('Spot balances:', await client.getSpotAccounts());
console.log(
'Open BTC_USDT orders:',
await client.getSpotOrders({
currency_pair: 'BTC_USDT',
status: 'open',
account: 'spot',
page: 1,
limit: 100,
}),
);
}
main().catch(() => {
console.error(
'Account request failed. Check credentials, permissions and environment.',
);
process.exitCode = 1;
});See
getSpotAutoOrders()
getSpotAutoOrders(params: GetSpotAutoOrdersReq): Promise<SpotPriceTriggeredOrder[]>;Retrieve running auto order list
Parameters
| Parameter | Type | Description |
|---|---|---|
params | GetSpotAutoOrdersReq | Parameters for retrieving running auto order list |
Returns
Promise<SpotPriceTriggeredOrder[]>
Promise<SpotPriceTriggeredOrder[]>
getSpotBatchFeeRates()
getSpotBatchFeeRates(params: object): Promise<Record<string, SpotFeeRates>>;Query a batch of user trading fee rates
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { currency_pairs: string; } | Parameters for querying a batch of user trading fee rates |
params.currency_pairs | string | - |
Returns
Promise<Record<string, SpotFeeRates>>
getSpotCandles()
getSpotCandles(params: GetSpotCandlesReq): Promise<SpotCandle[]>;Market Candles
Maximum of 1000 points can be returned in a query. Be sure not to exceed the limit when specifying from, to and interval.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | GetSpotCandlesReq | Parameters for retrieving market Candles |
Returns
Promise<SpotCandle[]>
Promise<GetSpotCandlesResp>
getSpotCurrencies()
getSpotCurrencies(): Promise<SpotCurrency[]>;List all currencies' details
Currency has two forms:
- Only currency name, e.g., BTC, USDT
- <currency>_<chain>, e.g., HT_ETH
The latter one occurs when one currency has multiple chains. Currency detail contains a chain field whatever the form is. To retrieve all chains of one currency, you can use all the details which have the name of the currency or name starting with <currency>_.
Returns
Promise<SpotCurrency[]>
Promise<GetSpotCurrenciesResp[]>
getSpotCurrency()
getSpotCurrency(params: object): Promise<SpotCurrency>;Get details of a specific currency
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { currency: string; } | Parameters for retrieving details of a specific currency |
params.currency | string | - |
Returns
Promise<SpotCurrency>
Promise<GetSpotCurrenciesResp>
getSpotCurrencyPair()
getSpotCurrencyPair(params: object): Promise<CurrencyPair>;Get details of a specific currency pair
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { currency_pair: string; } | Parameters for retrieving details of a specific currency pair |
params.currency_pair | string | - |
Returns
Promise<CurrencyPair>
Promise<CurrencyPair>
getSpotCurrencyPairs()
getSpotCurrencyPairs(): Promise<CurrencyPair[]>;List all currency pairs supported
Returns
Promise<CurrencyPair[]>
Promise<CurrencyPair[]>
getSpotFeeRates()
getSpotFeeRates(params?: object): Promise<SpotFeeRates>;Query user trading fee rates
This API is deprecated in favour of new fee retrieving API /wallet/fee.
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | { currency_pair?: string; } | Parameters for querying user trading fee rates |
params.currency_pair? | string | - |
Returns
Promise<SpotFeeRates>
Promise<GetSpotFeeRatesResp>
getSpotInsuranceHistory()
getSpotInsuranceHistory(params: GetSpotInsuranceHistoryReq): Promise<SpotInsuranceHistory[]>;Query spot insurance fund historical data
Parameters
| Parameter | Type | Description |
|---|---|---|
params | GetSpotInsuranceHistoryReq | Parameters for querying spot insurance fund history |
Returns
Promise<SpotInsuranceHistory[]>
Promise<{ currency: string; balance: string; time: number; }[]>
getSpotOpenOrders()
getSpotOpenOrders(params?: object): Promise<GetSpotOpenOrdersResp[]>;List all open orders
List open orders in all currency pairs. Note that pagination parameters affect record number in each currency pair's open order list. No pagination is applied to the number of currency pairs returned. All currency pairs with open orders will be returned. Spot, portfolio, and margin orders are returned by default. To list cross margin orders, account must be set to cross_margin.
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | { account?: "spot" | "margin" | "cross_margin" | "unified"; limit?: number; page?: number; } | Parameters for listing all open orders |
params.account? | "spot" | "margin" | "cross_margin" | "unified" | - |
params.limit? | number | - |
params.page? | number | - |
Returns
Promise<GetSpotOpenOrdersResp[]>
Promise<GetSpotOpenOrdersResp[]>
getSpotOrder()
getSpotOrder(params: GetSpotOrderReq): Promise<SpotOrder>;Get a single order
Spot, portfolio and margin orders are queried by default. If cross margin orders are needed or portfolio margin account are used, account must be set to cross_margin.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | GetSpotOrderReq | Parameters for getting a single order |
Returns
Promise<SpotOrder>
Promise<Order>
See
getSpotOrderBook()
getSpotOrderBook(params: GetSpotOrderBookReq): Promise<SpotOrderBook>;Retrieve order book
Order book will be sorted by price from high to low on bids; low to high on asks.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | GetSpotOrderBookReq | Parameters for retrieving order book |
Returns
Promise<SpotOrderBook>
Promise<GetSpotOrderBookResp>
Example
import { RestClient } from 'gateio-api';
const client = new RestClient({}, { timeout: 10000 });
async function main() {
console.log(
'Pair rules:',
await client.getSpotCurrencyPair({ currency_pair: 'BTC_USDT' }),
);
console.log(
'Order book:',
await client.getSpotOrderBook({
currency_pair: 'BTC_USDT',
limit: 10,
with_id: true,
}),
);
console.log(
'Candles:',
await client.getSpotCandles({
currency_pair: 'BTC_USDT',
interval: '1m',
limit: 5,
}),
);
}
main().catch(() => {
console.error('Unable to read market data.');
process.exitCode = 1;
});See
getSpotOrders()
getSpotOrders(params: GetSpotOrdersReq): Promise<SpotOrder[]>;List orders
Spot, portfolio and margin orders are returned by default. If cross margin orders are needed, account must be set to cross_margin.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | GetSpotOrdersReq | Parameters for listing orders |
Returns
Promise<SpotOrder[]>
Promise<Order[]>
See
getSpotPovOrder()
getSpotPovOrder(params: object): Promise<SpotPovOrder>;Query Spot POV order details
Supports the order ID returned after creation, or the custom ID specified in the text field.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { order_id: string; } | Parameters containing the order ID |
params.order_id | string | - |
Returns
Promise<SpotPovOrder>
Promise<SpotPovOrder>
getSpotPovOrders()
getSpotPovOrders(params: GetSpotPovOrdersReq): Promise<SpotPovOrder[]>;List Spot POV orders
List percentage-of-volume strategy orders. Status defaults to open when listing active orders.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | GetSpotPovOrdersReq | Parameters for listing Spot POV orders |
Returns
Promise<SpotPovOrder[]>
Promise<SpotPovOrder[]>
getSpotRpiOrderBook()
getSpotRpiOrderBook(params: GetSpotOrderBookReq): Promise<SpotOrderBook>;Spot RPI order book
Public. No API key. Bids are sorted by descending price, asks by ascending price. Same query parameters as getSpotOrderBook.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | GetSpotOrderBookReq | currency_pair, optional interval, limit, with_id |
Returns
Promise<SpotOrderBook>
getSpotTicker()
getSpotTicker(params?: object): Promise<SpotTicker[]>;Retrieve ticker information
Return only related data if currency_pair is specified; otherwise return all of them.
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | { currency_pair?: string; timezone?: "all" | "utc0" | "utc8"; } | Parameters for retrieving ticker information |
params.currency_pair? | string | - |
params.timezone? | "all" | "utc0" | "utc8" | - |
Returns
Promise<SpotTicker[]>
Promise<GetSpotTickerResp[]>
Example
import { RestClient } from 'gateio-api';
const client = new RestClient({}, { timeout: 10000 });
async function main() {
const tickers = await client.getSpotTicker({ currency_pair: 'BTC_USDT' });
const ticker = tickers[0];
if (!ticker) {
throw new Error('No BTC_USDT ticker returned.');
}
console.log('BTC_USDT last price:', ticker.last);
}
main().catch(() => {
console.error('Unable to read the public ticker.');
process.exitCode = 1;
});See
getSpotTrades()
getSpotTrades(params: GetSpotTradesReq): Promise<SpotTrade[]>;Retrieve market trades
You can use from and to to query by time range, or use last_id by scrolling page. The default behavior is by time range. Scrolling query using last_id is not recommended any more. If last_id is specified, time range query parameters will be ignored.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | GetSpotTradesReq | Parameters for retrieving market trades |
Returns
Promise<SpotTrade[]>
Promise<GetSpotTradesResp[]>
getSpotTradingHistory()
getSpotTradingHistory(params?: GetSpotTradingHistoryReq): Promise<SpotHistoricTradeRecord[]>;List personal trading history
By default query of transaction records for spot, unified account and warehouse-by-site leverage accounts.
The history within a specified time range can be queried by specifying from or (and) to.
If no time parameters are specified, only data for the last 7 days can be obtained. If only any parameter of from or to is specified, only 7-day data from the start (or end) of the specified time is returned. The range not allowed to exceed 30 days. The parameters of the time range filter are processed according to the order end time.
The maximum number of pages when searching data using limit&page paging function is 100,0, that is, limit * (page - 1) <= 100,0.
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | GetSpotTradingHistoryReq | Parameters for listing personal trading history |
Returns
Promise<SpotHistoricTradeRecord[]>
Promise<GetSpotTradingHistoryResp[]>
See
getStakingCoins()
getStakingCoins(params?: object): Promise<string[]>;List staking coins
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | { coin?: string; cointype?: string; } | Parameters for listing staking coins |
params.coin? | string | - |
params.cointype? | string | - |
Returns
Promise<string[]>
Promise<string[]>
getStockBalanceRecords()
getStockBalanceRecords(params?: GetStockBalanceRecordsReq): Promise<StockApiResp<StockListData<StockBalanceRecordItem>>>;Query user stock balance records
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | GetStockBalanceRecordsReq | Optional filters, time range, sort direction, details, and pagination |
Returns
Promise<StockApiResp<StockListData<StockBalanceRecordItem>>>
Promise with paginated balance records; detail is returned only when include_detail=true
getStockExchanges()
getStockExchanges(): Promise<StockApiResp<StockListData<StockExchangeItem>>>;Query supported stock exchanges
Returns
Promise<StockApiResp<StockListData<StockExchangeItem>>>
Promise with exchange list
getStockFeeRate()
getStockFeeRate(): Promise<StockApiResp<StockListData<StockFeeRateItem>>>;Query stock fee rates
Maker/taker fee fields apply to Japanese and Korean stocks.
Returns
Promise<StockApiResp<StockListData<StockFeeRateItem>>>
Promise with fee rate list by VIP level
getStockOrderBook()
getStockOrderBook(symbol: string): Promise<StockApiResp<StockOrderBook>>;Query stock market order book
Parameters
| Parameter | Type | Description |
|---|---|---|
symbol | string | Symbol |
Returns
Promise<StockApiResp<StockOrderBook>>
Promise with order book data
getStockOrderDeals()
getStockOrderDeals(params: GetStockOrderDealsReq): Promise<StockApiResp<StockListData<StockOrderDealItem>>>;Query stock order trade records
Parameters
| Parameter | Type | Description |
|---|---|---|
params | GetStockOrderDealsReq | Order ID and optional pagination |
Returns
Promise<StockApiResp<StockListData<StockOrderDealItem>>>
Promise with paginated trade records
getStockOrderHistory()
getStockOrderHistory(params?: GetStockOrderHistoryReq): Promise<StockApiResp<StockListData<StockOrderHistoryItem>>>;Query stock order history
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | GetStockOrderHistoryReq | Optional filters for symbol, order IDs, time range, side, and pagination |
Returns
Promise<StockApiResp<StockListData<StockOrderHistoryItem>>>
Promise with paginated historical order list
getStockOrders()
getStockOrders(params?: GetStockOrdersReq): Promise<StockApiResp<StockListData<StockOrderItem>>>;Query open stock orders
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | GetStockOrdersReq | Optional symbol filter |
Returns
Promise<StockApiResp<StockListData<StockOrderItem>>>
Promise with open order list
getStockPositions()
getStockPositions(params?: GetStockPositionsReq): Promise<StockApiResp<StockListData<StockPositionItem>>>;Query current stock positions
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | GetStockPositionsReq | Optional filters for PnL calc, symbol, and exchange |
Returns
Promise<StockApiResp<StockListData<StockPositionItem>>>
Promise with position list
getStockSymbolDetail()
getStockSymbolDetail(params?: GetStockSymbolDetailReq): Promise<StockApiResp<StockListData<StockSymbolDetailItem>>>;Query stock symbol details
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | GetStockSymbolDetailReq | Optional filters for symbols, exchange, and pagination |
Returns
Promise<StockApiResp<StockListData<StockSymbolDetailItem>>>
Promise with paginated symbol detail list
getStockSymbols()
getStockSymbols(params?: GetStockSymbolsReq): Promise<StockApiResp<StockListData<StockSymbolItem>>>;Query stock symbol list
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | GetStockSymbolsReq | Optional filters for symbols, exchange, and pagination |
Returns
Promise<StockApiResp<StockListData<StockSymbolItem>>>
Promise with paginated symbol list
getStockTransactions()
getStockTransactions(params?: GetStockTransactionsReq): Promise<StockApiResp<StockListData<StockTransactionItem>>>;Query stock transaction records
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | GetStockTransactionsReq | Optional filters for time range, ref_id, type, and pagination |
Returns
Promise<StockApiResp<StockListData<StockTransactionItem>>>
Promise with paginated transaction list
getStockUserAssets()
getStockUserAssets(params?: GetStockUserAssetsReq): Promise<StockApiResp<StockUserAssets>>;Query user stock assets
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | GetStockUserAssetsReq | Optional PnL calculation parameters |
Returns
Promise<StockApiResp<StockUserAssets>>
Promise with user asset details
getStpGroups()
getStpGroups(params?: object): Promise<StpGroup[]>;List STP Groups
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | { name?: string; } | Parameters for listing STP groups |
params.name? | string | - |
Returns
Promise<StpGroup[]>
Promise<CreateStpGroupResp[]>
getStpGroupUsers()
getStpGroupUsers(params: object): Promise<StpGroupUser[]>;List users of the STP group
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { stp_id: number; } | Parameters for listing users of the STP group |
params.stp_id | number | - |
Returns
Promise<StpGroupUser[]>
Promise<StpResp[]>
getSubAccount()
getSubAccount(params: object): Promise<SubAccount>;Get the sub-account
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { user_id: number; } | Parameters containing the sub-account user ID |
params.user_id | number | - |
Returns
Promise<SubAccount>
Promise<SubAccountResp>
getSubAccountApiKey()
getSubAccountApiKey(params: object): Promise<SubAccountAPIKey>;Get the API Key of the sub-account
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { key: string; user_id: number; } | Parameters containing the sub-account user ID and API key |
params.key | string | - |
params.user_id | number | - |
Returns
Promise<SubAccountAPIKey>
Promise<SubAccountKey>
getSubAccountApiKeys()
getSubAccountApiKeys(params: object): Promise<SubAccountAPIKey[]>;List all API Key of the sub-account
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { user_id: number; } | Parameters containing the sub-account user ID |
params.user_id | number | - |
Returns
Promise<SubAccountAPIKey[]>
Promise<SubAccountKey[]>
getSubAccountMode()
getSubAccountMode(): Promise<SubAccountMode>;Get sub-account mode
Unified account mode:
- classic: Classic account mode
- multi_currency: Multi-currency margin mode
- portfolio: Portfolio margin mode
Returns
Promise<SubAccountMode>
Promise<SubAccountMode>
getSubAccounts()
getSubAccounts(params?: object): Promise<SubAccount[]>;List sub-accounts
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | { type?: string; } | Parameters for listing sub-accounts |
params.type? | string | - |
Returns
Promise<SubAccount[]>
Promise<GetSubAccountsResp[]>
getSubBalance()
getSubBalance(params?: GetSubAccountBalancesReq): Promise<SubAccountBalance[]>;Retrieve sub account balances
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | GetSubAccountBalancesReq | Parameters for retrieving sub account balances |
Returns
Promise<SubAccountBalance[]>
Promise<SubAccountBalance[]>
getSubCrossMarginBalances()
getSubCrossMarginBalances(params?: object): Promise<SubAccountCrossMarginBalancesResp[]>;Query subaccount's cross_margin account info
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | { sub_uid?: string; } | Parameters for querying subaccount's cross_margin account info |
params.sub_uid? | string | - |
Returns
Promise<SubAccountCrossMarginBalancesResp[]>
Promise<SubAccountCrossMarginBalancesResp[]>
getSubFuturesBalances()
getSubFuturesBalances(params?: object): Promise<SubAccountFuturesBalancesResp[]>;Query sub accounts' futures account balances
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | { settle?: string; sub_uid?: string; } | Parameters for querying sub accounts' futures account balances |
params.settle? | string | - |
params.sub_uid? | string | - |
Returns
Promise<SubAccountFuturesBalancesResp[]>
Promise<SubAccountFuturesBalancesResp[]>
getSubMarginBalances()
getSubMarginBalances(params?: object): Promise<{
available: SubAccountMarginBalance[];
uid: string;
}>;Query sub accounts' margin balances
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | { sub_uid?: string; } | Parameters for querying sub accounts' margin balances |
params.sub_uid? | string | - |
Returns
Promise<{ available: SubAccountMarginBalance[]; uid: string; }>
Promise<SubAccountMarginBalancesResp[]>
getSystemMaintenanceStatus()
getSystemMaintenanceStatus(): Promise<any>;Returns
Promise<any>
getTradFiAssets()
getTradFiAssets(): Promise<TradFiApiResp<TradFiAssets>>;Returns
Promise<TradFiApiResp<TradFiAssets>>
getTradFiKlines()
getTradFiKlines(symbol: string, params: TradFiGetKlinesParams): Promise<TradFiApiResp<TradFiListData<TradFiKlineItem>>>;TradFi symbol klines
symbol is the path parameter (for example XAUUSD). Query rules are on TradFiGetKlinesParams: times are Unix seconds, limit max 500, and limit cannot be combined with begin_time and end_time (INVALID_ARGUMENT). begin_time without end_time returns HTTP 400, label INTERNAL_SERVER_ERROR, message "Service is busy. Please try again later."
Parameters
| Parameter | Type |
|---|---|
symbol | string |
params | TradFiGetKlinesParams |
Returns
Promise<TradFiApiResp<TradFiListData<TradFiKlineItem>>>
getTradFiMT5Account()
getTradFiMT5Account(): Promise<TradFiApiResp<TradFiMT5Account>>;Returns
Promise<TradFiApiResp<TradFiMT5Account>>
getTradFiOrderHistory()
getTradFiOrderHistory(params?: TradFiGetOrderHistoryParams): Promise<TradFiApiResp<TradFiListData<TradFiOrderHistoryItem>>>;Parameters
| Parameter | Type |
|---|---|
params? | TradFiGetOrderHistoryParams |
Returns
Promise<TradFiApiResp<TradFiListData<TradFiOrderHistoryItem>>>
getTradFiOrderLog()
getTradFiOrderLog(params: object): Promise<TradFiApiResp<TradFiOrderLog>>;Query order details by log_id from order placement (v4.106.94)
Parameters
| Parameter | Type |
|---|---|
params | { log_id: string | number; } |
params.log_id | string | number |
Returns
Promise<TradFiApiResp<TradFiOrderLog>>
getTradFiOrders()
getTradFiOrders(): Promise<TradFiApiResp<TradFiListData<TradFiOrderItem>>>;Returns
Promise<TradFiApiResp<TradFiListData<TradFiOrderItem>>>
getTradFiPositionHistory()
getTradFiPositionHistory(params?: TradFiGetPositionHistoryParams): Promise<TradFiApiResp<TradFiListData<TradFiPositionHistoryItem>>>;Parameters
| Parameter | Type |
|---|---|
params? | TradFiGetPositionHistoryParams |
Returns
Promise<TradFiApiResp<TradFiListData<TradFiPositionHistoryItem>>>
getTradFiPositions()
getTradFiPositions(): Promise<TradFiApiResp<TradFiListData<TradFiPositionItem>>>;Returns
Promise<TradFiApiResp<TradFiListData<TradFiPositionItem>>>
getTradFiSymbolCategories()
getTradFiSymbolCategories(): Promise<TradFiApiResp<TradFiListData<TradFiCategoryItem>>>;Returns
Promise<TradFiApiResp<TradFiListData<TradFiCategoryItem>>>
getTradFiSymbolCommissions()
getTradFiSymbolCommissions(params?: TradFiGetSymbolCommissionsParams): Promise<TradFiApiResp<TradFiListData<TradFiSymbolCommissionItem>>>;Query CFD symbol commission rates
At least one of symbols or category_code is required. When both are provided, symbols are filtered by category.
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | TradFiGetSymbolCommissionsParams | Optional filters for symbols and/or category codes |
Returns
Promise<TradFiApiResp<TradFiListData<TradFiSymbolCommissionItem>>>
Promise with list of symbol commission rates
getTradFiSymbolDetail()
getTradFiSymbolDetail(params: TradFiGetSymbolDetailParams): Promise<TradFiApiResp<TradFiListData<TradFiSymbolDetailItem>>>;Parameters
| Parameter | Type |
|---|---|
params | TradFiGetSymbolDetailParams |
Returns
Promise<TradFiApiResp<TradFiListData<TradFiSymbolDetailItem>>>
getTradFiSymbols()
getTradFiSymbols(): Promise<TradFiApiResp<TradFiListData<TradFiSymbolItem>>>;Returns
Promise<TradFiApiResp<TradFiListData<TradFiSymbolItem>>>
getTradFiTicker()
getTradFiTicker(symbol: string): Promise<TradFiApiResp<TradFiTicker>>;Parameters
| Parameter | Type |
|---|---|
symbol | string |
Returns
Promise<TradFiApiResp<TradFiTicker>>
getTradFiTransactions()
getTradFiTransactions(params?: TradFiGetTransactionsParams): Promise<TradFiApiResp<TradFiTransactionListData>>;Parameters
| Parameter | Type |
|---|---|
params? | TradFiGetTransactionsParams |
Returns
Promise<TradFiApiResp<TradFiTransactionListData>>
getTradingFees()
getTradingFees(params?: object): Promise<TradingFees>;Retrieve personal trading fee
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | { currency_pair?: string; settle?: "BTC" | "USDT" | "USD"; } | Parameters for retrieving personal trading fee |
params.currency_pair? | string | - |
params.settle? | "BTC" | "USDT" | "USD" | - |
Returns
Promise<TradingFees>
Promise<GetTradingFeesResp>
getTrailOrderChangeLog()
getTrailOrderChangeLog(params: GetTrailOrderChangeLogReq): Promise<{
code?: number;
data?: {
change_log?: TrailChangeLog[];
};
message?: string;
timestamp?: number;
}>;Get trail order user modification records
Parameters
| Parameter | Type | Description |
|---|---|---|
params | GetTrailOrderChangeLogReq | settle, id and optional pagination |
Returns
Promise<{ code?: number; data?: { change_log?: TrailChangeLog[]; }; message?: string; timestamp?: number; }>
Promise with code, message, timestamp and data.change_log
getTrailOrderDetail()
getTrailOrderDetail(params: GetTrailOrderDetailReq): Promise<{
code?: number;
data?: {
order?: TrailOrder;
};
message?: string;
timestamp?: number;
}>;Get trail order details
Parameters
| Parameter | Type | Description |
|---|---|---|
params | GetTrailOrderDetailReq | settle and order id |
Returns
Promise<{ code?: number; data?: { order?: TrailOrder; }; message?: string; timestamp?: number; }>
Promise with code, message, data.order
getTrailOrderList()
getTrailOrderList(params: GetTrailOrderListReq): Promise<{
code?: number;
data?: {
orders?: TrailOrder[];
};
message?: string;
timestamp?: number;
}>;Get trail order list
Parameters
| Parameter | Type | Description |
|---|---|---|
params | GetTrailOrderListReq | query parameters |
Returns
Promise<{ code?: number; data?: { orders?: TrailOrder[]; }; message?: string; timestamp?: number; }>
Promise with code, message, timestamp and data.orders
getTransfer()
getTransfer(params: GetTransferReq): Promise<AccountTransferDetail>;Get trading account transfer details
Retrieve the current user's trading account transfer details by tx_id. Response includes transfer status, currency, amount, source and destination account types, and applicable settlement currency or margin currency pair.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | GetTransferReq | Parameters containing the transfer transaction ID |
Returns
Promise<AccountTransferDetail>
Promise<AccountTransferDetail>
getTransferStatus()
getTransferStatus(params: object): Promise<{
status: "PENDING" | "FAIL" | "SUCCESS" | "PARTIAL_SUCCESS";
tx_id: string;
}>;Query transfer status based on client_order_id or tx_id
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { client_order_id?: string; tx_id?: string; } | Parameters for querying transfer status |
params.client_order_id? | string | - |
params.tx_id? | string | - |
Returns
Promise<{ status: "PENDING" | "FAIL" | "SUCCESS" | "PARTIAL_SUCCESS"; tx_id: string; }>
Promise<{ tx_id: string; status: 'PENDING' | 'SUCCESS' | 'FAIL' | 'PARTIAL_SUCCESS'; }>
getUnifiedAccountInfo()
getUnifiedAccountInfo(params?: object): Promise<UnifiedAccountInfo>;Get unified account information
The assets of each currency in the account will be adjusted according to their liquidity, defined by corresponding adjustment coefficients, and then uniformly converted to USD to calculate the total asset value and position value of the account.
For specific formulas, please refer to Margin Formula
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | { currency?: string; sub_uid?: string; } | Parameters for retrieving unified account information |
params.currency? | string | - |
params.sub_uid? | string | - |
Returns
Promise<UnifiedAccountInfo>
Promise<UnifiedAccountInfo>
getUnifiedAccountMode()
getUnifiedAccountMode(): Promise<SetUnifiedAccountModeReq>;Query mode of the unified account
Returns
Promise<SetUnifiedAccountModeReq>
Promise<SetUnifiedAccountModeReq>
getUnifiedBatchMaxBorrowable()
getUnifiedBatchMaxBorrowable(params: object): Promise<any>;Parameters
| Parameter | Type |
|---|---|
params | { currencies: string[]; } |
params.currencies | string[] |
Returns
Promise<any>
getUnifiedCurrencyDiscountTiers()
getUnifiedCurrencyDiscountTiers(): Promise<UnifiedCurrencyDiscountTiers[]>;List currency discount tiers
Returns
Promise<UnifiedCurrencyDiscountTiers[]>
Promise<GetUnifiedCurrencyDiscountTiersResp[]>
getUnifiedDeltaNeutral()
getUnifiedDeltaNeutral(): Promise<DeltaNeutralEnabled>;Query Delta-neutral strategy mode setting (v4.106.97)
Returns
Promise<DeltaNeutralEnabled>
getUnifiedEstimateRate()
getUnifiedEstimateRate(params: object): Promise<Record<string, string>>;Get unified estimate rate
Due to fluctuations in lending depth, hourly interest rates may vary, and thus, I cannot provide exact rates. When a currency is not supported, the interest rate returned will be an empty string.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { currencies: string[]; } | Parameters for querying estimate rates |
params.currencies | string[] | - |
Returns
Promise<Record<string, string>>
Promise<Record<string, string>>
getUnifiedInterestRecords()
getUnifiedInterestRecords(params?: GetUnifiedInterestRecordsReq): Promise<UnifiedInterestRecord[]>;List interest records
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | GetUnifiedInterestRecordsReq | Parameters for listing interest records |
Returns
Promise<UnifiedInterestRecord[]>
Promise<GetUnifiedInterestRecordsResp[]>
getUnifiedLoanCurrencies()
getUnifiedLoanCurrencies(params?: object): Promise<UnifiedLoanCurrency[]>;List loan currencies supported by unified account
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | { currency?: string; } | Optional parameters for filtering |
params.currency? | string | - |
Returns
Promise<UnifiedLoanCurrency[]>
Promise with array of loan currencies
getUnifiedLoanRecords()
getUnifiedLoanRecords(params?: GetUnifiedLoanRecordsReq): Promise<UnifiedLoanRecord[]>;Get loan records
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | GetUnifiedLoanRecordsReq | Parameters for getting loan records |
Returns
Promise<UnifiedLoanRecord[]>
Promise<GetUnifiedLoanRecordsResp[]>
getUnifiedLoans()
getUnifiedLoans(params?: GetUnifiedLoansReq): Promise<UnifiedLoan[]>;List loans
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | GetUnifiedLoansReq | Parameters for listing loans |
Returns
Promise<UnifiedLoan[]>
Promise<GetUnifiedLoansResp[]>
getUnifiedMaxBorrow()
getUnifiedMaxBorrow(params: object): Promise<{
amount: string;
currency: string;
}>;Query about the maximum borrowing for the unified account
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { currency: string; } | Parameters for querying the maximum borrowing for the unified account |
params.currency | string | - |
Returns
Promise<{ amount: string; currency: string; }>
Promise<{ currency: string; amount: string; }>
getUnifiedMaxTransferable()
getUnifiedMaxTransferable(params: object): Promise<{
amount: string;
currency: string;
}>;Query about the maximum transferable for the unified account
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { currency: string; } | Parameters for querying the maximum transferable for the unified account |
params.currency | string | - |
Returns
Promise<{ amount: string; currency: string; }>
Promise<{ currency: string; amount: string; }>
getUnifiedMaxTransferables()
getUnifiedMaxTransferables(params: object): Promise<object[]>;Batch query maximum transferable amounts for unified accounts
After withdrawing currency, the transferable amount will change.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { currencies: string; } | Parameters containing currencies to query (up to 100 at once) |
params.currencies | string | - |
Returns
Promise<object[]>
Promise with array of currency and maximum transferable amount
getUnifiedRiskUnitDetails()
getUnifiedRiskUnitDetails(): Promise<UnifiedRiskUnitDetails>;Retrieve user risk unit details, only valid in portfolio margin mode
Returns
Promise<UnifiedRiskUnitDetails>
Promise<GetUnifiedRiskUnitDetailsResp>
getUserCurrencyLeverageConfig()
getUserCurrencyLeverageConfig(params: object): Promise<UserCurrencyLeverageConfig>;Query user currency leverage configuration
Get the maximum and minimum leverage multiples that users can set for a currency type
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { currency: string; } | Parameters containing the currency |
params.currency | string | - |
Returns
Promise<UserCurrencyLeverageConfig>
Promise<UserCurrencyLeverageConfig>
getUserCurrencyLeverageSettings()
getUserCurrencyLeverageSettings(params?: object): Promise<object[]>;Get the user's currency leverage
If currency is not passed, query all currencies.
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | { currency?: string; } | Optional parameters containing the currency |
params.currency? | string | - |
Returns
Promise<object[]>
Promise<UserCurrencyLeverageSetting[]>
getUserRebateInfo()
getUserRebateInfo(): Promise<{
invite_uid: number;
}>;User retrieves rebate information.
Returns
Promise<{ invite_uid: number; }>
getUserSubordinateRelationships()
getUserSubordinateRelationships(params: object): Promise<{
list: object[];
}>;Query user-subordinate relationship
Checks whether specified users are in the system and their relationship status
Parameters
| Parameter | Type |
|---|---|
params | { user_id_list: string; } |
params.user_id_list | string |
Returns
Promise<{ list: object[]; }>
getWithdrawalRecords()
getWithdrawalRecords(params?: GetWithdrawalRecordsReq): Promise<WithdrawalRecord[]>;Retrieve withdrawal records
Record time range cannot exceed 30 days. withdraw_id returns that one record and disables the time filter. withdraw_order_id returns the user-defined order.
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | GetWithdrawalRecordsReq | Parameters for filtering withdrawal records |
Returns
Promise<WithdrawalRecord[]>
Promise<Withdraw[]>
getWithdrawalStatus()
getWithdrawalStatus(params?: object): Promise<WithdrawalStatus[]>;Retrieve withdrawal status
Parameters
| Parameter | Type | Description |
|---|---|---|
params? | { currency?: string; } | Parameters for retrieving withdrawal status |
params.currency? | string | - |
Returns
Promise<WithdrawalStatus[]>
Promise<WithdrawalStatus[]>
listAnnouncementArticles()
listAnnouncementArticles(params?: ListAnnouncementArticlesReq): Promise<AnnouncementArticleListResponse>;Parameters
| Parameter | Type |
|---|---|
params? | ListAnnouncementArticlesReq |
Returns
Promise<AnnouncementArticleListResponse>
listFuturesADLRiskStates()
listFuturesADLRiskStates(params: GetFuturesADLRiskStatesReq): Promise<FuturesADLRiskStates>;Parameters
| Parameter | Type |
|---|---|
params | GetFuturesADLRiskStatesReq |
Returns
Promise<FuturesADLRiskStates>
lockSubAccount()
lockSubAccount(params: object): Promise<any>;Lock the sub-account
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { user_id: number; } | Parameters containing the sub-account user ID |
params.user_id | number | - |
Returns
Promise<any>
Promise<any>
markOTCOrderAsPaid()
markOTCOrderAsPaid(params: MarkOTCOrderAsPaidReq): Promise<OTCActionResp>;Mark fiat order as paid
Mark fiat order as paid
Parameters
| Parameter | Type | Description |
|---|---|---|
params | MarkOTCOrderAsPaidReq | Parameters with order_id |
Returns
Promise<OTCActionResp>
Promise with confirmation
modifyCrossExOrder()
modifyCrossExOrder(order_id: string, params: ModifyCrossExOrderReq): Promise<ModifyCrossExOrderResp>;Modify Order
Modify an existing order. Rate Limit: 100 requests per 10 seconds
Parameters
| Parameter | Type | Description |
|---|---|---|
order_id | string | Order ID or Text for Modify Order |
params | ModifyCrossExOrderReq | Modification parameters |
Returns
Promise<ModifyCrossExOrderResp>
Promise with modification confirmation
modifyTradFiOrder()
modifyTradFiOrder(orderId: number, params: TradFiModifyOrderReq): Promise<TradFiApiResp<TradFiModifyOrderResult>>;Parameters
| Parameter | Type |
|---|---|
orderId | number |
params | TradFiModifyOrderReq |
Returns
Promise<TradFiApiResp<TradFiModifyOrderResult>>
modifyTradFiPosition()
modifyTradFiPosition(positionId: number, params: TradFiModifyPositionReq): Promise<TradFiApiResp<Record<string, never>>>;Parameters
| Parameter | Type |
|---|---|
positionId | number |
params | TradFiModifyPositionReq |
Returns
Promise<TradFiApiResp<Record<string, never>>>
placeP2PMerchantBizPushOrder()
placeP2PMerchantBizPushOrder(params: P2PMerchantPlaceBizPushOrderReq): Promise<P2PMerchantApiResp<Record<string, unknown>>>;Place ad order
Parameters
| Parameter | Type |
|---|---|
params | P2PMerchantPlaceBizPushOrderReq |
Returns
Promise<P2PMerchantApiResp<Record<string, unknown>>>
portfolioMarginCalculate()
portfolioMarginCalculate(params: PortfolioMarginCalculatorReq): Promise<PortfolioMarginCalculation>;Portfolio margin calculator
Portfolio Margin Calculator When inputting a simulated position portfolio, each position includes the position name and quantity held, supporting markets within the range of BTC and ETH perpetual contracts, options, and spot markets. When inputting simulated orders, each order includes the market identifier, order price, and order quantity, supporting markets within the range of BTC and ETH perpetual contracts, options, and spot markets. Market orders are not included.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | PortfolioMarginCalculatorReq | Parameters for portfolio margin calculator |
Returns
Promise<PortfolioMarginCalculation>
Promise<PortfolioMarginCalculatorResp>
repayMultiLoan()
repayMultiLoan(params: RepayMultiLoanReq): Promise<RepayMultiLoanResp>;Repay Multi-Collateral Loan
Parameters
| Parameter | Type | Description |
|---|---|---|
params | RepayMultiLoanReq | Parameters for repaying a multi-collateral loan |
Returns
Promise<RepayMultiLoanResp>
Promise<RepayMultiLoanResp>
resetOptionsMMPSettings()
resetOptionsMMPSettings(params: object): Promise<OptionsMMPSettings>;Reset MMP (Market Maker Protection) settings
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { underlying: string; } | Parameters for resetting MMP settings |
params.underlying | string | - |
Returns
Promise<OptionsMMPSettings>
Promise<OptionsMMPSettings>
sendP2PMerchantChatMessage()
sendP2PMerchantChatMessage(params: P2PMerchantSendChatMessageReq): Promise<P2PMerchantApiResp<{
SRVTM: number;
}>>;Send chat message
Parameters
| Parameter | Type |
|---|---|
params | P2PMerchantSendChatMessageReq |
Returns
Promise<P2PMerchantApiResp<{ SRVTM: number; }>>
setCollateralCurrency()
setCollateralCurrency(params: object): Promise<{
is_success: boolean;
}>;Set collateral currency
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { collateral_type: 0 | 1; disable_list?: string[]; enable_list?: string[]; } | Parameters for setting collateral currency |
params.collateral_type | 0 | 1 | - |
params.disable_list? | string[] | - |
params.enable_list? | string[] | - |
Returns
Promise<{ is_success: boolean; }>
Promise<{ is_success: boolean; }>
setCrossExMarginPositionLeverage()
setCrossExMarginPositionLeverage(params: SetCrossExMarginPositionLeverageReq): Promise<SetCrossExMarginPositionLeverageResp>;Modify Leveraged Trading Pair Leverage Multiplier
Modify leverage for margin trading pair. Rate Limit: 100 requests per 10 seconds
Parameters
| Parameter | Type | Description |
|---|---|---|
params | SetCrossExMarginPositionLeverageReq | Leverage modification parameters |
Returns
Promise<SetCrossExMarginPositionLeverageResp>
Promise with leverage update confirmation
setCrossExPositionLeverage()
setCrossExPositionLeverage(params: SetCrossExPositionLeverageReq): Promise<SetCrossExPositionLeverageResp>;Modify Contract Trading Pair Leverage Multiplier
Modify leverage for contract trading pair. Rate Limit: 100 requests per 10 seconds
Parameters
| Parameter | Type | Description |
|---|---|---|
params | SetCrossExPositionLeverageReq | Leverage modification parameters |
Returns
Promise<SetCrossExPositionLeverageResp>
Promise with leverage update confirmation
setDefaultOTCBank()
setDefaultOTCBank(params: OTCBankIdReq): Promise<OTCActionResp>;Set default bank card
Parameters
| Parameter | Type |
|---|---|
params | OTCBankIdReq |
Returns
Promise<OTCActionResp>
setFuturesOrderCancelCountdown()
setFuturesOrderCancelCountdown(params: object): Promise<{
triggerTime: number;
}>;Countdown cancel orders
When the timeout set by the user is reached, if there is no cancel or set a new countdown, the related pending orders will be automatically cancelled. This endpoint can be called repeatedly to set a new countdown or cancel the countdown. For example, call this endpoint at 30s intervals, each countdown timeout is set to 30s. If this endpoint is not called again within 30 seconds, all pending orders on the specified market will be automatically cancelled, if no market is specified, all market pending orders will be cancelled. If the timeout is set to 0 within 30 seconds, the countdown timer will expire and the cancel function will be cancelled.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { contract?: string; settle: FuturesSettle; timeout: number; } | Parameters for setting countdown cancel orders |
params.contract? | string | - |
params.settle | FuturesSettle | - |
params.timeout | number | - |
Returns
Promise<{ triggerTime: number; }>
Promise<{ triggerTime: number }>
setGTDeduction()
setGTDeduction(params: object): Promise<void>;Set GT deduction
Enable or disable GT deduction for the current account.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { enabled: boolean; } | Parameters for setting GT deduction |
params.enabled | boolean | - |
Returns
Promise<void>
Promise<void>
setMarginUserLeverage()
setMarginUserLeverage(params: object): Promise<any>;Set the user market leverage multiple
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { currency_pair: string; leverage: string; } | Parameters containing currency pair and leverage value |
params.currency_pair | string | - |
params.leverage | string | - |
Returns
Promise<any>
Promise<void> - Returns nothing on success (204 No Content)
setOptionsMMPSettings()
setOptionsMMPSettings(params: OptionsMMPSettingsReq): Promise<OptionsMMPSettings>;Set MMP (Market Maker Protection) settings
Parameters
| Parameter | Type | Description |
|---|---|---|
params | OptionsMMPSettingsReq | Parameters for setting MMP settings |
Returns
Promise<OptionsMMPSettings>
Promise<OptionsMMPSetings>
setP2PMerchantWorkHours()
setP2PMerchantWorkHours(params: P2PMerchantSetMerchantWorkHoursReq): Promise<P2PMerchantApiResp<{
work_status: number;
}>>;Set merchant working status and custom working hours (v4.106.96)
Parameters
| Parameter | Type |
|---|---|
params | P2PMerchantSetMerchantWorkHoursReq |
Returns
Promise<P2PMerchantApiResp<{ work_status: number; }>>
setStockMarginFeature()
setStockMarginFeature(params: SetStockMarginFeatureReq): Promise<StockApiResp<Record<string, never>>>;Set stock margin financing availability
Parameters
| Parameter | Type | Description |
|---|---|---|
params | SetStockMarginFeatureReq | Whether to enable margin financing |
Returns
Promise<StockApiResp<Record<string, never>>>
Promise with empty data on success
setUnifiedAccountMode()
setUnifiedAccountMode(params: SetUnifiedAccountModeReq): Promise<any>;Set mode of the unified account
Switching between different account modes requires only passing the parameters corresponding to the target account mode. It also supports opening or closing configuration switches for the corresponding account mode when switching.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | SetUnifiedAccountModeReq | Parameters for setting the mode of the unified account |
Returns
Promise<any>
Promise<any>
setUnifiedDeltaNeutral()
setUnifiedDeltaNeutral(params: SetUnifiedDeltaNeutralReq): Promise<DeltaNeutralEnabled>;Set Delta-neutral strategy mode (v4.106.97)
Requires VIP level >= 4 and cross-currency margin mode.
Parameters
| Parameter | Type |
|---|---|
params | SetUnifiedDeltaNeutralReq |
Returns
Promise<DeltaNeutralEnabled>
setUserLeverage()
setUserLeverage(params: SetUserLeverageReq): Promise<LeverageFailedCurrency[]>;Set leverage for all borrowed currencies
Set leverage for all of a user's borrowed currencies. Currencies with outstanding loans cannot be changed. Values above a currency's leverage limit are capped. The response lists currencies whose updates failed together with the failure reason.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | SetUserLeverageReq | Parameters containing the leverage value |
Returns
Promise<LeverageFailedCurrency[]>
Promise<LeverageFailedCurrency[]>
stopAllChaseOrders()
stopAllChaseOrders(params: StopAllChaseOrdersReq): Promise<StopAllChaseOrdersResp>;Stop chase orders in batch
Parameters
| Parameter | Type |
|---|---|
params | StopAllChaseOrdersReq |
Returns
Promise<StopAllChaseOrdersResp>
stopAutoInvestPlan()
stopAutoInvestPlan(params: StopAutoInvestPlanReq): Promise<unknown>;Stop auto invest plan
Parameters
| Parameter | Type |
|---|---|
params | StopAutoInvestPlanReq |
Returns
Promise<unknown>
stopChaseOrder()
stopChaseOrder(params: StopChaseOrderReq): Promise<StopChaseOrderResp>;Stop a chase order
Parameters
| Parameter | Type |
|---|---|
params | StopChaseOrderReq |
Returns
Promise<StopChaseOrderResp>
submitCrossMarginBorrowLoan()
submitCrossMarginBorrowLoan(params: SubmitCrossMarginBorrowLoanReq): Promise<CrossMarginMorrowLoanRecord>;Parameters
| Parameter | Type | Description |
|---|---|---|
params | SubmitCrossMarginBorrowLoanReq | Parameters for creating a cross margin borrow loan |
Returns
Promise<CrossMarginMorrowLoanRecord>
Promise<SubmitCrossMarginBorrowLoanResp>
Deprecated
as of 2025-02-10 Create a cross margin borrow loan
Borrow amount cannot be less than currency minimum borrow amount.
submitCrossMarginRepayment()
submitCrossMarginRepayment(params: object): Promise<CrossMarginMorrowLoanRecord[]>;Parameters
| Parameter | Type | Description |
|---|---|---|
params | { amount: string; currency: string; } | Parameters for cross margin repayments |
params.amount | string | - |
params.currency | string | - |
Returns
Promise<CrossMarginMorrowLoanRecord[]>
Promise<SubmitCrossMarginBorrowLoanResp[]>
Deprecated
as of 2025-02-10 Cross margin repayments
When the liquidity of the currency is insufficient and the transaction risk is high, the currency will be disabled, and funds cannot be transferred. When the available balance of cross-margin is insufficient, the balance of the spot account can be used for repayment. Please ensure that the balance of the spot account is sufficient, and system uses cross-margin account for repayment first.
submitDeliveryOrder()
submitDeliveryOrder(params: SubmitDeliveryFuturesOrderReq): Promise<FuturesOrder>;Create a futures order
Zero-filled order cannot be retrieved 10 minutes after order cancellation
Parameters
| Parameter | Type | Description |
|---|---|---|
params | SubmitDeliveryFuturesOrderReq | Parameters for creating a futures order |
Returns
Promise<FuturesOrder>
Promise<FuturesOrder>
submitDeliveryTriggeredOrder()
submitDeliveryTriggeredOrder(params: SubmitFuturesTriggeredOrderReq): Promise<TriggerOrderResponse>;Create a price-triggered order
Parameters
| Parameter | Type | Description |
|---|---|---|
params | SubmitFuturesTriggeredOrderReq | Parameters for creating a price-triggered order |
Returns
Promise<TriggerOrderResponse>
Promise<TriggerOrderResponse>
submitDualInvestmentOrder()
submitDualInvestmentOrder(params: PlaceDualInvestmentOrderParams): Promise<DualInvestmentOrder>;Place Dual Investment order
Parameters
| Parameter | Type | Description |
|---|---|---|
params | PlaceDualInvestmentOrderParams | plan_id, amount (or copies), optional text |
Returns
Promise<DualInvestmentOrder>
Promise<DualInvestmentOrder>
submitDualOrderRefund()
submitDualOrderRefund(params: SubmitDualOrderRefundParams): Promise<DualInvestmentOrder>;Dual-currency order early redemption
Parameters
| Parameter | Type |
|---|---|
params | SubmitDualOrderRefundParams |
Returns
Promise<DualInvestmentOrder>
submitDualStockOrder()
submitDualStockOrder(params: PlaceDualStockInvestmentOrderParams): Promise<DualInvestmentOrder>;Place a stock dual investment order
hit_spot, hit_stock, and hit_simple apply to buy-low (put) subscriptions. 1 selects that funding account.
Parameters
| Parameter | Type |
|---|---|
params | PlaceDualStockInvestmentOrderParams |
Returns
Promise<DualInvestmentOrder>
submitDualStockOrderRefund()
submitDualStockOrderRefund(params: SubmitDualOrderRefundParams): Promise<DualInvestmentOrder>;Redeem a stock dual investment order
Parameters
| Parameter | Type |
|---|---|
params | SubmitDualOrderRefundParams |
Returns
Promise<DualInvestmentOrder>
submitFlashSwapOrder()
submitFlashSwapOrder(params: SubmitFlashSwapOrderReq): Promise<FlashSwapOrder>;Create a flash swap order
Initiate a flash swap preview in advance because order creation requires a preview result.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | SubmitFlashSwapOrderReq | Parameters for creating a flash swap order |
Returns
Promise<FlashSwapOrder>
Promise<SubmitFlashSwapOrderResp>
submitFlashSwapOrderPreview()
submitFlashSwapOrderPreview(params: SubmitFlashSwapOrderPreviewReq): Promise<SubmitFlashSwapOrderPreviewResp>;Initiate a flash swap order preview
Parameters
| Parameter | Type | Description |
|---|---|---|
params | SubmitFlashSwapOrderPreviewReq | Parameters for initiating a flash swap order preview |
Returns
Promise<SubmitFlashSwapOrderPreviewResp>
Promise<SubmitFlashSwapOrderPreviewResp>
submitFuturesBatchOrders()
submitFuturesBatchOrders(params: object): Promise<FuturesOrder[]>;Create a batch of futures orders
Up to 10 orders per request. If any of the order's parameters are missing or in the wrong format, all of them will not be executed, and a http status 400 error will be returned directly. If the parameters are checked and passed, all are executed. Even if there is a business logic error in the middle (such as insufficient funds), it will not affect other execution orders. The returned result is in array format, and the order corresponds to the orders in the request body. In the returned result, the succeeded field of type bool indicates whether the execution was successful or not. If the execution is successful, the normal order content is included; if the execution fails, the label field is included to indicate the cause of the error. In the rate limiting, each order is counted individually.
NOTE: The "xGateExptime" parameter will translate to the "x-gate-exptime" header.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { orders: SubmitFuturesOrderReq[]; settle: FuturesSettle; xGateExptime?: number; } | Parameters for creating a batch of futures orders |
params.orders | SubmitFuturesOrderReq[] | - |
params.settle | FuturesSettle | - |
params.xGateExptime? | number | - |
Returns
Promise<FuturesOrder[]>
Promise<FuturesOrder[]>
submitFuturesOrder()
submitFuturesOrder(params: SubmitFuturesOrderReq): Promise<FuturesOrder>;Create a futures order
Creating futures orders requires size, which is the number of contracts instead of currency amount. You can use quanto_multiplier in the contract detail response to know how much currency 1 size contract represents. Zero-filled order cannot be retrieved 10 minutes after order cancellation. You will get a 404 not found for such orders. Set reduce_only to true to keep the position from changing side when reducing position size. In single position mode, to close a position, you need to set size to 0 and close to true. In dual position mode, to close one side position, you need to set auto_size side, reduce_only to true, and size to 0. Set stp_act to decide the strategy of self-trade prevention. For detailed usage, refer to the stp_act parameter in the request body.
NOTE: The "xGateExptime" parameter will translate to the "x-gate-exptime" header.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | SubmitFuturesOrderReq | Parameters for creating a futures order |
Returns
Promise<FuturesOrder>
Promise<FuturesOrder>
submitFuturesPriceTriggeredOrder()
submitFuturesPriceTriggeredOrder(params: SubmitFuturesTriggeredOrderReq): Promise<TriggerOrderResponse>;Create a price-triggered order
Parameters
| Parameter | Type | Description |
|---|---|---|
params | SubmitFuturesTriggeredOrderReq | Parameters for creating a price-triggered order |
Returns
Promise<TriggerOrderResponse>
Promise<TriggerOrderResponse>
submitLendOrRedeemOrder()
submitLendOrRedeemOrder(params: SubmitLendOrRedeemReq): Promise<any>;Lend or redeem
Parameters
| Parameter | Type | Description |
|---|---|---|
params | SubmitLendOrRedeemReq | Parameters for lending or redeeming |
Returns
Promise<any>
Promise<any>
submitMainSubTransfer()
submitMainSubTransfer(params: SubmitMainSubTransferReq): Promise<any>;Transfer between main and sub accounts
Support transferring with sub user's spot or futures account. Note that only main user's spot account is used no matter which sub user's account is operated.
On HTTP 5xx or SERVER_ERROR, the transfer may still have been accepted. Set client_order_id, then check getTransferStatus({ client_order_id }) before sending it again.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | SubmitMainSubTransferReq | Transfer parameters |
Returns
Promise<any>
Promise<any>
submitMarginUNIBorrowOrRepay()
submitMarginUNIBorrowOrRepay(params: object): Promise<any>;Borrow or repay
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { amount: string; currency: string; currency_pair: string; repaid_all?: boolean; type: "borrow" | "repay"; } | Parameters for borrowing or repaying |
params.amount | string | - |
params.currency | string | - |
params.currency_pair | string | - |
params.repaid_all? | boolean | - |
params.type | "borrow" | "repay" | - |
Returns
Promise<any>
Promise<any>
submitMultiLoanOrder()
submitMultiLoanOrder(params: SubmitMultiLoanOrderReq): Promise<{
order_id: number;
}>;Create Multi-Collateral Order
Parameters
| Parameter | Type | Description |
|---|---|---|
params | SubmitMultiLoanOrderReq | Parameters for creating a multi-collateral order |
Returns
Promise<{ order_id: number; }>
Promise<{ order_id: number }>
submitOptionsCountdownCancel()
submitOptionsCountdownCancel(params: object): Promise<{
triggerTime: number;
}>;Countdown cancel orders for options
Option order heartbeat detection. When the timeout set by the user is reached, if there is no cancel or new countdown set, related pending orders will be automatically cancelled. This endpoint can be called repeatedly to set a new countdown or cancel the countdown.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { contract?: string; timeout: number; underlying?: string; } | Parameters for setting countdown cancel orders |
params.contract? | string | - |
params.timeout | number | - |
params.underlying? | string | - |
Returns
Promise<{ triggerTime: number; }>
Promise<{ triggerTime: number; }>
submitOptionsOrder()
submitOptionsOrder(params: SubmitOptionsOrderReq): Promise<SubmitOptionsOrderResp>;Create an options order
Parameters
| Parameter | Type | Description |
|---|---|---|
params | SubmitOptionsOrderReq | Parameters for creating an options order |
Returns
Promise<SubmitOptionsOrderResp>
Promise<SubmitOptionsOrderResp>
submitOTCBankEnterpriseSupplement()
submitOTCBankEnterpriseSupplement(params: SubmitOTCBankEnterpriseSupplementReq): Promise<OTCActionResp>;Submit enterprise bank card supplement materials (multipart/form-data)
Parameters
| Parameter | Type |
|---|---|
params | SubmitOTCBankEnterpriseSupplementReq |
Returns
Promise<OTCActionResp>
submitOTCBankPersonalSupplement()
submitOTCBankPersonalSupplement(params: SubmitOTCBankPersonalSupplementReq): Promise<OTCActionResp>;Submit personal bank card supplement materials (multipart/form-data)
Parameters
| Parameter | Type |
|---|---|
params | SubmitOTCBankPersonalSupplementReq |
Returns
Promise<OTCActionResp>
submitSpotBatchOrders()
submitSpotBatchOrders(body: SpotOrder[], params?: object): Promise<SubmitSpotBatchOrdersResp[]>;Create a batch of orders
Batch orders requirements:
- custom order field text is required
- At most 4 currency pairs, maximum 10 orders each, are allowed in one request
- No mixture of spot orders and margin orders, i.e. account must be identical for all orders
NOTE: The "xGateExptime" parameter will translate to the "x-gate-exptime" header.
Parameters
| Parameter | Type | Description |
|---|---|---|
body | SpotOrder[] | - |
params? | { xGateExptime?: number; } | Parameters for creating a batch of orders |
params.xGateExptime? | number | - |
Returns
Promise<SubmitSpotBatchOrdersResp[]>
Promise<SubmitSpotBatchOrdersResp[]>
submitSpotClosePosCrossDisabled()
submitSpotClosePosCrossDisabled(params: SubmitSpotClosePosCrossDisabledReq): Promise<SpotOrder>;Close position when cross-currency is disabled
Currently, only cross-margin accounts are supported to close position when cross currencies are disabled. Maximum buy quantity = (unpaid principal and interest - currency balance - the amount of the currency in the order book) / 0.998
Parameters
| Parameter | Type | Description |
|---|---|---|
params | SubmitSpotClosePosCrossDisabledReq | Parameters for closing position when cross-currency is disabled |
Returns
Promise<SpotOrder>
Promise<Order>
submitSpotCountdownOrders()
submitSpotCountdownOrders(params: object): Promise<{
triggerTime: number;
}>;Countdown cancel orders
When the timeout set by the user is reached, if there is no cancel or set a new countdown, the related pending orders will be automatically cancelled. This endpoint can be called repeatedly to set a new countdown or cancel the countdown.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { currency_pair?: string; timeout: number; } | Parameters for setting countdown cancel orders |
params.currency_pair? | string | - |
params.timeout | number | - |
Returns
Promise<{ triggerTime: number; }>
Promise<{ triggerTime: number; }>
submitSpotMainAccountTransfer()
submitSpotMainAccountTransfer(params: object): Promise<{
id: number;
}>;Transfer between spot main accounts
Both parties cannot be sub-accounts.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { amount: string; currency: string; receive_uid: number; } | Transfer parameters |
params.amount | string | - |
params.currency | string | - |
params.receive_uid | number | - |
Returns
Promise<{ id: number; }>
Promise<{ id: number; }>
submitSpotOrder()
submitSpotOrder(params: SubmitSpotOrderReq): Promise<SpotOrder>;Create an order
You can place orders with spot, portfolio, margin or cross margin account through setting the account field. It defaults to spot, which means spot account is used to place orders. If the user is using unified account, it defaults to the unified account.
NOTE: The "xGateExptime" parameter will translate to the "x-gate-exptime" header.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | SubmitSpotOrderReq | Parameters for creating an order |
Returns
Promise<SpotOrder>
Promise<Order>
See
submitSpotPriceTriggerOrder()
submitSpotPriceTriggerOrder(params: SpotPriceTriggeredOrder): Promise<{
id: number;
}>;Create a price-triggered order
Parameters
| Parameter | Type | Description |
|---|---|---|
params | SpotPriceTriggeredOrder | Parameters for creating a price-triggered order |
Returns
Promise<{ id: number; }>
Promise<{ id: number; }>
submitStakingSwap()
submitStakingSwap(params: object): Promise<any>;On-chain Token Swap for Earned Coins
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { amount: string; coin: string; pid?: number; side: "0" | "1"; } | Parameters for staking swap |
params.amount | string | - |
params.coin | string | - |
params.pid? | number | - |
params.side | "0" | "1" | - |
Returns
Promise<any>
Promise<any>
submitSubToSubTransfer()
submitSubToSubTransfer(params: SubmitSubToSubTransferReq): Promise<any>;Sub-account transfers to sub-account
It is possible to perform balance transfers between two sub-accounts under the same main account. You can use either the API Key of the main account or the API Key of the sub-account to initiate the transfer.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | SubmitSubToSubTransferReq | Transfer parameters |
Returns
Promise<any>
Promise<any>
submitTransfer()
submitTransfer(params: SubmitTransferReq): Promise<{
tx_id: number;
}>;Transfer between trading accounts
Transfer between different accounts. Currently support transfers between the following:
- spot - margin
- spot - futures(perpetual)
- spot - delivery
- spot - cross margin
- spot - options
Parameters
| Parameter | Type | Description |
|---|---|---|
params | SubmitTransferReq | Transfer parameters |
Returns
Promise<{ tx_id: number; }>
Promise<TransferResponse>
submitUnifiedBorrowOrRepay()
submitUnifiedBorrowOrRepay(params: SubmitUnifiedBorrowOrRepayReq): Promise<any>;Borrow or repay
When borrowing, it is essential to ensure that the borrowed amount is not below the minimum borrowing threshold for the specific cryptocurrency and does not exceed the maximum borrowing limit set by the platform and the user.
The interest on the loan will be automatically deducted from the account at regular intervals. It is the user's responsibility to manage the repayment of the borrowed amount.
For repayment, the option to repay the entire borrowed amount is available by setting the parameter repaid_all=true
Parameters
| Parameter | Type | Description |
|---|---|---|
params | SubmitUnifiedBorrowOrRepayReq | Parameters for borrowing or repaying |
Returns
Promise<any>
Promise<any>
submitUnifiedLoanRepay()
submitUnifiedLoanRepay(params: SubmitUnifiedLoanRepayReq): Promise<any>;Parameters
| Parameter | Type |
|---|---|
params | SubmitUnifiedLoanRepayReq |
Returns
Promise<any>
submitWithdrawal()
submitWithdrawal(params: SubmitWithdrawalReq): Promise<WithdrawalRecord>;Withdraw
Withdrawals to Gate addresses do not incur transaction fees.
On HTTP 5xx or SERVER_ERROR, the withdrawal may still have been accepted. Set withdraw_order_id, then check getWithdrawalRecords({ withdraw_order_id }) before sending it again.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | SubmitWithdrawalReq | Withdrawal parameters |
Returns
Promise<WithdrawalRecord>
Promise<Withdraw>
terminateTrailOrder()
terminateTrailOrder(params: TerminateTrailOrderReq): Promise<{
code?: number;
data?: {
order?: TrailOrder;
};
message?: string;
timestamp?: number;
}>;Terminate trail order
Parameters
| Parameter | Type | Description |
|---|---|---|
params | TerminateTrailOrderReq | settle and id or text |
Returns
Promise<{ code?: number; data?: { order?: TrailOrder; }; message?: string; timestamp?: number; }>
Promise with code, message, timestamp and data.order
unlockSubAccount()
unlockSubAccount(params: object): Promise<any>;Unlock the sub-account
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { user_id: number; } | Parameters containing the sub-account user ID |
params.user_id | number | - |
Returns
Promise<any>
Promise<any>
updateAutoInvestPlan()
updateAutoInvestPlan(params: UpdateAutoInvestPlanReq): Promise<unknown>;Update auto invest plan
Parameters
| Parameter | Type |
|---|---|
params | UpdateAutoInvestPlanReq |
Returns
Promise<unknown>
updateAutoRepaymentSetting()
updateAutoRepaymentSetting(params: object): Promise<{
status: "on" | "off";
}>;Update user's auto repayment setting
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { status: "on" | "off"; } | Parameters for updating auto repayment setting |
params.status | "on" | "off" | - |
Returns
Promise<{ status: "on" | "off"; }>
Promise<{ status: 'on' | 'off' }>
updateCrossExAccount()
updateCrossExAccount(params: UpdateCrossExAccountReq): Promise<UpdateCrossExAccountResp>;Modify Account Contract Position Mode and Account Mode
Modify account settings. Rate Limit: 100 requests per 60 seconds
Parameters
| Parameter | Type | Description |
|---|---|---|
params | UpdateCrossExAccountReq | Account modification parameters |
Returns
Promise<UpdateCrossExAccountResp>
Promise with update confirmation
updateCrossExPositionsMargin()
updateCrossExPositionsMargin(params: UpdateCrossExPositionsMarginReq): Promise<UpdateCrossExPositionsMarginResp>;Parameters
| Parameter | Type |
|---|---|
params | UpdateCrossExPositionsMarginReq |
Returns
Promise<UpdateCrossExPositionsMarginResp>
updateDeliveryLeverage()
updateDeliveryLeverage(params: object): Promise<FuturesPosition>;Update position leverage
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { contract: string; leverage: string; settle: "usdt"; } | Parameters for updating position leverage |
params.contract | string | - |
params.leverage | string | - |
params.settle | "usdt" | - |
Returns
Promise<FuturesPosition>
Promise<Position>
updateDeliveryMargin()
updateDeliveryMargin(params: object): Promise<FuturesPosition>;Update position margin
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { change: string; contract: string; settle: "usdt"; } | Parameters for updating position margin |
params.change | string | - |
params.contract | string | - |
params.settle | "usdt" | - |
Returns
Promise<FuturesPosition>
Promise<Position>
updateDeliveryRiskLimit()
updateDeliveryRiskLimit(params: object): Promise<FuturesPosition>;Update position risk limit
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { contract: string; risk_limit: string; settle: "usdt"; } | Parameters for updating position risk limit |
params.contract | string | - |
params.risk_limit | string | - |
params.settle | "usdt" | - |
Returns
Promise<FuturesPosition>
Promise<Position>
updateDualModePositionLeverage()
updateDualModePositionLeverage(params: UpdateDualModePositionLeverageReq): Promise<FuturesPosition[]>;Update position leverage in dual mode
Parameters
| Parameter | Type | Description |
|---|---|---|
params | UpdateDualModePositionLeverageReq | Parameters for updating position leverage in dual mode |
Returns
Promise<FuturesPosition[]>
Promise<Position[]>
updateDualModePositionMargin()
updateDualModePositionMargin(params: UpdateDualModePositionMarginReq): Promise<FuturesPosition[]>;Update position margin in dual mode
Parameters
| Parameter | Type | Description |
|---|---|---|
params | UpdateDualModePositionMarginReq | Parameters for updating position margin in dual mode |
Returns
Promise<FuturesPosition[]>
Promise<Position[]>
updateDualModePositionRiskLimit()
updateDualModePositionRiskLimit(params: object): Promise<FuturesPosition[]>;Update position risk limit in dual mode
See risk limit rules for more information
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { contract: string; risk_limit: string; settle: FuturesSettle; } | Parameters for updating position risk limit in dual mode |
params.contract | string | - |
params.risk_limit | string | - |
params.settle | FuturesSettle | - |
Returns
Promise<FuturesPosition[]>
Promise<FuturesPosition[]>
updateDualOrderReinvest()
updateDualOrderReinvest(params: UpdateDualOrderReinvestParams): Promise<unknown>;Update dual-currency order reinvest settings
Parameters
| Parameter | Type |
|---|---|
params | UpdateDualOrderReinvestParams |
Returns
Promise<unknown>
updateDualStockOrderReinvest()
updateDualStockOrderReinvest(params: UpdateDualOrderReinvestParams): Promise<unknown>;Update reinvestment settings for a stock dual investment order
Parameters
| Parameter | Type |
|---|---|
params | UpdateDualOrderReinvestParams |
Returns
Promise<unknown>
updateFuturesDualMode()
updateFuturesDualMode(params: object): Promise<FuturesAccount>;Enable or disable dual mode
Before setting dual mode, make sure all positions are closed and no orders are open.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { dual_mode: boolean; settle: FuturesSettle; } | Parameters for enabling or disabling dual mode |
params.dual_mode | boolean | - |
params.settle | FuturesSettle | - |
Returns
Promise<FuturesAccount>
Promise<FuturesAccount>
updateFuturesLeverage()
updateFuturesLeverage(params: object): Promise<FuturesPosition>;Update position leverage
Position Mode Switching Rules:
- leverage ≠ 0: Isolated Margin Mode (Regardless of whether cross_leverage_limit is filled, this parameter will be ignored)
- leverage = 0: Cross Margin Mode (Use cross_leverage_limit to set the leverage multiple)
Examples:
- Set isolated margin with 10x leverage: leverage=10
- Set cross margin with 10x leverage: leverage=0&cross_leverage_limit=10
- leverage=5&cross_leverage_limit=10 → Result: Isolated margin with 5x leverage (cross_leverage_limit is ignored)
Warning: Incorrect settings may cause unexpected position mode switching, affecting risk management.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { contract: string; cross_leverage_limit?: string; leverage: string; pid?: number; settle: FuturesSettle; } | Parameters for updating position leverage |
params.contract | string | - |
params.cross_leverage_limit? | string | - |
params.leverage | string | - |
params.pid? | number | - |
params.settle | FuturesSettle | - |
Returns
Promise<FuturesPosition>
Promise<Position>
updateFuturesMargin()
updateFuturesMargin(params: object): Promise<FuturesPosition>;Update position margin
Under the new risk limit rules, the position limit is related to the leverage you set; a lower leverage will result in a higher position limit. Please use the leverage adjustment api to adjust the position limit.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { change: string; contract: string; settle: FuturesSettle; } | Parameters for updating position margin |
params.change | string | - |
params.contract | string | - |
params.settle | FuturesSettle | - |
Returns
Promise<FuturesPosition>
Promise<Position>
updateFuturesOrder()
updateFuturesOrder(params: UpdateFuturesOrderReq): Promise<FuturesOrder>;Amend an order
NOTE: The "xGateExptime" parameter will translate to the "x-gate-exptime" header.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | UpdateFuturesOrderReq | Parameters for amending an order |
Returns
Promise<FuturesOrder>
Promise<FuturesOrder>
updateFuturesPositionMode()
updateFuturesPositionMode(params: object): Promise<FuturesPosition>;Update position by store mode
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { contract: string; mode: "CROSS" | "ISOLATED"; settle: "usdt" | "btc"; } | Parameters for updating position by store mode |
params.contract | string | - |
params.mode | "CROSS" | "ISOLATED" | - |
params.settle | "usdt" | "btc" | - |
Returns
Promise<FuturesPosition>
Promise<FuturesPosition>
updateFuturesPriceTriggeredOrder()
updateFuturesPriceTriggeredOrder(params: UpdateFuturesPriceTriggeredOrderReq): Promise<TriggerOrderResponse>;Update a single price-triggered order
v4.106.160: PUT /futures/{settle}/price_orders/amend/{order_id}. order_id is required in the path and is still sent in the JSON body.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | UpdateFuturesPriceTriggeredOrderReq | Parameters for updating a price-triggered order |
Returns
Promise<TriggerOrderResponse>
Promise<TriggerOrderResponse>
updateInterestReinvestment()
updateInterestReinvestment(params: object): Promise<any>;Set interest reinvestment toggle
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { currency: string; status: boolean; } | Parameters for setting interest reinvestment toggle |
params.currency | string | - |
params.status | boolean | - |
Returns
Promise<any>
Promise<any>
Deprecated
as of v4.99.0, 23-06-2025
updateLendingOrder()
updateLendingOrder(params: object): Promise<any>;Amend lending order
Currently only supports amending the minimum interest rate (hour)
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { currency?: string; min_rate?: string; } | Parameters for amending lending order |
params.currency? | string | - |
params.min_rate? | string | - |
Returns
Promise<any>
Promise<any>
updateMultiLoan()
updateMultiLoan(params: UpdateMultiLoanReq): Promise<UpdateMultiLoanResp>;Operate Multi-Collateral
Parameters
| Parameter | Type | Description |
|---|---|---|
params | UpdateMultiLoanReq | Parameters for operating multi-collateral |
Returns
Promise<UpdateMultiLoanResp>
Promise<UpdateMultiLoanResp>
updateP2PMerchantAdsStatus()
updateP2PMerchantAdsStatus(params: P2PMerchantAdsUpdateStatusReq): Promise<P2PMerchantApiResp<{
status: number;
}>>;Update ad status
Parameters
| Parameter | Type |
|---|---|
params | P2PMerchantAdsUpdateStatusReq |
Returns
Promise<P2PMerchantApiResp<{ status: number; }>>
updatePositionRiskLimit()
updatePositionRiskLimit(params: object): Promise<FuturesPosition>;Update position risk limit
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { contract: string; risk_limit: string; settle: FuturesSettle; } | Parameters for updating position risk limit |
params.contract | string | - |
params.risk_limit | string | - |
params.settle | FuturesSettle | - |
Returns
Promise<FuturesPosition>
Promise<Position>
updateSpotOrder()
updateSpotOrder(params: UpdateSpotOrderReq): Promise<SpotOrder>;Amend an order
By default, the orders of spot, portfolio and margin account are updated. If you need to modify orders of the cross-margin account, you must specify account as cross_margin. For portfolio margin account, only cross_margin account is supported.
Currently, only supports modification of price or amount fields.
NOTE: The "xGateExptime" parameter will translate to the "x-gate-exptime" header.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | UpdateSpotOrderReq | Parameters for amending an order |
Returns
Promise<SpotOrder>
Promise<Order>
See
updateStockOrder()
updateStockOrder(orderId: number, params: UpdateStockOrderReq): Promise<StockApiResp<StockUpdateOrderResult>>;Modify a stock order
Parameters
| Parameter | Type | Description |
|---|---|---|
orderId | number | Order ID |
params | UpdateStockOrderReq | Modified volume and price |
Returns
Promise<StockApiResp<StockUpdateOrderResult>>
Promise with updated order ID
updateSubAccountApiKey()
updateSubAccountApiKey(params: UpdateSubAccountApiKeyReq): Promise<any>;Update API key of the sub-account
Note: This interface cannot modify the mode account type attribute
Parameters
| Parameter | Type | Description |
|---|---|---|
params | UpdateSubAccountApiKeyReq | Parameters for updating API key of the sub-account |
Returns
Promise<any>
Promise<any>
updateTrailOrder()
updateTrailOrder(params: UpdateTrailOrderReq): Promise<{
code?: number;
data?: {
order?: TrailOrder;
};
message?: string;
timestamp?: number;
}>;Update trail order
Parameters
| Parameter | Type | Description |
|---|---|---|
params | UpdateTrailOrderReq | settle, id and fields to update |
Returns
Promise<{ code?: number; data?: { order?: TrailOrder; }; message?: string; timestamp?: number; }>
Promise with code, message, timestamp and data.order
updateUserCurrencyLeverage()
updateUserCurrencyLeverage(params: object): Promise<any>;Set the currency leverage ratio
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { currency: string; leverage: string; } | Parameters for setting currency leverage ratio |
params.currency | string | - |
params.leverage | string | - |
Returns
Promise<any>
Promise<any> Returns nothing on success (204 No Content)
uploadP2PMerchantChatFile()
uploadP2PMerchantChatFile(params: P2PMerchantUploadChatFileReq): Promise<P2PMerchantApiResp<{
file_key: string;
}>>;Upload chat file
Parameters
| Parameter | Type |
|---|---|
params | P2PMerchantUploadChatFileReq |
Returns
Promise<P2PMerchantApiResp<{ file_key: string; }>>