API Reference

March 17, 2026 ยท View on GitHub

WAIaaS exposes a REST API on http://127.0.0.1:3100. All endpoints are defined using OpenAPI 3.0 decorators and the daemon serves the full specification at runtime.

Note: This document provides an overview of authentication, endpoint categories, and error codes. For complete request/response schemas, parameter details, and examples, use the OpenAPI specification served by the daemon.

Base URL

http://127.0.0.1:3100

The daemon binds to 127.0.0.1 (localhost only) by default. Do not expose it directly to the public internet.

Authentication

WAIaaS uses three authentication methods, each scoped to a different actor:

masterAuth (System Administrator)

Header: X-Master-Password: <your-master-password>

Used for system administration: creating wallets, managing sessions, configuring policies, Admin API operations. The master password is hashed with Argon2id.

curl -X POST http://127.0.0.1:3100/v1/wallets \
  -H "Content-Type: application/json" \
  -H "X-Master-Password: my-secret-password" \
  -d '{"name": "my-wallet", "chain": "solana", "environment": "mainnet"}'

sessionAuth (AI Agent)

Header: Authorization: Bearer wai_sess_<jwt-token>

Used by AI agents and SDKs for wallet queries, transaction submission, and session-scoped operations. Session tokens are JWTs issued via POST /v1/sessions and scoped to a specific wallet.

curl http://127.0.0.1:3100/v1/wallet/balance \
  -H "Authorization: Bearer wai_sess_eyJhbGciOiJIUzI1NiJ9..."

ownerAuth (Fund Owner)

Headers: X-Owner-Signature: <signature> + X-Owner-Message: <message>

Used by the fund owner (human) for high-value transaction approval, kill switch recovery, and owner verification. Supports SIWS (Sign-In with Solana) and SIWE (Sign-In with Ethereum) signature schemes.

curl -X POST http://127.0.0.1:3100/v1/transactions/<tx-id>/approve \
  -H "X-Owner-Signature: <ed25519-or-secp256k1-signature>" \
  -H "X-Owner-Message: <signed-message>"

OpenAPI Specification

The daemon serves a complete OpenAPI 3.0 JSON specification at runtime:

EndpointDescription
GET /docOpenAPI 3.0 JSON spec
GET /referenceScalar API reference UI
# Download the spec
curl http://127.0.0.1:3100/doc -o openapi.json

# View interactive documentation
open http://127.0.0.1:3100/reference

The spec includes all request/response schemas, parameter definitions, and example payloads. All route definitions use @hono/zod-openapi decorators, which means the OpenAPI spec is always in sync with the actual implementation.

Endpoint Summary

System (Public)

MethodPathAuthDescription
GET/healthNoneHealth check (version, uptime, schema version)
GET/docNoneOpenAPI 3.0 JSON specification
GET/referenceNoneScalar API reference UI
GET/v1/nonceNoneGet ownerAuth nonce for signature construction
GET/v1/skills/{name}NoneGet API skill file content

Wallets (masterAuth)

MethodPathAuthDescription
POST/v1/walletsmasterAuthCreate a new wallet
GET/v1/walletsmasterAuthList all wallets
GET/v1/wallets/{id}masterAuthGet wallet details (incl. ownerState)
PUT/v1/wallets/{id}masterAuthUpdate wallet name
DELETE/v1/wallets/{id}masterAuthTerminate wallet (cascading cleanup)
PUT/v1/wallets/{id}/ownermasterAuthSet/change owner address
POST/v1/wallets/{id}/owner/verifyownerAuthVerify owner (GRACE -> LOCKED)
PUT/v1/wallets/{id}/default-networkmasterAuthUpdate wallet default network
GET/v1/wallets/{id}/networksmasterAuthList available networks
POST/v1/wallets/{id}/withdrawownerAuthWithdraw all assets to owner address

Wallet (sessionAuth -- Session-Scoped)

MethodPathAuthDescription
GET/v1/wallet/addresssessionAuthGet wallet address
GET/v1/wallet/balancesessionAuthGet wallet balance (with display currency)
GET/v1/wallet/assetssessionAuthGet all assets (native + tokens)
PUT/v1/wallet/default-networksessionAuthChange default network

Sessions (masterAuth / sessionAuth)

MethodPathAuthDescription
POST/v1/sessionsmasterAuthCreate session + JWT issuance
GET/v1/sessionsmasterAuthList active sessions
DELETE/v1/sessions/{id}masterAuthRevoke a session
PUT/v1/sessions/{id}/renewsessionAuthRenew session token (5 safety checks)

Transactions (sessionAuth / ownerAuth)

MethodPathAuthDescription
POST/v1/transactions/sendsessionAuthSend transaction (6-stage pipeline)
POST/v1/transactions/signsessionAuthSign external unsigned transaction
GET/v1/transactionssessionAuthList transactions (cursor pagination)
GET/v1/transactions/pendingsessionAuthList pending/queued transactions
GET/v1/transactions/{id}sessionAuthGet transaction details
POST/v1/transactions/{id}/approveownerAuthApprove pending transaction
POST/v1/transactions/{id}/rejectownerAuthReject pending transaction
POST/v1/transactions/{id}/cancelsessionAuthCancel delayed transaction

Transaction Types (discriminatedUnion by type field):

TypeDescription
TRANSFERNative token transfer (SOL, ETH)
TOKEN_TRANSFERSPL / ERC-20 token transfer
CONTRACT_CALLArbitrary smart contract call
APPROVEToken approval (allowance)
BATCHMultiple instructions in one transaction

Policies (masterAuth)

MethodPathAuthDescription
POST/v1/policiesmasterAuthCreate a new policy
GET/v1/policiesmasterAuthList policies (optional walletId filter)
PUT/v1/policies/{id}masterAuthUpdate a policy
DELETE/v1/policies/{id}masterAuthDelete a policy

Policy Types: SPENDING_LIMIT, WHITELIST, ALLOWED_TOKENS, CONTRACT_WHITELIST, APPROVED_SPENDERS, RATE_LIMIT, TIME_WINDOW, GAS_LIMIT, AUTOSTOP, X402_ALLOWED_DOMAINS, CUMULATIVE_SPENDING_LIMIT, DISPLAY_CURRENCY.

Tokens (masterAuth / sessionAuth)

MethodPathAuthDescription
GET/v1/tokenssessionAuthList tokens for a network
POST/v1/tokensmasterAuthAdd custom token to registry
DELETE/v1/tokensmasterAuthRemove custom token from registry

Actions (sessionAuth)

MethodPathAuthDescription
GET/v1/actions/providerssessionAuthList action providers and their actions
POST/v1/actions/{provider}/{action}sessionAuthExecute an action (DeFi protocol)

x402 Payments (sessionAuth)

MethodPathAuthDescription
POST/v1/x402/fetchsessionAuthFetch URL with x402 auto-payment

WalletConnect (masterAuth / sessionAuth)

MethodPathAuthDescription
POST/v1/wallets/{id}/wc/pairmasterAuthCreate WC pairing + QR code
GET/v1/wallets/{id}/wc/sessionmasterAuthGet WC session info
DELETE/v1/wallets/{id}/wc/sessionmasterAuthDisconnect WC session
GET/v1/wallets/{id}/wc/pair/statusmasterAuthPoll pairing progress
POST/v1/wallet/wc/pairsessionAuthCreate WC pairing (session-scoped)
GET/v1/wallet/wc/sessionsessionAuthGet WC session info (session-scoped)
DELETE/v1/wallet/wc/sessionsessionAuthDisconnect WC session (session-scoped)
GET/v1/wallet/wc/pair/statussessionAuthPoll pairing status (session-scoped)

MCP Token Provisioning (masterAuth)

MethodPathAuthDescription
POST/v1/mcp/tokensmasterAuthCreate MCP session token + config snippet

Admin (masterAuth)

MethodPathAuthDescription
GET/v1/admin/statusmasterAuthDaemon health/uptime/version
POST/v1/admin/kill-switchmasterAuthActivate kill switch
GET/v1/admin/kill-switchNoneGet kill switch state
POST/v1/admin/recovermasterAuthDeactivate kill switch (dual-auth)
POST/v1/admin/shutdownmasterAuthGraceful daemon shutdown
POST/v1/admin/rotate-secretmasterAuthRotate JWT secret
GET/v1/admin/notifications/statusmasterAuthNotification channel status
POST/v1/admin/notifications/testmasterAuthSend test notification
GET/v1/admin/notifications/logmasterAuthQuery notification logs
GET/v1/admin/settingsmasterAuthGet all runtime settings
PUT/v1/admin/settingsmasterAuthUpdate runtime settings
POST/v1/admin/settings/test-rpcmasterAuthTest RPC connectivity
GET/v1/admin/oracle-statusmasterAuthOracle cache/validation status
GET/v1/admin/api-keysmasterAuthList Action Provider API key status
PUT/v1/admin/api-keys/{provider}masterAuthSet/update API key
DELETE/v1/admin/api-keys/{provider}masterAuthDelete API key
GET/v1/admin/forex/ratesmasterAuthForex exchange rates
GET/v1/admin/telegram-usersmasterAuthList Telegram bot users
PUT/v1/admin/telegram-users/{chatId}masterAuthUpdate Telegram user role
DELETE/v1/admin/telegram-users/{chatId}masterAuthDelete Telegram user

Error Codes

All errors follow a consistent JSON format:

{
  "error": {
    "code": "WALLET_NOT_FOUND",
    "message": "Wallet 'abc-123' not found",
    "domain": "WALLET",
    "retryable": false
  }
}

Common Error Codes

CodeHTTPDomainDescription
INVALID_MASTER_PASSWORD401AUTHInvalid master password
INVALID_TOKEN401AUTHInvalid authentication token
TOKEN_EXPIRED401AUTHAuthentication token has expired
INVALID_SIGNATURE401AUTHInvalid cryptographic signature
SYSTEM_LOCKED503AUTHSystem is locked (kill switch)
WALLET_NOT_FOUND404WALLETWallet not found
WALLET_TERMINATED410WALLETWallet has been terminated
SESSION_NOT_FOUND404SESSIONSession not found
SESSION_LIMIT_EXCEEDED403SESSIONMaximum session limit exceeded
TX_NOT_FOUND404TXTransaction not found
INSUFFICIENT_BALANCE400TXInsufficient balance
CHAIN_ERROR502TXBlockchain RPC error (retryable)
SIMULATION_FAILED422TXTransaction simulation failed
POLICY_DENIED403POLICYTransaction denied by policy
POLICY_NOT_FOUND404POLICYPolicy not found
WHITELIST_DENIED403POLICYAddress not in whitelist
RATE_LIMIT_EXCEEDED429POLICYRate limit exceeded (retryable)
KILL_SWITCH_ACTIVE409SYSTEMKill switch is active
ACTION_NOT_FOUND404ACTIONAction provider/action not found
API_KEY_REQUIRED403ACTIONAPI key required for provider

The daemon defines 83 error codes across 11 domains (AUTH, SESSION, TX, POLICY, OWNER, SYSTEM, WALLET, WITHDRAW, ACTION, ADMIN, X402). For the complete list, consult the OpenAPI specification at GET /doc.

SDKs

TypeScript SDK

npm install @waiaas/sdk

Zero external dependencies. Provides typed methods for all session-scoped endpoints.

import { WAIaaSClient } from '@waiaas/sdk';

const client = new WAIaaSClient({
  baseUrl: 'http://127.0.0.1:3100',
  sessionToken: 'wai_sess_...',
});

const balance = await client.getBalance();
const tx = await client.sendToken({ to: '...', amount: '0.5' });

See: @waiaas/sdk on npm

Python SDK

pip install waiaas

Built on httpx + Pydantic v2 with async/await support.

from waiaas import WAIaaSClient

async with WAIaaSClient("http://127.0.0.1:3100", "wai_sess_...") as client:
    balance = await client.get_balance()
    tx = await client.send_token("recipient...", "0.5")

See: python-sdk/README.md

MCP (Model Context Protocol)

The MCP server exposes WAIaaS as tools for AI agents (Claude, etc.):

waiaas mcp setup  # Automatic Claude Desktop configuration

Tools: send_token, get_balance, get_address, list_transactions, get_transaction, get_nonce, plus dynamic Action Provider tools.

Resources: waiaas://wallet/balance, waiaas://wallet/address, waiaas://system/status.

See: @waiaas/mcp on npm