akkounts/app/controllers/api/kredits_controller.rb
Sebastian Kippe 03dc6c7a9c
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
Log unexpected kredits API errors
2022-05-24 13:42:00 +02:00

14 lines
370 B
Ruby

class Api::KreditsController < Api::BaseController
def onchain_btc_balance
btcpay = BtcPay.new
balance = btcpay.onchain_wallet_balance
render json: balance
rescue => error
Rails.logger.warn "Failed to fetch kredits BTC wallet balance: #{error.message}"
render json: { error: 'Failed to fetch wallet balance' },
status: 500
end
end