API Reference
Complete API documentation for @zkprivacy/sdk.
Modules
Core
| Export | Description |
|---|---|
PrivacyClient | Main client for privacy operations |
Prover | ZK proof generation |
DEPLOYMENTS | Contract addresses by network |
Shield (Lightweight)
| Export | Description |
|---|---|
shieldTo | Shield tokens to a ZK address |
encryptNoteForRecipient | Encrypt note data |
generateDepositAddress | Create new deposit address |
Utilities
| Export | Description |
|---|---|
detectNetwork | Auto-detect network |
formatTokenAmount | Format for display |
parseTokenAmount | Parse user input |
Quick Import Guide
typescript
// Full SDK
import {
PrivacyClient,
createProver,
setGlobalProver,
DEPLOYMENTS,
detectNetwork,
} from '@zkprivacy/sdk';
// Shield only (smaller bundle)
import {
shieldTo,
encryptNoteForRecipient,
} from '@zkprivacy/sdk/shield';
// Types
import type {
PrivacyClientConfig,
ConnectOptions,
TransferRequest,
UnshieldRequest,
TrackedNote,
} from '@zkprivacy/sdk';Re-exports from @zkprivacy/core
The SDK re-exports all primitives from @zkprivacy/core:
typescript
import {
// Hashing
poseidonHash,
// Address encoding
encodeAddress,
decodeAddress,
// Keys
deriveKeysFromSpendingKey,
// Constants
TREE_DEPTH,
TREE_ARITY,
} from '@zkprivacy/sdk';