def json_parse(json_wrapper): ch = json_wrapper.get_string("topic") parse = ChannelParser(ch) order_update_event = OrderUpdateNewEvent() order_update_event.symbol = parse.symbol order_update_event.timestamp = json_wrapper.get_int("ts") data = json_wrapper.get_object("data") order = OrderUpdateNew.json_parse(data) order_update_event.data = order return order_update_event
def json_parse(json_wrapper): ch = json_wrapper.get_string("topic") parse = ChannelParser(ch) order_update_event = OrderUpdateNewEvent() order_update_event.symbol = parse.symbol order_update_event.timestamp = convert_cst_in_millisecond_to_utc( json_wrapper.get_int("ts")) data = json_wrapper.get_object("data") order = OrderUpdateNew() order.match_id = data.get_int("match-id") order.order_id = data.get_int("order-id") order.symbol = parse.symbol order.state = data.get_string("order-state") order.role = data.get_string("role") order.price = data.get_float("price") order.filled_amount = data.get_float("filled-amount") order.filled_cash_amount = data.get_float("filled-cash-amount") order.unfilled_amount = data.get_float("unfilled-amount") order.client_order_id = data.get_string("client-order-id") order_update_event.data = order return order_update_event