Skip to main content
The Wraith and WraithAgent classes are the primary interface for building with Wraith. They handle all communication with the managed TEE infrastructure.

Wraith Class

Constructor

WraithConfig

wraith.createAgent(config)

Create a new agent with a .wraith name and stealth keys.

AgentConfig

Returns a WraithAgent instance.

wraith.agent(agentId)

Connect to an existing agent by ID. Does not make a network call.

wraith.getAgentByWallet(walletAddress)

Look up an agent by its owner wallet address.

wraith.getAgentByName(name)

Look up an agent by its .wraith name.

wraith.listAgents()

List all agents associated with your API key.

WraithAgent Class

Returned by wraith.createAgent(), wraith.getAgentByWallet(), and wraith.getAgentByName(). Provides all agent operations.

agent.info

The agent’s identity information.

agent.chat(message, conversationId?)

Natural language interaction with the AI agent.
Returns a ChatResponse:

agent.getStatus()

Get the agent’s current status including balance and stats.

agent.getBalance()

Get the agent’s balance across all assets.

agent.scanPayments()

Scan for incoming stealth payments via the AI agent.

agent.exportKey(signature, message)

Export the agent’s private key. Requires a fresh wallet signature for verification.

agent.getConversations()

List all conversations with this agent.

agent.getMessages(conversationId)

Get messages from a specific conversation.

agent.deleteConversation(conversationId)

Delete a conversation and its messages.

agent.getNotifications()

Get notifications for this agent.

agent.markNotificationsRead()

Mark all notifications as read.

agent.clearNotifications()

Delete all notifications.

AI-Powered Tools

When you use agent.chat(), the AI agent has access to these tools:

Example: Invoicing

Example: Privacy Check


Authentication

Every request includes:

Error Handling

All methods throw on failure. The error message comes from the server: