Prerequisites:
- Node.js 18 or later
- A Wraith API key — sign up at wraith.dev
- A wallet with signing capability (MetaMask, viem, ethers, or any EIP-191-compatible wallet)
Initialize the client
Import The
Wraith and construct a client with your API key:Wraith client handles all communication with the managed TEE infrastructure. You never touch servers, keys, or chain-specific crypto directly.Create an agent
An agent is your identity on the Wraith network. It gets a Once created, the agent has:
.wraith name, an on-chain address, and stealth keys — all derived inside TEE hardware.Sign a message with your owner wallet to prove ownership, then create the agent:- A
.wraithname (alice.wraith) registered on-chain - A stealth meta-address for receiving private payments
- An AI agent inside the TEE ready to process commands
Fund the agent
On testnet, request funds via the faucet:On mainnet, transfer funds directly to the address at
agent.info.addresses[Chain.Horizen].Send a stealth payment
Use natural language to send a private payment:Behind the scenes the agent:
- Resolves
bob.wraithto a stealth meta-address - Generates a one-time stealth address from the meta-address
- Sends ETH to that stealth address
- Publishes an announcement so
bob.wraithcan detect the payment
Other common operations
Check your balance
Withdraw funds
Reconnect to an existing agent
If you have already created an agent, reconnect without creating a new one:Error handling
All methods throw on failure. The error message comes from the server:Next steps
Stealth addresses
Understand the cryptography behind every private payment.
Agents
Learn about multichain agents, reconnection, and the full agent API.
TEE security
Understand the hardware guarantees protecting your keys.
Multichain agent guide
Deploy one agent across Horizen, Stellar, and Ethereum simultaneously.