Skip to content

API Reference

Complete API documentation for @zkprivacy/sdk.

Modules

Core

ExportDescription
PrivacyClientMain client for privacy operations
ProverZK proof generation
DEPLOYMENTSContract addresses by network

Shield (Lightweight)

ExportDescription
shieldToShield tokens to a ZK address
encryptNoteForRecipientEncrypt note data
generateDepositAddressCreate new deposit address

Utilities

ExportDescription
detectNetworkAuto-detect network
formatTokenAmountFormat for display
parseTokenAmountParse 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';

Released under the MIT License.