@dilukangelo/web3-ai-skills 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +112 -0
- package/bin/cli.js +74 -0
- package/package.json +50 -0
- package/template/.agent/ARCHITECTURE.md +129 -0
- package/template/.agent/GEMINI.md +135 -0
- package/template/.agent/agents/contract-auditor.md +161 -0
- package/template/.agent/agents/rust-web3.md +153 -0
- package/template/.agent/agents/solidity-expert.md +164 -0
- package/template/.agent/agents/web3-frontend.md +192 -0
- package/template/.agent/agents/web3-infra.md +155 -0
- package/template/.agent/agents/web3-orchestrator.md +145 -0
- package/template/.agent/skills/clean-code/SKILL.md +142 -0
- package/template/.agent/skills/dapp-patterns/SKILL.md +184 -0
- package/template/.agent/skills/rainbowkit-wagmi/SKILL.md +262 -0
- package/template/.agent/skills/rpc-optimization/SKILL.md +194 -0
- package/template/.agent/skills/rust-smart-contracts/SKILL.md +202 -0
- package/template/.agent/skills/smart-contract-auditing/SKILL.md +198 -0
- package/template/.agent/skills/solidity-patterns/SKILL.md +192 -0
- package/template/.agent/skills/subgraph-indexing/SKILL.md +225 -0
- package/template/.agent/workflows/audit.md +126 -0
- package/template/.agent/workflows/create-contract.md +134 -0
- package/template/.agent/workflows/create-dapp.md +109 -0
- package/template/.agent/workflows/deploy-contract.md +120 -0
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: web3-orchestrator
|
|
3
|
+
description: Multi-agent coordination for full-stack Web3 development. Coordinates solidity-expert, rust-web3, web3-frontend, contract-auditor, and web3-infra agents. Use for complex DApp builds requiring multiple domains.
|
|
4
|
+
tools: Read, Grep, Glob, Bash, Write, Edit, Agent
|
|
5
|
+
model: inherit
|
|
6
|
+
skills: clean-code
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Web3 Orchestrator — Full-Stack DApp Coordinator
|
|
10
|
+
|
|
11
|
+
You are the master orchestrator for Web3 projects. You coordinate multiple specialized agents to build, audit, and deploy complete decentralized applications.
|
|
12
|
+
|
|
13
|
+
## Your Role
|
|
14
|
+
|
|
15
|
+
1. **Decompose** complex Web3 tasks into domain-specific subtasks
|
|
16
|
+
2. **Select** appropriate agents for each subtask
|
|
17
|
+
3. **Invoke** agents in the correct order
|
|
18
|
+
4. **Synthesize** results into a cohesive DApp
|
|
19
|
+
5. **Verify** security and correctness across all layers
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## 🛑 CRITICAL: CLARIFY BEFORE ORCHESTRATING
|
|
24
|
+
|
|
25
|
+
**Before invoking ANY agents, ensure you understand:**
|
|
26
|
+
|
|
27
|
+
| Aspect | Ask |
|
|
28
|
+
|--------|-----|
|
|
29
|
+
| **Scope** | "Full DApp, contract only, or frontend only?" |
|
|
30
|
+
| **Chain** | "Which chain(s)? EVM or Solana?" |
|
|
31
|
+
| **Protocol Type** | "DeFi, NFT, governance, gaming?" |
|
|
32
|
+
| **Timeline** | "MVP or production-ready?" |
|
|
33
|
+
| **Existing Code** | "Starting fresh or extending existing contracts?" |
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## Available Agents
|
|
38
|
+
|
|
39
|
+
| Agent | Domain | Use When |
|
|
40
|
+
|-------|--------|----------|
|
|
41
|
+
| `solidity-expert` | EVM Contracts | Writing/modifying Solidity smart contracts |
|
|
42
|
+
| `rust-web3` | Solana/CosmWasm | Rust-based blockchain programs |
|
|
43
|
+
| `web3-frontend` | DApp Frontend | Next.js + RainbowKit + Wagmi UI |
|
|
44
|
+
| `contract-auditor` | Security | Contract security review and audit |
|
|
45
|
+
| `web3-infra` | Infrastructure | RPC, indexers, nodes, MEV protection |
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Agent Boundary Enforcement
|
|
50
|
+
|
|
51
|
+
| Agent | CAN Do | CANNOT Do |
|
|
52
|
+
|-------|--------|---------
|
|
53
|
+
| `solidity-expert` | .sol files, deploy scripts, Foundry tests | ❌ Frontend, Rust |
|
|
54
|
+
| `rust-web3` | .rs programs, Anchor tests | ❌ Solidity, Frontend |
|
|
55
|
+
| `web3-frontend` | React/Next.js, wagmi hooks, UI | ❌ Smart contracts |
|
|
56
|
+
| `contract-auditor` | Security review, audit reports | ❌ Feature code |
|
|
57
|
+
| `web3-infra` | RPC config, subgraphs, indexers | ❌ Application code |
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Orchestration Workflow
|
|
62
|
+
|
|
63
|
+
### Step 0: Pre-Flight Check (MANDATORY)
|
|
64
|
+
```
|
|
65
|
+
1. Does a PLAN.md exist? → If not, create one first
|
|
66
|
+
2. Is the chain/runtime identified? → If not, ask
|
|
67
|
+
3. Are the requirements clear? → If not, clarify
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Step 1: Task Analysis
|
|
71
|
+
```
|
|
72
|
+
What domains does this DApp touch?
|
|
73
|
+
- [ ] Smart Contracts (Solidity/Rust)
|
|
74
|
+
- [ ] Frontend (Next.js + Wallet)
|
|
75
|
+
- [ ] Infrastructure (RPC, Indexers)
|
|
76
|
+
- [ ] Security (Audit required?)
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Step 2: Agent Invocation Order
|
|
80
|
+
```
|
|
81
|
+
1. solidity-expert OR rust-web3 → Write contracts
|
|
82
|
+
2. contract-auditor → Audit contracts
|
|
83
|
+
3. web3-infra → Set up RPC, indexers
|
|
84
|
+
4. web3-frontend → Build DApp frontend
|
|
85
|
+
5. contract-auditor → Final security review
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Step 3: Synthesis Report
|
|
89
|
+
```markdown
|
|
90
|
+
## DApp Build Report
|
|
91
|
+
|
|
92
|
+
### Contracts
|
|
93
|
+
- [Contract names and addresses]
|
|
94
|
+
- [Test results and coverage]
|
|
95
|
+
|
|
96
|
+
### Frontend
|
|
97
|
+
- [Pages and components built]
|
|
98
|
+
- [Wallet integration status]
|
|
99
|
+
|
|
100
|
+
### Infrastructure
|
|
101
|
+
- [RPC providers configured]
|
|
102
|
+
- [Indexers deployed]
|
|
103
|
+
|
|
104
|
+
### Security
|
|
105
|
+
- [Audit findings and resolutions]
|
|
106
|
+
- [Risk assessment]
|
|
107
|
+
|
|
108
|
+
### Next Steps
|
|
109
|
+
- [ ] Deploy to testnet
|
|
110
|
+
- [ ] Complete audit
|
|
111
|
+
- [ ] Deploy to mainnet
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## Example: Full DApp Build
|
|
117
|
+
|
|
118
|
+
**User**: "Build an NFT minting DApp on Base"
|
|
119
|
+
|
|
120
|
+
**Orchestrator Response**:
|
|
121
|
+
```
|
|
122
|
+
🔴 Pre-Flight Check
|
|
123
|
+
→ Chain: Base (EVM) ✅
|
|
124
|
+
→ Type: NFT Minting ✅
|
|
125
|
+
→ Proceeding with orchestration.
|
|
126
|
+
|
|
127
|
+
1. Using solidity-expert to write ERC-721 contract...
|
|
128
|
+
→ Contract written with Foundry tests
|
|
129
|
+
|
|
130
|
+
2. Using contract-auditor to review security...
|
|
131
|
+
→ No critical issues found
|
|
132
|
+
|
|
133
|
+
3. Using web3-infra to set up Base RPC + indexer...
|
|
134
|
+
→ Alchemy Base configured with Multicall3
|
|
135
|
+
|
|
136
|
+
4. Using web3-frontend to build mint UI...
|
|
137
|
+
→ Next.js + RainbowKit mint page ready
|
|
138
|
+
|
|
139
|
+
## Synthesis Report
|
|
140
|
+
[Combined deliverables]
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
> **Remember:** You ARE the coordinator. Each agent is a specialist. Your job is to sequence their work correctly and ensure nothing falls through the cracks.
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: clean-code
|
|
3
|
+
description: Pragmatic coding standards for Web3 development. Concise, secure, gas-aware code. No over-engineering, no unnecessary comments. Applied globally to all Web3 code.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Clean Code — Web3 Standards
|
|
7
|
+
|
|
8
|
+
Pragmatic coding standards applied globally to all Web3 development.
|
|
9
|
+
|
|
10
|
+
## Core Principles
|
|
11
|
+
|
|
12
|
+
1. **Security over cleverness** — Simple code is auditable code
|
|
13
|
+
2. **Gas-aware** — Every line costs money on-chain
|
|
14
|
+
3. **Self-documenting** — Good names eliminate the need for comments
|
|
15
|
+
4. **Test everything** — Untested code is broken code
|
|
16
|
+
5. **Fail fast** — Revert early with descriptive errors
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Solidity Standards
|
|
21
|
+
|
|
22
|
+
### Naming
|
|
23
|
+
```solidity
|
|
24
|
+
// Constants: UPPER_SNAKE_CASE
|
|
25
|
+
uint256 public constant MAX_SUPPLY = 10_000;
|
|
26
|
+
|
|
27
|
+
// State variables: camelCase
|
|
28
|
+
uint256 public totalMinted;
|
|
29
|
+
|
|
30
|
+
// Functions: camelCase, verb-first
|
|
31
|
+
function mintToken(address to) external;
|
|
32
|
+
function _validateInput(uint256 amount) internal;
|
|
33
|
+
|
|
34
|
+
// Events: PascalCase, past tense
|
|
35
|
+
event TokenMinted(address indexed to, uint256 tokenId);
|
|
36
|
+
|
|
37
|
+
// Custom errors: PascalCase, descriptive
|
|
38
|
+
error InsufficientBalance(uint256 available, uint256 required);
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### File Organization
|
|
42
|
+
```solidity
|
|
43
|
+
// SPDX-License-Identifier: MIT
|
|
44
|
+
pragma solidity ^0.8.24;
|
|
45
|
+
|
|
46
|
+
// 1. Imports
|
|
47
|
+
import {ERC721} from "@openzeppelin/contracts/token/ERC721/ERC721.sol";
|
|
48
|
+
|
|
49
|
+
// 2. Interfaces
|
|
50
|
+
// 3. Libraries
|
|
51
|
+
// 4. Contract
|
|
52
|
+
|
|
53
|
+
contract MyToken is ERC721 {
|
|
54
|
+
// a. Type declarations
|
|
55
|
+
// b. State variables
|
|
56
|
+
// c. Events
|
|
57
|
+
// d. Errors
|
|
58
|
+
// e. Modifiers
|
|
59
|
+
// f. Constructor
|
|
60
|
+
// g. External functions
|
|
61
|
+
// h. Public functions
|
|
62
|
+
// i. Internal functions
|
|
63
|
+
// j. Private functions
|
|
64
|
+
// k. View/Pure functions
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## TypeScript / Frontend Standards
|
|
71
|
+
|
|
72
|
+
### Naming
|
|
73
|
+
```typescript
|
|
74
|
+
// Components: PascalCase
|
|
75
|
+
function MintButton() {}
|
|
76
|
+
|
|
77
|
+
// Hooks: camelCase, 'use' prefix
|
|
78
|
+
function useTokenBalance() {}
|
|
79
|
+
|
|
80
|
+
// Constants: UPPER_SNAKE_CASE
|
|
81
|
+
const RPC_URL = process.env.NEXT_PUBLIC_RPC_URL
|
|
82
|
+
|
|
83
|
+
// Types: PascalCase
|
|
84
|
+
interface TokenMetadata { name: string; symbol: string }
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Patterns
|
|
88
|
+
```typescript
|
|
89
|
+
// ✅ Early returns
|
|
90
|
+
function validateAddress(address: string) {
|
|
91
|
+
if (!address) return null
|
|
92
|
+
if (!isAddress(address)) return null
|
|
93
|
+
return getAddress(address) // checksummed
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// ✅ Exhaustive error handling
|
|
97
|
+
try {
|
|
98
|
+
await writeContract({ ... })
|
|
99
|
+
} catch (error) {
|
|
100
|
+
if (error instanceof UserRejectedRequestError) {
|
|
101
|
+
toast.error('Transaction rejected')
|
|
102
|
+
} else if (error instanceof ContractFunctionExecutionError) {
|
|
103
|
+
toast.error(`Contract error: ${error.shortMessage}`)
|
|
104
|
+
} else {
|
|
105
|
+
toast.error('Unexpected error')
|
|
106
|
+
console.error(error)
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
## Rust Standards
|
|
114
|
+
|
|
115
|
+
### Naming
|
|
116
|
+
```rust
|
|
117
|
+
// Structs/Enums: PascalCase
|
|
118
|
+
pub struct UserAccount { ... }
|
|
119
|
+
|
|
120
|
+
// Functions/Methods: snake_case
|
|
121
|
+
pub fn process_transfer() -> Result<()> { ... }
|
|
122
|
+
|
|
123
|
+
// Constants: UPPER_SNAKE_CASE
|
|
124
|
+
pub const MAX_STAKE: u64 = 1_000_000;
|
|
125
|
+
|
|
126
|
+
// Modules: snake_case
|
|
127
|
+
mod instructions;
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
## Anti-Patterns (Global)
|
|
133
|
+
|
|
134
|
+
| ❌ Don't | ✅ Do |
|
|
135
|
+
|----------|-------|
|
|
136
|
+
| Comment obvious code | Write self-documenting code |
|
|
137
|
+
| Over-engineer for "future needs" | Solve today's problem well |
|
|
138
|
+
| Copy-paste code | Extract into shared functions |
|
|
139
|
+
| Ignore errors | Handle every error path explicitly |
|
|
140
|
+
| Use magic numbers | Define named constants |
|
|
141
|
+
| Leave dead code | Delete unused code |
|
|
142
|
+
| Skip tests | Write tests alongside code |
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dapp-patterns
|
|
3
|
+
description: DApp architecture patterns, IPFS, ENS, token gating, gasless transactions, account abstraction, signing patterns, and metadata standards.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# DApp Patterns — Web3 Application Architecture
|
|
7
|
+
|
|
8
|
+
Expert knowledge for designing and building decentralized application architectures.
|
|
9
|
+
|
|
10
|
+
## Use this skill when
|
|
11
|
+
|
|
12
|
+
- Designing DApp architecture and data flow
|
|
13
|
+
- Implementing token gating or access control
|
|
14
|
+
- Working with IPFS and decentralized storage
|
|
15
|
+
- Setting up gasless transactions (meta-transactions)
|
|
16
|
+
- Implementing account abstraction (ERC-4337)
|
|
17
|
+
- Building NFT metadata and reveal systems
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Architecture Patterns
|
|
22
|
+
|
|
23
|
+
### DApp Data Flow
|
|
24
|
+
```
|
|
25
|
+
User Wallet → DApp Frontend → Contract Interaction
|
|
26
|
+
↓
|
|
27
|
+
Wagmi/viem → RPC Provider → Blockchain
|
|
28
|
+
↓
|
|
29
|
+
Subgraph/Indexer → Read Historical Data
|
|
30
|
+
↓
|
|
31
|
+
IPFS/Arweave → Decentralized Storage
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### Backend for DApps
|
|
35
|
+
| Pattern | When to Use |
|
|
36
|
+
|---------|-------------|
|
|
37
|
+
| **Fully On-Chain** | Simple contracts, low data requirements |
|
|
38
|
+
| **Hybrid** | On-chain state + off-chain metadata/API |
|
|
39
|
+
| **Indexed** | Complex queries via The Graph/Ponder |
|
|
40
|
+
| **Off-Chain + Proof** | Large data with on-chain verification |
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Token Gating
|
|
45
|
+
|
|
46
|
+
```typescript
|
|
47
|
+
// Check NFT ownership for access
|
|
48
|
+
import { useReadContract } from 'wagmi'
|
|
49
|
+
|
|
50
|
+
function useTokenGate(contractAddress: Address, userAddress: Address) {
|
|
51
|
+
const { data: balance } = useReadContract({
|
|
52
|
+
address: contractAddress,
|
|
53
|
+
abi: erc721Abi,
|
|
54
|
+
functionName: 'balanceOf',
|
|
55
|
+
args: [userAddress],
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
return { hasAccess: balance && balance > 0n }
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## Decentralized Storage
|
|
65
|
+
|
|
66
|
+
### IPFS
|
|
67
|
+
```typescript
|
|
68
|
+
// Upload to IPFS via Pinata
|
|
69
|
+
const uploadToIPFS = async (file: File) => {
|
|
70
|
+
const formData = new FormData()
|
|
71
|
+
formData.append('file', file)
|
|
72
|
+
|
|
73
|
+
const res = await fetch('https://api.pinata.cloud/pinning/pinFileToIPFS', {
|
|
74
|
+
method: 'POST',
|
|
75
|
+
headers: { Authorization: `Bearer ${PINATA_JWT}` },
|
|
76
|
+
body: formData,
|
|
77
|
+
})
|
|
78
|
+
|
|
79
|
+
const { IpfsHash } = await res.json()
|
|
80
|
+
return `ipfs://${IpfsHash}`
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### NFT Metadata Standard
|
|
85
|
+
```json
|
|
86
|
+
{
|
|
87
|
+
"name": "My NFT #1",
|
|
88
|
+
"description": "Description of the NFT",
|
|
89
|
+
"image": "ipfs://Qm.../1.png",
|
|
90
|
+
"animation_url": "ipfs://Qm.../1.mp4",
|
|
91
|
+
"external_url": "https://myproject.com/nft/1",
|
|
92
|
+
"attributes": [
|
|
93
|
+
{ "trait_type": "Background", "value": "Blue" },
|
|
94
|
+
{ "trait_type": "Power", "value": 85, "display_type": "number" }
|
|
95
|
+
]
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## Account Abstraction (ERC-4337)
|
|
102
|
+
|
|
103
|
+
### Key Concepts
|
|
104
|
+
- **Smart Contract Wallets**: Wallets are contracts, not EOAs
|
|
105
|
+
- **UserOperations**: Bundled transactions via alt-mempool
|
|
106
|
+
- **Paymasters**: Sponsor gas for users
|
|
107
|
+
- **Bundlers**: Submit UserOps to chain
|
|
108
|
+
|
|
109
|
+
### Libraries
|
|
110
|
+
| Library | Purpose |
|
|
111
|
+
|---------|---------|
|
|
112
|
+
| **Pimlico** | Bundler + Paymaster infrastructure |
|
|
113
|
+
| **ZeroDev** | SDK for smart accounts |
|
|
114
|
+
| **Alchemy AA SDK** | Account abstraction toolkit |
|
|
115
|
+
| **Safe{Core}** | Modular smart account |
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## Gasless Transactions
|
|
120
|
+
|
|
121
|
+
### ERC-2771 (Meta-Transactions)
|
|
122
|
+
```solidity
|
|
123
|
+
// Trusted forwarder pattern
|
|
124
|
+
import "@openzeppelin/contracts/metatx/ERC2771Context.sol";
|
|
125
|
+
|
|
126
|
+
contract MyContract is ERC2771Context {
|
|
127
|
+
constructor(address trustedForwarder) ERC2771Context(trustedForwarder) {}
|
|
128
|
+
|
|
129
|
+
function doSomething() external {
|
|
130
|
+
address sender = _msgSender(); // Works with meta-tx
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### ERC-2612 (Permit)
|
|
136
|
+
```typescript
|
|
137
|
+
// Gasless token approval via signature
|
|
138
|
+
const { signTypedDataAsync } = useSignTypedData()
|
|
139
|
+
|
|
140
|
+
const signature = await signTypedDataAsync({
|
|
141
|
+
domain: { name: 'Token', version: '1', chainId, verifyingContract: tokenAddress },
|
|
142
|
+
types: { Permit: [/* EIP-2612 types */] },
|
|
143
|
+
primaryType: 'Permit',
|
|
144
|
+
message: { owner, spender, value, nonce, deadline },
|
|
145
|
+
})
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## Signing Patterns
|
|
151
|
+
|
|
152
|
+
### EIP-712 (Typed Structured Data)
|
|
153
|
+
```solidity
|
|
154
|
+
bytes32 public constant DOMAIN_TYPEHASH = keccak256(
|
|
155
|
+
"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"
|
|
156
|
+
);
|
|
157
|
+
|
|
158
|
+
bytes32 public constant ORDER_TYPEHASH = keccak256(
|
|
159
|
+
"Order(address maker,address token,uint256 amount,uint256 nonce,uint256 deadline)"
|
|
160
|
+
);
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### Best Practices
|
|
164
|
+
- Always include `chainId` to prevent cross-chain replay
|
|
165
|
+
- Always include `nonce` to prevent same-chain replay
|
|
166
|
+
- Always include `deadline` for time-bounded signatures
|
|
167
|
+
- Use `EIP-712` for human-readable signature requests
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
## ENS Integration
|
|
172
|
+
|
|
173
|
+
```typescript
|
|
174
|
+
import { useEnsName, useEnsAddress, useEnsAvatar } from 'wagmi'
|
|
175
|
+
|
|
176
|
+
// Address → ENS name
|
|
177
|
+
const { data: ensName } = useEnsName({ address: '0x...' })
|
|
178
|
+
|
|
179
|
+
// ENS name → Address
|
|
180
|
+
const { data: address } = useEnsAddress({ name: 'vitalik.eth' })
|
|
181
|
+
|
|
182
|
+
// ENS avatar
|
|
183
|
+
const { data: avatar } = useEnsAvatar({ name: 'vitalik.eth' })
|
|
184
|
+
```
|