from huobi.connection.restapi_sync_client import RestApiSyncClient from huobi.constant.system import HttpMethod from huobi.model.account import * from huobi.utils import * ''' https://huobiapi.github.io/docs/spot/v1/cn/#84f1b5486d 财务流水 API Key 权限:读取 该节点基于用户账户ID返回财务流水。 一期上线暂时仅支持划转流水的查询(“transactType” = “transfer”)。 通过“startTime”/“endTime”框定的查询窗口最大为10天,意即,通过单次查询可检索的范围最大为10天。 该查询窗口可在最近180天范围内平移,意即,通过多次平移窗口查询,最多可检索到过往180天的记录。 ''' class GetAccountLedgerService: def __init__(self, params): self.params = params def request(self, **kwargs): channel = "/v2/account/ledger" def parse(dict_data): data_list = dict_data.get("data", []) return default_parse_list_dict(data_list, AccountLedger, []) return RestApiSyncClient(**kwargs).request_process(HttpMethod.GET_SIGN, channel, self.params, parse)