class DefaultBirthdayStore : WalletBirthdayStore
Default implementation of the WalletBirthdayStore interface that loads checkpoints from the assets directory, in JSON format and stores the current birthday in shared preferences.
<init> |
Default implementation of the WalletBirthdayStore interface that loads checkpoints from the assets directory, in JSON format and stores the current birthday in shared preferences. DefaultBirthdayStore(appContext: Context, importedBirthdayHeight: Int? = null, alias: String = DEFAULT_ALIAS) |
alias |
val alias: String |
newWalletBirthday |
Birthday that helps new wallets not have to scan from the beginning, which saves significant amounts of startup time. This value is created using the context passed into the constructor. val newWalletBirthday: WalletBirthday |
getBirthday |
Get the birthday of the wallet, saved in this store. fun getBirthday(): WalletBirthday |
hasExistingBirthday |
Return true when a birthday has been stored in this instance. fun hasExistingBirthday(): Boolean |
hasImportedBirthday |
Return true when a birthday was imported into this instance. fun hasImportedBirthday(): Boolean |
loadBirthday |
Load a birthday matching the given height. This is most commonly used during import to find the first available checkpoint that is lower than the requested height. fun loadBirthday(birthdayHeight: Int): WalletBirthday |
setBirthday |
Set the birthday of the wallet to be saved in this store. fun setBirthday(value: WalletBirthday): Unit |
DEFAULT_ALIAS |
The default alias to use for naming the preference file used for storage. const val DEFAULT_ALIAS: String |
ImportedWalletBirthdayStore |
A convenience constructor function for creating an instance of this class to use for
imported wallets. It sets the stored birthday to match the given
fun ImportedWalletBirthdayStore(appContext: Context, importedBirthdayHeight: Int?, alias: String = DEFAULT_ALIAS): WalletBirthdayStore |
loadBirthdayFromAssets |
Load the given birthday file from the assets of the given context. When no height is specified, we default to the file with the greatest name. fun loadBirthdayFromAssets(context: Context, birthdayHeight: Int? = null): WalletBirthday |
NewWalletBirthdayStore |
A convenience constructor function for creating an instance of this class to use for
new wallets. It sets the stored birthday to match the fun NewWalletBirthdayStore(appContext: Context, alias: String = DEFAULT_ALIAS): WalletBirthdayStore |