Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Contributing

## Search review cadence

Review documentation search once per quarter. The goal is to catch terms that users already try, then either add the missing page content or add internal search keywords to the page that should answer the query.

1. Open the Mintlify dashboard analytics page and switch to human traffic.
2. Review the top 20 search queries with low click-through rate or no satisfying result.
3. For each query, decide whether the fix is:
- new or expanded documentation content,
- a `keywords` frontmatter update on an existing page,
- a navigation or frontmatter `boost` adjustment.
4. Open a docs PR with the query list, chosen fixes, and manual verification notes.

You can also pull the same data from the Mintlify CLI after logging in:

```bash
mint analytics search --from 2026-01-01
```

For automation, use the Mintlify Analytics API search export with a server-side admin API key:

```bash
curl --request GET \
--url "https://api.mintlify.com/v1/analytics/{projectId}/searches?limit=100" \
--header "Authorization: Bearer $MINTLIFY_ADMIN_API_KEY"
```

## Search metadata rules

- Put user-facing synonyms in each page's `keywords` frontmatter.
- Keep keywords specific to the page; broad terms should point to onboarding pages first.
- Use `boost` sparingly. Prefer `getting-started` and practical guides over reference pages for beginner queries.
- Stellar pages should include both protocol names and likely user terms, such as `Soroban`, `Stellar smart contract`, `friendbot`, and `testnet faucet`.
- Re-run the manual checks in `SEARCH_TESTS.md` after changing search metadata.
21 changes: 21 additions & 0 deletions SEARCH_TESTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Search Tests

Run these checks in the Mintlify hosted search modal after deployment. The expected result should appear as the first result unless the query is intentionally broad; broad queries should still place the expected page in the visible result list.

| Query | Expected top result | Why |
| ------------------------ | ----------------------------- | ---------------------------------------------------- |
| `quickstart` | `getting-started.mdx` | Common onboarding term. |
| `install sdk` | `getting-started.mdx` | First setup path should win over SDK internals. |
| `create agent` | `getting-started.mdx` | Beginner flow before detailed API reference. |
| `send private payment` | `guides/stealth-payments.mdx` | Conceptual payment explanation. |
| `send stellar payment` | `getting-started.mdx` | Onboarding should surface before Stellar primitives. |
| `stellar quickstart` | `sdk/chains/stellar.mdx` | Stellar-specific SDK primitives. |
| `soroban` | `contracts/stellar.mdx` | Stellar smart contract docs. |
| `stellar smart contract` | `contracts/stellar.mdx` | Synonym for Soroban. |
| `friendbot` | `getting-started.mdx` | User-facing synonym for testnet funding. |
| `testnet faucet` | `getting-started.mdx` | Same intent as friendbot/funding. |
| `metaaddress` | `guides/stealth-payments.mdx` | No-hyphen variant of meta-address. |
| `meta address` | `guides/stealth-payments.mdx` | Spaced variant of meta-address. |
| `unlinkable` | `guides/stealth-payments.mdx` | Plain-language synonym for stealth privacy. |
| `tee keys` | `architecture/tee.mdx` | Security/key derivation detail. |
| `api bearer token` | `api-reference/endpoints.mdx` | Authentication reference. |
50 changes: 31 additions & 19 deletions api-reference/endpoints.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
---
title: "API Endpoints"
description: "Full HTTP API reference for the managed platform"
keywords:
[
"API endpoints",
"REST API",
"authentication",
"Bearer token",
"agent create",
"agents",
"chat endpoint",
"payment endpoint",
"HTTP reference",
]
---

The TEE server exposes a REST API. The SDK's `Wraith` and `WraithAgent` classes wrap these endpoints — most developers don't call them directly.
Expand Down Expand Up @@ -48,11 +60,11 @@ Create a new agent with a `.wraith` name.

```typescript
{
id: string; // UUID
name: string; // "alice"
chain: string; // "horizen"
address: string; // agent's on-chain address
metaAddress: string; // stealth meta-address
id: string; // UUID
name: string; // "alice"
chain: string; // "horizen"
address: string; // agent's on-chain address
metaAddress: string; // stealth meta-address
}
```

Expand Down Expand Up @@ -127,16 +139,16 @@ Export the agent's private key. Requires a fresh wallet signature.

```typescript
{
signature: string; // fresh signature from owner wallet
message: string; // signed message
signature: string; // fresh signature from owner wallet
message: string; // signed message
}
```

**Response:**

```typescript
{
secret: string; // "0x..." — the agent's private key
secret: string; // "0x..." — the agent's private key
}
```

Expand Down Expand Up @@ -173,9 +185,9 @@ Send a natural language message to the AI agent.

```typescript
interface ToolCall {
name: string; // "send_payment", "scan_payments", etc.
status: string; // "success" or "error"
detail?: string; // JSON string with tool result
name: string; // "send_payment", "scan_payments", etc.
status: string; // "success" or "error"
detail?: string; // JSON string with tool result
}
```

Expand Down Expand Up @@ -221,7 +233,7 @@ Array<{
role: "user" | "agent" | "tool" | "system";
text: string;
createdAt: string;
}>
}>;
```

### Delete Conversation
Expand Down Expand Up @@ -353,13 +365,13 @@ All errors return JSON with a `message` field:
}
```

| Status Code | Meaning |
|---|---|
| 400 | Bad request (missing params, invalid signature) |
| 401 | Unauthorized (invalid API key) |
| 404 | Agent/invoice/conversation not found |
| 409 | Conflict (name already taken) |
| 500 | Server error |
| Status Code | Meaning |
| ----------- | ----------------------------------------------- |
| 400 | Bad request (missing params, invalid signature) |
| 401 | Unauthorized (invalid API key) |
| 404 | Agent/invoice/conversation not found |
| 409 | Conflict (name already taken) |
| 500 | Server error |

### Example

Expand Down
58 changes: 35 additions & 23 deletions api-reference/types.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
---
title: "TypeScript Types"
description: "Type definitions and interfaces"
keywords:
[
"TypeScript types",
"interfaces",
"AgentConfig",
"AgentInfo",
"ChatResponse",
"ToolCall",
"Payment",
"Balance",
"SDK types",
]
---

All types exported from `@wraith-protocol/sdk`.
Expand Down Expand Up @@ -221,29 +233,29 @@ type HexString = `0x${string}`;

```typescript
interface StealthKeys {
spendingKey: HexString; // 32-byte private key
viewingKey: HexString; // 32-byte private key
spendingPubKey: HexString; // 33-byte compressed public key
viewingPubKey: HexString; // 33-byte compressed public key
spendingKey: HexString; // 32-byte private key
viewingKey: HexString; // 32-byte private key
spendingPubKey: HexString; // 33-byte compressed public key
viewingPubKey: HexString; // 33-byte compressed public key
}
```

### `StealthMetaAddress`

```typescript
interface StealthMetaAddress {
spendingPubKey: HexString; // 33-byte compressed public key
viewingPubKey: HexString; // 33-byte compressed public key
spendingPubKey: HexString; // 33-byte compressed public key
viewingPubKey: HexString; // 33-byte compressed public key
}
```

### `GeneratedStealthAddress`

```typescript
interface GeneratedStealthAddress {
stealthAddress: HexString; // 20-byte EVM address
ephemeralPubKey: HexString; // 33-byte compressed public key
viewTag: number; // 0-255
stealthAddress: HexString; // 20-byte EVM address
ephemeralPubKey: HexString; // 33-byte compressed public key
viewTag: number; // 0-255
}
```

Expand All @@ -255,7 +267,7 @@ interface Announcement {
stealthAddress: HexString;
caller: HexString;
ephemeralPubKey: HexString;
metadata: HexString; // first byte is view tag
metadata: HexString; // first byte is view tag
}
```

Expand Down Expand Up @@ -288,22 +300,22 @@ import type {

```typescript
interface StealthKeys {
spendingKey: Uint8Array; // 32-byte seed
spendingScalar: bigint; // clamped scalar from SHA-512(seed)
viewingKey: Uint8Array; // 32-byte seed
viewingScalar: bigint; // clamped scalar
spendingPubKey: Uint8Array; // 32-byte ed25519 public key
viewingPubKey: Uint8Array; // 32-byte ed25519 public key
spendingKey: Uint8Array; // 32-byte seed
spendingScalar: bigint; // clamped scalar from SHA-512(seed)
viewingKey: Uint8Array; // 32-byte seed
viewingScalar: bigint; // clamped scalar
spendingPubKey: Uint8Array; // 32-byte ed25519 public key
viewingPubKey: Uint8Array; // 32-byte ed25519 public key
}
```

### `GeneratedStealthAddress`

```typescript
interface GeneratedStealthAddress {
stealthAddress: string; // Stellar G... address
ephemeralPubKey: Uint8Array; // 32-byte ed25519 public key
viewTag: number; // 0-255
stealthAddress: string; // Stellar G... address
ephemeralPubKey: Uint8Array; // 32-byte ed25519 public key
viewTag: number; // 0-255
}
```

Expand All @@ -312,10 +324,10 @@ interface GeneratedStealthAddress {
```typescript
interface Announcement {
schemeId: number;
stealthAddress: string; // G... address
caller: string; // G... address
ephemeralPubKey: string; // hex-encoded 32 bytes
metadata: string; // hex-encoded, first byte = view tag
stealthAddress: string; // G... address
caller: string; // G... address
ephemeralPubKey: string; // hex-encoded 32 bytes
metadata: string; // hex-encoded, first byte = view tag
}
```

Expand Down
Loading