Skip to main content

Overview

The Agentic Wallet SDK provides a fully-typed TypeScript client for interacting with all platform capabilities. It wraps the REST API with convenient methods and handles authentication, error normalization, and response parsing.

Installation

The SDK is available as @agentic-wallet/sdk in the monorepo.
Install in Monorepo
For external projects:

Quick Start

Basic Usage

Client Creation

Create a client instance with authentication and configuration.
Client Configuration
Parameters:
  • baseUrl: API Gateway URL (e.g., http://localhost:3000)
  • options.apiKey: API key for authentication (sent as x-api-key header)
  • options.tenantId: Optional tenant identifier (sent as x-tenant-id header)
  • options.headers: Additional custom headers
Example:

SDK Modules

The SDK client exposes the following modules:

wallet

Wallet creation, balance, tokens, signing

policy

Policy creation, evaluation, versioning

transaction

Transaction lifecycle, proofs, approvals

agent

Agent management, execution, capabilities

protocol

Protocol adapters, DeFi operations

risk

Risk controls, chaos engineering

strategy

Backtesting, paper trading

treasury

Budget allocation, rebalancing

audit

Audit events, metrics

mcp

MCP tools and invocation

Wallet Module

Manage wallet creation, balances, tokens, and signing operations.

Policy Module

Create and manage wallet policies with versioning and evaluation.

Transaction Module

Manage the complete transaction lifecycle from creation to confirmation.

Agent Module

Create and manage AI agents with capabilities and execution modes.

Protocol Module

Interact with protocol adapters for DeFi operations.

Risk Module

Manage protocol risk profiles, portfolio controls, and chaos engineering.

Strategy Module

Backtest strategies and execute paper trades.

Treasury Module

Manage agent budgets and treasury operations.
Treasury Operations

Audit Module

Query audit events and metrics.

MCP Module

Invoke MCP tools for AI agent integration.

Error Handling

The SDK normalizes errors using the stable envelope format.
Error Handling
Error codes:
  • VALIDATION_ERROR - Input validation failure
  • POLICY_VIOLATION - Policy denied the operation
  • PIPELINE_ERROR - Build/sign/send/runtime failure
  • CONFIRMATION_FAILED - Transaction confirmation failure
Failure stages:
  • validation - Input validation
  • policy - Policy evaluation
  • build - Transaction construction
  • sign - Signing operation
  • send - RPC submission
  • confirm - Transaction confirmation
  • gateway - Gateway-level error

TypeScript Types

The SDK is fully typed with interfaces from @agentic-wallet/common.
Common Types
Transaction Types:

Next Steps

CLI Integration

Use the command-line interface

MCP Tools

Integrate with MCP server

SKILLS Contract

Review agent integration contract

API Reference

Explore REST API endpoints