A fully-typed React library for connecting Morsel Wallet to your dApp. QR scan, browser extension, Wallet Standard — with light & dark mode and native support for Cookie Chain and Solana.

Encrypted WebSocket relay with NaCl (X25519 + XSalsa20) lets mobile users scan and connect securely.
Detects Morsel Wallet browser extension automatically — zero config for extension users.
Auto-discovers any wallet implementing the Wallet Standard protocol, including hardware wallets.
From useWallet() to useSendTransaction() — composable hooks for every wallet interaction.
Full type definitions, typed errors, and IntelliSense support out of the box.
Switch between Cookie Chain and Solana at runtime. One adapter, two networks, zero refactoring.
From zero to wallet-connected in under 5 minutes.
npm install @morsel-wallet/adapter @solana/web3.js @wallet-standard/appimport { WalletProvider, WalletModalProvider, ConnectButton } from '@morsel-wallet/adapter';
import { MorselCookieWalletAdapter, StandardWalletAdapter } from '@morsel-wallet/adapter';
import { getWallets } from '@wallet-standard/app';
const morsel = new MorselCookieWalletAdapter();
const standard = getWallets().get().map(w => new StandardWalletAdapter(w));
export default function App() {
return (
<WalletProvider adapters={[morsel, ...standard]} autoConnect>
<WalletModalProvider>
<ConnectButton />
</WalletModalProvider>
</WalletProvider>
);
}import { useWallet, useWalletBalance, useSignMessage } from '@morsel-wallet/adapter';
import { Connection } from '@solana/web3.js';
function MyComponent() {
const { connected, publicKey, disconnect } = useWallet();
const connection = new Connection('https://rpc.cookiechain.io');
const { balance, loading, refetch } = useWalletBalance(connection);
const { signMessage, signing } = useSignMessage();
if (!connected) return <ConnectButton />;
return (
<div>
<p>{publicKey.toBase58()}</p>
<p>{loading ? 'Loading...' : `${balance} COOKIE`}</p>
<button onClick={() => signMessage(new TextEncoder().encode('Hello!'))}>
{signing ? 'Signing...' : 'Sign Message'}
</button>
</div>
);
}Every hook is fully typed and tree-shakeable.
useWallet() Full wallet context — state, methods, events
useWalletAddress() Public key as Base58 string or null
useWalletBalance() SOL / COOKIE balance with loading & refetch
useWalletStatus() Monitor connection state changes
useSignMessage() Sign arbitrary messages
useSignTransaction() Sign one or multiple transactions
useSendTransaction() Send transactions to the network
useWalletConnection() Connection lifecycle management
useWalletError() Access and clear current error state
useAutoConnect() Manage auto-connect behaviour
useWalletEvent() Subscribe to wallet events
useOnConnect() Callback fired on wallet connect
useOnDisconnect() Callback fired on wallet disconnect
Main adapter class. Handles QR connect, injected provider detection, and all signing operations.
connect()disconnect() signTransaction(tx)signAllTransactions(txs) signMessage(msg)sendTransaction(tx, conn)Wraps any wallet implementing the Wallet Standard protocol — automatically discovered via getWallets().
connect()disconnect() signTransaction(tx)signMessage(msg)React context provider. Manages lifecycle, auto-connect, localStorage persistence, and wallet deduplication.
adapters={[]}autoConnect={bool}onError={fn}Drop-in UI component. Shows connect modal when disconnected, address + balance when connected.
showAddressuseModalclassNameonConnectErrorOpen-source under MIT. Built and maintained by the Morsel Labs team.