<commit_before>class Api::AccountController < ActionController::Base

  before_filter :build_account

  def index
    render json: @account
  end

  def withdraw
    ap params

    amount = params[:withdrawAmount].to_satoshis
    to_address = params[:toAddress]

    result = @user.withdraw(amount, to_address)

    @account[:balance] = (@account[:balance] - ((amount + FEE).to_btc.to_s)).round(8)
    @account[:messages][:withdraw] = {
      default: false,
      success: true,
      error: false
    }

    render json: @account<commit_msg>BTCStr error in withdraw<commit_after>class Api::AccountController < ActionController::Base

  before_filter :build_account

  def index
    render json: @account
  end

  def withdraw
    ap params

    amount = params[:withdrawAmount].to_satoshis
    to_address = params[:toAddress]

    result = @user.withdraw(amount, to_address)

    @account[:balance] = (@account[:balance] - ((amount + FEE).to_BTCStr)).round(8)
    @account[:messages][:withdraw] = {
      default: false,
      success: true,
      error: false
    }

    render json: @account
{'fraction_non_alphanumeric': 0.1178082191780822, 'fraction_numerical': 0.0018264840182648401, 'mean_word_length': 3.5102880658436213, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4613920', 'n_tokens_mistral': 345, 'n_tokens_neox': 332, 'n_words': 74}