From dde0dd9f4f49c982716b570c0ca9fab06f833754 Mon Sep 17 00:00:00 2001 From: Kayos Date: Sun, 29 Mar 2026 08:44:10 -0700 Subject: [PATCH] feat(wallet): flip to Cardano mainnet - CardanoNetworkConfig.NETWORK = MAINNET - Koios API: api.koios.rest (was preprod.koios.rest) - Explorer: cardanoscan.io (was preprod.cardanoscan.io) - Address prefix: addr1 (was addr_test1) - WalletPanelNode: use config for explorer URL To flip back to testnet, change one line: val NETWORK = CardanoNetwork.TESTNET --- .../features/wallet/impl/cardano/CardanoNetworkConfig.kt | 6 +++--- .../android/features/wallet/impl/panel/WalletPanelNode.kt | 6 +----- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/features/wallet/impl/src/main/kotlin/io/element/android/features/wallet/impl/cardano/CardanoNetworkConfig.kt b/features/wallet/impl/src/main/kotlin/io/element/android/features/wallet/impl/cardano/CardanoNetworkConfig.kt index 12f92d62c1..46374fb669 100644 --- a/features/wallet/impl/src/main/kotlin/io/element/android/features/wallet/impl/cardano/CardanoNetworkConfig.kt +++ b/features/wallet/impl/src/main/kotlin/io/element/android/features/wallet/impl/cardano/CardanoNetworkConfig.kt @@ -17,10 +17,10 @@ enum class CardanoNetwork { /** * Centralized network configuration for the Cardano wallet. * - * To switch networks, change [NETWORK] to [CardanoNetwork.MAINNET]. + * To switch networks, change [NETWORK] to [CardanoNetwork.TESTNET]. * All derived values (network ID, API URLs) will update automatically. * - * **Current configuration: TESTNET (preprod)** + * **Current configuration: MAINNET** */ object CardanoNetworkConfig { /** @@ -29,7 +29,7 @@ object CardanoNetworkConfig { * Set to [CardanoNetwork.TESTNET] for development/testing. * Set to [CardanoNetwork.MAINNET] for production. */ - val NETWORK: CardanoNetwork = CardanoNetwork.TESTNET + val NETWORK: CardanoNetwork = CardanoNetwork.MAINNET /** * Cardano network ID. diff --git a/features/wallet/impl/src/main/kotlin/io/element/android/features/wallet/impl/panel/WalletPanelNode.kt b/features/wallet/impl/src/main/kotlin/io/element/android/features/wallet/impl/panel/WalletPanelNode.kt index ca1d38a46b..4c1a55449a 100644 --- a/features/wallet/impl/src/main/kotlin/io/element/android/features/wallet/impl/panel/WalletPanelNode.kt +++ b/features/wallet/impl/src/main/kotlin/io/element/android/features/wallet/impl/panel/WalletPanelNode.kt @@ -55,11 +55,7 @@ class WalletPanelNode @AssistedInject constructor( eventSink = { event -> when (event) { is WalletPanelEvent.OpenTransaction -> { - val url = if (CardanoNetworkConfig.NETWORK_NAME != "mainnet") { - "https://preprod.cardanoscan.io/transaction/${event.txHash}" - } else { - "https://cardanoscan.io/transaction/${event.txHash}" - } + val url = "${CardanoNetworkConfig.EXPLORER_BASE_URL}/transaction/${event.txHash}" val intent = Intent(Intent.ACTION_VIEW, Uri.parse(url)) context.startActivity(intent) }