package Ġcom . con cord ium . wallet . ui . account . new account confirmed Ċ Ċ import Ġandroid . app . Application Ċ import Ġandroidx . lifecycle .* Ċ import Ġcom . con cord ium . wallet . data . Account Repository Ċ import Ġcom . con cord ium . wallet . data . Identity Repository Ċ import Ġcom . con cord ium . wallet . data . room . Account Ċ import Ġcom . con cord ium . wallet . data . room . Account With Identity Ċ import Ġcom . con cord ium . wallet . data . room . Identity Ċ import Ġcom . con cord ium . wallet . data . room . Wallet Database Ċ import Ġcom . con cord ium . wallet . ui . common . identity . Identity Updater Ċ import Ġkotlinx . coroutines . launch Ċ Ċ class ĠNew Account Confirmed ViewModel ( application : ĠApplication ) Ġ: ĠAndroid ViewModel ( application ) Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġidentity Repository : ĠIdentity Repository ĊĠĠĠ Ġprivate Ġval Ġaccount Repository : ĠAccount Repository ĊĊĠĠĠ Ġprivate Ġval Ġ_ waiting LiveData Ġ= ĠMutable LiveData < Boolean >() ĊĠĠĠ Ġval Ġwaiting LiveData : ĠLive Data < Boolean > ĊĠĠĠĠĠĠĠ Ġget () Ġ= Ġ_ waiting LiveData ĊĊĠĠĠ Ġlateinit Ġvar Ġaccount : ĠAccount ĊĊĠĠĠ Ġlateinit Ġvar Ġaccount With Identity LiveData : ĠLive Data < Account With Identity > ĊĊĠĠĠ Ġinit Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġidentity Dao Ġ= ĠWallet Database . get Database ( application ). identity Dao () ĊĠĠĠĠĠĠĠ Ġidentity Repository Ġ= ĠIdentity Repository ( identity Dao ) ĊĠĠĠĠĠĠĠ Ġval Ġaccount Dao Ġ= ĠWallet Database . get Database ( application ). account Dao () ĊĠĠĠĠĠĠĠ Ġaccount Repository Ġ= ĠAccount Repository ( account Dao ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġinitialize ( account : ĠAccount ) Ġ{ ĊĠĠĠĠĠĠĠ Ġthis . account Ġ= Ġaccount ĊĠĠĠĠĠĠĠ Ġaccount With Identity LiveData Ġ= Ġaccount Repository . getById With Identity As LiveData ( account . id ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġupdate State () Ġ{ ĊĠĠĠĠĠĠĠ Ġ_ waiting LiveData . value Ġ= Ġtrue ĊĠĠĠĠĠĠĠ ĠviewModel Scope . launch Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ_ waiting LiveData . value Ġ= Ġfalse ĊĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊ Ċ }