Developer Documentation
Integration guides for developers building on ZKP2P.
Target Audiences
| Document | Audience | Integration Type |
|---|---|---|
peer-cash/*.md | Cash-out integrators | @zkp2p/cash overview and integration guide |
sdk/*.md | Protocol SDK consumers | @zkp2p/sdk client, React hooks, React Native |
integrate-zkp2p/integrate-redirect-onramp.md | App developers | Use Peer extension headless payment capture in web apps |
offramp-integration.md | Liquidity providers | Manage USDC deposits for offramp; includes the rate-field glossary |
post-intent-hooks.md | Protocol developers | Custom fulfillment logic (Solidity) |
build-your-own-extension.md | Whitelabel/extension developers | Custom capture extension (buyer + Seller Autopilot), provider templates, inline config |
Directory Structure
developer/
├── peer-cash/
│ ├── overview.md # @zkp2p/cash introduction and SDK boundary
│ └── guide.md # End-to-end Peer Cash integration guide
├── sdk/
│ ├── overview.md # @zkp2p/sdk overview
│ ├── client-reference.md # Client API reference
│ ├── react-hooks.md # React hooks
│ └── react-native.md # React Native SDK
├── integrate-zkp2p/
│ └── integrate-redirect-onramp.md # Peer extension headless onramp
├── offramp-integration.md # OfframpClient SDK + rate-field glossary
├── post-intent-hooks.md # IPostIntentHook Solidity
└── build-your-own-extension.md # Custom capture extension + provider templates
SDK Packages
| Package | Purpose |
|---|---|
@zkp2p/cash | Opinionated, offramp-only cash-out SDK |
@zkp2p/sdk | Main SDK (peerExtensionSdk, OfframpClient) |
Curator /providers APIs | Active web and mobile provider template definitions |
Documentation Patterns
Standard Structure
## Overview
Brief description of what this enables.
## Prerequisites
Who should use this and what they need.
## Installation
npm/yarn/pnpm/bun commands.
## Quick Start
Minimal working example.
## API Reference
Parameter tables with types and descriptions.
## Common Issues
Troubleshooting section.
Code Examples
TypeScript SDK pattern:
// 1. Import
import { SomeClient } from "@zkp2p/sdk";
// 2. Initialize
const client = new SomeClient({ walletClient, chainId });
// 3. Use
await client.someAction({ ...params });
Solidity contract pattern:
import { IInterface } from "zkp2p-v2-contracts/contracts/interfaces/IInterface.sol";
contract MyContract is IInterface {
// Implementation
}
Formatting Conventions
- Use Docusaurus admonitions:
:::info,:::note,:::warning - Parameter tables for all API methods
- BigInt notation for on-chain amounts:
10000000000n - Always document decimal precision (USDC = 6, rates = 18)
- Link to Discord for support
Common Updates
- SDK changes: Verify published versions against npm and update code examples to match the current API
- New integration type: Follow existing document structure
- Deployment updates: Cross-reference protocol/deployments.md