def post(self):
    btc_rpc_connection = AuthServiceProxy(RPC_URL)
    try:
        from_addr = self.get_argument('from')
        to_addr = self.get_argument('to')
        from decimal import Decimal
        amount = Decimal(str(self.get_argument('amount')))
        (ret, rsp) = BTC_CreateRawTransaction.process(btc_rpc_connection, from_addr, to_addr, amount)
        if (not ret):
            self.write(json.dumps(BaseHandler.error_ret_with_data(rsp)))
            return
        self.write(json.dumps(BaseHandler.success_ret_with_data(rsp), default=decimal_default))
    except Exception as e:
        self.write(json.dumps(BaseHandler.error_ret_with_data(('error: %s' % e))))
        logging.error('BTC_CreatRawTransaction error:{0} in {1}'.format(e, get_linenumber()))
def post(self):
    btc_rpc_connection = AuthServiceProxy(RPC_URL)
    try:
        from_addr = self.get_argument('from')
        to_addr = self.get_argument('to')
        from decimal import Decimal
        amount = Decimal(str(self.get_argument('amount')))
        (ret, rsp) = BTC_CreateRawTransaction.process(btc_rpc_connection, from_addr, to_addr, amount)
        if (not ret):
            self.write(json.dumps(BaseHandler.error_ret_with_data(rsp)))
            return
        self.write(json.dumps(BaseHandler.success_ret_with_data(rsp), default=decimal_default))
    except Exception as e:
        self.write(json.dumps(BaseHandler.error_ret_with_data(('error: %s' % e))))
        logging.error('BTC_CreatRawTransaction error:{0} in {1}'.format(e, get_linenumber()))