Updated on 2026-08-14
This commit is contained in:
parent
cf5a7d68ad
commit
b99dd44c2b
2 changed files with 20 additions and 0 deletions
|
|
@ -96,6 +96,18 @@ internal class DefaultWalletConnectRepository(
|
|||
Timber.d("sessionProposal: $sessionProposal")
|
||||
this@DefaultWalletConnectRepository.sessionProposal = sessionProposal
|
||||
|
||||
if (sessionProposal.name in unsupportedDApps) {
|
||||
Timber.w("Unsupported DApp")
|
||||
scope.launch {
|
||||
_events.emit(
|
||||
WalletConnectEvents.SessionApprovalError(
|
||||
WalletConnectError.UnsupportedDApp,
|
||||
),
|
||||
)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
val missingNetworks = findMissingNetworks(
|
||||
namespaces = sessionProposal.requiredNamespaces,
|
||||
userNamespaces = this@DefaultWalletConnectRepository.userNamespaces ?: emptyMap(),
|
||||
|
|
@ -476,4 +488,9 @@ internal class DefaultWalletConnectRepository(
|
|||
val userChains = userNamespaces.flatMap { it.value.map { account -> account.chainId } }
|
||||
return wcProvidedChains.intersect(userChains.toSet())
|
||||
}
|
||||
|
||||
private companion object {
|
||||
|
||||
val unsupportedDApps = listOf("dYdX", "dYdX v4", "Apex Pro")
|
||||
}
|
||||
}
|
||||
|
|
@ -1,6 +1,9 @@
|
|||
package com.tangem.tap.domain.walletconnect2.domain.models
|
||||
|
||||
sealed class WalletConnectError(val error: String) : Exception() {
|
||||
|
||||
data object UnsupportedDApp : WalletConnectError("UnsupportedDApp")
|
||||
|
||||
data class ApprovalErrorMissingNetworks(
|
||||
val missingChains: List<String>,
|
||||
) : WalletConnectError("ApprovalErrorMissingNetworks")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue