Skip to content

Commit

Permalink
Merge pull request #429 from tangem/feature/AND-5783_add_fee_paid_cur…
Browse files Browse the repository at this point in the history
…rency_method

AND-5244 Added feePaidCurrency method
  • Loading branch information
Yoggam1 authored Jan 14, 2024
2 parents ec4bba3 + 6f4661d commit c9590da
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
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()
}

0 comments on commit c9590da

Please sign in to comment.