def _get_offers_by_type_and_id(source_id_type, source_id):
""" get asset offers for given type and id
:param source_id_type: str
:param source_id: str
:returns: list of offers json
:raises: koi.exceptions.HTTPError
"""
client = API(options.url_query, ssl_options=ssl_server_options())
try:
req_body = '[{"source_id_type": "' + source_id_type + '", "source_id": "' + source_id + '"}]'
client.query.search.offers.prepare_request(headers={'Content-Type': 'application/json'},
body=req_body.strip())
res = yield client.query.search.offers.post()
raise Return(res['data'])
except httpclient.HTTPError as exc:
msg = 'Unexpected error ' + exc.message
raise exceptions.HTTPError(exc.code, msg, source='query')
评论列表
文章目录