daocafe-sdk
The official TypeScript SDK for DAO.CAFE - providing type-safe access to governance data from the CreateDAO protocol.React Hooks
TanStack Query integration for seamless data fetching
Query Functions
Promise-based API for Node.js and vanilla JS
TypeScript Types
Full type definitions for all entities
Examples
Real-world code examples
Features
| Feature | Description |
|---|---|
| 🔍 Type-safe | Full TypeScript support with generated types |
| ⚛️ React Hooks | TanStack Query integration with caching and refetching |
| 🚀 Tree-shakable | Only bundle what you use |
| 📦 Zero Config | Pre-configured to work with the DAO.CAFE endpoint |
| 🔄 Real-time Ready | Built-in caching and background refetching |
Installation
Peer Dependencies (for React hooks)
If you plan to use the React hooks, install these peer dependencies:Quick Start
With React Hooks
With Async Functions (Node.js / Vanilla JS)
Supported Networks
| Network | Chain ID | Status |
|---|---|---|
| Base Mainnet | 8453 | ✅ Supported |
| Sepolia Testnet | 11155111 | ✅ Supported |
ID Formats
The SDK uses composite IDs for all entities:| Entity | ID Format | Example |
|---|---|---|
| DAO | chainId_governorAddress | 11155111_0xf51C4b7b... |
| Proposal | chainId_governor_proposalId | 11155111_0xf51C4b7b..._12345 |
| Vote | chainId_governor_proposalId_voter | 11155111_0xf51C...._12345_0xAbc... |
| Delegate | chainId_tokenAddress_delegatorAddress | 11155111_0xcfCf..._0xAbc... |
| TokenHolder | chainId_tokenAddress_holderAddress | 11155111_0xcfCf..._0xAbc... |