API Reference

Complete API documentation for the Shadow Protocol SDK with examples and type definitions.

Sections

ShadowProtocolClient

The main client class for interacting with Shadow Protocol.

Constructor

new ShadowProtocolClient(config: ShadowProtocolConfig)

Creates a new Shadow Protocol client instance.

const client = new ShadowProtocolClient({
  rpcUrl: 'https://api.devnet.solana.com',
  arciumClusterPubkey: 'your-cluster-pubkey',
  wallet: yourWallet,
  commitment: 'confirmed'
});

createSealedAuction()

async createSealedAuction(params: CreateAuctionParams): Promise<CreateAuctionResult>

Creates a new sealed-bid auction with encrypted reserve price.

Parameters

interface CreateAuctionParams {
  assetMint: PublicKey;        // Token mint for auction
  duration: number;            // Duration in seconds
  minimumBid: number;          // Minimum bid in lamports
  reservePrice?: number;       // Hidden reserve price
  metadata?: AuctionMetadata;  // Optional metadata
}

Example

const auction = await client.createSealedAuction({
  assetMint: new PublicKey('So11111111111111111111111111111111111111112'),
  duration: 3600,              // 1 hour
  minimumBid: 1_000_000,       // 1 SOL
  reservePrice: 5_000_000,     // 5 SOL (encrypted)
});

console.log(`Auction created: ${auction.auctionId}`);

submitEncryptedBid()

async submitEncryptedBid(params: SubmitBidParams): Promise<SubmitBidResult>

Submits an encrypted bid to a sealed auction.

Example

const bid = await client.submitEncryptedBid({
  auctionId: '123',
  amount: 7_000_000,           // 7 SOL bid
});

console.log(`Bid submitted: ${bid.signature}`);