package Ġio . horizontal systems . bank wallet . modules . create wallet Ċ Ċ import Ġandroidx . lifecycle . ViewModel Ċ import Ġandroidx . lifecycle . ViewModel Provider Ċ import Ġio . horizontal systems . bank wallet . core . App Ċ import Ġio . horizontal systems . bank wallet . entities . Coin Ċ import Ġio . horizontal systems . bank wallet . entities . Pre defined Account Type Ċ import Ġio . reactivex . Observable Ċ Ċ object ĠCreate Wallet Module Ġ{ ĊĊĠĠĠ Ġinterface ĠIService { ĊĠĠĠĠĠĠĠ Ġval Ġstate Async : ĠObservable < Create Wallet Service . State > ĊĠĠĠĠĠĠĠ Ġval Ġcan Create Async : ĠObservable < Boolean > ĊĠĠĠĠĠĠĠ Ġvar Ġstate : ĠCreate Wallet Service . State ĊĊĠĠĠĠĠĠĠ Ġfun Ġenable ( coin : ĠCoin ) ĊĠĠĠĠĠĠĠ Ġfun Ġdisable ( coin : ĠCoin ) ĊĠĠĠĠĠĠĠ Ġfun Ġcreate () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġclass ĠFactory ( private Ġval Ġpredefined Account Type : ĠPre defined Account Type ?) Ġ: ĠViewModel Provider . Factory Ġ{ ĊĠĠĠĠĠĠĠ Ġ@ Suppress (" UN CHECK ED _ CAST ") ĊĠĠĠĠĠĠĠ Ġoverride Ġfun Ġ< T Ġ: ĠViewModel > Ġcreate ( model Class : ĠClass < T >): ĠT Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġservice Ġ= ĠCreate Wallet Service ( pre defined Account Type , ĠApp . pre defined Account Type Manager , ĠApp . coin Manager , ĠApp . account Creator , ĠApp . account Manager , ĠApp . wallet Manager , ĠApp . der ivation Settings Manager ) ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġreturn ĠCreate Wallet ViewModel ( service , ĠlistOf ( service )) Ġas ĠT ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ } Ċ