| | |
| | | result = hosting_api_util.get_account_money_for_cb() |
| | | return_str = json.dumps(result) |
| | | break |
| | | elif type_ == 'refresh_trade_data': |
| | | # 验证签名 |
| | | data = data_json["data"] |
| | | refresh_type = data["ctype"] |
| | | result = hosting_api_util.refresh_trade_data_for_cb(refresh_type) |
| | | return_str = json.dumps(result) |
| | | break |
| | | |
| | | elif type_ == 'common': |
| | | params = data_json["data"] |
| | |
| | | return __read_response(client, request_id, blocking) |
| | | |
| | | |
| | | def refresh_trade_data_for_cb(refresh_type, blocking=True): |
| | | """ |
| | | 刷新交易数据 |
| | | :param refresh_type: |
| | | :param blocking: |
| | | :return: |
| | | """ |
| | | |
| | | request_id, client = __request(ClientSocketManager.CLIENT_TYPE_TRADE_CB, |
| | | {"type": API_TYPE_REFRESH_TRADE_DATA, "ctype": refresh_type, |
| | | "sinfo": f"cb_{API_TYPE_REFRESH_TRADE_DATA}_{round(time.time() * 1000)}"}) |
| | | return __read_response(client, request_id, blocking) |
| | | |
| | | |
| | | def get_account_money_for_cb(blocking=True): |
| | | """ |
| | | 获取账户资金情况 |
| | |
| | | {"type": API_TYPE_REFRESH_TRADE_DATA, "ctype": type_, |
| | | "sinfo": f"cb_{API_TYPE_REFRESH_TRADE_DATA}_{round(time.time() * 1000)}"}) |
| | | return __read_response(client, request_id, blocking) |
| | | |
| | | |
| | | |
| | | def common_request_for_cb(params, blocking=True): |