Skip to main content

Developer Documentation

Integration guides for developers building on ZKP2P.

Target Audiences

DocumentAudienceIntegration Type
peer-cash/*.mdCash-out integrators@zkp2p/cash overview and integration guide
sdk/*.mdProtocol SDK consumers@zkp2p/sdk client, React hooks, React Native
integrate-zkp2p/integrate-redirect-onramp.mdApp developersUse Peer extension headless payment capture in web apps
offramp-integration.mdLiquidity providersManage USDC deposits for offramp; includes the rate-field glossary
post-intent-hooks.mdProtocol developersCustom fulfillment logic (Solidity)
build-your-own-extension.mdWhitelabel/extension developersCustom 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

PackagePurpose
@zkp2p/cashOpinionated, offramp-only cash-out SDK
@zkp2p/sdkMain SDK (peerExtensionSdk, OfframpClient)
Curator /providers APIsActive 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

  1. SDK changes: Verify published versions against npm and update code examples to match the current API
  2. New integration type: Follow existing document structure
  3. Deployment updates: Cross-reference protocol/deployments.md