Add kredits API with wallet balance endpoint
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
5
app/controllers/api/base_controller.rb
Normal file
5
app/controllers/api/base_controller.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
class Api::BaseController < ApplicationController
|
||||
|
||||
layout false
|
||||
|
||||
end
|
||||
12
app/controllers/api/kredits_controller.rb
Normal file
12
app/controllers/api/kredits_controller.rb
Normal 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
|
||||
Reference in New Issue
Block a user