Skip to content
Back to skills

Wagmi React Hooks

ASecurity

React hooks for blockchain queries and mutations. Use when reading/writing contracts or querying chain data.

  • 9 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 10, 2026
developmenttypescriptreact

Security analysis

A100/100

Scanned September 10, 2026

npx -y skills add cyotee/indexedex --skill wagmi-react-hooks --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Wagmi React Hooks?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Wagmi React Hooks
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/cyotee-wagmi-react-hooks/badge)](https://www.skillsdirectory.com/skills/cyotee-wagmi-react-hooks)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: wagmi-react-hooks
description: React hooks for blockchain queries and mutations. Use when reading/writing contracts or querying chain data.
---

# Wagmi-React Hooks

Overview of React hooks.

## Query vs Write Hooks

- **Query hooks** - Read data (useReadContract, useBalance, etc.)
- **Write hooks** - Send transactions (useWriteContract, useSendTransaction)

## Common Query Hooks

```typescript
// Contract reads
useReadContract({ abi, address, functionName, args })
useReadContracts({ contracts: [...] })

// Chain data
useBlockNumber({ chainId })
useBalance({ address, chainId })
useChainId()

// Transactions
useTransactionReceipt({ hash })
useWaitForTransactionReceipt({ hash })
```

## Common Write Hooks

```typescript
// Contract writes
useWriteContract()
useSimulateContract()

// Transactions
useSendTransaction()
useSignMessage()
useSignTypedData()
```

## Watching for Changes

```typescript
// Re-fetch on block changes
useReadContract({
  abi,
  address,
  functionName: 'balanceOf',
  args: [address],
  watch: true  // re-fetch when block changes
})
```

## Query Options

```typescript
useReadContract({
  abi,
  address,
  functionName: 'balanceOf',
  args: [address],
  query: {
    enabled: !!address,        // only fetch when address exists
    staleTime: 5 * 60 * 1000, // cache for 5 minutes
    refetchOnWindowFocus: false,
  }
})
```

## Return Values

```typescript
const { data, error, isError, isLoading, isPending, refetch } = useReadContract({
  abi, address, functionName, args
})

// data - the result (if successful)
// error - error object (if failed)
// isLoading / isPending - loading state
// isError - error state
// refetch - function to manually re-fetch
```

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…