Removing initialize methods from the main/manager class also allows for different iniitalizers in specific task services
14 lines
406 B
Ruby
14 lines
406 B
Ruby
module BtcpayManager
|
|
class FetchOnchainWalletBalance < BtcpayManagerService
|
|
def call
|
|
res = get "/payment-methods/onchain/BTC/wallet"
|
|
|
|
{
|
|
balance: (res["balance"].to_f * 100000000).to_i, # BTC to sats
|
|
unconfirmed_balance: (res["unconfirmedBalance"].to_f * 100000000).to_i,
|
|
confirmed_balance: (res["confirmedBalance"].to_f * 100000000).to_i
|
|
}
|
|
end
|
|
end
|
|
end
|