@waiaas/shared 2.10.0-rc.24 → 2.10.0-rc.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +228 -0
  3. package/package.json +5 -6
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 WAIaaS Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,228 @@
1
+ # WAIaaS
2
+
3
+ **Wallet-as-a-Service for AI Agents**
4
+
5
+ [![npm downloads](https://img.shields.io/npm/dt/@waiaas/core)](https://www.npmjs.com/package/@waiaas/core)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
7
+ [![Node.js](https://img.shields.io/badge/Node.js-22_LTS-green.svg)](https://nodejs.org/)
8
+ [![Tests](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/minhoyoo-iotrust/<GIST_ID>/raw/waiaas-test-badge.json)](#)
9
+
10
+ A self-hosted wallet daemon that lets AI agents perform on-chain transactions securely -- while the owner keeps full control of funds.
11
+
12
+ ## The Problem
13
+
14
+ AI agents that need to transact on-chain face an impossible choice: hold private keys (and risk total loss if compromised) or depend on a centralized custodian (single point of failure, trust dependency).
15
+
16
+ WAIaaS bridges the gap -- agents handle small transactions instantly, large amounts require owner approval, and everything runs on your machine with no third-party dependency.
17
+
18
+ ## How It Works
19
+
20
+ WAIaaS is a local daemon that sits between your AI agent and the blockchain:
21
+
22
+ - **3-tier authentication** -- Separate roles for the daemon operator (masterAuth), fund owner (ownerAuth), and AI agent (sessionAuth)
23
+ - **4-tier policy engine** -- Transactions are auto-classified by USD value into INSTANT / NOTIFY / DELAY / APPROVAL tiers
24
+ - **12 policy types** -- Cumulative spend limits, token allowlists, contract whitelists, approved spenders, and more
25
+ - **Defense in depth** -- Kill Switch, AutoStop engine, audit logging, 4-channel notifications
26
+
27
+ See [Security Model](docs/security-model.md) for full details.
28
+
29
+ ## Architecture
30
+
31
+ ```mermaid
32
+ graph LR
33
+ subgraph Interfaces
34
+ SDK["TypeScript SDK"]
35
+ MCP["MCP Server"]
36
+ CLI["CLI"]
37
+ Admin["Admin UI"]
38
+ Skills["Skill Files"]
39
+ WalletSDK["Wallet SDK"]
40
+ end
41
+
42
+ subgraph Daemon
43
+ API["API Layer<br>(Hono + Middleware)"]
44
+ Services["Service Layer<br>(Policy, Notifications, Kill Switch)"]
45
+ Pipeline["Transaction Pipeline<br>(6-stage + 8-state)"]
46
+ Infra["Infrastructure<br>(SQLite, Keystore, Config)"]
47
+ end
48
+
49
+ subgraph Blockchain
50
+ Solana["Solana"]
51
+ EVM["EVM Chains"]
52
+ end
53
+
54
+ SDK & MCP & CLI & Admin & Skills & WalletSDK --> API
55
+ API --> Services --> Pipeline --> Infra
56
+ Infra --> Solana & EVM
57
+ ```
58
+
59
+ **12 packages** in a monorepo:
60
+
61
+ - **@waiaas/core** — Shared types, Zod schemas, enums, and interfaces
62
+ - **@waiaas/daemon** — Self-hosted wallet daemon (Hono HTTP server)
63
+ - **@waiaas/adapter-solana** — Solana chain adapter (SPL / Token-2022)
64
+ - **@waiaas/adapter-evm** — EVM chain adapter (ERC-20 via viem)
65
+ - **@waiaas/actions** — DeFi Action Providers (Jupiter, 0x, LI.FI, Lido, Jito)
66
+ - **@waiaas/sdk** — TypeScript client library
67
+ - **@waiaas/mcp** — Model Context Protocol server for AI agents
68
+ - **@waiaas/cli** — Command-line interface
69
+ - **@waiaas/admin** — Preact-based Admin Web UI
70
+ - **@waiaas/wallet-sdk** — Wallet Signing SDK for wallet app integration
71
+ - **@waiaas/push-relay** — Push Relay Server (ntfy → push services)
72
+ - **@waiaas/skills** — Pre-built `.skill.md` instruction files for AI agents
73
+
74
+ See [Architecture](docs/architecture.md) for the full technical deep-dive.
75
+
76
+ ## Quick Start
77
+
78
+ ```bash
79
+ npm install -g @waiaas/cli
80
+ waiaas init # Create data directory + config.toml
81
+ waiaas start # Start daemon (sets master password on first run)
82
+ waiaas quickset --mode mainnet # Create wallets + MCP sessions in one step
83
+ ```
84
+
85
+ The `quickset` command does everything you need to get started:
86
+
87
+ 1. Creates **Solana Mainnet + EVM Ethereum Mainnet** wallets automatically
88
+ 2. Issues **MCP session tokens** for each wallet
89
+ 3. Outputs a **Claude Desktop MCP config** snippet -- just copy and paste
90
+
91
+ > We recommend configuring spending limits and registering an owner wallet for high-value transaction approval. For testing, use `waiaas quickset --mode testnet` to create Solana Devnet + EVM Sepolia wallets instead.
92
+
93
+ ### Admin UI
94
+
95
+ After starting the daemon, manage everything from the admin panel at `http://127.0.0.1:3100/admin` (masterAuth required).
96
+
97
+ ## Connect Your AI Agent
98
+
99
+ After quickset, choose one of two integration paths:
100
+
101
+ ### Path A: MCP (Claude Desktop / Claude Code)
102
+
103
+ For AI agents that support the [Model Context Protocol](https://modelcontextprotocol.io):
104
+
105
+ ```bash
106
+ # quickset already printed the MCP config JSON -- paste it into
107
+ # ~/Library/Application Support/Claude/claude_desktop_config.json
108
+ # Or auto-register with all wallets:
109
+ waiaas mcp setup --all
110
+ ```
111
+
112
+ The daemon runs as an MCP server. Your agent calls wallet tools directly -- send tokens, check balances, manage policies -- all through the MCP protocol.
113
+
114
+ ### Path B: Skill Files (Any AI Agent)
115
+
116
+ For agents that don't support MCP, or when you prefer REST API integration:
117
+
118
+ ```bash
119
+ npx @waiaas/skills add all
120
+ ```
121
+
122
+ This adds `.skill.md` instruction files to your project. Include them in your agent's context and it learns the WAIaaS API automatically. Available skills: `setup`, `quickstart`, `wallet`, `transactions`, `policies`, `admin`, `actions`, `x402`.
123
+
124
+ ### Agent Self-Setup (Auto-Provision)
125
+
126
+ AI agents can set up WAIaaS fully autonomously with no human interaction:
127
+
128
+ ```bash
129
+ npm install -g @waiaas/cli
130
+ waiaas init --auto-provision # Generates random master password → recovery.key
131
+ waiaas start # No password prompt
132
+ waiaas quickset # Creates wallets + sessions automatically
133
+ waiaas set-master # (Later) Harden password, then delete recovery.key
134
+ ```
135
+
136
+ The `--auto-provision` flag generates a cryptographically random master password and saves it to `~/.waiaas/recovery.key`. All subsequent CLI commands read it automatically. See the [Agent Self-Setup Guide](docs/guides/agent-self-setup.md) for the complete flow.
137
+
138
+ For manual setup with human-guided password entry, install skills and follow `waiaas-setup/SKILL.md`:
139
+
140
+ ```bash
141
+ npx @waiaas/skills add all
142
+ ```
143
+
144
+ ## Alternative: Docker
145
+
146
+ ```bash
147
+ git clone https://github.com/minho-yoo/waiaas.git && cd waiaas
148
+ docker compose up -d
149
+ ```
150
+
151
+ The daemon listens on `http://127.0.0.1:3100`.
152
+
153
+ ## Using the SDK
154
+
155
+ ```typescript
156
+ import { WAIaaSClient } from '@waiaas/sdk';
157
+
158
+ const client = new WAIaaSClient({
159
+ baseUrl: 'http://127.0.0.1:3100',
160
+ sessionToken: process.env.WAIAAS_SESSION_TOKEN,
161
+ });
162
+
163
+ const balance = await client.getBalance();
164
+ console.log(`Balance: ${balance.balance} ${balance.symbol}`);
165
+
166
+ const tx = await client.sendToken({
167
+ to: 'recipient-address...',
168
+ amount: '0.1',
169
+ });
170
+ console.log(`Transaction: ${tx.id}`);
171
+ ```
172
+
173
+ ## Admin UI
174
+
175
+ Access the admin panel at `http://127.0.0.1:3100/admin` with your master password:
176
+
177
+ - **Dashboard** -- System overview, wallet balances, recent transactions
178
+ - **Wallets** -- Create, manage, and monitor wallets across chains; RPC endpoints, balance monitoring, and WalletConnect settings
179
+ - **Sessions** -- Issue and revoke agent session tokens; session lifetime and rate limit settings
180
+ - **Policies** -- Configure 12 policy types with visual form editors; default deny and tier settings
181
+ - **Notifications** -- Channel status and delivery logs; Telegram, Discord, ntfy, and Slack settings
182
+ - **Security** -- Kill Switch emergency controls, AutoStop protection rules, JWT rotation
183
+ - **System** -- API keys, display currency, price oracle, rate limits, log level, and daemon shutdown
184
+
185
+ Features include settings search (Ctrl+K / Cmd+K) and unsaved changes protection.
186
+
187
+ Enabled by default (`admin_ui = true` in config.toml).
188
+
189
+ ## Supported Networks
190
+
191
+ | Chain | Environment | Networks |
192
+ |-------|-------------|----------|
193
+ | Solana | mainnet | mainnet |
194
+ | Solana | testnet | devnet, testnet |
195
+ | EVM | mainnet | ethereum-mainnet, polygon-mainnet, arbitrum-mainnet, optimism-mainnet, base-mainnet |
196
+ | EVM | testnet | ethereum-sepolia, polygon-amoy, arbitrum-sepolia, optimism-sepolia, base-sepolia |
197
+
198
+ 13 networks total (Solana 3 + EVM 10).
199
+
200
+ ## Features
201
+
202
+ - **Self-hosted local daemon** -- No central server; keys never leave your machine
203
+ - **Multi-chain** -- Solana (SPL / Token-2022) and EVM (ERC-20) via `IChainAdapter`
204
+ - **Token, contract, and DeFi** -- Native transfers, token transfers, contract calls, approve, batch transactions, Action Provider plugins (Jupiter Swap, etc.)
205
+ - **USD policy evaluation** -- Price oracles (CoinGecko / Pyth / Chainlink) evaluate all transactions in USD
206
+ - **x402 payments** -- Automatic HTTP 402 payment handling with EIP-3009 signatures
207
+ - **Multiple interfaces** -- REST API, TypeScript SDK, Python SDK, MCP server, CLI, Admin Web UI, Tauri Desktop, Telegram Bot
208
+ - **Skill files** -- Pre-built instruction files that teach AI agents how to use the API
209
+
210
+ ## Documentation
211
+
212
+ | Document | Description |
213
+ |----------|-------------|
214
+ | [Architecture](docs/architecture.md) | System overview, package structure, pipeline, chain adapters |
215
+ | [Security Model](docs/security-model.md) | Authentication, policy engine, Kill Switch, AutoStop |
216
+ | [Deployment Guide](docs/deployment.md) | Docker, npm, configuration reference |
217
+ | [API Reference](docs/api-reference.md) | REST API endpoints and authentication |
218
+ | [Agent Self-Setup Guide](docs/guides/agent-self-setup.md) | Fully autonomous setup with auto-provision |
219
+ | [Agent Skills Integration](docs/guides/agent-skills-integration.md) | Universal guide for 27+ AI agent platforms |
220
+ | [Claude Code Integration](docs/guides/claude-code-integration.md) | Skill files + MCP server setup for Claude Code |
221
+ | [OpenClaw Integration](docs/guides/openclaw-integration.md) | Quick setup for OpenClaw bot |
222
+ | [Wallet SDK Integration](docs/wallet-sdk-integration.md) | Integration guide for wallet developers |
223
+ | [Why WAIaaS?](docs/why-waiaas/) | Background on AI agent wallet security |
224
+ | [Contributing](CONTRIBUTING.md) | Development setup, code style, testing, PR guidelines |
225
+
226
+ ## License
227
+
228
+ [MIT](LICENSE) -- Copyright (c) 2026 WAIaaS Contributors
package/package.json CHANGED
@@ -1,9 +1,8 @@
1
1
  {
2
2
  "name": "@waiaas/shared",
3
- "version": "2.10.0-rc.24",
3
+ "version": "2.10.0-rc.27",
4
4
  "description": "WAIaaS shared constants — pure TypeScript, no native dependencies",
5
5
  "license": "MIT",
6
-
7
6
  "type": "module",
8
7
  "repository": {
9
8
  "type": "git",
@@ -21,6 +20,9 @@
21
20
  "files": [
22
21
  "dist"
23
22
  ],
23
+ "devDependencies": {
24
+ "typescript": "^5.7.0"
25
+ },
24
26
  "scripts": {
25
27
  "build": "tsc -p tsconfig.build.json",
26
28
  "test": "echo 'no tests yet'",
@@ -32,8 +34,5 @@
32
34
  "lint": "echo 'no lint yet'",
33
35
  "typecheck": "tsc --noEmit",
34
36
  "clean": "rm -rf dist"
35
- },
36
- "devDependencies": {
37
- "typescript": "^5.7.0"
38
37
  }
39
- }
38
+ }