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.

50 lines
1.2 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.json_parser import default_parse_data_as_long
'''
https://huobiapi.github.io/docs/spot/v1/cn/#de93fae07b
API Key 权限:交易
限频值NEW100次/2s
此接口发送一个撤销订单的请求。
此接口只提交取消请求,实际取消结果需要通过订单状态,撮合状态等接口来确认。
请求参数:
order-id 订单ID填在path中
Success response:
{
"data": "59378" 返回的主数据对象是一个对应下单单号的字符串。
}
Failure response:
{
"status": "error",
"err-code": "order-orderstate-error",
"err-msg": "订单状态错误",
"order-state":-1 // 当前订单状态
}
'''
class PostCancelOrderService:
def __init__(self, params):
self.params = params
def request(self, **kwargs):
order_id = self.params["order_id"]
def get_channel():
path = "/v1/order/orders/{}/submitcancel"
return path.format(order_id)
def parse(dict_data):
return default_parse_data_as_long(dict_data, None)
return RestApiSyncClient(**kwargs).request_process(HttpMethod.POST_SIGN, get_channel(), self.params, parse)