Allow other controllers to access lndhub user balance

This commit is contained in:
2024-02-14 10:47:27 +01:00
parent 5db0ee6658
commit 1b3ac90ddd
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