Skip to content

Subscribe Balance

balance.subscribeBalance()

Subscribe to balance updates as they occur.

ts
import { 
FedimintWallet
} from '@fedimint/core-web'
const
wallet
= new
FedimintWallet
()
wallet
.
open
()
const
unsubscribe
=
wallet
.
balance
.
subscribeBalance
((
mSats
) => {
console
.
log
('Balance updated:',
mSats
)
// 1000 mSats = 1 satoshi }) // ...Cleanup Later
unsubscribe
()