def get(self):
    btc_rpc_connection = AuthServiceProxy(RPC_URL)
    try:
        account = self.get_argument('account').decode('utf-8')
        if ((account is None) or (len(account) == 0)):
            self.write(json.dumps(BaseHandler.error_ret()))
            return
        commands = [['getbalance', account]]
        data = btc_rpc_connection.batch_(commands)
        self.write(json.dumps(BaseHandler.success_ret_with_data(data), default=decimal_default))
    except Exception as e:
        self.write(json.dumps(BaseHandler.error_ret_with_data(('error: %s' % e))))
        logging.error('BTC_GetAccountBalance error:{0} in {1}'.format(e, get_linenumber()))
def get(self):
    btc_rpc_connection = AuthServiceProxy(RPC_URL)
    try:
        account = self.get_argument('account').decode('utf-8')
        if ((account is None) or (len(account) == 0)):
            self.write(json.dumps(BaseHandler.error_ret()))
            return
        commands = [['getbalance', account]]
        data = btc_rpc_connection.batch_(commands)
        self.write(json.dumps(BaseHandler.success_ret_with_data(data), default=decimal_default))
    except Exception as e:
        self.write(json.dumps(BaseHandler.error_ret_with_data(('error: %s' % e))))
        logging.error('BTC_GetAccountBalance error:{0} in {1}'.format(e, get_linenumber()))