diff --git a/src/features/swaps/SwapScreen.tsx b/src/features/swaps/SwapScreen.tsx index c08b012d8..b3cc4792f 100644 --- a/src/features/swaps/SwapScreen.tsx +++ b/src/features/swaps/SwapScreen.tsx @@ -76,7 +76,7 @@ enum SelectorMode { const SwapScreen = () => { const { t } = useTranslation() const { currentAccount } = useAccountStorage() - const { cluster, anchorProvider, connection } = useSolana() + const { isDevnet, anchorProvider, connection } = useSolana() const wallet = useCurrentWallet() const colors = useColors() const navigation = useNavigation() @@ -118,7 +118,6 @@ const SwapScreen = () => { getRoute, } = useJupiter() - const isDevnet = useMemo(() => cluster === 'devnet', [cluster]) const inputMintDecimals = useMint(inputMint)?.info?.decimals const outputMintDecimals = useMint(outputMint)?.info?.decimals diff --git a/src/solana/SolanaProvider.tsx b/src/solana/SolanaProvider.tsx index ea765e36f..4f5f8b958 100644 --- a/src/solana/SolanaProvider.tsx +++ b/src/solana/SolanaProvider.tsx @@ -53,6 +53,7 @@ const useSolanaHook = () => { return getConnection(cluster, sessionKeyActual) } }, [cluster, sessionKey, loading]) + const isDevnet = useMemo(() => cluster === 'devnet', [cluster]) const address = useMemo( () => currentAccount?.address, [currentAccount?.address], @@ -173,6 +174,7 @@ const useSolanaHook = () => { return { anchorProvider, cluster, + isDevnet, connection, dcProgram, hemProgram, @@ -186,6 +188,7 @@ const useSolanaHook = () => { const initialState = { anchorProvider: undefined, cluster: 'mainnet-beta' as Cluster, + isDevnet: false, connection: undefined, dcProgram: undefined, hemProgram: undefined,