graz is a collection of React hooks containing everything you need to start working with the Cosmos ecosystem.
- πͺ 20+ hooks for interfacing with wallets, clients, signers, etc. (connecting, view balances, send tokens, etc.)
 - π³ Multiple wallet supports (Keplr, Leap, Cosmostation, Vectis, Station, XDefi, Metamask Snap, WalletConnect, Compass, Initia, OKX, Para)
 - βοΈ Generate mainnet & testnet 
ChainInfo - π Built-in caching, request deduplication, and all the good stuff from 
@tanstack/react-queryandzustand - π Auto refresh on wallet and network change
 - π Fully typed and tree-shakeable
 - π¦ Lightweight and optimized (only ~220 KB package size)
 - β‘οΈ Optimized build system for fast development and production builds
 - ...and many more β¨
 
graz requires react@>=17 due to using function components and hooks and the new JSX transform.
Install graz using npm, yarn, or pnpm:
# using npm
npm install graz
# using yarn
yarn add graz
# using pnpm
pnpm add grazTo avoid version missmatch we dcided to make these packages as peer dependencies
# using npm
npm install @cosmjs/cosmwasm-stargate @cosmjs/proto-signing @cosmjs/stargate @cosmjs/encoding
# using yarn
yarn add @cosmjs/cosmwasm-stargate @cosmjs/proto-signing @cosmjs/stargate @cosmjs/encoding
# using pnpm
pnpm add @cosmjs/cosmwasm-stargate @cosmjs/proto-signing @cosmjs/stargate @cosmjs/encodingWrap your React app with <QueryClientProvider /> and <GrazProvider />, and use available graz hooks anywhere:
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { GrazProvider } from "graz";
const queryClient = new QueryClient();
const cosmoshub: ChainInfo = {
  chainId: "cosmoshub-4",
  chainName: "Cosmos Hub",
  //... rest of cosmoshub ChainInfo
}
function App() {
  return (
    <QueryClientProvider queryClient={queryClient}>
      <GrazProvider grazOptions={{
        chains: [cosmoshub]
      }}>
        <Wallet />
      </GrazProvider>
    </QueryClientProvider>
  );
}import { mainnetChains, useAccount, useConnect, useDisconnect } from "graz";
function Wallet() {
  const { connect, status } = useConnect();
  const { data: account, isConnected } = useAccount();
  const { disconnect } = useDisconnect();
  function handleConnect() {
    return isConnected ? disconnect() : connect();
  }
  return (
    <div>
      {account ? `Connected to ${account.bech32Address}` : status}
      <button onClick={handleConnect}>{isConnected ? "Disconnect" : "Connect"}</button>
    </div>
  );
}- Playground (Next.js + Multi-Chain) - Full-featured demo with multi-chain support and modern UI (source code)
 - Vite - Simple Vite app showcasing core functionality (source code)
 
- π― Simple & Intuitive API - Get started in minutes with well-designed hooks that follow React best practices
 - π Production Ready - Battle-tested in production apps across the Cosmos ecosystem
 - π Excellent Documentation - Comprehensive guides, examples, and API references to help you build faster
 - π§ Developer Experience - TypeScript support, autocomplete, and helpful error messages make development a breeze
 - π€ Active Maintenance - Regular updates, bug fixes, and new features based on community feedback
 - π Ecosystem Integration - Built on proven tools like TanStack Query and Zustand for reliability
 - β‘οΈ Performance Focused - Optimized for speed with smart caching, request deduplication, and minimal re-renders
 - π Multi-Chain First - Designed from the ground up to support multi-chain applications seamlessly
 
Graz powers some of the most popular applications in the Cosmos ecosystem:
- dYdX - Leading decentralized exchange for perpetual trading
 - Stargaze - The premier Cosmos NFT marketplace
 - Skip Go - Cross-chain swaps and bridging infrastructure
 
Want to add your project? Submit a PR or open an issue!
You can read more about available hooks and exports on Documentation Site or via paka.dev.
- Nur Fikri/Kiki (@codingki)
 
