kucoin-universal-sdk
Version:
Official KuCoin Universal SDK.
244 lines (243 loc) • 15 kB
TypeScript
import { Transport } from '../../../internal/interfaces/transport';
import { GetOrderByOrderIdResp } from './model_get_order_by_order_id_resp';
import { GetTradeHistoryResp } from './model_get_trade_history_resp';
import { GetOrderByClientOidResp } from './model_get_order_by_client_oid_resp';
import { CancelOrderByClientOidReq } from './model_cancel_order_by_client_oid_req';
import { GetClosedOrdersResp } from './model_get_closed_orders_resp';
import { AddOrderV1Req } from './model_add_order_v1_req';
import { AddOrderReq } from './model_add_order_req';
import { GetOpenOrdersResp } from './model_get_open_orders_resp';
import { GetClosedOrdersReq } from './model_get_closed_orders_req';
import { CancelOrderByOrderIdReq } from './model_cancel_order_by_order_id_req';
import { CancelAllOrdersBySymbolResp } from './model_cancel_all_orders_by_symbol_resp';
import { GetSymbolsWithOpenOrderReq } from './model_get_symbols_with_open_order_req';
import { GetOpenOrdersReq } from './model_get_open_orders_req';
import { AddOrderTestV1Req } from './model_add_order_test_v1_req';
import { GetTradeHistoryReq } from './model_get_trade_history_req';
import { CancelAllOrdersBySymbolReq } from './model_cancel_all_orders_by_symbol_req';
import { AddOrderTestReq } from './model_add_order_test_req';
import { AddOrderTestV1Resp } from './model_add_order_test_v1_resp';
import { AddOrderV1Resp } from './model_add_order_v1_resp';
import { CancelOrderByClientOidResp } from './model_cancel_order_by_client_oid_resp';
import { CancelOrderByOrderIdResp } from './model_cancel_order_by_order_id_resp';
import { AddOrderTestResp } from './model_add_order_test_resp';
import { GetOrderByClientOidReq } from './model_get_order_by_client_oid_req';
import { AddOrderResp } from './model_add_order_resp';
import { GetOrderByOrderIdReq } from './model_get_order_by_order_id_req';
import { GetSymbolsWithOpenOrderResp } from './model_get_symbols_with_open_order_resp';
export interface OrderAPI {
/**
* addOrder Add Order
* Description: Place order in the Cross-margin or Isolated-margin trading system. You can place two major types of order: Limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.
* Documentation: https://www.kucoin.com/docs-new/api-3470204
* +-----------------------+---------+
* | Extra API Info | Value |
* +-----------------------+---------+
* | API-DOMAIN | SPOT |
* | API-CHANNEL | PRIVATE |
* | API-PERMISSION | MARGIN |
* | API-RATE-LIMIT-POOL | SPOT |
* | API-RATE-LIMIT-WEIGHT | 2 |
* +-----------------------+---------+
*/
addOrder(req: AddOrderReq): Promise<AddOrderResp>;
/**
* addOrderTest Add Order Test
* Description: Order test endpoint: This endpoint’s request and return parameters are identical to the order endpoint, and can be used to verify whether the signature is correct, among other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried.
* Documentation: https://www.kucoin.com/docs-new/api-3470205
* +-----------------------+---------+
* | Extra API Info | Value |
* +-----------------------+---------+
* | API-DOMAIN | SPOT |
* | API-CHANNEL | PRIVATE |
* | API-PERMISSION | MARGIN |
* | API-RATE-LIMIT-POOL | SPOT |
* | API-RATE-LIMIT-WEIGHT | 2 |
* +-----------------------+---------+
*/
addOrderTest(req: AddOrderTestReq): Promise<AddOrderTestResp>;
/**
* cancelOrderByOrderId Cancel Order By OrderId
* Description: This endpoint can be used to cancel a margin order by orderId. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to Websocket.
* Documentation: https://www.kucoin.com/docs-new/api-3470195
* +-----------------------+---------+
* | Extra API Info | Value |
* +-----------------------+---------+
* | API-DOMAIN | SPOT |
* | API-CHANNEL | PRIVATE |
* | API-PERMISSION | MARGIN |
* | API-RATE-LIMIT-POOL | SPOT |
* | API-RATE-LIMIT-WEIGHT | 2 |
* +-----------------------+---------+
*/
cancelOrderByOrderId(req: CancelOrderByOrderIdReq): Promise<CancelOrderByOrderIdResp>;
/**
* cancelOrderByClientOid Cancel Order By ClientOid
* Description: This endpoint can be used to cancel a margin order by clientOid. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to Websocket.
* Documentation: https://www.kucoin.com/docs-new/api-3470201
* +-----------------------+---------+
* | Extra API Info | Value |
* +-----------------------+---------+
* | API-DOMAIN | SPOT |
* | API-CHANNEL | PRIVATE |
* | API-PERMISSION | MARGIN |
* | API-RATE-LIMIT-POOL | SPOT |
* | API-RATE-LIMIT-WEIGHT | 2 |
* +-----------------------+---------+
*/
cancelOrderByClientOid(req: CancelOrderByClientOidReq): Promise<CancelOrderByClientOidResp>;
/**
* cancelAllOrdersBySymbol Cancel All Orders By Symbol
* Description: This interface can cancel all open Margin orders by symbol. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to Websocket.
* Documentation: https://www.kucoin.com/docs-new/api-3470197
* +-----------------------+---------+
* | Extra API Info | Value |
* +-----------------------+---------+
* | API-DOMAIN | SPOT |
* | API-CHANNEL | PRIVATE |
* | API-PERMISSION | MARGIN |
* | API-RATE-LIMIT-POOL | SPOT |
* | API-RATE-LIMIT-WEIGHT | 5 |
* +-----------------------+---------+
*/
cancelAllOrdersBySymbol(req: CancelAllOrdersBySymbolReq): Promise<CancelAllOrdersBySymbolResp>;
/**
* getSymbolsWithOpenOrder Get Symbols With Open Order
* Description: This interface can query all Margin symbols that have active orders.
* Documentation: https://www.kucoin.com/docs-new/api-3470196
* +-----------------------+---------+
* | Extra API Info | Value |
* +-----------------------+---------+
* | API-DOMAIN | SPOT |
* | API-CHANNEL | PRIVATE |
* | API-PERMISSION | MARGIN |
* | API-RATE-LIMIT-POOL | SPOT |
* | API-RATE-LIMIT-WEIGHT | 4 |
* +-----------------------+---------+
*/
getSymbolsWithOpenOrder(req: GetSymbolsWithOpenOrderReq): Promise<GetSymbolsWithOpenOrderResp>;
/**
* getOpenOrders Get Open Orders
* Description: This interface is to obtain all Margin active order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order. After the user successfully places an order, the order is in the Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.
* Documentation: https://www.kucoin.com/docs-new/api-3470198
* +-----------------------+---------+
* | Extra API Info | Value |
* +-----------------------+---------+
* | API-DOMAIN | SPOT |
* | API-CHANNEL | PRIVATE |
* | API-PERMISSION | GENERAL |
* | API-RATE-LIMIT-POOL | SPOT |
* | API-RATE-LIMIT-WEIGHT | 4 |
* +-----------------------+---------+
*/
getOpenOrders(req: GetOpenOrdersReq): Promise<GetOpenOrdersResp>;
/**
* getClosedOrders Get Closed Orders
* Description: This interface is to obtain all Margin closed order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order. After the user successfully places an order, the order is in the Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.
* Documentation: https://www.kucoin.com/docs-new/api-3470199
* +-----------------------+---------+
* | Extra API Info | Value |
* +-----------------------+---------+
* | API-DOMAIN | SPOT |
* | API-CHANNEL | PRIVATE |
* | API-PERMISSION | GENERAL |
* | API-RATE-LIMIT-POOL | SPOT |
* | API-RATE-LIMIT-WEIGHT | 10 |
* +-----------------------+---------+
*/
getClosedOrders(req: GetClosedOrdersReq): Promise<GetClosedOrdersResp>;
/**
* getTradeHistory Get Trade History
* Description: This endpoint can be used to obtain a list of the latest Margin transaction details. The returned data is sorted in descending order according to the latest update time of the order.
* Documentation: https://www.kucoin.com/docs-new/api-3470200
* +-----------------------+---------+
* | Extra API Info | Value |
* +-----------------------+---------+
* | API-DOMAIN | SPOT |
* | API-CHANNEL | PRIVATE |
* | API-PERMISSION | GENERAL |
* | API-RATE-LIMIT-POOL | SPOT |
* | API-RATE-LIMIT-WEIGHT | 5 |
* +-----------------------+---------+
*/
getTradeHistory(req: GetTradeHistoryReq): Promise<GetTradeHistoryResp>;
/**
* getOrderByOrderId Get Order By OrderId
* Description: This endpoint can be used to obtain information for a single Margin order using the order ID. After the user successfully places an order, the order is in the Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.
* Documentation: https://www.kucoin.com/docs-new/api-3470202
* +-----------------------+---------+
* | Extra API Info | Value |
* +-----------------------+---------+
* | API-DOMAIN | SPOT |
* | API-CHANNEL | PRIVATE |
* | API-PERMISSION | GENERAL |
* | API-RATE-LIMIT-POOL | SPOT |
* | API-RATE-LIMIT-WEIGHT | 5 |
* +-----------------------+---------+
*/
getOrderByOrderId(req: GetOrderByOrderIdReq): Promise<GetOrderByOrderIdResp>;
/**
* getOrderByClientOid Get Order By ClientOid
* Description: This endpoint can be used to obtain information for a single Margin order using the client order ID. After the user successfully places an order, the order is in the Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.
* Documentation: https://www.kucoin.com/docs-new/api-3470203
* +-----------------------+---------+
* | Extra API Info | Value |
* +-----------------------+---------+
* | API-DOMAIN | SPOT |
* | API-CHANNEL | PRIVATE |
* | API-PERMISSION | GENERAL |
* | API-RATE-LIMIT-POOL | SPOT |
* | API-RATE-LIMIT-WEIGHT | 5 |
* +-----------------------+---------+
*/
getOrderByClientOid(req: GetOrderByClientOidReq): Promise<GetOrderByClientOidResp>;
/**
* @deprecated
* addOrderV1 Add Order - V1
* Description: Place order in the Cross-margin or Isolated-margin trading system. You can place two major types of order: Limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.
* Documentation: https://www.kucoin.com/docs-new/api-3470312
* +-----------------------+---------+
* | Extra API Info | Value |
* +-----------------------+---------+
* | API-DOMAIN | SPOT |
* | API-CHANNEL | PRIVATE |
* | API-PERMISSION | MARGIN |
* | API-RATE-LIMIT-POOL | SPOT |
* | API-RATE-LIMIT-WEIGHT | 5 |
* +-----------------------+---------+
*/
addOrderV1(req: AddOrderV1Req): Promise<AddOrderV1Resp>;
/**
* @deprecated
* addOrderTestV1 Add Order Test - V1
* Description: Order test endpoint: This endpoint’s request and return parameters are identical to the order endpoint, and can be used to verify whether the signature is correct, among other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried.
* Documentation: https://www.kucoin.com/docs-new/api-3470313
* +-----------------------+---------+
* | Extra API Info | Value |
* +-----------------------+---------+
* | API-DOMAIN | SPOT |
* | API-CHANNEL | PRIVATE |
* | API-PERMISSION | MARGIN |
* | API-RATE-LIMIT-POOL | SPOT |
* | API-RATE-LIMIT-WEIGHT | 5 |
* +-----------------------+---------+
*/
addOrderTestV1(req: AddOrderTestV1Req): Promise<AddOrderTestV1Resp>;
}
export declare class OrderAPIImpl implements OrderAPI {
private transport;
constructor(transport: Transport);
addOrder(req: AddOrderReq): Promise<AddOrderResp>;
addOrderTest(req: AddOrderTestReq): Promise<AddOrderTestResp>;
cancelOrderByOrderId(req: CancelOrderByOrderIdReq): Promise<CancelOrderByOrderIdResp>;
cancelOrderByClientOid(req: CancelOrderByClientOidReq): Promise<CancelOrderByClientOidResp>;
cancelAllOrdersBySymbol(req: CancelAllOrdersBySymbolReq): Promise<CancelAllOrdersBySymbolResp>;
getSymbolsWithOpenOrder(req: GetSymbolsWithOpenOrderReq): Promise<GetSymbolsWithOpenOrderResp>;
getOpenOrders(req: GetOpenOrdersReq): Promise<GetOpenOrdersResp>;
getClosedOrders(req: GetClosedOrdersReq): Promise<GetClosedOrdersResp>;
getTradeHistory(req: GetTradeHistoryReq): Promise<GetTradeHistoryResp>;
getOrderByOrderId(req: GetOrderByOrderIdReq): Promise<GetOrderByOrderIdResp>;
getOrderByClientOid(req: GetOrderByClientOidReq): Promise<GetOrderByClientOidResp>;
addOrderV1(req: AddOrderV1Req): Promise<AddOrderV1Resp>;
addOrderTestV1(req: AddOrderTestV1Req): Promise<AddOrderTestV1Resp>;
}