Updated on 2026-08-14
This commit is contained in:
parent
58e6110121
commit
8b91930e18
5 changed files with 18 additions and 2 deletions
|
|
@ -24,6 +24,12 @@ internal class TangemWcBlockchainHelper(
|
|||
return blockchain?.toNetworkId()
|
||||
}
|
||||
|
||||
override fun chainIdsToBlockchains(chainIds: List<String>): List<Blockchain> {
|
||||
return chainIds.mapNotNull {
|
||||
it.parseId()?.chainIdToBlockchain()
|
||||
}.distinct()
|
||||
}
|
||||
|
||||
override fun chainIdToMissingNetworkNameOrNull(chainId: String): String? {
|
||||
val parsedId = chainId.parseId() ?: return null
|
||||
val blockchain = parsedId.chainIdToBlockchain()
|
||||
|
|
@ -103,6 +109,7 @@ internal class TangemWcBlockchainHelper(
|
|||
second.toIntOrNull()
|
||||
?.let(Blockchain::fromChainId)
|
||||
}
|
||||
SOLANA_NAMESPACE -> Blockchain.Solana
|
||||
else -> {
|
||||
Blockchain.fromNetworkId(networkId = first)
|
||||
.takeIf(supportedNonEvmBlockchains::contains)
|
||||
|
|
@ -112,6 +119,7 @@ internal class TangemWcBlockchainHelper(
|
|||
|
||||
private companion object {
|
||||
const val EVM_NAMESPACE = "eip155"
|
||||
const val SOLANA_NAMESPACE = "solana"
|
||||
const val CHAIN_SEPARATOR = ":"
|
||||
const val TESTNET_SEPARATOR = "/"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ internal class WalletConnectEventsHandlerImpl : WalletConnectEventsHandler {
|
|||
WalletConnectDialog.SessionProposalDialog(
|
||||
sessionProposal = proposal,
|
||||
networks = networksFormatted,
|
||||
onApprove = { store.dispatchOnMain(WalletConnectAction.ApproveProposal) },
|
||||
onApprove = { store.dispatchOnMain(WalletConnectAction.ApproveProposal(proposal)) },
|
||||
onReject = { store.dispatchOnMain(WalletConnectAction.RejectProposal) },
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.tangem.tap.domain.walletconnect2.domain
|
||||
|
||||
import com.tangem.blockchain.common.Blockchain
|
||||
import com.tangem.tap.domain.walletconnect2.domain.models.Account
|
||||
|
||||
interface WcBlockchainHelper {
|
||||
|
|
@ -14,4 +15,6 @@ interface WcBlockchainHelper {
|
|||
fun chainIdToFullNameOrNull(chainId: String): String?
|
||||
|
||||
fun chainIdsToAccounts(walletAddress: String, chainIds: List<String>, derivationPath: String?): List<Account>
|
||||
|
||||
fun chainIdsToBlockchains(chainIds: List<String>): List<Blockchain>
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue