Add kredits API with wallet balance endpoint
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2022-05-23 22:47:08 +02:00
parent e1ff5c479e
commit caea2d0121
7 changed files with 70 additions and 5 deletions

View File

@@ -0,0 +1,5 @@
class Api::BaseController < ApplicationController
layout false
end

View File

@@ -0,0 +1,12 @@
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