taler-android

Android apps for GNU Taler (wallet, PoS, cashier)
Log | Files | Refs | README | LICENSE

InitResponse.kt (2577B)


      1 /*
      2  * This file is part of GNU Taler
      3  * (C) 2023 Taler Systems S.A.
      4  *
      5  * GNU Taler is free software; you can redistribute it and/or modify it under the
      6  * terms of the GNU General Public License as published by the Free Software
      7  * Foundation; either version 3, or (at your option) any later version.
      8  *
      9  * GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY
     10  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
     11  * A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
     12  *
     13  * You should have received a copy of the GNU General Public License along with
     14  * GNU Taler; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
     15  */
     16 
     17 package net.taler.wallet.backend
     18 
     19 import kotlinx.serialization.Serializable
     20 import net.taler.wallet.exchanges.BuiltinExchange
     21 
     22 @Serializable
     23 data class InitResponse(
     24     val versionInfo: WalletCoreVersion,
     25 )
     26 
     27 @Serializable
     28 data class WalletRunConfig(
     29     val builtin: Builtin? = Builtin(),
     30     val testing: Testing? = Testing(),
     31     val features: Features? = Features(),
     32     val logLevel: String?,
     33 ) {
     34     /**
     35      * Initialization values useful for a complete startup.
     36      *
     37      * These are values may be overridden by different wallets
     38      */
     39     @Serializable
     40     data class Builtin(
     41         val exchanges: List<BuiltinExchange> = emptyList(),
     42     )
     43 
     44     /**
     45      * Unsafe options which it should only be used to create
     46      * testing environment.
     47      */
     48     @Serializable
     49     data class Testing(
     50         /**
     51          * Allow withdrawal of denominations even though they are about to expire.
     52          */
     53         val denomselAllowLate: Boolean = false,
     54         val devModeActive: Boolean = false,
     55         val insecureTrustExchange: Boolean = false,
     56         val preventThrottling: Boolean = false,
     57         val skipDefaults: Boolean = false,
     58         val emitObservabilityEvents: Boolean? = false,
     59     )
     60 
     61     /**
     62      * Configurations values that may be safe to show to the user
     63      */
     64     @Serializable
     65     data class Features(
     66         val allowHttp: Boolean = false,
     67         val enableV1Contracts: Boolean = false,
     68     )
     69 }
     70 
     71 fun interface VersionReceiver {
     72     fun onVersionReceived(versionInfo: WalletCoreVersion)
     73 }
     74 
     75 @Serializable
     76 data class WalletCoreVersion(
     77     val implementationSemver: String,
     78     val implementationGitHash: String,
     79     val version: String,
     80     val exchange: String,
     81     val merchant: String,
     82     val bankIntegrationApiRange: String,
     83     val bankConversionApiRange: String,
     84     val corebankApiRange: String,
     85     val devMode: Boolean,
     86 )