Allow other controllers to access lndhub user balance

This commit is contained in:
2024-02-14 10:47:27 +01:00
parent 69b3afb8f7
commit 26d613bdca
3 changed files with 40 additions and 25 deletions

View File

@@ -0,0 +1,12 @@
module LndhubManager
class FetchUserBalance < Lndhub
def initialize(auth_token:)
@auth_token = auth_token
end
def call
data = fetch_balance(auth_token)
data["BTC"]["AvailableBalance"] rescue nil
end
end
end