@nowallet/react
v2.0.1
Published
React hooks for NoWallet SDK (Mantle Network)
Readme
@nowallet/react
Social login → automatic wallet → gasless transaction.
No seed phrase. No MetaMask. No manual wallet selection.
Users log in with Google/email, and a wallet is automatically created in the background. All transactions can be gasless via sponsorship.
Features
- 🔐 Social login (Google, email)
- 🎒 Auto wallet creation (no private key needed)
- ⛽ Gasless transactions (sponsored by paymaster)
- ⚛️ React hooks for easy integration
- TypeScript support
- Mantle Network native
Installation
pnpm add @nowallet/react @nowallet/coreQuick Start
import { NoWalletProvider, useNoWallet, useSendTransaction } from '@nowallet/react';
function App() {
return (
<NoWalletProvider config={{ apiKey: 'nw_live_your_key', chain: 'mantle' }}>
<Dashboard />
</NoWalletProvider>
);
}
function Dashboard() {
const { user, login } = useNoWallet();
const { send } = useSendTransaction();
if (!user) {
return <button onClick={() => login('google', googleToken)}>Login with Google</button>;
}
return (
<div>
<p>Wallet: {user.walletAddress}</p>
<button onClick={() => send('0xRecipient', '0.01')}>Send 0.01 MNT (Gasless)</button>
</div>
);
}Available Hooks
- useNoWallet() — Main hook (user, login, logout, isLoading, isConnected)
- useUser() — User info (user, isConnected)
- useWallet() — Wallet data (wallet, address, balance, isConnected)
- useBalance() — Balance with refresh (balance, refresh, isLoading)
- useSendTransaction() — Send tx (send, isLoading, error, data)
- useMintNFT() — Mint NFT (mint, isLoading, error, data)
Session Persistence
User sessions are automatically saved to localStorage. On refresh or revisit, the user stays logged in.
License
MIT
