{"id":13566929,"url":"https://github.com/graz-sh/graz","last_synced_at":"2025-04-06T00:08:32.753Z","repository":{"id":43422729,"uuid":"509500310","full_name":"graz-sh/graz","owner":"graz-sh","description":"React hooks for Cosmos 🪐","archived":false,"fork":false,"pushed_at":"2024-04-29T04:00:01.000Z","size":9092,"stargazers_count":99,"open_issues_count":17,"forks_count":25,"subscribers_count":7,"default_branch":"dev","last_synced_at":"2024-05-01T16:25:14.006Z","etag":null,"topics":["cosmjs","cosmos","cosmos-sdk","graz","keplr","keplr-wallet","leap","leap-wallet","react-cosmos-hooks","use-keplr","vectis","vectis-wallet","wallet-connect"],"latest_commit_sha":null,"homepage":"https://graz.sh/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/graz-sh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"polar":"graz-sh"}},"created_at":"2022-07-01T15:16:04.000Z","updated_at":"2024-05-09T18:45:53.594Z","dependencies_parsed_at":"2023-02-14T14:31:29.013Z","dependency_job_id":"f6d2032d-fec9-48c9-836d-f5721efdd899","html_url":"https://github.com/graz-sh/graz","commit_stats":{"total_commits":587,"total_committers":19,"mean_commits":"30.894736842105264","dds":0.5587734241908007,"last_synced_commit":"d5613ae4fa6b1212a254e9c1738aa7b4272b6647"},"previous_names":["strangelove-ventures/graz"],"tags_count":77,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graz-sh%2Fgraz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graz-sh%2Fgraz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graz-sh%2Fgraz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graz-sh%2Fgraz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/graz-sh","download_url":"https://codeload.github.com/graz-sh/graz/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247233767,"owners_count":20905842,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cosmjs","cosmos","cosmos-sdk","graz","keplr","keplr-wallet","leap","leap-wallet","react-cosmos-hooks","use-keplr","vectis","vectis-wallet","wallet-connect"],"created_at":"2024-08-01T13:02:19.834Z","updated_at":"2025-04-06T00:08:32.732Z","avatar_url":"https://github.com/graz-sh.png","language":"TypeScript","funding_links":["https://polar.sh/graz-sh"],"categories":["TypeScript"],"sub_categories":[],"readme":"![graz](./banner.png)\n\n[![npm/v](https://badgen.net/npm/v/graz)](https://www.npmjs.com/package/graz)\n[![npm/dt](https://badgen.net/npm/dt/graz)](https://www.npmjs.com/package/graz)\n[![stars](https://badgen.net/github/stars/graz-sh/graz)](https://github.com/graz-sh/graz)\n\n`graz` is a collection of React hooks containing everything you need to start working with the [Cosmos ecosystem](https://cosmos.network/).\n\n## Features\n\n- 🪝 20+ hooks for interfacing with wallets, clients, signers, etc. (connecting, view balances, send tokens, etc.)\n- 💳 Multiple wallet supports (Keplr, Leap, Cosmostation, Vectis, Station, XDefi, Metamask Snap, WalletConnect)\n- ⚙️ Generate mainnet \u0026 testnet `ChainInfo`\n- 📚 Built-in caching, request deduplication, and all the good stuff from [`@tanstack/react-query`](https://tanstack.com/query) and [`zustand`](https://github.com/pmndrs/zustand)\n- 🔄 Auto refresh on wallet and network change\n- 👏 Fully typed and tree-shakeable\n- ...and many more ✨\n\n## Requirements\n\n`graz` requires `react@\u003e=17` due to using [function components and hooks](https://reactjs.org/blog/2019/02/06/react-v16.8.0.html) and the [new JSX transform](https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html).\n\n## Installing\n\nInstall `graz` using [npm](https://docs.npmjs.com/cli/v8/commands/npm-install), [yarn](https://yarnpkg.com/cli/add), or [pnpm](https://pnpm.io/cli/install):\n\n```sh\n# using npm\nnpm install graz\n\n# using yarn\nyarn add graz\n\n# using pnpm\npnpm add graz\n```\n\n### Install peer dependencies\n\nTo avoid version mismatch we decided to make these packages as peer dependencies:\n\n```shell\n# using npm\nnpm install @cosmjs/cosmwasm-stargate @cosmjs/launchpad @cosmjs/proto-signing @cosmjs/stargate @cosmjs/tendermint-rpc long\n\n# using yarn\nyarn add @cosmjs/cosmwasm-stargate @cosmjs/launchpad @cosmjs/proto-signing @cosmjs/stargate @cosmjs/tendermint-rpc long\n\n# using pnpm\npnpm add @cosmjs/cosmwasm-stargate @cosmjs/launchpad @cosmjs/proto-signing @cosmjs/stargate @cosmjs/tendermint-rpc long\n```\n\n## Quick start\n\nWrap your React app with `\u003cQueryClientProvider /\u003e` and `\u003cGrazProvider /\u003e`, and use available `graz` hooks anywhere:\n\n```jsx\nimport { QueryClient, QueryClientProvider } from \"@tanstack/react-query\";\nimport { GrazProvider } from \"graz\";\n\nconst queryClient = new QueryClient();\n\nconst cosmoshub: ChainInfo = {\n  chainId: \"cosmoshub-4\",\n  chainName: \"Cosmos Hub\",\n  //... rest of cosmoshub ChainInfo\n}\n\nfunction App() {\n  return (\n    \u003cQueryClientProvider queryClient={queryClient}\u003e\n      \u003cGrazProvider grazOptions={{\n        chains: [cosmoshub]\n      }}\u003e\n        \u003cWallet /\u003e\n      \u003c/GrazProvider\u003e\n    \u003c/QueryClientProvider\u003e\n  );\n}\n```\n\n```jsx\nimport { mainnetChains, useAccount, useConnect, useDisconnect } from \"graz\";\n\nfunction Wallet() {\n  const { connect, status } = useConnect();\n  const { data: account, isConnected } = useAccount();\n  const { disconnect } = useDisconnect();\n\n  function handleConnect() {\n    return isConnected ? disconnect() : connect();\n  }\n\n  return (\n    \u003cdiv\u003e\n      {account ? `Connected to ${account.bech32Address}` : status}\n      \u003cbutton onClick={handleConnect}\u003e{isConnected ? \"Disconnect\" : \"Connect\"}\u003c/button\u003e\n    \u003c/div\u003e\n  );\n}\n```\n\n## Examples\n\n- Next.js + Multi chain: https://graz.sh/examples/starter ([source code](https://github.com/graz-sh/graz/tree/dev/example/starter/))\n- Next.js + Chakra UI: https://graz.sh/examples/next ([source code](./example/next/))\n- Vite: https://graz.sh/examples/vite ([source code](./example/vite/))\n\n## API\n\nYou can read more about available hooks and exports on [Documentation Site](https://graz.sh/) or via [paka.dev](https://paka.dev/npm/graz).\n\n## Maintainers\n\n- Griko Nibras ([@grikomsn](https://github.com/grikomsn))\n- Nur Fikri ([@codingki](https://github.com/codingki))\n\n## License\n\n[MIT License, Copyright (c) 2023 Graz](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraz-sh%2Fgraz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgraz-sh%2Fgraz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraz-sh%2Fgraz/lists"}