def format_exchange_pair(exchange, mkt_coin, base_coin): if exchange == 'binance': return mkt_coin.upper() + base_coin.upper() elif exchange == 'bittrex': return base_coin.upper() + '-' + mkt_coin.upper() elif exchange == 'gemini': return mkt_coin.lower() + base_coin.lower() elif exchange == 'gdax': return mkt_coin.upper() + '-' + base_coin.upper() else: raise APIDoesNotExistError(exchange, 'format_exchange_pair')
def format_exchange_interval(exchange, interval): if exchange == 'binance': return interval elif exchange == 'bittrex': return interval elif exchange == 'gemini': return int(interval[0]) * INTERVAL_RATES[interval[1]] elif exchange == 'gdax': return int( int(interval[0]) * INTERVAL_RATES[interval[1]] / INTERVAL_RATES['s']) elif exchange == 'cryptopia': return interval else: raise APIDoesNotExistError(exchange, 'format_exchange_interval')
def format_exchange_start_and_end_times(self, exchange, timestamp, minutes): divisor = self.exchange_divisors[exchange] start = timestamp / divisor end = timestamp / divisor + (minutes * 60000 / divisor) if exchange == 'binance': return int(start), int(end) elif exchange == 'bittrex': return start, end elif exchange == 'gemini': return start, end elif exchange == 'gdax': return datetime.fromtimestamp( start).isoformat(), datetime.fromtimestamp(end).isoformat() elif exchange == 'cryptopia': return start, end else: raise APIDoesNotExistError(exchange, 'format_exchange_start_and_end_times')
def initiate_withdrawal(self, coin, dest_addr): raise APIDoesNotExistError('bittrex', 'initiate_withdrawal')
def get_account_info(self): raise APIDoesNotExistError('bittrex', 'get_account_info')
def get_historical_tickers(self, start_time=None, end_time=None, interval='1m'): raise APIDoesNotExistError('bittrex', 'get_historical_tickers')
def get_historical_rate(self, pair, timestamp=None, interval='1m'): raise APIDoesNotExistError('bittrex', 'get_historical_rate')
def get_historical_trades(self, pair): raise APIDoesNotExistError('GateIOAPI', 'get_historical_trades')