hunk.code_window:                 } else if (error == -2011) {
                       throw new OrderNotFound (this.id + ' ' + this.json (response));
                   } else if (error == -1013) { // Invalid quantity
                       throw new InvalidOrder (this.id + ' ' + this.json (response));
                   } else if (error < 0) {
                       throw new ExchangeError (this.id + ' ' + this.json (response));
                   }
               }
           }
       }
  
hunk.labels: keep keep keep keep replace replace keep keep keep keep
hunk.file_path: js/binance.js
hunk.type: replace
file: # -*- coding: utf-8 -*-
  
  from ccxt.base.exchange import Exchange
  import base64
  import hashlib
  from ccxt.base.errors import ExchangeError
  
  
  class lakebtc (Exchange):
  
      def describe(self):
          return self.deep_extend(super(lakebtc, self).describe(), {
              'id': 'lakebtc',
              'name': 'LakeBTC',
              'countries': 'US',
              'version': 'api_v2',
              'hasCORS': True,
              'urls': {
                  'logo': 'https://user-images.githubusercontent.com/1294454/28074120-72b7c38a-6660-11e7-92d9-d9027502281d.jpg',
                  'api': 'https://api.lakebtc.com',
                  'www': 'https://www.lakebtc.com',
                  'doc': [
                      'https://www.lakebtc.com/s/api_v2',
                      'https://www.lakebtc.com/s/api',
                  ],
              },
              'api': {
                  'public': {
                      'get': [
                          'bcorderbook',
                          'bctrades',
                          'ticker',
                      ],
                  },
                  'private': {
                      'post': [
                          'buyOrder',
                          'cancelOrders',
                          'getAccountInfo',
                          'getExternalAccounts',
                          'getOrders',
                          'getTrades',
                          'openOrders',
                          'sellOrder',
                      ],
                  },
              },
              'fees': {
                  'trading': {
                      'maker': 0.15 / 100,
                      'taker': 0.2 / 100,
                  },
              },
          })
  
      def fetch_markets(self):
          markets = self.publicGetTicker()
          result = []
          keys = list(markets.keys())
          for k in range(0, len(keys)):
              id = keys[k]
              market = markets[id]
              base = id[0:3]
              quote = id[3:6]
              base = base.upper()
              quote = quote.upper()
              symbol = base + '/' + quote
              result.append({
                  'id': id,
                  'symbol': symbol,
                  'base': base,
                  'quote': quote,
                  'info': market,
              })
          return result
  
      def fetch_balance(self, params={}):
          self.load_markets()
          response = self.privatePostGetAccountInfo()
          balances = response['balance']
          result = {'info': response}
          currencies = list(balances.keys())
          for c in range(0, len(currencies)):
              currency = currencies[c]
              balance = float(balances[currency])
              account = {
                  'free': balance,
                  'used': 0.0,
                  'total': balance,
              }
              result[currency] = account
          return self.parse_balance(result)
  
      def fetch_order_book(self, symbol, params={}):
          self.load_markets()
          orderbook = self.publicGetBcorderbook(self.extend({
              'symbol': self.market_id(symbol),
          }, params))
          return self.parse_order_book(orderbook)
  
      def fetch_ticker(self, symbol, params={}):
          self.load_markets()
          market = self.market(symbol)
          tickers = self.publicGetTicker(self.extend({
              'symbol': market['id'],
          }, params))
          ticker = tickers[market['id']]
          timestamp = self.milliseconds()
          return {
              'symbol': symbol,
              'timestamp': timestamp,
              'datetime': self.iso8601(timestamp),
              'high': self.safe_float(ticker, 'high'),
              'low': self.safe_float(ticker, 'low'),
              'bid': self.safe_float(ticker, 'bid'),
              'ask': self.safe_float(ticker, 'ask'),
              'vwap': None,
              'open': None,
              'close': None,
              'first': None,
              'last': self.safe_float(ticker, 'last'),
              'change': None,
              'percentage': None,
              'average': None,
              'baseVolume': self.safe_float(ticker, 'volume'),
              'quoteVolume': None,
              'info': ticker,
          }
  
      def parse_trade(self, trade, market):
          timestamp = trade['date'] * 1000
          return {
              'info': trade,
              'timestamp': timestamp,
              'datetime': self.iso8601(timestamp),
              'symbol': market['symbol'],
              'id': str(trade['tid']),
              'order': None,
              'type': None,
              'side': None,
              'price': float(trade['price']),
              'amount': float(trade['amount']),
          }
  
      def fetch_trades(self, symbol, since=None, limit=None, params={}):
          self.load_markets()
          market = self.market(symbol)
          response = self.publicGetBctrades(self.extend({
              'symbol': market['id'],
          }, params))
          return self.parse_trades(response, market, since, limit)
  
      def create_order(self, market, type, side, amount, price=None, params={}):
          self.load_markets()
          if type == 'market':
              raise ExchangeError(self.id + ' allows limit orders only')
          method = 'privatePost' + self.capitalize(side) + 'Order'
          marketId = self.market_id(market)
          order = {
              'params': [price, amount, marketId],
          }
          response = getattr(self, method)(self.extend(order, params))
          return {
              'info': response,
              'id': str(response['id']),
          }
  
      def cancel_order(self, id, symbol=None, params={}):
          self.load_markets()
          return self.privatePostCancelOrder({'params': id})
  
      def nonce(self):
          return self.microseconds()
  
      def sign(self, path, api='public', method='GET', params={}, headers=None, body=None):
          url = self.urls['api'] + '/' + self.version
          if api == 'public':
              url += '/' + path
              if params:
                  url += '?' + self.urlencode(params)
          else:
              self.check_required_credentials()
              nonce = self.nonce()
              if params:
                  params = ','.join(params)
              else:
                  params = ''
              query = self.urlencode({
                  'tonce': nonce,
                  'accesskey': self.apiKey,
                  'requestmethod': method.lower(),
                  'id': nonce,
                  'method': path,
                  'params': params,
              })
              body = self.json({
                  'method': path,
                  'params': params,
                  'id': nonce,
              })
              signature = self.hmac(self.encode(query), self.encode(self.secret), hashlib.sha1)
              auth = self.encode(self.apiKey + ':' + signature)
              headers = {
                  'Json-Rpc-Tonce': nonce,
                  'Authorization': "Basic " + self.decode(base64.b64encode(auth)),
                  'Content-Type': 'application/json',
              }
          return {'url': url, 'method': method, 'body': body, 'headers': headers}
  
      def request(self, path, api='public', method='GET', params={}, headers=None, body=None):
          response = self.fetch2(path, api, method, params, headers, body)
          if 'error' in response:
              raise ExchangeError(self.id + ' ' + self.json(response))
          return response
  