Updated on 2026-08-14

This commit is contained in:
Tangem 2023-08-04 16:19:14 +03:00
commit 53cbe15b78
430 changed files with 12468 additions and 1527 deletions

View file

@ -0,0 +1,18 @@
package com.tangem.lib.crypto
import com.tangem.lib.crypto.models.txhistory.ProxyTransactionHistoryItem
import com.tangem.lib.crypto.models.txhistory.ProxyTransactionHistoryState
interface TxHistoryManager {
@Throws(IllegalStateException::class)
suspend fun checkTxHistoryState(networkId: String, derivationPath: String?): ProxyTransactionHistoryState
@Throws(IllegalStateException::class)
suspend fun getTxHistoryItems(
networkId: String,
derivationPath: String?,
page: Int,
pageSize: Int,
): List<ProxyTransactionHistoryItem>
}

View file

@ -0,0 +1,21 @@
package com.tangem.lib.crypto.models.txhistory
import com.tangem.lib.crypto.models.ProxyAmount
data class ProxyTransactionHistoryItem(
val txHash: String,
val timestamp: Long,
val direction: TransactionDirection,
val status: ProxyTransactionStatus,
val type: TransactionType,
val amount: ProxyAmount,
) {
sealed interface TransactionDirection {
data class Incoming(val from: String) : TransactionDirection
data class Outgoing(val to: String) : TransactionDirection
}
sealed interface TransactionType {
object Transfer : TransactionType
}
}

View file

@ -0,0 +1,15 @@
package com.tangem.lib.crypto.models.txhistory
sealed class ProxyTransactionHistoryState {
sealed class Success : ProxyTransactionHistoryState() {
object Empty : Success()
data class HasTransactions(val txCount: Int) : Success()
}
sealed class Failed : ProxyTransactionHistoryState() {
data class FetchError(val exception: Exception) : Failed()
}
object NotImplemented : ProxyTransactionHistoryState()
}

View file

@ -0,0 +1,3 @@
package com.tangem.lib.crypto.models.txhistory
enum class ProxyTransactionStatus { Confirmed, Unconfirmed }