Updated on 2026-08-14

This commit is contained in:
Tangem 2023-12-28 15:10:09 +03:00
parent c82c3b806c
commit c04036723e
2 changed files with 21 additions and 9 deletions

View file

@ -3,6 +3,7 @@ package com.tangem.tap.common.feedback
import android.os.Build
import com.tangem.blockchain.common.*
import com.tangem.blockchain.common.address.Address
import com.tangem.crypto.NetworkType
import com.tangem.domain.models.scan.CardDTO
import com.tangem.domain.models.scan.ScanResponse
import com.tangem.domain.userwallets.UserWalletIdBuilder
@ -35,6 +36,7 @@ class AdditionalFeedbackInfo {
var cardIssuer: String = ""
var cardBlockchain: String = ""
var userWalletId: String = ""
var extendedPublicKey: String = ""
// wallets
val walletsInfo = CopyOnWriteArrayList<EmailWalletInfo>()
@ -70,6 +72,9 @@ class AdditionalFeedbackInfo {
cardIssuer = data.card.issuer.name
signedHashesCount = formatSignedHashes(data.card.wallets)
userWalletId = UserWalletIdBuilder.scanResponse(data).build()?.stringValue ?: ""
extendedPublicKey = data.card.wallets.firstOrNull { it.extendedPublicKey != null }
?.extendedPublicKey
?.serialize(networkType = NetworkType.Mainnet).orEmpty()
}
@Deprecated("Don't use it directly")

View file

@ -1,5 +1,6 @@
package com.tangem.tap.common.feedback
import com.tangem.blockchain.common.Blockchain
import com.tangem.tap.common.extensions.breakLine
class FeedbackDataBuilder(
@ -27,26 +28,32 @@ class FeedbackDataBuilder(
}
fun appendWalletsInfo(): FeedbackDataBuilder {
infoHolder.walletsInfo.forEach {
infoHolder.walletsInfo.forEach { walletInfo ->
builder.appendDelimiter()
builder.appendKeyValue("Blockchain", it.blockchain.fullName)
builder.appendKeyValue("Derivation path", it.derivationPath)
builder.appendKeyValue("Outputs count", it.outputsCount)
builder.appendKeyValue("Blockchain", walletInfo.blockchain.fullName)
builder.appendKeyValue("Derivation path", walletInfo.derivationPath)
if (it.tokens.isNotEmpty()) {
if (walletInfo.blockchain == Blockchain.Bitcoin) {
builder.appendKeyValue("XPUB", infoHolder.extendedPublicKey)
}
builder.appendKeyValue("Outputs count", walletInfo.outputsCount)
if (walletInfo.tokens.isNotEmpty()) {
builder.append("Tokens:")
breakLine()
it.tokens.forEach { token ->
walletInfo.tokens.forEach { token ->
builder.appendKeyValue("ID", token.id ?: "[custom token]")
builder.appendKeyValue("Name", token.name)
builder.appendKeyValue("Contract address", token.contractAddress)
}
}
builder.appendKeyValue("Host", it.host)
builder.appendKeyValue("Wallet address", it.addresses)
builder.appendKeyValue("Explorer link", it.explorerLink)
builder.appendKeyValue("Host", walletInfo.host)
builder.appendKeyValue("Wallet address", walletInfo.addresses)
builder.appendKeyValue("Explorer link", walletInfo.explorerLink)
}
return this
}