akkounts/app/services/btcpay_manager/fetch_lightning_wallet_balance.rb
Râu Cao 5db0ee6658
DRY up btcpay and lndhub services
Removing initialize methods from the main/manager class also allows for
different iniitalizers in specific task services
2024-02-22 15:19:27 +01:00

12 lines
249 B
Ruby

module BtcpayManager
class FetchLightningWalletBalance < BtcpayManagerService
def call
res = get "/lightning/BTC/balance"
{
confirmed_balance: res["offchain"]["local"].to_i / 1000 # msats to sats
}
end
end
end