Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/leapwallet/graz-integration-testing
https://github.com/leapwallet/graz-integration-testing
Last synced: 9 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/leapwallet/graz-integration-testing
- Owner: leapwallet
- License: mit
- Created: 2023-09-04T08:57:09.000Z (about 1 year ago)
- Default Branch: dev
- Last Pushed: 2023-09-04T09:02:32.000Z (about 1 year ago)
- Last Synced: 2023-12-05T07:33:48.211Z (12 months ago)
- Language: TypeScript
- Size: 7.92 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
![graz](./banner.png)
[![npm/v](https://badgen.net/npm/v/graz)](https://www.npmjs.com/package/graz)
[![npm/dt](https://badgen.net/npm/dt/graz)](https://www.npmjs.com/package/graz)
[![stars](https://badgen.net/github/stars/graz-sh/graz)](https://github.com/graz-sh/graz)`graz` is a collection of React hooks containing everything you need to start working with the [Cosmos ecosystem](https://cosmos.network/).
## 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`](https://tanstack.com/query) and [`zustand`](https://github.com/pmndrs/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](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).
## Installing
Install `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):
```sh
# using npm
npm install graz# using yarn
yarn add graz# using pnpm
pnpm add graz
```## Quick start
Wrap your React app with `` and use available `graz` hooks anywhere:
```jsx
import { GrazProvider, mainnetChains } from "graz";function App() {
return (
);
}
``````jsx
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 (
{account ? `Connected to ${account.bech32Address}` : status}
{isConnected ? "Disconnect" : "Connect"}
);
}
```## Examples
- Next.js + Chakra UI: https://graz-example.vercel ([source code](./example/next/))
- Vite: https://graz-vite-example.vercel.app ([source code](./example/vite/))## Third-party dependencies
`graz` uses various dependencies such as [`@cosmjs/cosmwasm-stargate`](https://www.npmjs.com/package/@cosmjs/cosmwasm-stargate) and [`@keplr-wallet/types`](https://www.npmjs.com/package/@keplr-wallet/types).
Rather than importing those packages directly, you can import from [`graz/dist/cosmjs`](./packages/graz/src/cosmjs.ts) and [`graz/dist/keplr`](./packages/graz/src/keplr.ts) which re-exports all respective dependencies:
```diff
- 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:
```sh
# 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](https://graz.sh/) or via [paka.dev](https://paka.dev/npm/graz).
## Maintainers
- Griko Nibras ([@grikomsn](https://github.com/grikomsn))
- Nur Fikri ([@codingki](https://github.com/codingki))## License
[MIT License, Copyright (c) 2023 Graz](./LICENSE)