Updated on 2026-08-14

This commit is contained in:
Tangem 2020-10-20 19:42:04 +03:00
parent a889552559
commit 57d7e90fda
4 changed files with 39 additions and 10 deletions

View file

@ -67,7 +67,7 @@ dependencies {
implementation 'com.google.android.material:material:1.2.1'
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.0.10'
implementation 'com.tangem:blockchain:1.83.0'
implementation 'com.tangem:blockchain:1.96.0'
implementation 'com.tangem:core:1.68.0'
implementation 'com.tangem:sdk:1.68.0'

View file

@ -11,15 +11,21 @@ data class PendingTransaction(
val type: PendingTransactionType
)
enum class PendingTransactionType { Incoming, Outcoming }
enum class PendingTransactionType { Incoming, Outgoing, Unknown }
fun TransactionData.toPendingTransaction(walletAddress: String): PendingTransaction? {
if (this.status == TransactionStatus.Confirmed) return null
val type: PendingTransactionType = if (this.sourceAddress == walletAddress) {
PendingTransactionType.Outcoming
} else {
PendingTransactionType.Incoming
val type: PendingTransactionType = when {
// this.sourceAddress == walletAddress -> {
// PendingTransactionType.Outgoing
// }
// this.destinationAddress == walletAddress -> {
// PendingTransactionType.Incoming
// }
else -> {
PendingTransactionType.Unknown
}
}
val address = if (this.sourceAddress == walletAddress) {
this.destinationAddress

View file

@ -42,15 +42,18 @@ class PendingTransactionsAdapter
fun bind(transaction: PendingTransaction) {
val transactionDescriptionRes = when (transaction.type) {
PendingTransactionType.Incoming -> R.string.wallet_pending_tx_receiving
PendingTransactionType.Outcoming -> R.string.wallet_pending_tx_sending
PendingTransactionType.Outgoing -> R.string.wallet_pending_tx_sending
PendingTransactionType.Unknown -> return
}
val transactionAddressRes = when (transaction.type) {
PendingTransactionType.Incoming -> R.string.wallet_pending_tx_receiving_address_format
PendingTransactionType.Outcoming -> R.string.wallet_pending_tx_sending_address_format
PendingTransactionType.Outgoing -> R.string.wallet_pending_tx_sending_address_format
PendingTransactionType.Unknown -> return
}
val image = when (transaction.type) {
PendingTransactionType.Incoming -> R.drawable.ic_arrow_left
PendingTransactionType.Outcoming -> R.drawable.ic_arrow_right_20
PendingTransactionType.Outgoing -> R.drawable.ic_arrow_right_20
PendingTransactionType.Unknown -> return
}
view.tv_pending_transaction.text = view.context.getString(transactionDescriptionRes)

View file

@ -21,7 +21,27 @@ allprojects {
google()
jcenter()
maven { url 'https://jitpack.io' }
maven { url "https://api.bitbucket.org/2.0/repositories/tangem/maven_repository/src/releases" }
def nexusUser = "viewer"
def nexusPass = "smartcash124"
repositories {
google()
jcenter()
maven {
credentials {
username = nexusUser
password = nexusPass
}
url "https://nexus.tangem.com/repository/maven-releases/"
}
maven {
credentials {
username = nexusUser
password = nexusPass
}
url "https://nexus.tangem.com/repository/maven-snapshots/"
}
maven { url 'https://jitpack.io' }
}
}
}