def GetOrders(api_key, api_secret, order_type='LIMIT'): homiex = BrokerContractClient(entry_point=MyExchange.tread_url, api_key=api_key, secret=api_secret) raw_data = homiex.open_orders(order_type=order_type) ret_data = {"data": []} if len(raw_data) > 0: for i in range(len(raw_data)): ret_data["data"].append({ "id": raw_data[i]['orderId'], "amount": raw_data[i]['origQty'], "price": raw_data[i]['price'], "status": raw_data[i]['status'], "type": raw_data[i]['side'], }) ret_data['raw'] = raw_data return ret_data
orderType='LIMIT', quantity='2', price='8000', leverage='10', timeInForce='GTC', triggerPrice=None) print(result) order_id = result['orderId'] print(order_id) print(b.order_cancel(order_id=order_id)) print(b.open_orders(order_type='LIMIT')) print(b.history_orders()) print(b.account()) print(b.my_trades()) listen_key = b.stream_get_listen_key() print(listen_key) print(b.stream_keepalive(listen_key.get('listenKey'))) print(b.stream_close(listen_key.get('listenKey')))