Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AND-5244 Added feePaidCurrency method #429

Merged
merged 1 commit into from
Jan 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import com.tangem.blockchain.blockchains.solana.SolanaAddressService
import com.tangem.blockchain.blockchains.stellar.StellarAddressService
import com.tangem.blockchain.blockchains.tezos.TezosAddressService
import com.tangem.blockchain.blockchains.tron.TronAddressService
import com.tangem.blockchain.blockchains.vechain.VechainWalletManager
import com.tangem.blockchain.blockchains.xrp.XrpAddressService
import com.tangem.blockchain.common.address.Address
import com.tangem.blockchain.common.address.AddressService
Expand Down Expand Up @@ -430,9 +431,10 @@ enum class Blockchain(
else -> false
}

fun tokenTransactionFeePaidInNetworkCurrency(): Boolean = when (this) {
TerraV1 -> true
else -> false
fun feePaidCurrency(): FeePaidCurrency = when (this) {
Vechain, VechainTestnet -> FeePaidCurrency.Token(VechainWalletManager.VTHO_TOKEN)
TerraV1 -> FeePaidCurrency.SameCurrency
else -> FeePaidCurrency.Coin
}

companion object {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.tangem.blockchain.common

import com.tangem.blockchain.common.Token as BlockchainToken

sealed class FeePaidCurrency {
object Coin : FeePaidCurrency()
object SameCurrency : FeePaidCurrency()
data class Token(val token: BlockchainToken) : FeePaidCurrency()
}