@wraith-protocol/sdk. Import only what you need — tree-shaking ensures unused types add no runtime overhead.
Chain
The Chain enum lists every supported blockchain. Pass Chain.All to indicate that an operation spans all chains the agent is deployed on.
WraithConfig
Configuration passed to the Wraith constructor.
| Field | Required | Description |
|---|---|---|
apiKey | Yes | Your Wraith platform API key (wraith_live_...). |
baseUrl | No | Override the API base URL — useful for self-hosted deployments. |
ai.provider | No | AI provider for BYOM mode. |
ai.apiKey | No | Your API key for the chosen AI provider. |
AgentConfig
Passed to wraith.createAgent().
| Field | Required | Description |
|---|---|---|
name | Yes | Agent name without the .wraith suffix. 3–32 characters, lowercase alphanumeric and hyphens. |
chain | Yes | The chain(s) to deploy the agent on. |
wallet | Yes | Owner wallet address. |
signature | Yes | EIP-191 or ed25519 signature proving wallet ownership. |
message | No | The message that was signed, used for server-side verification. |
AgentInfo
The agent’s identity, returned by create, list, and lookup operations.
| Field | Description |
|---|---|
id | UUID that uniquely identifies the agent. |
name | Short name without the .wraith suffix. |
chains | All chains the agent is deployed on. |
addresses | Map of chain to the agent’s on-chain address. |
metaAddresses | Map of chain to the agent’s stealth meta-address (used to receive private payments). |
ChatResponse
Returned by agent.chat() and POST /agent/:id/chat.
| Field | Description |
|---|---|
response | The agent’s natural language reply. |
toolCalls | The tools the agent executed, if any. |
conversationId | Pass this value in your next request to continue the conversation. |
ToolCall
Describes a single tool the agent invoked while processing a message.
| Field | Description |
|---|---|
name | Tool name — e.g., send_payment, create_invoice, scan_payments. |
status | "success" or "error". |
detail | JSON string with the tool’s result or error details. Parse with JSON.parse(detail). |
Conversation
Represents a chat session with the agent.
| Field | Description |
|---|---|
id | Unique conversation UUID. |
title | Auto-generated title based on the first message. |
createdAt | ISO 8601 creation timestamp. |
updatedAt | ISO 8601 timestamp of the most recent message. |
Message
A single message within a conversation.
| Field | Description |
|---|---|
role | Who sent the message: the user, the agent, a tool execution, or the system. |
text | The message content. For tool role messages, this is a JSON string. |
createdAt | ISO 8601 timestamp. |
Invoice
Represents a payment request created by an agent.
| Field | Description |
|---|---|
id | Unique invoice ID. |
agentName | The .wraith name of the agent that created the invoice. |
amount | Requested amount as a decimal string. |
asset | Asset symbol — e.g., ETH, ZEN, USDC. |
memo | Description or note attached to the invoice. |
status | "pending" until paid, then "paid". |
txHash | Transaction hash of the payment, or null if not yet paid. |
paymentLink | Shareable URL the payer opens to complete payment. |
createdAt | ISO 8601 creation timestamp. |
Notification
An event notification delivered to an agent.
| Field | Description |
|---|---|
id | Auto-incrementing integer ID. |
type | Event type — e.g., payment_received, invoice_paid, schedule_executed. |
title | Short event summary. |
body | Full event description including amounts and addresses. |
read | true if marked as read. |
createdAt | ISO 8601 timestamp. |
Balance
The agent’s asset holdings, returned by agent.getBalance().
| Field | Description |
|---|---|
native | Native chain asset balance as a decimal string — e.g., "1.5" for 1.5 ETH. |
tokens | Map of token symbol to balance string — e.g., { "USDC": "50.0", "ZEN": "100.0" }. |
Payment
A stealth payment detected by agent.scanPayments().
| Field | Description |
|---|---|
stealthAddress | The stealth address that received the payment. |
balance | The balance held at this stealth address. |
ephemeralPubKey | The ephemeral public key used to generate the stealth address. |
TxResult
Returned by operations that submit on-chain transactions.
| Field | Description |
|---|---|
txHash | The transaction hash. |
txLink | A block explorer URL for the transaction. |
Schedule
A recurring payment schedule.
| Field | Description |
|---|---|
id | Unique schedule ID. |
recipient | Recipient .wraith name or stealth meta-address. |
amount | Payment amount as a decimal string. |
asset | Asset symbol. |
interval | Payment frequency: daily, weekly, or monthly. |
status | active, paused, or cancelled. |
nextRun | ISO 8601 timestamp of the next scheduled execution. |

