package Ġorg . summer of bitcoin . wallet . wallet Ċ Ċ import Ġandroid . app . Application Ċ import Ġandroid . util . Log Ċ import Ġandroidx . lifecycle . Android ViewModel Ċ import Ġandroidx . lifecycle . Mutable LiveData Ċ import Ġorg . summer of bitcoin . wallet . data . Wallet Ċ Ċ class ĠWallet ViewModel ( application : ĠApplication ) Ġ: ĠAndroid ViewModel ( application ) Ġ{ ĊĊĠĠĠ Ġpublic Ġvar Ġbalance : ĠMutable LiveData < Long > Ġ= ĠMutable LiveData ( 0 ) ĊĊĠĠĠ Ġpublic Ġfun Ġupdate Balance () Ġ{ ĊĠĠĠĠĠĠĠ ĠWallet . sync ( 1 0 0 ) ĊĠĠĠĠĠĠĠ Ġval Ġnew Balance Ġ= ĠWallet . get Balance () ĊĠĠĠĠĠĠĠ ĠLog . i (" S obi Wallet ", Ġ" New Ġbalance Ġis Ġ$ new Balance ") ĊĠĠĠĠĠĠĠ Ġbalance . post Value ( new Balance ) ĊĠĠĠ Ġ} Ċ } Ċ