System Diagram
TEE Server Architecture
One NestJS server deployment with a chain connector registry. The core agent engine is chain-agnostic. Chain-specific logic lives behind a pluggable interface.Module Structure
Agent Lifecycle
Creation
Chat Orchestration
The chat method runs a multi-turn tool-calling loop:Tool Execution
Each tool call routes to the appropriate chain connector:Database Schema
agents
conversations
messages
invoices
notifications
scheduled_payments
Platform Model
Wraith operates as a managed service, similar to Privy or Turnkey.What Wraith Manages
- TEE infrastructure (Phala deployment)
- Key derivation and security
- Chain connectors and RPC endpoints
- Database and session storage
- Name registration and gas sponsorship
- Payment scanning and notifications

