예제 #1
0
 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
예제 #2
0
 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
예제 #3
0
 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
예제 #4
0
 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
예제 #5
0
 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