示例#1
0
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'])
示例#2
0
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'])
示例#3
0
 def markettrades(self, market_id):
     response = self.request('markettrades', params={'marketid': market_id})
     return parse_trade_list(response, market_id=market_id)
示例#4
0
 def allmytrades(self):
     response = self.request('allmytrades')
     return parse_trade_list(response)
示例#5
0
 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)
示例#6
0
 def allmytrades(self):
     response = self.request('allmytrades')
     return parse_trade_list(response)
示例#7
0
 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)
示例#8
0
 def markettrades(self, market_id):
     response = self.request('markettrades', params={'marketid': market_id})
     return parse_trade_list(response, market_id=market_id)