Skip to main content
Use this path when your runtime is TypeScript-first and built with Mastra. Run CLI Setup and TypeScript SDK first, then add the Mastra layer. CAW does not ship a dedicated Mastra adapter. The recommended pattern is to define Mastra tools that call @cobo/agentic-wallet, then expose only the subset your agent needs.

Why Mastra fits CAW

Mastra is a good fit when you want:
  • TypeScript-native agents and workflows
  • explicit tool definitions with structured schemas
  • clean separation between planning logic and deterministic execution
That maps well to CAW’s model of scoped authorization, execution, and audit.

Step 1: Install

Step 2: Configure environment

Step 3: Define CAW-backed Mastra tools

mastra_quickstart.ts
For Mastra agents, start with one of these subsets:
  • Execution agentsubmit_pact, one execution tool, one tracking tool
  • Observer agent — balances, transaction records, audit logs
  • Planner plus executor — keep CAW submission in the executor only
Add audit-log tools on the observer side once you want agents to explain operator history. That avoids giving every agent broad wallet authority.

Design guidance

  • keep planner and executor roles separate when possible
  • keep CAW execution in a narrow subset instead of a broad wallet surface
  • track outcomes with transaction records and audit logs
  • treat pact submission as part of the runtime contract, not optional setup