Clusters
Wallet UI needs to know which Solana clusters your application supports. The core library provides simple helper functions to define these clusters.
createSolanaDevnet()createSolanaLocalnet()createSolanaMainnet()createSolanaTestnet()
Each helper returns a SolanaCluster object. You can pass a custom RPC URL directly, or provide a configuration object when you want to override the default label or endpoint details.
Typical usage
Section titled “Typical usage”Most apps expose a small set of clusters, then choose one of them as the active RPC target through the Wallet UI provider configuration.
You provide the list of clusters to the WalletUi provider from the @wallet-ui/react package.
import { createWalletUiConfig, WalletUi } from '@wallet-ui/react';import { createSolanaDevnet, createSolanaMainnet } from '@wallet-ui/core';
const config = createWalletUiConfig({ clusters: [createSolanaMainnet('https://your-custom-rpc.com'), createSolanaDevnet()],});
function App({ children }) { return <WalletUi config={config}>{children}</WalletUi>;}Choosing clusters deliberately
Section titled “Choosing clusters deliberately”- Use
devnetfor most early integration and QA work. - Add
localnetwhen your team runs a local validator during feature development. - Add
mainnetonly when you are ready to point users at production infrastructure. - Prefer a dedicated RPC URL for production traffic instead of the public default endpoint.