def getAccountInfo(self): params = {"method": ACCOUNT_INFO} extra = {} response = send2api(params, extra) if response and "code" not in response: account = Account() account.btc_balance = float(response["available_btc_display"]) account.cny_balance = float(response["available_cny_display"]) account.btc_frozen = float(response["frozen_btc_display"]) account.cny_frozen = float(response["frozen_cny_display"]) return account return None
def getAccountInfo(self): USERINFO_RESOURCE = "/api/v1/userinfo.do" params = {} params['api_key'] = APIKEY params['sign'] = buildMySign(params, SECRETKEY) response = httpPost(URL, USERINFO_RESOURCE, params) if response and response['result']: account = Account() account.btc_balance = float( response['info']['funds']['free']['btc']) account.cny_balance = float( response['info']['funds']['free']['cny']) account.btc_frozen = float( response['info']['funds']['freezed']['btc']) account.cny_frozen = float( response['info']['funds']['freezed']['cny']) return account return None