diff --git a/wallet/src/main/java/net/taler/wallet/withdraw/WithdrawManager.kt b/wallet/src/main/java/net/taler/wallet/withdraw/WithdrawManager.kt index f2862adc..965fd93b 100644 --- a/wallet/src/main/java/net/taler/wallet/withdraw/WithdrawManager.kt +++ b/wallet/src/main/java/net/taler/wallet/withdraw/WithdrawManager.kt @@ -214,6 +214,12 @@ data class WithdrawalDetailsForAmount( * Scope info of the currency withdrawn. */ val scopeInfo: ScopeInfo, + + /** + * Number of coins that would be withdrawn. + * wallet-core asks UIs to warn when this is high (roughly > 100). + */ + val numCoins: Int? = null, ) @Serializable diff --git a/wallet/src/main/java/net/taler/wallet/withdraw/WithdrawalShowInfo.kt b/wallet/src/main/java/net/taler/wallet/withdraw/WithdrawalShowInfo.kt index 7bc37929..eb3293e6 100644 --- a/wallet/src/main/java/net/taler/wallet/withdraw/WithdrawalShowInfo.kt +++ b/wallet/src/main/java/net/taler/wallet/withdraw/WithdrawalShowInfo.kt @@ -73,6 +73,9 @@ import net.taler.wallet.withdraw.WithdrawStatus.Status.TosReviewRequired import net.taler.wallet.withdraw.WithdrawStatus.Status.Updating import net.taler.wallet.withdraw.WithdrawalOperationStatusFlag.Pending +/** above this many coins the withdrawal takes noticeably longer (wallet-core: "roughly at >100") */ +private const val MANY_COINS = 100 + @Composable fun WithdrawalShowInfo( status: WithdrawStatus, @@ -272,6 +275,16 @@ fun WithdrawalShowInfo( ) } + if (status.status != TosReviewRequired + && (status.amountInfo?.numCoins ?: 0) > MANY_COINS) { + WarningLabel( + label = stringResource(R.string.withdraw_many_coins), + modifier = Modifier + .padding(16.dp) + .fillMaxWidth(), + ) + } + if (exchange != null && selectedAmount.scope !is ScopeInfo.Exchange) { TransactionInfoComposable( label = stringResource(R.string.withdraw_exchange), diff --git a/wallet/src/main/res/values/strings.xml b/wallet/src/main/res/values/strings.xml index 89750709..1f809491 100644 --- a/wallet/src/main/res/values/strings.xml +++ b/wallet/src/main/res/values/strings.xml @@ -430,6 +430,7 @@ GNU Taler is immune to many types of fraud such as credit card data theft, phish Copy this code and paste it into the subject/purpose field (or “Message to recipient”) in your banking app or bank website: Restrict usage to age Unrestricted + This withdrawal creates more than 100 digital coins and may take longer than usual. You must first accept the payment service\'s terms of service before you can withdraw electronic cash to your wallet. Select target bank account Withdraw