Hooks
React hooks for shielded transactions and signed reads
seismic-react provides four hooks that mirror wagmi's hook API but route through Seismic's shielded transport layer. Each hook wraps the corresponding seismic-viem client or contract method, handling encryption, signing, and decryption automatically.
Hook Comparison
useShieldedWallet
useAccount + useWalletClient
Access shielded public and wallet clients
useShieldedContract
useContract
Get a ShieldedContract instance
useShieldedWriteContract
useWriteContract
Send encrypted write transactions
useSignedReadContract
useReadContract
Execute authenticated read calls
Common Patterns
Wallet check
Always verify the wallet is loaded before calling contract methods:
const { walletClient, loaded } = useShieldedWallet()
if (!loaded) return <div>Loading wallet...</div>
if (!walletClient) return <div>Please connect your wallet</div>Loading states
The write and read hooks expose isLoading so you can disable buttons or show spinners:
Error handling
Every hook returns an error field. Check it after operations complete:
Pages
Access shielded wallet and public clients from context
Get a ShieldedContract instance for reads and writes
Send encrypted write transactions
Execute authenticated read calls
See Also
ShieldedWalletProvider -- Context provider required by all hooks
Installation -- Package setup and peer dependencies
Seismic React Overview -- SDK architecture and quick start
Last updated

