npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@josefleventon/graz

v0.0.0

Published

![graz](./banner.png)

Downloads

60

Readme

graz

npm/v npm/dt stars

graz-interchain adds multiple chain support for graz.

graz is a collection of React hooks containing everything you need to start working with the Cosmos ecosystem.

Features

  • 🪝 20+ hooks for interfacing with wallets, clients, signers, etc. (connecting, view balances, send tokens, etc.)
  • 💳 Multiple wallet supports (Keplr, Leap, Cosmostation, WalletConnect )
  • ⚙️ Generate mainnet & testnet ChainInfo from chain registry
  • 📚 Built-in caching, request deduplication, and all the good stuff from @tanstack/react-query and zustand
  • 🔄 Auto refresh on wallet and network change
  • 👏 Fully typed and tree-shakeable
  • ...and many more ✨

Requirements

graz requires react@>=17 due to using function components and hooks and the new JSX transform.

Installing

Install graz using npm, yarn, or pnpm:

# using npm
npm install graz

# using yarn
yarn add graz

# using pnpm
pnpm add graz

Quick start

Wrap your React app with <GrazProvider /> and use available graz hooks anywhere:

import { GrazProvider, mainnetChains } from "graz";

function App() {
  return (
    <GrazProvider
      // optional
      grazOptions={{
        defaultChain: mainnetChains.cosmos,
      }}
    >
      <Wallet />
    </GrazProvider>
  );
}
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>
  );
}

Examples

  • Next.js + Chakra UI: https://graz.sh/examples/next (source code)
  • Vite: https://graz.sh/examples/vite (source code)
  • Next.js Starter: https://graz.sh/examples/starter (source code)

Third-party dependencies

graz uses various dependencies such as @cosmjs/cosmwasm-stargate and @keplr-wallet/types.

Rather than importing those packages directly, you can import from graz/dist/cosmjs and graz/dist/keplr which re-exports all respective dependencies:

- import type { CosmWasmClient } from "@cosmjs/cosmwasm-stargate";
+ import type { CosmWasmClient } from "graz/dist/cosmjs";

But if you prefer importing from their respective pacakges, you can install dependencies that graz uses for better intellisense:

# using pnpm
pnpm add @cosmjs/cosmwasm-stargate @cosmjs/proto-signing @cosmjs/stargate @keplr-wallet/types

API

You can read more about available hooks and exports on Documentation Site or via paka.dev.

Maintainers

License

MIT License, Copyright (c) 2023 Graz