Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.usewraith.xyz/llms.txt

Use this file to discover all available pages before exploring further.

@wraith-protocol/sdk is a single npm package with multiple entry points. Most developers use the root import. Power users building custom stealth address integrations use the chain-specific imports.

Installation

npm install @wraith-protocol/sdk

Entry Points

ImportPurposeAudience
@wraith-protocol/sdkAgent client — create agents, chat, paymentsMost developers
@wraith-protocol/sdk/chains/evmRaw secp256k1 stealth crypto primitivesPower users building custom EVM integrations
@wraith-protocol/sdk/chains/stellarRaw ed25519 stealth crypto for StellarPower users building on Stellar
@wraith-protocol/sdk/chains/solanaRaw ed25519 stealth crypto for SolanaPower users building on Solana
@wraith-protocol/sdk/chains/ckbRaw secp256k1 stealth crypto for CKBPower users building on Nervos CKB

Root Import — Agent Client

import { Wraith, Chain } from "@wraith-protocol/sdk";
This is the managed platform client. It talks to Wraith’s hosted TEE infrastructure over HTTP. Zero heavy dependencies — just fetch and TypeScript types. No crypto libraries, no database drivers, no native modules.

Chain Imports — Crypto Primitives

// EVM chains (secp256k1)
import {
  generateStealthAddress,
  deriveStealthKeys,
  scanAnnouncements,
  deriveStealthPrivateKey,
} from "@wraith-protocol/sdk/chains/evm";

// Stellar (ed25519)
import {
  generateStealthAddress,
  deriveStealthKeys,
  scanAnnouncements,
  deriveStealthPrivateScalar,
} from "@wraith-protocol/sdk/chains/stellar";

// Solana (ed25519)
import {
  generateStealthAddress,
  deriveStealthKeys,
  scanAnnouncements,
  deriveStealthPrivateScalar,
} from "@wraith-protocol/sdk/chains/solana";

// CKB (secp256k1 + Cell model)
import {
  generateStealthAddress,
  deriveStealthKeys,
  scanStealthCells,
  deriveStealthPrivateKey,
} from "@wraith-protocol/sdk/chains/ckb";
Each chain module exports the same conceptual functions adapted to that chain’s cryptographic scheme and address format. You only need these if you’re building custom stealth address integrations without the managed agent platform.

The Chain Enum

Always use the Chain enum when specifying chains. Never pass raw strings.
import { Chain } from "@wraith-protocol/sdk";

// Single chain
const agent = await wraith.createAgent({
  name: "alice",
  chain: Chain.Horizen,
  wallet: "0x...",
  signature: "0x...",
});

// Multiple chains
const agent = await wraith.createAgent({
  name: "bob",
  chain: [Chain.Horizen, Chain.Stellar, Chain.Ethereum],
  wallet: "0x...",
  signature: "0x...",
});

// All supported chains
const agent = await wraith.createAgent({
  name: "carol",
  chain: Chain.All,
  wallet: "0x...",
  signature: "0x...",
});

Available Values

enum Chain {
  Horizen = "horizen",
  Ethereum = "ethereum",
  Polygon = "polygon",
  Base = "base",
  Stellar = "stellar",
  Solana = "solana",
  CKB = "ckb",
  All = "all",
}

Dependencies

PackageUsed ByPurpose
@noble/curvesEVM + Stellar + Solana + CKB chainsElliptic curve operations
@noble/hashesEVM + Stellar + Solana + CKB chainsSHA-256, SHA-512, keccak256, blake2b
viemEVM chains + agent clientEVM utilities, address encoding
@stellar/stellar-sdkStellar chain (optional peer dep)StrKey encoding for Stellar addresses
@solana/web3.jsSolana chain (optional peer dep)PublicKey encoding for Solana addresses
@stellar/stellar-sdk and @solana/web3.js are optional peer dependencies. They’re only needed if you import their respective chain modules. The CKB module has no additional peer dependencies — it uses raw fetch for RPC calls and @noble/hashes for blake2b.

Package Exports

The SDK uses package.json exports to expose multiple entry points from a single package:
{
  "exports": {
    ".": {
      "types": "./dist/index.d.ts",
      "import": "./dist/index.js",
      "require": "./dist/index.cjs"
    },
    "./chains/evm": {
      "types": "./dist/chains/evm/index.d.ts",
      "import": "./dist/chains/evm/index.js",
      "require": "./dist/chains/evm/index.cjs"
    },
    "./chains/stellar": {
      "types": "./dist/chains/stellar/index.d.ts",
      "import": "./dist/chains/stellar/index.js",
      "require": "./dist/chains/stellar/index.cjs"
    },
    "./chains/solana": {
      "types": "./dist/chains/solana/index.d.ts",
      "import": "./dist/chains/solana/index.js",
      "require": "./dist/chains/solana/index.cjs"
    },
    "./chains/ckb": {
      "types": "./dist/chains/ckb/index.d.ts",
      "import": "./dist/chains/ckb/index.js",
      "require": "./dist/chains/ckb/index.cjs"
    }
  }
}
Both ESM and CJS formats are supported. TypeScript declarations are included.

Next Steps