akkounts/app/controllers/api/kredits_controller.rb
Sebastian Kippe caea2d0121
All checks were successful
continuous-integration/drone/push Build is passing
Add kredits API with wallet balance endpoint
2022-05-23 22:47:08 +02:00

13 lines
276 B
Ruby

class Api::KreditsController < Api::BaseController
def onchain_btc_balance
btcpay = BtcPay.new
balance = btcpay.onchain_wallet_balance
render json: balance
rescue
render json: { error: 'Failed to fetch wallet balance' },
status: 500
end
end