Skip to content

Commit

Permalink
remove market order support, per #27
Browse files Browse the repository at this point in the history
  • Loading branch information
ericsomdahl committed Aug 6, 2017
1 parent 6d9e55a commit a0ca464
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 40 deletions.
41 changes: 1 addition & 40 deletions bittrex/bittrex.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def encrypt(api_key, api_secret, export=True, export_fn='secrets.json'):
cipher = AES.new(getpass.getpass('Input encryption password (string will not show)'))
api_key_n = cipher.encrypt(api_key)
api_secret_n = cipher.encrypt(api_secret)
api = {'key': str(api_key_n), 'secret':str(api_secret_n)}
api = {'key': str(api_key_n), 'secret': str(api_secret_n)}
if export:
with open(export_fn, 'w') as outfile:
json.dump(api, outfile)
Expand Down Expand Up @@ -63,7 +63,6 @@ def decrypt(self):
else:
raise ImportError('"pycrypto" module has to be installed')


def api_query(self, method, options=None):
"""
Queries Bittrex with given method and options
Expand Down Expand Up @@ -173,24 +172,6 @@ def get_market_history(self, market, count):
"""
return self.api_query('getmarkethistory', {'market': market, 'count': count})

def buy_market(self, market, quantity):
"""
Used to place a buy order in a specific market. Use buymarket to
place market orders. Make sure you have the proper permissions
set on your API keys for this call to work
/market/buymarket
:param market: String literal for the market (ex: BTC-LTC)
:type market: str
:param quantity: The amount to purchase
:type quantity: float
:param rate: The rate at which to place the order.
This is not needed for market orders
:type rate: float
:return:
:rtype : dict
"""
return self.api_query('buymarket', {'market': market, 'quantity': quantity})

def buy_limit(self, market, quantity, rate):
"""
Used to place a buy order in a specific market. Use buylimit to place
Expand All @@ -209,24 +190,6 @@ def buy_limit(self, market, quantity, rate):
"""
return self.api_query('buylimit', {'market': market, 'quantity': quantity, 'rate': rate})

def sell_market(self, market, quantity):
"""
Used to place a sell order in a specific market. Use sellmarket to place
market orders. Make sure you have the proper permissions set on your
API keys for this call to work
/market/sellmarket
:param market: String literal for the market (ex: BTC-LTC)
:type market: str
:param quantity: The amount to purchase
:type quantity: float
:param rate: The rate at which to place the order.
This is not needed for market orders
:type rate: float
:return:
:rtype : dict
"""
return self.api_query('sellmarket', {'market': market, 'quantity': quantity})

def sell_limit(self, market, quantity, rate):
"""
Used to place a sell order in a specific market. Use selllimit to place
Expand Down Expand Up @@ -276,8 +239,6 @@ def get_balances(self):
"""
return self.api_query('getbalances', {})



def get_balance(self, currency):
"""
Used to retrieve the balance from your account for a specific currency
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
requests

0 comments on commit a0ca464

Please sign in to comment.