I am creating a new dapp but I can’t figure out how I can connect Solflare and Sollet wallet of Solana blockchain. Here is my code below.
import './App.css';
import { useMoralis } from "react-moralis";
function App() {
const { authenticate, isAuthenticated, user, logout } = useMoralis();
console.log("isAuthenticated: ", isAuthenticated);
if (!isAuthenticated) {
return (
<div>
<button onClick={() => authenticate({
type: "sol",
signingMessage: "Samrat Authentication",
})}>Authenticate</button>
</div>
);
}
return (
<div>
<h1>Welcome {user.get("username")}</h1>
<button onClick={logout}>Log Out</button>
</div>
);
}
export default App;
kindly help me it’s urgent.