wallet provider fix

This commit is contained in:
thesn10
2026-05-21 22:21:54 +02:00
parent 79456e3927
commit 9810270e7e

View File

@@ -21,8 +21,13 @@ export const NetworkContext = React.createContext<NetworkContextValue>({
export function WalletProviders({ children }: { children: React.ReactNode }) {
const [network, setNetwork] = useState<WalletAdapterNetwork>(WalletAdapterNetwork.Devnet)
// You can also provide a custom RPC endpoint
const endpoint = useMemo(() => clusterApiUrl(network), [network]);
const endpoint = useMemo(
() =>
(network as string) === 'localnet'
? 'http://localhost:8899'
: clusterApiUrl(network),
[network],
);
const onError = useCallback((error: WalletError) => {
console.warn('[wallet]', error.name, error.message, error.error)