Updated on 2026-08-14
This commit is contained in:
parent
3f5f3ef68b
commit
d1a09370c7
39 changed files with 317 additions and 301 deletions
|
|
@ -1,18 +0,0 @@
|
|||
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>
|
||||
}
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
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
|
||||
}
|
||||
}
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
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()
|
||||
}
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
package com.tangem.lib.crypto.models.txhistory
|
||||
|
||||
enum class ProxyTransactionStatus { Confirmed, Unconfirmed }
|
||||
Loading…
Add table
Add a link
Reference in a new issue