def _parse_pair_info(market_id, info): if 'recenttrades' in info: info['recenttrades'] = parse_trade_list(info['recenttrades'], market_id=market_id) if 'lasttradetime' in info: info['lasttradetime'] = datetime.strptime(info['lasttradetime'], DATETIME_FORMAT) if 'sellorders' in info: info['sellorders'] = parse_order_list(info['sellorders'], type_='sell', market_id=market_id) if 'lasttradeprice' in info: info['lasttradeprice'] = Decimal(info['lasttradeprice']) if 'volume' in info: info['volume'] = Decimal(info['volume']) if 'buyorders' in info: info['buyorders'] = parse_order_list(info['buyorders'], type_='buy', market_id=market_id) if 'marketid' in info: info['marketid'] = int(info['marketid'])
def markettrades(self, market_id): response = self.request('markettrades', params={'marketid': market_id}) return parse_trade_list(response, market_id=market_id)
def allmytrades(self): response = self.request('allmytrades') return parse_trade_list(response)
def mytrades(self, market_id, limit=None): params = {'marketid': market_id} if limit: params.update(limit=limit) response = self.request('mytrades', params=params) return parse_trade_list(response, market_id=market_id)