Updated on 2026-08-14
This commit is contained in:
parent
33b7a53905
commit
c5560c3c6a
101 changed files with 274 additions and 272 deletions
|
|
@ -9,12 +9,8 @@ import com.tangem.data.walletconnect.request.WcRequestToUseCaseConverter
|
|||
import com.tangem.data.walletconnect.request.WcRequestToUseCaseConverter.Companion.fromJson
|
||||
import com.tangem.data.walletconnect.sign.WcMethodUseCaseContext
|
||||
import com.tangem.data.walletconnect.utils.WcNamespaceConverter
|
||||
import com.tangem.domain.walletconnect.model.WcEthAddChain
|
||||
import com.tangem.domain.models.network.Network
|
||||
import com.tangem.domain.walletconnect.model.WcEthMethod
|
||||
import com.tangem.domain.walletconnect.model.WcEthMethodName
|
||||
import com.tangem.domain.walletconnect.model.WcEthSignTypedDataParams
|
||||
import com.tangem.domain.walletconnect.model.WcEthTransactionParams
|
||||
import com.tangem.domain.walletconnect.model.*
|
||||
import com.tangem.domain.walletconnect.model.sdkcopy.WcSdkSessionRequest
|
||||
import com.tangem.domain.walletconnect.repository.WcSessionsManager
|
||||
import com.tangem.domain.walletconnect.usecase.method.WcMethodUseCase
|
||||
|
|
@ -129,7 +125,7 @@ internal class WcEthNetwork(
|
|||
}
|
||||
|
||||
override fun toCAIP2(network: Network): CAIP2? {
|
||||
val blockchain = Blockchain.fromId(network.id.value)
|
||||
val blockchain = Blockchain.fromId(network.rawId)
|
||||
if (!blockchain.isEvm()) return null
|
||||
val chainId = blockchain.getChainId() ?: return null
|
||||
return CAIP2(
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ internal object WcEthTxHelper {
|
|||
val gasLimit = txParams.gas?.hexToBigDecimal() ?: return null
|
||||
val gasPrice = txParams.gasPrice?.hexToBigDecimal() ?: return null
|
||||
|
||||
val blockchain = Blockchain.fromId(network.id.value)
|
||||
val blockchain = Blockchain.fromId(network.rawId)
|
||||
|
||||
var feeDecimal = (gasLimit * gasPrice)
|
||||
.movePointLeft(blockchain.decimals())
|
||||
|
|
@ -38,7 +38,7 @@ internal object WcEthTxHelper {
|
|||
txParams: WcEthTransactionParams,
|
||||
): TransactionData.Uncompiled? {
|
||||
val destinationAddress = txParams.to ?: return null
|
||||
val blockchain = Blockchain.fromId(network.id.value)
|
||||
val blockchain = Blockchain.fromId(network.rawId)
|
||||
val value = (txParams.value ?: "0")
|
||||
.hexToBigDecimal()
|
||||
.movePointLeft(blockchain.decimals())
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ internal class WcSolanaNetwork(
|
|||
|
||||
private suspend fun getAccountAddress(network: Network): String? {
|
||||
return try {
|
||||
walletManager.getWalletAddress(network.id.value, network.derivationPath.value)
|
||||
walletManager.getWalletAddress(network.rawId, network.derivationPath.value)
|
||||
} catch (exception: Exception) {
|
||||
Timber.e(exception)
|
||||
null
|
||||
|
|
@ -84,7 +84,7 @@ internal class WcSolanaNetwork(
|
|||
}
|
||||
|
||||
override fun toCAIP2(network: Network): CAIP2? {
|
||||
val blockchain = Blockchain.fromId(network.id.value)
|
||||
val blockchain = Blockchain.fromId(network.rawId)
|
||||
val chainId = when (blockchain) {
|
||||
Blockchain.Solana -> MAINNET_CHAIN_ID
|
||||
Blockchain.SolanaTestnet -> TESTNET_CHAIN_ID
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue