Skip to main content
@wraith-protocol/sdk is a single npm package with three entry points. The root import gives you the agent client — a lightweight HTTP client for the managed Wraith platform. The chain-specific imports give you raw cryptographic primitives if you want to build custom stealth address integrations without the managed platform.

Installation

npm install @wraith-protocol/sdk

Entry points

The package exposes three entry points, each with a distinct purpose and audience.
Import pathPurposeAudience
@wraith-protocol/sdkAgent client — create agents, chat, manage 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

Root import — agent client

import { Wraith, Chain } from "@wraith-protocol/sdk";
This is the managed platform client. It communicates with Wraith’s hosted TEE infrastructure over HTTP. It has zero heavy dependencies — just fetch and TypeScript types. No crypto libraries, no database drivers, no native modules. Use this entry point when you want to create agents, send payments, scan for incoming transfers, and interact with the AI via natural language.

Chain imports — crypto primitives

You only need these if you are building a custom stealth address flow without the managed agent platform.
import {
  generateStealthAddress,
  deriveStealthKeys,
  scanAnnouncements,
  deriveStealthPrivateKey,
} from "@wraith-protocol/sdk/chains/evm";
Each chain module exports the same conceptual operations — derive keys, generate a stealth address, scan announcements, derive the spending key — adapted to that chain’s cryptographic scheme and address format.

The Chain enum

Always use the Chain enum when specifying chains. Never pass raw strings — the enum is the single source of truth for chain identifiers across the SDK and platform API.
import { Chain } from "@wraith-protocol/sdk";

Available values

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

Usage patterns

import { Wraith, Chain } from "@wraith-protocol/sdk";

const wraith = new Wraith({ apiKey: "wraith_live_abc123" });

const agent = await wraith.createAgent({
  name: "alice",
  chain: Chain.Horizen,
  wallet: "0xYourWallet",
  signature: "0xSignatureFromWallet",
});
Use Chain.All to create an agent that covers every supported chain in one call. You can also pass an array of specific Chain values if you want a subset.

Dependencies

PackageUsed byPurpose
@noble/curvesEVM + Stellar chain importsElliptic curve operations (secp256k1, ed25519, x25519)
@noble/hashesEVM + Stellar chain importsSHA-256, SHA-512, keccak256
viemEVM chain import + agent clientEVM address encoding and utilities
@stellar/stellar-sdkStellar chain import onlyStrKey encoding for Stellar G... addresses
@stellar/stellar-sdk is an optional peer dependency. It is only required if you import @wraith-protocol/sdk/chains/stellar. You do not need it for the root import or the EVM chain import.
To use the Stellar primitives, install the peer dependency separately:
npm install @wraith-protocol/sdk @stellar/stellar-sdk

ESM and CJS support

The package ships both ESM and CommonJS builds, plus TypeScript declarations for all three entry points.
{
  "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"
    }
  }
}
Your bundler or Node.js version will automatically select the correct format. TypeScript will resolve the correct declaration file for each entry point.

Next steps

Agent client

Full reference for the Wraith and WraithAgent classes, all methods, and the AI tools table.

EVM primitives

Low-level secp256k1 stealth address functions for Horizen, Ethereum, Polygon, Base, and other EVM chains.

Stellar primitives

Low-level ed25519 stealth address functions for Stellar.