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