Updated on 2026-08-14
This commit is contained in:
parent
6936f04093
commit
c7151d95a7
20 changed files with 335 additions and 1096 deletions
|
|
@ -1,50 +0,0 @@
|
|||
package com.tangem.lib.crypto
|
||||
|
||||
import com.tangem.blockchain.common.Amount
|
||||
import com.tangem.blockchain.common.smartcontract.SmartContractCallData
|
||||
import com.tangem.lib.crypto.models.*
|
||||
import java.math.BigInteger
|
||||
|
||||
interface TransactionManager {
|
||||
|
||||
/**
|
||||
* Get fee
|
||||
*
|
||||
* @param networkId network id of blockchain
|
||||
* @param amountToSend amount
|
||||
* @param currencyToSend currency to send in tx
|
||||
* @param destinationAddress address to send tx
|
||||
* @param increaseBy percents in format 125 = 25%
|
||||
* @param callData tx smart contract call data
|
||||
* @param derivationPath derivation path
|
||||
* @return
|
||||
*/
|
||||
@Suppress("LongParameterList")
|
||||
@Throws(IllegalStateException::class)
|
||||
suspend fun getFee(
|
||||
networkId: String,
|
||||
amountToSend: Amount,
|
||||
currencyToSend: Currency,
|
||||
destinationAddress: String,
|
||||
increaseBy: Int?,
|
||||
callData: SmartContractCallData?,
|
||||
derivationPath: String?,
|
||||
): ProxyFees
|
||||
|
||||
@Throws(IllegalStateException::class)
|
||||
suspend fun getFeeForGas(networkId: String, gas: BigInteger, derivationPath: String?): ProxyFees
|
||||
|
||||
@Throws(IllegalStateException::class)
|
||||
suspend fun updateWalletManager(networkId: String, derivationPath: String?)
|
||||
|
||||
/**
|
||||
* In app blockchain id, actual in blockchain sdk, not the same as networkId
|
||||
*
|
||||
* workaround till not use backend only and not integrated server vs sdk
|
||||
*/
|
||||
@Throws(IllegalStateException::class)
|
||||
fun getBlockchainInfo(networkId: String): ProxyNetworkInfo
|
||||
|
||||
@Throws(IllegalStateException::class)
|
||||
fun getExplorerTransactionLink(networkId: String, txAddress: String): String
|
||||
}
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
package com.tangem.lib.crypto.models
|
||||
|
||||
import java.math.BigDecimal
|
||||
import java.math.BigInteger
|
||||
|
||||
sealed interface ProxyFee {
|
||||
|
||||
val gasLimit: BigInteger
|
||||
val fee: ProxyAmount
|
||||
|
||||
data class Common(
|
||||
override val gasLimit: BigInteger,
|
||||
override val fee: ProxyAmount,
|
||||
) : ProxyFee
|
||||
|
||||
data class CardanoToken(
|
||||
override val gasLimit: BigInteger,
|
||||
override val fee: ProxyAmount,
|
||||
val minAdaValue: BigDecimal,
|
||||
) : ProxyFee
|
||||
|
||||
data class Filecoin(
|
||||
override val gasLimit: BigInteger,
|
||||
override val fee: ProxyAmount,
|
||||
val gasPremium: Long,
|
||||
) : ProxyFee
|
||||
|
||||
data class Sui(
|
||||
override val gasLimit: BigInteger,
|
||||
override val fee: ProxyAmount,
|
||||
val gasPrice: Long,
|
||||
val gasBudget: Long,
|
||||
) : ProxyFee
|
||||
}
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
package com.tangem.lib.crypto.models
|
||||
|
||||
sealed class ProxyFees {
|
||||
|
||||
data class MultipleFees(
|
||||
val minFee: ProxyFee,
|
||||
val normalFee: ProxyFee,
|
||||
val priorityFee: ProxyFee,
|
||||
) : ProxyFees()
|
||||
|
||||
data class SingleFee(
|
||||
val singleFee: ProxyFee,
|
||||
) : ProxyFees()
|
||||
}
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
package com.tangem.lib.crypto.models
|
||||
|
||||
data class ProxyNetworkInfo(
|
||||
val name: String,
|
||||
val blockchainId: String,
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue