Updated on 2026-08-14
This commit is contained in:
parent
a667fcc955
commit
db6157cae4
20 changed files with 435 additions and 500 deletions
|
|
@ -1,9 +1,8 @@
|
|||
package com.tangem.data.visa.utils
|
||||
|
||||
import com.tangem.blockchain.common.Blockchain
|
||||
import com.tangem.blockchainsdk.utils.ExcludedBlockchains
|
||||
import com.tangem.data.common.currency.CryptoCurrencyFactory
|
||||
import com.tangem.data.common.currency.getNetwork
|
||||
import com.tangem.data.common.network.NetworkFactory
|
||||
import com.tangem.domain.common.util.derivationStyleProvider
|
||||
import com.tangem.domain.models.currency.CryptoCurrency
|
||||
import com.tangem.domain.models.network.NetworkAddress
|
||||
|
|
@ -19,7 +18,7 @@ import javax.inject.Inject
|
|||
|
||||
internal class VisaCurrencyFactory @Inject constructor(
|
||||
private val cryptoCurrencyFactory: CryptoCurrencyFactory,
|
||||
private val excludedBlockchains: ExcludedBlockchains,
|
||||
private val networkFactory: NetworkFactory,
|
||||
) {
|
||||
|
||||
fun create(userWallet: UserWallet, contractInfo: VisaContractInfo, fiatRate: BigDecimal): VisaCurrency {
|
||||
|
|
@ -31,11 +30,10 @@ internal class VisaCurrencyFactory @Inject constructor(
|
|||
}
|
||||
val remainingOtpLimit = getRemainingOtp(currentLimit, now)
|
||||
|
||||
val currencyNetwork = getNetwork(
|
||||
val currencyNetwork = networkFactory.create(
|
||||
blockchain = Blockchain.Polygon,
|
||||
extraDerivationPath = null,
|
||||
derivationStyleProvider = userWallet.scanResponse.derivationStyleProvider,
|
||||
excludedBlockchains = excludedBlockchains,
|
||||
canHandleTokens = true,
|
||||
) ?: error("Unable to create network for Visa currency")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue