diff --git a/docs.json b/docs.json index 9bf040cad..f003dbdb0 100644 --- a/docs.json +++ b/docs.json @@ -247,7 +247,8 @@ "tooling/indexers/the-graph", "tooling/indexers/subquery", "tooling/indexers/envio", - "tooling/indexers/goldrush" + "tooling/indexers/goldrush", + "tooling/indexers/indexing-co" ] }, { @@ -316,6 +317,7 @@ "tooling/libraries-sdks/reown/index", "tooling/libraries-sdks/dynamic/index", "tooling/libraries-sdks/portal/index", + "tooling/libraries-sdks/jaw/index", { "group": "ContractKit", "pages": [ diff --git a/tooling/indexers/indexing-co.mdx b/tooling/indexers/indexing-co.mdx new file mode 100644 index 000000000..ff575c289 --- /dev/null +++ b/tooling/indexers/indexing-co.mdx @@ -0,0 +1,150 @@ +--- +title: Indexing Co +--- + +[Indexing Co](https://indexing.co) provides custom blockchain data pipelines with JavaScript transformation logic, sub-second latency, and delivery to Postgres, webhooks, or Kafka. Indexing Co supports Celo and 100+ other blockchains, making it easy to build cross-chain data workflows from a single platform. + +## How It Works + +Indexing Co pipelines have three stages: + +| Stage | Description | +|---|---| +| **Filter** | Select which blocks and transactions to process by contract address, event signature, or other criteria. | +| **Transformation** | Write JavaScript functions that extract and reshape the data you need from each block. | +| **Destination** | Deliver processed data to Postgres, HTTP webhooks, WebSockets, or other adapters. | + +## Key Features + +- **Celo support** — Native support for Celo mainnet with real-time and historical data. +- **Custom JavaScript transformations** — Write `function main(block)` handlers with full control over how data is extracted and shaped. +- **Multiple destinations** — Deliver data to Postgres, HTTP endpoints, WebSockets, or Kafka. +- **Backfills** — Replay historical blocks through your pipeline to populate your database from any starting point. +- **Cross-chain** — Run the same pipeline logic across 100+ supported blockchains. +- **Built-in helpers** — Use `templates.tokenTransfers(block)`, `utils.evmDecodeLog()`, and other utilities to accelerate development. + +## Quick Start + +All API requests use the base URL `https://app.indexing.co/dw` and require an `X-API-KEY` header for authentication. Sign up at [indexing.co](https://indexing.co) to get your API key. + +### Step 1: Create a Filter + +Create a filter to select which Celo transactions to process. This example filters for a specific contract address: + +```bash +curl -X POST https://app.indexing.co/dw/filters/my-celo-filter \ + -H "Content-Type: application/json" \ + -H "X-API-KEY: YOUR_API_KEY" \ + -d '{ + "addresses": ["0xYOUR_CONTRACT_ADDRESS"] + }' +``` + +### Step 2: Create a Transformation + +Create a transformation with a JavaScript `function main(block)` handler that processes each block: + +```bash +curl -X POST https://app.indexing.co/dw/transformations/my-celo-transform \ + -H "Content-Type: application/json" \ + -H "X-API-KEY: YOUR_API_KEY" \ + -d '{ + "code": "function main(block) {\n const transfers = templates.tokenTransfers(block);\n return transfers.map(t => ({\n from: t.from,\n to: t.to,\n value: t.value,\n token: t.address,\n block_number: block.number,\n timestamp: block.timestamp\n }));\n}" + }' +``` + +### Step 3: Test the Transformation + +Test your transformation against a real Celo block to verify the output: + +```bash +curl -X POST "https://app.indexing.co/dw/transformations/test?network=celo&beat=BLOCK_NUMBER" \ + -H "Content-Type: application/json" \ + -H "X-API-KEY: YOUR_API_KEY" \ + -d '{ + "code": "function main(block) {\n const transfers = templates.tokenTransfers(block);\n return transfers.map(t => ({\n from: t.from,\n to: t.to,\n value: t.value,\n token: t.address,\n block_number: block.number,\n timestamp: block.timestamp\n }));\n}" + }' +``` + +### Step 4: Create a Pipeline + +Combine the filter, transformation, and a destination into a pipeline that delivers data to Postgres: + +```bash +curl -X POST https://app.indexing.co/dw/pipelines \ + -H "Content-Type: application/json" \ + -H "X-API-KEY: YOUR_API_KEY" \ + -d '{ + "name": "my-celo-pipeline", + "network": "celo", + "filter": "my-celo-filter", + "transformation": "my-celo-transform", + "adapter": { + "type": "POSTGRES", + "config": { + "connection_url": "postgresql://user:password@host:5432/dbname", + "table": "celo_transfers" + } + } + }' +``` + +## Backfilling Historical Data + +Once your pipeline is running, you can backfill historical data from any starting block: + +```bash +curl -X POST https://app.indexing.co/dw/pipelines/my-celo-pipeline/backfill \ + -H "Content-Type: application/json" \ + -H "X-API-KEY: YOUR_API_KEY" \ + -d '{ + "start_block": 20000000 + }' +``` + +## Claude Code Integration + +Indexing Co provides first-class support for [Claude Code](https://docs.anthropic.com/en/docs/claude-code) through an MCP server and a pipeline skill, enabling you to build and query Celo data pipelines directly from your AI coding workflow. + +### MCP Server + +The [Indexing Co MCP server](https://github.com/indexing-co/indexing-co-mcp) streams real-time blockchain data from your pipelines into Claude Code. Events are stored in local SQLite and queryable with SQL — no external database needed for development. + +```bash +# Install +git clone https://github.com/indexing-co/indexing-co-mcp.git +cd indexing-co-mcp && npm install && npm run build + +# Register with Claude Code +claude mcp add indexing-co -- node /path/to/indexing-co-mcp/dist/index.js +``` + +Once registered, Claude Code gains tools to subscribe to pipeline channels, query event data with SQL, and manage pipelines, filters, and transformations — all through natural conversation. + +To stream Celo data into Claude Code, set the pipeline destination to the `DIRECT` adapter: + +```json +{ + "adapter": "DIRECT", + "connectionUri": "my-celo-channel", + "table": "my-celo-channel" +} +``` + +### Claude Code Skill + +The [Indexing Co pipeline skill](https://github.com/indexing-co/indexing-co-pipeline-skill) guides Claude through building and deploying pipelines via conversation. Install it to let Claude help you write transformation functions, generate SQL schemas, and manage pipelines: + +```bash +git clone https://github.com/indexing-co/indexing-co-pipeline-skill.git +cp -r indexing-co-pipeline-skill/skills/indexing-co-pipelines ~/.claude/skills/ +``` + +## Resources + +- [Documentation](https://docs.indexing.co) +- [Platform](https://app.indexing.co) +- [GitHub](https://github.com/indexing-co) +- [MCP Server](https://github.com/indexing-co/indexing-co-mcp) +- [Claude Code Skill](https://github.com/indexing-co/indexing-co-pipeline-skill) +- [Support](mailto:support@indexing.co) diff --git a/tooling/indexers/overview.mdx b/tooling/indexers/overview.mdx index 73ed31aa5..587d155cd 100644 --- a/tooling/indexers/overview.mdx +++ b/tooling/indexers/overview.mdx @@ -32,3 +32,5 @@ for querying real-time and historical data. - Industry leading SubQuery and Subgraph data indexer hosting, so you can sleep easy. - [GoldRush(powered by Covalent)](https://goldrush.dev/docs/chains/celo) - GoldRush offers the most comprehensive Blockchain Data API suite for developers, analysts, and enterprises. Whether you are building a DeFi dashboard, a wallet, a trading bot, an AI agent or a compliance platform, the Data APIs provide fast, accurate, and developer-friendly access to the essential on-chain data you need. +- [Indexing Co](https://indexing.co) + - Indexing Co provides custom data pipelines for Celo and 100+ other blockchains, with JavaScript transformation logic, sub-second latency, and delivery to Postgres, webhooks, or Kafka. diff --git a/tooling/libraries-sdks/celo-sdks.mdx b/tooling/libraries-sdks/celo-sdks.mdx index 2ba4be6be..f603d0031 100644 --- a/tooling/libraries-sdks/celo-sdks.mdx +++ b/tooling/libraries-sdks/celo-sdks.mdx @@ -21,3 +21,4 @@ Because Celo is compatible with Ethereum any ethereum package can be used with C - [Reown](/tooling/libraries-sdks/reown) - [Portal](/tooling/libraries-sdks/portal) +- [JAW](/tooling/libraries-sdks/jaw) diff --git a/tooling/libraries-sdks/jaw/index.mdx b/tooling/libraries-sdks/jaw/index.mdx new file mode 100644 index 000000000..de7cbe938 --- /dev/null +++ b/tooling/libraries-sdks/jaw/index.mdx @@ -0,0 +1,357 @@ +--- +title: Build with JAW +og:description: Smart account infrastructure for Celo with passkey authentication, ENS identity, gasless transactions, and programmable permissions. +sidebarTitle: "JAW" +--- + +[JAW](https://jaw.id/) provides smart account infrastructure for Celo applications. Give users passkey-secured accounts with ENS identity, sponsor their gas, and enable programmable permissions for subscriptions and delegated agent execution. + +## Key Features + +- **Passkey authentication**: phishing-resistant, synced across devices via iCloud/Google (works as transport layer) +- **ERC-4337 smart accounts**: gasless, batchable, and programmable +- **EIP-1193 compatible**: drop-in replacement for MetaMask or any injected wallet +- **Delegated permissions**: let contracts or agents perform scoped actions (ERC-7715) +- **ENS subname issuance**: assign human-readable identities on onboarding +- **Headless/server-side support**: AI agent wallets or backend-triggered transactions + +## Getting Started + +Get an API key from the [JAW Dashboard](https://dashboard.jaw.id) and add your domain to the allowed list. Use `localhost` for local development, your production domain for production. + +**`@jaw.id/wagmi`**: React connector with wagmi hooks. Use this for React and Next.js apps. +**`@jaw.id/core`**: Framework-agnostic EIP-1193 provider. Use this for vanilla JS, server-side, or headless environments. + +### @jaw.id/wagmi (React) + +**Installation** + +```bash +npm install @jaw.id/wagmi wagmi @tanstack/react-query +``` + +**Configure** + +Create your wagmi config with the JAW connector, then wrap your app with `WagmiProvider` and `QueryClientProvider`. Both are required. + +```typescript +// config.ts +import { createConfig, http } from 'wagmi'; +import { celo } from 'wagmi/chains'; +import { jaw } from '@jaw.id/wagmi'; + +export const config = createConfig({ + chains: [celo], + connectors: [ + jaw({ + apiKey: process.env.NEXT_PUBLIC_JAW_API_KEY!, + appName: 'My Celo App', + defaultChainId: celo.id, // 42220 + }), + ], + transports: { + [celo.id]: http(), + }, +}); +``` + +```tsx +// App.tsx +import { WagmiProvider } from 'wagmi'; +import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; +import { config } from './config'; + +const queryClient = new QueryClient(); + +export function App({ children }: { children: React.ReactNode }) { + return ( + + + {children} + + + ); +} +``` + +For testnet (Celo Sepolia), enable `showTestnets` in the connector: + +```typescript +jaw({ + apiKey: process.env.NEXT_PUBLIC_JAW_API_KEY!, + defaultChainId: 11142220, // Celo Sepolia Testnet + preference: { showTestnets: true }, +}) +``` + +**Connect a Wallet** + +Use `useConnect` from `@jaw.id/wagmi` (not from `wagmi`) to support JAW-specific capabilities like SIWE and subname issuance during connection. + +```tsx +import { useConnect } from '@jaw.id/wagmi'; +import { useAccount } from 'wagmi'; + +export function ConnectButton() { + const { connect, connectors } = useConnect(); + const { address, isConnected } = useAccount(); + + if (isConnected) return

Connected: {address}

; + + return ( + + ); +} +``` + +In CrossPlatform mode, clicking the button opens a `keys.jaw.id` popup where the user registers or authenticates with their passkey. In AppSpecific mode, the `uiHandler` renders the UI inside your app instead. + +**Send a Transaction** + +```tsx +import { useSendCalls } from 'wagmi'; +import { parseEther } from 'viem'; + +export function SendCelo() { + const { sendCalls } = useSendCalls(); + + return ( + + ); +} +``` + +**Enable Gasless Transactions** + +Add a paymaster to your config to sponsor gas fees so users never need to hold CELO. JAW requires an ERC-7677 compatible paymaster using EntryPoint v0.8. + +```typescript +// config.ts +import { createConfig, http } from 'wagmi'; +import { celo } from 'wagmi/chains'; +import { jaw } from '@jaw.id/wagmi'; + +export const config = createConfig({ + chains: [celo], + connectors: [ + jaw({ + apiKey: process.env.NEXT_PUBLIC_JAW_API_KEY!, + appName: 'My Celo App', + defaultChainId: celo.id, + paymasters: { + [celo.id]: { url: 'https://your-paymaster-url/rpc' }, + }, + }), + ], + transports: { + [celo.id]: http(), + }, +}); +``` + +Once configured, transactions via `useSendCalls` and `useWriteContract` are automatically sponsored. No changes to your transaction code needed. + +**Delegated Permissions** + +Permissions (ERC-7715) let you grant a spender (a backend wallet, contract, or AI agent) the ability to perform scoped actions on behalf of the user. Permissions define exactly which contracts can be called, how much can be spent, and for how long. Use them for subscription payments, recurring charges, and autonomous agent wallets. + +```tsx +import { useGrantPermissions } from '@jaw.id/wagmi'; +import { parseUnits } from 'viem'; + +const CELO_NATIVE = '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE'; + +function GrantPermission() { + const { mutate: grant, isPending } = useGrantPermissions(); + + return ( + + ); +} +``` + +Use `usePermissions` to query active permissions and `useRevokePermissions` to revoke them, both from `@jaw.id/wagmi`. + +### @jaw.id/core (Framework-agnostic) + +**Installation** + +```bash +npm install @jaw.id/core +``` + +**Configure** + +Initialize once in a dedicated file and import the instance wherever needed. No provider wrapping required. + +```typescript +// jaw.ts +import { JAW } from '@jaw.id/core'; + +export const provider = JAW.create({ + apiKey: process.env.JAW_API_KEY!, // set in your .env file + appName: 'My Celo App', + defaultChainId: 42220, // Celo Mainnet +}); +``` + +For testnet (Celo Sepolia), enable `showTestnets`: + +```typescript +export const provider = JAW.create({ + apiKey: process.env.JAW_API_KEY!, + defaultChainId: 11142220, // Celo Sepolia Testnet + preference: { showTestnets: true }, +}); +``` + +**Connect a Wallet** + +```typescript +import { provider } from './jaw'; + +const accounts = await provider.request({ method: 'eth_requestAccounts' }); +console.log('Connected:', accounts[0]); +``` + +**Send a Transaction** + +```typescript +import { provider } from './jaw'; +import { numberToHex, parseEther } from 'viem'; + +const result = await provider.request({ + method: 'wallet_sendCalls', + params: [{ + calls: [{ + to: '0xRecipientAddress', + value: numberToHex(parseEther('0.01')), + }], + }], +}); +console.log('Call ID:', result.id); +``` + +**Enable Gasless Transactions** + +Add a paymaster to sponsor gas fees. JAW requires an ERC-7677 compatible paymaster using EntryPoint v0.8. + +```typescript +// jaw.ts +import { JAW } from '@jaw.id/core'; + +export const provider = JAW.create({ + apiKey: process.env.JAW_API_KEY!, + defaultChainId: 42220, + paymasters: { + 42220: { url: 'https://your-paymaster-url/rpc' }, + }, +}); +``` + +**Delegated Permissions** + +Permissions (ERC-7715) let you grant a spender (a backend wallet, contract, or AI agent) the ability to perform scoped actions on behalf of the user. Permissions define exactly which contracts can be called, how much can be spent, and for how long. Use them for subscription payments, recurring charges, and autonomous agent wallets. + +```typescript +import { provider } from './jaw'; +import { parseUnits } from 'viem'; + +const CELO_NATIVE = '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE'; + +const result = await provider.request({ + method: 'wallet_grantPermissions', + params: [{ + expiry: Math.floor(Date.now() / 1000) + 86400 * 30, // 30 days + spender: '0xYourAgentOrBackendWallet', + permissions: { + calls: [{ + target: '0xSomeContract', + functionSignature: 'execute(address,uint256)', + }], + spends: [{ + token: CELO_NATIVE, + allowance: parseUnits('1', 18).toString(), + unit: 'day', + }], + }, + }], +}); + +// Store result.permissionId, needed to execute delegated calls and to revoke +console.log('Permission granted:', result.permissionId); +``` + +Once a permission is granted, a server-side spender can execute calls against it using `Account.fromLocalAccount()` from `@jaw.id/core`. See [Subscription Payments](https://docs.jaw.id/guides/subscription-payments) and [Account API](https://docs.jaw.id/account) for full details. + +## Authentication Modes + +- **CrossPlatform** (default): passkey operations run on `keys.jaw.id` via a popup, giving users a portable wallet that works across any JAW-powered app. +- **AppSpecific**: passkey operations run inside your app via a `uiHandler`, giving you full UI control at the cost of wallet portability. + +See the [JAW configuration docs](https://docs.jaw.id/configuration) for setup details and UIHandler implementation. + +## Common Setup Issues + +| Symptom | Likely cause | +|---|---| +| Passkey popup doesn't open | Your domain isn't in the allowed list on the JAW Dashboard | +| Testnet chain not available | Set `preference: { showTestnets: true }` when using a testnet `defaultChainId` | +| AppSpecific mode throws on init | `uiHandler` is missing, required when using `Mode.AppSpecific` | + +## Next Steps + +- [Quickstart guide](https://docs.jaw.id/guides/quickstart): full end-to-end walkthrough +- [Account API](https://docs.jaw.id/account): headless smart accounts for agents and server-side use +- [Gas Sponsoring](https://docs.jaw.id/guides/gas-sponsoring): paymaster setup and sponsorship policies +- [Sign-In With Ethereum](https://docs.jaw.id/guides/sign-in-with-ethereum): SIWE during connection +- [Subscription Payments](https://docs.jaw.id/guides/subscription-payments): recurring charges with delegated permissions +- [Onchain Identity](https://docs.jaw.id/guides/onchain-identity): ENS subname issuance on onboarding +- [Configuration reference](https://docs.jaw.id/configuration): all config options + +## Resources + +- [JAW Documentation](https://docs.jaw.id/) +- [JAW Website](https://jaw.id/) +- [JAW Dashboard](https://dashboard.jaw.id/) +- [Source Code](https://github.com/JustaName-id/jaw-mono) +- [Example Integrations](https://github.com/JustaName-id/jaw-examples) diff --git a/tooling/wallets/index.mdx b/tooling/wallets/index.mdx index 6bbef2427..96a370d1e 100644 --- a/tooling/wallets/index.mdx +++ b/tooling/wallets/index.mdx @@ -149,3 +149,13 @@ Portal is an MPC wallet provider and web3 developer platform. You can use Portal - Platforms: [iOS](https://docs.portalhq.io/guides/ios), [Android](https://docs.portalhq.io/guides/android), [Browser](https://docs.portalhq.io/guides/web), [Flutter](https://docs.portalhq.io/resources/flutter), [API](https://docs.portalhq.io/guides/enclave-mpc-api), [React Native](https://docs.portalhq.io/guides/react-native) - Maintainers: [Portal](https://portalhq.io/) - [Documentation](https://docs.portalhq.io/) + +--- + +### [JAW](https://jaw.id/) + +JAW provides smart account infrastructure for Celo applications. Give users passkey-secured accounts with ENS identity, sponsor their gas, and enable programmable permissions for subscriptions and delegated agent execution through a TypeScript SDK. +- Homepage: [jaw.id](https://jaw.id/) +- [Docs](https://docs.jaw.id/) +- [Source Code](https://github.com/JustaName-id/jaw-mono) +- [Dashboard](https://dashboard.jaw.id/)