package Ġio . horizontal systems . bank wallet . core . managers Ċ Ċ import Ġio . horizontal systems . bank wallet . core . storage . Blockchain Settings Storage Ċ import Ġio . horizontal systems . bank wallet . entities . Account Origin Ċ import Ġio . horizontal systems . bank wallet . entities . Btc Blockchain Ċ import Ġio . horizontal systems . bank wallet . entities . Btc Restore Mode Ċ import Ġio . horizontal systems . bank wallet . entities . Transaction Data Sort Mode Ċ import Ġio . horizontal systems . bitcoin core . Bitcoin Core Ċ import Ġio . horizontal systems . market kit . models . Coin Type Ċ import Ġio . reactivex . Observable Ċ import Ġio . reactivex . subjects . Publish Subject Ċ Ċ class ĠB tc Blockchain Manager ( ĊĠĠĠ Ġprivate Ġval Ġstorage : ĠBlock chain Settings Storage Ċ ) Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġrestore Mode Updated Subject Ġ= ĠPublish Subject . create < Btc Blockchain >() ĊĠĠĠ Ġval Ġrestore Mode Updated Observable : ĠObservable < Btc Blockchain > Ġ= Ġrestore Mode Updated Subject ĊĊĠĠĠ Ġprivate Ġval Ġtransaction Sort Mode Updated Subject Ġ= ĠPublish Subject . create < Btc Blockchain >() ĊĠĠĠ Ġval Ġtransaction Sort Mode Updated Observable : ĠObservable < Btc Blockchain > Ġ= ĊĠĠĠĠĠĠĠ Ġtransaction Sort Mode Updated Subject ĊĊĊĠĠĠ Ġfun Ġblockchain ( coin Type : ĠCoin Type ): ĠB tc Blockchain ? Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠB tc Blockchain . values (). first OrNull Ġ{ Ġit . supports ( coin Type ) Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġrestore Mode ( blockchain : ĠB tc Blockchain ): ĠB tc Restore Mode Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġstorage . btc Restore Mode ( blockchain ) Ġ?: ĠB tc Restore Mode . Api ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġsync Mode ( blockchain : ĠB tc Blockchain , Ġaccount Origin : ĠAccount Origin ): ĠBitcoin Core . Sync Mode Ġ{ ĊĠĠĠĠĠĠĠ Ġif Ġ( account Origin Ġ== ĠAccount Origin . Created ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġreturn ĠBitcoin Core . Sync Mode . New Wallet () ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġreturn Ġwhen Ġ( restore Mode ( blockchain )) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠB tc Restore Mode . Api Ġ-> ĠBitcoin Core . Sync Mode . Api () ĊĠĠĠĠĠĠĠĠĠĠĠ ĠB tc Restore Mode . Blockchain Ġ-> ĠBitcoin Core . Sync Mode . Full () ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġsave ( restore Mode : ĠB tc Restore Mode , Ġblockchain : ĠB tc Blockchain ) Ġ{ ĊĠĠĠĠĠĠĠ Ġstorage . save ( restore Mode , Ġblockchain ) ĊĠĠĠĠĠĠĠ Ġrestore Mode Updated Subject . onNext ( blockchain ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġtransaction Sort Mode ( blockchain : ĠB tc Blockchain ): ĠTransaction Data Sort Mode Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġstorage . btc Transaction Sort Mode ( blockchain ) Ġ?: ĠTransaction Data Sort Mode . Shuffle ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġsave ( transaction Sort Mode : ĠTransaction Data Sort Mode , Ġblockchain : ĠB tc Blockchain ) Ġ{ ĊĠĠĠĠĠĠĠ Ġstorage . save ( transaction Sort Mode , Ġblockchain ) ĊĠĠĠĠĠĠĠ Ġtransaction Sort Mode Updated Subject . onNext ( blockchain ) ĊĠĠĠ Ġ} Ċ } Ċ