def __init__(self, **kwargs): super().__init__() self.currency = Utils.safe_string(kwargs, 'currency') self.balance = Utils.safe_float(kwargs, 'balance') self.available = Utils.safe_float(kwargs, 'available') self.freeze = Utils.safe_float(kwargs, 'freeze')
def json_parse(json_array): trade = Trade() trade.price = Utils.safe_float(json_array, 5) trade.amount = Utils.safe_float(json_array, 6) trade.side = 'buy' if Utils.safe_string(json_array, 4) == 'bid' else 'sell' trade.timestamp = Utils.safe_integer(json_array, 2) return trade
def __init__(self, **kwargs): self.id = "" self.name = "" self.draw_flag = "" self.once_draw_limit = 0 self.daily_draw_limit = 0 super().__init__(**kwargs) self.draw_fee = Utils.safe_float(kwargs, "draw-fee") self.min_draw_limit = Utils.safe_float(kwargs, "min-draw-limit")
def __init__(self, **kwargs): self.trade_id = '' self.order_id = '' self.match_id = '' self.symbol = '' self.side = '' self.role = '' self.created_at = 0 super().__init__(**kwargs) self.price = Utils.safe_float(kwargs, 'price') self.filled_amount = Utils.safe_float(kwargs, 'filled-amount', 0) self.filled_fees = Utils.safe_float(kwargs, 'filled-fees', 0)
def __init__(self, **kwargs): self.order_id = '' self.symbol = '' self.side = '' self.state = '' self.created_at = 0 super().__init__(**kwargs) self.price = Utils.safe_float(kwargs, 'price') self.amount = Utils.safe_float(kwargs, 'amount') self.available_amount = Utils.safe_float(kwargs, 'available-amount') self.filled_amount = Utils.safe_float(kwargs, 'filled-amount', 0) self.filled_cash_amount = Utils.safe_float(kwargs, 'filled-cash-amount', 0)
def json_parse(data): obj = PriceDepthEvent() if isinstance(data[0], list): data = data[0] obj.timestamp = Utils.safe_integer(data, 3) obj.data = { 'asks': [DepthEntry.json_parse(e) for e in data[4]['asks']], 'bids': [DepthEntry.json_parse(e) for e in data[5]['bids']] } else: obj.data_type = 'E' obj.timestamp = Utils.safe_integer(data, 2) obj.data = { 'side': 'buy' if 'bid' == Utils.safe_string(data, 4).lower() else 'sell', 'price': Utils.safe_float(data, 5), 'amount': Utils.safe_float(data, 6), } return obj
def json_parse(json_array): data_obj = Ticker() data_obj.symbol_id = json_array[0] data_obj.close = Utils.safe_float(json_array, 1) data_obj.low = Utils.safe_float(json_array, 3) data_obj.high = Utils.safe_float(json_array, 2) data_obj.amount = Utils.safe_float(json_array, 9) data_obj.rate = Utils.safe_float(json_array, 5) data_obj.volume = Utils.safe_float(json_array, 4) data_obj.ask = Utils.safe_float(json_array, 8) data_obj.bid = Utils.safe_float(json_array, 7) return data_obj
def __init__(self, **kwargs): self.withdraw_id = '' self.currency = '' self.address = '' self.tx_hash = '' self.state = '' self.fee = '' self.created_at = 0 self.audited_at = 0 super().__init__(**kwargs) self.amount = Utils.safe_float(kwargs, 'amount')
def json_parse(json_array): data_obj = CandleStick() data_obj.id = json_array[3] data_obj.open = Utils.safe_float(json_array, 4) data_obj.close = Utils.safe_float(json_array, 7) data_obj.low = Utils.safe_float(json_array, 6) data_obj.high = Utils.safe_float(json_array, 5) data_obj.amount = Utils.safe_float(json_array, 13) data_obj.rate = Utils.safe_float(json_array, 9) data_obj.volume = Utils.safe_float(json_array, 8) return data_obj
def __init__(self, **kwargs): self.id = "" self.base_currency = "" self.quote_currency = "" self.price_precision = 0 self.amount_precision = 0 self.symbol_partition = "" self.symbol = "" self.state = "" # self.max_order_amt = "" super().__init__(**kwargs) self.min_order_amt = Utils.safe_float(kwargs, "min-order-amt")
def json_parse(item): order = OrderChange() order.order_id = item[0] order.side = 'buy' if Utils.safe_integer(item, 1) == 1 else 'sell' # status : 0:craeted 1:canceled 2: filled 3:partial-filled status = Utils.safe_integer(item, 2) if status == 0: order.status = 'created' elif status == 1: order.status = 'canceled' elif status == 2: order.status = 'filled' elif status == 3: order.status = 'partial-filled' order.price = Utils.safe_float(item, 3) order.amount = Utils.safe_float(item, 4) order.filled_amount = Utils.safe_float(item, 5, 0.0) order.filled_cash_amount = Utils.safe_float(item, 6, 0.0) order.avg_amount = Utils.safe_float(item, 7, 0.0) order.timestamp = Utils.safe_integer(item, 8) return order
def __init__(self, **kwargs): self.deposit_id = '' self.currency = '' self.address = '' self.tx_hash = '' self.confirm_times = 0 self.state = '' self.type = '' self.created_at = 0 self.confirmed_at = 0 super().__init__(**kwargs) self.amount = Utils.safe_float(kwargs, 'amount')