Updated on 2026-08-14
This commit is contained in:
commit
3c615650fd
4 changed files with 39 additions and 10 deletions
|
|
@ -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'
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
22
build.gradle
22
build.gradle
|
|
@ -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' }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue