You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.3 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

from huobi.connection.restapi_sync_client import RestApiSyncClient
from huobi.constant import *
from huobi.utils import *
from huobi.model.trade import *
'''
https://huobiapi.github.io/docs/spot/v1/cn/#b9af010185
批量撤销指定订单
API Key 权限:交易
限频值NEW50次/2s
此接口同时为多个订单基于id发送取消请求建议通过order-ids来撤单比client-order-ids更快更稳定。
请求参数:
order-ids 订单编号列表order-ids和client-order-ids必须且只能选一个填写不超过50张订单建议通过order-ids来撤单比client-order-ids更快更稳定
client-order-ids 用户自编订单号列表order-ids和client-order-ids必须且只能选一个填写不超过50张订单必须已有该订单存在否则下次下单时不允许用此值
'''
class PostBatchCancelOrderService:
def __init__(self, params):
self.params = params
def request(self, **kwargs):
channel = "/v1/order/orders/batchcancel"
def parse(dict_data):
data = dict_data.get("data", {})
return default_parse_fill_directly(data, BatchCancelResult)
return RestApiSyncClient(**kwargs).request_process(HttpMethod.POST_SIGN, channel, self.params, parse)