示例#1
0
 def getBalance(self) -> object:
     dit = {
         "accesskey": self.accessKey,
         "nonce": getTimestamp(),
     }
     dit["signature"] = getSignature(dit, self.secretKey)
     return HttpUtil().get(self.URL + "/trade/api/v1/getBalance", dit)
示例#2
0
 def getPayOutAddress(self, coin: str):
     dit = {
         "accesskey": self.accessKey,
         "nonce": getTimestamp(),
         "coin": coin,
     }
     dit["signature"] = getSignature(dit, self.secretKey)
     return HttpUtil().get(self.URL + "/trade/api/v1/getPayOutAddress", dit)
示例#3
0
 def getFunds(self, account: int):
     dit = {
         "accesskey": self.accessKey,
         "account": account,
         "nonce": getTimestamp(),
     }
     dit["signature"] = getSignature(dit, self.secretKey)
     return HttpUtil().get(self.URL + "/trade/api/v1/getFunds", dit)
示例#4
0
 def getBatchOrders(self, market: str, *ids: str):
     dit = {
         "accesskey": self.accessKey,
         "nonce": getTimestamp(),
         "market": market,
         "data": ids,
     }
     dit["signature"] = getSignature(dit, self.secretKey)
     return HttpUtil().get(self.URL + "/trade/api/v1/getBatchOrders", dit)
示例#5
0
 def getOrder(self, market: str, id: str):
     dit = {
         "accesskey": self.accessKey,
         "nonce": getTimestamp(),
         "market": market,
         "id": id,
     }
     dit["signature"] = getSignature(dit, self.secretKey)
     return HttpUtil().get(self.URL + "/trade/api/v1/getOrder", dit)
示例#6
0
 def batchOrder(self, market: str, jsonData: str):
     dit = {
         "accesskey": self.accessKey,
         "nonce": getTimestamp(),
         "market": market,
         "data": jsonData,
     }
     dit["signature"] = getSignature(dit, self.secretKey)
     return HttpUtil().post(self.URL + "/trade/api/v1/batchOrder", dit)
示例#7
0
 def getPayOutRecord(self, coin: str, page, pageSize):
     dit = {
         "accesskey": self.accessKey,
         "nonce": getTimestamp(),
         "coin": coin,
         "page": page,
         "pageSize": pageSize,
     }
     dit["signature"] = getSignature(dit, self.secretKey)
     return HttpUtil().get(self.URL + "/trade/api/v1/getPayOutRecord", dit)
示例#8
0
 def getOpenOrders(self, market: str, page, pageSize):
     dit = {
         "accesskey": self.accessKey,
         "nonce": getTimestamp(),
         "market": market,
         "page": page,
         "pageSize": pageSize,
     }
     dit["signature"] = getSignature(dit, self.secretKey)
     return HttpUtil().get(self.URL + "/trade/api/v1/getOpenOrders", dit)
示例#9
0
 def order(self, market: str, price: float, number: float, type, entrustType: float):
     dit = {
         "accesskey": self.accessKey,
         "nonce": getTimestamp(),
         "market": market,
         "price": price,
         "number": number,
         "type": type,
         "entrustType": entrustType,
     }
     dit["signature"] = getSignature(dit, self.secretKey)
     return HttpUtil().post(self.URL + "/trade/api/v1/order", dit)
示例#10
0
    def withdraw(self, coin: str, safePwd: str, amount: float, address: str):
        dit = {
            "accesskey": self.accessKey,
            "nonce": getTimestamp(),
            "coin": coin,
            "safePwd": safePwd,
            "amount": amount,
            "address": address,
        }
        dit["signature"] = getSignature(dit, self.secretKey)

        return HttpUtil().get(self.URL + "/trade/api/v1/withdraw", dit)
示例#11
0
 def transfer(self, _from, to, amount: float, coin: str, safePwd: str, ):
     dit = {
         "accesskey": self.accessKey,
         "nonce": getTimestamp(),
         "from": _from,
         "to": to,
         "amount": amount,
         "coin": coin,
         "safePwd": safePwd,
     }
     dit["signature"] = getSignature(dit, self.secretKey)
     return HttpUtil().post(self.URL + "/trade/api/v1/transfer", dit)
示例#12
0
 def getAccounts(self):
     return HttpUtil().get(self.URL + "/trade/api/v1/getAccounts")
示例#13
0
 def getMarketConfig(self):
     return HttpUtil().get(self.URL + "/data/api/v1/getMarketConfig")
示例#14
0
 def getTrades(self, market: str):
     return HttpUtil().get(self.URL + "/data/api/v1/getTrades?market=" + market)
示例#15
0
 def getDepth(self, market: str):
     return HttpUtil().get(self.URL + "/data/api/v1/getDepth?market=" + market)
示例#16
0
 def getTickers(self):
     return HttpUtil().get(self.URL + "/data/api/v1/getTickers")
示例#17
0
 def getKLine(self, market: str):
     return HttpUtil().get(self.URL + "/data/api/v1/getTicker?market=" + market)