akkounts/app/services/btcpay_manager/fetch_lightning_wallet_balance.rb
Râu Cao 7e8443c598
Some checks failed
continuous-integration/drone/push Build is failing
Change Lightning balance property
... so that clients can use the same property with all balances
2024-01-15 11:39:24 +03:00

12 lines
267 B
Ruby

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