Пример #1
0
 def cancelOrder(self, coinType, id, method="cancel_order"):
     coinType = chooseType(coinType)
     params = {"txid":id}
     result = ""
     try:
         result = ku.query_private(method, params, account=self.account)
         return result
     except BaseException as e:
         return {"result": "fail", "msg": "%s_%s" % (e, result)}
Пример #2
0
 def getOrders(self, coinType, method="OpenOrders"):
     coinType = chooseType(coinType)
     method = 'OpenOrders'
     params = {"pair": coinType}
     result = ""
     try:
         result = ku.query_private(method, params, account=self.account)
         return result
     except BaseException as e:
         return {"result": "fail", "msg": "%s_%s" % (e, result)}
Пример #3
0
 def sell(self, coinType, price, amount, method="AddOrder"):
     coinType = chooseType(coinType)
     params = {'pair': coinType,
               'price': price,
               'volume': amount,
               'type': "sell",
               'ordertype': "limit"}
     result = ""
     try:
         result = ku.query_private(method, params, account=self.account)
         return result
     except BaseException as e:
         return {"result": "fail", "msg": "%s_%s" % (e, result)}
Пример #4
0
 def getAccountInfo(self,method="get_account_info"):
     try:
         method = "Balance"
         result = ku.query_private(method,account=self.account)
         coins = ["eos","usd","neo"]
         result = result["result"]
         _result = {}
         for c in result:
             _result[c[1:]] = result[c]
         for c in coins:
             if c not in result.keys():
                 _result[c] = {"available": 0, "frozen": 0}
         return result
     except BaseException as e:
         return {"result":"fail","msg":"%s"%e}
Пример #5
0
 def order(self,pair,price,volume,Type,ordertype,method="AddOrder"):
     '''
     params = {'pair': 'XXBTZEUR',
         'type': 'buy',
         'ordertype': 'limit',
         'price': '1',
         'volume': '1',
         'close[pair]': 'XXBTZEUR',
         'close[type]': 'sell',
         'close[ordertype]': 'limit',
         'close[price]': '9001',
         'close[volume]': '1'}
     '''
     method = 'AddOrder'
     params = {'pair': pair,
         'price': price,
         'volume': volume,
         'type': Type,
         'ordertype': ordertype}
     result = ku.query_private(method, params, account=self.account)
     return result
Пример #6
0
 def QueryOrders(self,method=""):
     method = 'QueryOrders'
     params = {"txid":'1111'}
     result = ku.query_private(method, params, account=self.account)
     return result