def submit_order(self, type, currency_pair, price, amount): from packages import util aex2 = util.Client(self.account.api_key, self.account.secret_key, self.user_id) result = aex2.submitOrder(type,currency_pair.reference,price,amount,currency_pair.base) type="buy" if type==1 else "sell" result = universal.OrderInfo(self.MARKET, currency_pair, result, {'price':price,'amount':amount,'type':type}) return result
def balances(self): # https://api.aex.zone/getMyBalance.php from packages import util aex2=util.Client(self.account.api_key,self.account.secret_key,self.user_id) result=aex2.getMyBalance() result=universal.BalanceInfo(self.MARKET,result) return result
def order_list(self, currency_pair, current_page=1, page_length=200): from packages import util aex2 = util.Client(self.account.api_key, self.account.secret_key, self.user_id) result = aex2.getOrderList(currency_pair.base, currency_pair.reference) result = universal.SubmittedOrderList(currency_pair, self.MARKET, result) return result
def cancel_order(self, currency_pair, order_id): from packages import util aex2 = util.Client(self.account.api_key, self.account.secret_key, self.user_id) result = aex2.cancelOrder(currency_pair.reference, order_id, currency_pair.base) result = universal.CancelOrderResult(self.MARKET, currency_pair, result, order_id) return result
def trade_list(self, currency_pair, current_page=1, page_length=200): from packages import util aex2 = util.Client(self.account.api_key, self.account.secret_key, self.user_id) result = aex2.getMyTradeList(currency_pair.reference, currency_pair.base, current_page) result = universal.Trades(self.MARKET, currency_pair, result, 2, self.user_id) return result