Updated on 2026-08-14
This commit is contained in:
parent
2a1369fce6
commit
5a99de87fb
29 changed files with 194 additions and 47 deletions
|
|
@ -3,28 +3,31 @@ package com.tangem.domain.qrscanning.models
|
|||
import com.tangem.domain.models.currency.CryptoCurrency
|
||||
import java.math.BigDecimal
|
||||
|
||||
sealed class ClassifiedQrContent {
|
||||
sealed interface ClassifiedQrContent {
|
||||
|
||||
data class WalletConnect(val uri: String) : ClassifiedQrContent()
|
||||
data class WalletConnect(val uri: String) : ClassifiedQrContent
|
||||
|
||||
data class PaymentUri(
|
||||
val address: String,
|
||||
val amount: BigDecimal?,
|
||||
val memo: String?,
|
||||
val matchingCurrencies: List<CryptoCurrency>,
|
||||
) : ClassifiedQrContent()
|
||||
) : ClassifiedQrContent
|
||||
|
||||
data class PlainAddress(
|
||||
val address: String,
|
||||
val matchingCurrencies: List<CryptoCurrency>,
|
||||
) : ClassifiedQrContent()
|
||||
) : ClassifiedQrContent
|
||||
|
||||
sealed class Error : ClassifiedQrContent() {
|
||||
sealed interface Error : ClassifiedQrContent {
|
||||
|
||||
/** QR code not recognized by any parser */
|
||||
data class Unrecognized(val raw: String) : Error()
|
||||
data class Unrecognized(val raw: String) : Error
|
||||
|
||||
/** Network or token recognized but not available in user's wallet */
|
||||
data object UnsupportedNetwork : Error()
|
||||
data class UnsupportedNetwork(
|
||||
val raw: String,
|
||||
val blockchain: String?,
|
||||
) : Error
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue