agentwallet-sdk 4.0.3 → 4.0.5

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 (2) hide show
  1. package/README.md +118 -25
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,12 +1,15 @@
1
1
  # agentwallet-sdk
2
2
 
3
- Non-custodial agent wallet SDK. Your agent holds its own keys - no custodian, no KYC, no freeze risk.
3
+ **The only non-custodial agent wallet SDK. Unlike Coinbase Agentic Wallets your keys, your agent.**
4
+
5
+ Non-custodial agent wallet SDK. Your agent holds its own keys — no custodian, no KYC, no freeze risk.
4
6
 
5
7
  [![npm](https://img.shields.io/npm/v/agentwallet-sdk?style=flat-square)](https://www.npmjs.com/package/agentwallet-sdk)
6
8
  [![Discord](https://img.shields.io/discord/1475549260140253194?label=Community&logo=discord&color=5865F2)](https://discord.gg/958AACqf7Y)
7
9
  ![x402](https://img.shields.io/badge/x402-native-green?style=flat-square)
8
10
  ![CCTP V2](https://img.shields.io/badge/CCTP_V2-17_chains-red?style=flat-square)
9
- ![Tests](https://img.shields.io/badge/tests-376_passing-brightgreen?style=flat-square)
11
+ ![Tests](https://img.shields.io/badge/tests-629_passing-brightgreen?style=flat-square)
12
+ ![Swap Fee](https://img.shields.io/badge/swap_fee-0.77%25-blue?style=flat-square)
10
13
 
11
14
  ```bash
12
15
  npm i agentwallet-sdk
@@ -14,56 +17,126 @@ npm i agentwallet-sdk
14
17
 
15
18
  ---
16
19
 
17
- ## Why agent-wallet-sdk?
20
+ ## Why agentwallet-sdk?
18
21
 
19
22
  Most agent wallet solutions compromise on the thing that matters most: who controls the keys.
20
23
 
21
- | | agent-wallet-sdk | Coinbase Agentic Wallets | MoonPay Agents |
24
+ | | agentwallet-sdk | Coinbase Agentic Wallets | MoonPay Agents |
22
25
  |---|---|---|---|
23
26
  | **Key custody** | Agent holds own keys | Coinbase TEE (custodial) | MoonPay managed |
24
- | **Freeze risk** | None - on-chain only | Yes - platform can freeze | Yes - KYC-gated |
27
+ | **Freeze risk** | None on-chain only | Yes platform can freeze | Yes KYC-gated |
25
28
  | **Cross-chain** | 17 chains via CCTP V2 | Base only | Limited |
29
+ | **Swap fee** | **0.77%** | 0.875% | N/A |
26
30
  | **x402 support** | Native (v2.0.1+) | No public x402 client | No |
27
31
  | **Spend limits** | On-chain, enforced by contract | Platform-enforced | Platform-enforced |
32
+ | **Agent identity** | DID + Verifiable Credentials | No | No |
33
+ | **Agent staking** | AAVE USDC yield pool | No | No |
28
34
  | **KYC required** | No | No | Yes |
29
35
  | **MCP compatible** | Yes | No | No |
30
36
 
31
- ### Coinbase Agentic Wallets - what "TEE-custodial" means
37
+ ### 0.77% swap fee 12% cheaper than MetaMask and Coinbase Wallet
38
+
39
+ Both MetaMask and Coinbase Wallet charge **0.875%** on every swap. We charge **0.77%** — the lowest fee from any major wallet SDK. Built for agents that execute hundreds of swaps autonomously. Every basis point compounds.
32
40
 
33
- Coinbase stores private keys in Trusted Execution Environments on their infrastructure. The keys are not yours. If Coinbase freezes your account, halts the service, or gets a court order, your agent stops working. The TEE makes the custody tamper-resistant to Coinbase employees - but it does not make it non-custodial. You are still trusting Coinbase.
41
+ ```typescript
42
+ import { SwapModule } from 'agentwallet-sdk/swap';
34
43
 
35
- ### MoonPay Agents - the CLI-bound, KYC wall
44
+ const swap = new SwapModule(publicClient, walletClient, accountAddress);
36
45
 
37
- MoonPay requires identity verification before an agent can transact. That kills the autonomous agent use case - you can't run an agent at 2 AM that needs to pay an API if the payment rails need KYC approval first. MoonPay also does not expose an x402 interface, so agents using MoonPay can't participate in the emerging x402 payment ecosystem.
46
+ // 0.77% fee cheaper than MetaMask, cheaper than Coinbase Wallet
47
+ const result = await swap.executeSwap(USDC_ADDRESS, WETH_ADDRESS, 1000_000000n);
48
+ ```
38
49
 
39
- ### agent-wallet-sdk - true non-custody
50
+ ### True non-custody
40
51
 
41
- The wallet is an ERC-6551 token-bound account on-chain. The agent's private key lives in the agent's environment, controlled by whoever runs the agent. Nobody else has it. Spend limits are enforced by the smart contract - not by a platform policy that can change overnight.
52
+ The wallet is an ERC-6551 token-bound account on-chain. The agent's private key lives in the agent's environment, controlled by whoever runs the agent. Nobody else has it. Spend limits are enforced by the smart contract not by a platform policy that can change overnight.
42
53
 
43
54
  ```typescript
44
55
  import { createWallet, createX402Fetch, NATIVE_TOKEN } from 'agentwallet-sdk';
45
56
 
46
- // Agent holds its own key
47
57
  const wallet = createWallet({ accountAddress: '0x...', chain: 'base', walletClient });
48
58
 
49
59
  // x402 payments: agent pays APIs automatically, no human needed
50
60
  const fetch = createX402Fetch(wallet, { globalDailyLimit: 10_000_000n });
51
61
  const data = await fetch('https://api.example.com/premium');
52
62
  // Server returned 402? Payment handled. Original request retried. Human not consulted.
63
+ ```
64
+
65
+ ### Agent identity — permanent DID + Verifiable Credentials
53
66
 
54
- // Spend limits are on-chain - agent can't exceed them even under prompt injection
67
+ Every agent gets a permanent, self-sovereign decentralized identity derived directly from its wallet key. No external registry. No KYC. Just cryptographic proof that this agent is who it claims to be.
68
+
69
+ ```typescript
70
+ import { deriveAgentDID, issueCredential, verifyCredential } from 'agentwallet-sdk/identity';
71
+
72
+ // Permanent DID — same key always produces the same DID
73
+ const did = deriveAgentDID(privateKey);
74
+ // → "did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK"
75
+
76
+ // Issue a signed Verifiable Credential
77
+ const vc = issueCredential(did, privateKey, {
78
+ agentName: 'TradingAgent-01',
79
+ capabilities: ['swap', 'bridge', 'pay'],
80
+ owner: '0xff86...',
81
+ });
82
+
83
+ // Any counterparty can verify without phoning home
84
+ console.log(verifyCredential(vc)); // true
85
+ ```
86
+
87
+ ### Agent staking — earn yield on idle USDC
88
+
89
+ Agents can deposit USDC into an AAVE V3-backed staking pool and earn yield on earnings instead of holding cash in a wallet. **Agent participants only** — verified by DID at deposit time. No human participants.
90
+
91
+ ```typescript
92
+ import { AgentStakingPool } from 'agentwallet-sdk/staking';
93
+
94
+ const pool = new AgentStakingPool();
95
+
96
+ // Deposit TaskBridge earnings — starts earning yield immediately
97
+ await pool.deposit({
98
+ agentDID: did,
99
+ amountUsdc: 500_000000n, // 500 USDC
100
+ walletClient,
101
+ chain: 'base',
102
+ });
103
+
104
+ // Check balance (principal + yield, minus 0.5% annual management fee)
105
+ const balance = await pool.getBalance(did, 'base');
106
+ console.log(balance.currentBalanceUsdc); // growing
107
+ ```
108
+
109
+ ### Agent verification — machine-readable trust score
110
+
111
+ Before transacting with an unknown agent, request a trust bundle. Staking balance, task history, wallet age — all signed by the agent's DID. No PII. No central authority.
112
+
113
+ ```typescript
114
+ import { verifyAgent, verifyTrustBundle } from 'agentwallet-sdk/verify';
115
+
116
+ const bundle = await verifyAgent({ privateKey, chain: 'base' });
117
+ // {
118
+ // did: "did:key:z6Mk...",
119
+ // walletAddress: "0x...",
120
+ // stakingBalance: 500000000n, // 500 USDC staked
121
+ // reputationScore: 87, // 0-100
122
+ // taskBridgeTasksCompleted: 47,
123
+ // walletAgeDays: 183,
124
+ // signature: "..." // tamper-proof
125
+ // }
126
+
127
+ // Counterparty verifies before accepting payment or task
128
+ console.log(verifyTrustBundle(bundle)); // true
55
129
  ```
56
130
 
57
131
  ### Cross-chain without the ceremony
58
132
 
59
- One bridge interface across 17 chains. Coinbase Agentic Wallets are Base-only. MoonPay is not cross-chain native.
133
+ One bridge interface across 17 chains. Coinbase Agentic Wallets are Base-only.
60
134
 
61
135
  ```typescript
62
136
  import { UnifiedBridge } from 'agentwallet-sdk';
63
137
 
64
138
  const bridge = new UnifiedBridge({ evmSigner, solanaWallet });
65
139
 
66
- // Solana -> Base in one call
67
140
  await bridge.bridge({
68
141
  amount: 1_000_000n,
69
142
  sourceChain: 'solana',
@@ -103,8 +176,8 @@ const wallet = createWallet({
103
176
  // Set spend limits once (owner operation)
104
177
  await setSpendPolicy(wallet, {
105
178
  token: NATIVE_TOKEN,
106
- perTxLimit: 25_000000000000000n, // 0.025 ETH per tx
107
- periodLimit: 500_000000000000000n, // 0.5 ETH per day
179
+ perTxLimit: 25_000000000000000n, // 0.025 ETH per tx
180
+ periodLimit: 500_000000000000000n, // 0.5 ETH per day
108
181
  periodLength: 86400,
109
182
  });
110
183
 
@@ -112,14 +185,34 @@ await setSpendPolicy(wallet, {
112
185
  await agentExecute(wallet, { to: '0xSOME_SERVICE', value: 10_000000000000000n });
113
186
  ```
114
187
 
115
- ## Key Features
116
-
117
- - **Non-custodial**: Agent holds its own private key. No custodian.
118
- - **x402 native**: Drop-in fetch wrapper for automatic API payment handling
119
- - **17-chain CCTP V2**: Cross-chain USDC via Circle's bridge - EVM + Solana
120
- - **On-chain spend limits**: ERC-6551 token-bound accounts with contract-enforced policies
121
- - **MCP compatible**: Use with any MCP-based agent framework
122
- - **376 tests passing**
188
+ ## Modules
189
+
190
+ | Module | Import | What it does |
191
+ |---|---|---|
192
+ | Core | `agentwallet-sdk` | Wallet creation, spend limits, agent execution |
193
+ | x402 | `agentwallet-sdk/x402` | Automatic API payment handling (HTTP 402) |
194
+ | Bridge | `agentwallet-sdk/bridge` | CCTP V2 cross-chain USDC (17 chains) |
195
+ | Swap | `agentwallet-sdk/swap` | Uniswap V3 token swaps @ **0.77% fee** |
196
+ | Policy | `agentwallet-sdk/policy` | SpendingPolicy — allowlists, rolling caps |
197
+ | Identity | `agentwallet-sdk/identity` | Agent DID (W3C did:key) + Verifiable Credentials |
198
+ | Staking | `agentwallet-sdk/staking` | Agent-only AAVE USDC yield pool |
199
+ | Verify | `agentwallet-sdk/verify` | Trust bundle — DID + staking + reputation |
200
+
201
+ ## vs. MoonPay Agents
202
+
203
+ MoonPay entered the agent wallet space with a managed offering. Here's why builders choose `agentwallet-sdk` instead:
204
+
205
+ | | agentwallet-sdk | MoonPay Agents |
206
+ |---|---|---|
207
+ | **Open source** | ✅ MIT licensed | ❌ Closed enterprise product |
208
+ | **x402-native** | ✅ Built-in (v2.0.1+) | ❌ No x402 support |
209
+ | **Key custody** | Agent holds own keys | MoonPay managed |
210
+ | **KYC required** | ❌ None | ✅ KYC-gated |
211
+ | **Vendor lock-in** | ❌ On-chain, permissionless | ✅ Platform-dependent |
212
+ | **Cross-chain** | 17 chains via CCTP V2 | Limited |
213
+ | **DID / identity** | ✅ W3C did:key standard | ❌ No |
214
+
215
+ The difference isn't just technical. MoonPay Agents is a closed enterprise product — your agent's payment capability depends on MoonPay's platform staying available, compliant, and willing to serve you. `agentwallet-sdk` is open-source, x402-native, and permissionless. Your agent pays because it has keys, not because a vendor approved the transaction.
123
216
 
124
217
  ## Resources
125
218
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentwallet-sdk",
3
- "version": "4.0.3",
3
+ "version": "4.0.5",
4
4
  "description": "Non-custodial AI agent wallet SDK. x402 payments, 17-chain CCTP bridging, ERC-6551 identity, SpendingPolicy guardrails, agent DID, staking, trust verification. The agent holds the keys.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",