agentwallet-sdk 3.4.0 → 3.4.2
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.
- package/README.md +120 -0
- package/dist/x402/types.d.ts +1 -1
- package/dist/x402/types.d.ts.map +1 -1
- package/dist/x402/types.js +3 -1
- package/dist/x402/types.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# 🤖 Agent Wallet SDK
|
|
2
2
|
|
|
3
|
+
## The only non-custodial agent wallet SDK. You keep the keys.
|
|
4
|
+
|
|
5
|
+
> **Coinbase Agentic Wallets** store private keys in Coinbase infrastructure.
|
|
6
|
+
> **MoonPay Agents** require KYC before your agent can transact.
|
|
7
|
+
> **agentwallet-sdk**: your agent holds its own keys. Always. No custodian. No KYC. No freeze risk.
|
|
8
|
+
|
|
9
|
+

|
|
10
|
+

|
|
11
|
+

|
|
12
|
+

|
|
13
|
+

|
|
14
|
+

|
|
15
|
+

|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm i agentwallet-sdk
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
3
23
|
**Let your AI agent spend crypto. Stay in control.**
|
|
4
24
|
|
|
5
25
|
Agent Wallet gives AI agents autonomous spending power with hard on-chain limits. No more choosing between "agent can drain everything" and "every transaction needs manual approval."
|
|
@@ -190,6 +210,7 @@ for (const entry of history) {
|
|
|
190
210
|
| **Ethereum** | ✅ | High-value operations |
|
|
191
211
|
| **Arbitrum** | ✅ | DeFi agents |
|
|
192
212
|
| **Polygon** | ✅ | Micropayments |
|
|
213
|
+
| **Etherlink** | ✅ x402 | Tezos rollup, near-zero fees |
|
|
193
214
|
|
|
194
215
|
## x402 Protocol Support
|
|
195
216
|
|
|
@@ -283,6 +304,105 @@ Server verifies payment → returns 200 + data
|
|
|
283
304
|
|
|
284
305
|
Your agent's keys never leave the non-custodial wallet. All payments respect on-chain spend limits set by the wallet owner.
|
|
285
306
|
|
|
307
|
+
## Why agent-wallet-sdk?
|
|
308
|
+
|
|
309
|
+
Every major AI company launched an agent wallet in early 2026. Coinbase Agentic Wallets went live February 13. MoonPay Agents launched March 4. Stripe added x402 on February 11. The problem: every single one of them holds your agent's keys.
|
|
310
|
+
|
|
311
|
+
Here's the direct comparison:
|
|
312
|
+
|
|
313
|
+
| | Coinbase Agentic Wallets | MoonPay Agents | agent-wallet-sdk |
|
|
314
|
+
|---|---|---|---|
|
|
315
|
+
| **Key custody** | Coinbase servers | MoonPay servers | Your environment only |
|
|
316
|
+
| **Spend limits** | Session caps (off-chain API) | None | Per-tx + daily, on-chain contract |
|
|
317
|
+
| **x402 support** | Yes (Base/USDC) | No | Yes (Base/USDC, full spec) |
|
|
318
|
+
| **Cross-chain** | Base only | Limited | 5 chains via CCTP |
|
|
319
|
+
| **Freeze risk** | Yes (KYC, compliance) | Yes | None -- contract on-chain |
|
|
320
|
+
| **Audit trail** | API logs (centralized) | API logs | On-chain events, self-queryable |
|
|
321
|
+
| **Open source** | No | No | Yes (MIT) |
|
|
322
|
+
|
|
323
|
+
**The three questions that matter:**
|
|
324
|
+
|
|
325
|
+
**1. Who holds the key?** With Coinbase and MoonPay, their infrastructure holds your agent's private key. That means they can freeze it, they get hacked and your key goes with it, and they can shut down the product. agent-wallet-sdk generates keys locally and they never leave your environment.
|
|
326
|
+
|
|
327
|
+
**2. Where are spend limits enforced?** Coinbase uses session caps enforced at the API layer -- those can change. MoonPay has no per-transaction limits at all. agent-wallet-sdk enforces limits inside an EVM contract. A `perTxLimit` of 25 USDC means the contract will physically not execute a transaction over 25 USDC. No API to call, no policy to change.
|
|
328
|
+
|
|
329
|
+
**3. What happens when the platform shuts down?** Custodial wallets disappear with the platform. Your agent's wallet contract is deployed on-chain. It exists as long as the EVM exists.
|
|
330
|
+
|
|
331
|
+
```typescript
|
|
332
|
+
// Your keys stay in your environment -- not on Coinbase, not on MoonPay
|
|
333
|
+
const wallet = createWallet({
|
|
334
|
+
accountAddress: '0xYOUR_CONTRACT',
|
|
335
|
+
walletClient: createWalletClient({
|
|
336
|
+
account: privateKeyToAccount(process.env.AGENT_KEY), // never transmitted
|
|
337
|
+
transport: http('https://mainnet.base.org'),
|
|
338
|
+
}),
|
|
339
|
+
chain: 'base',
|
|
340
|
+
});
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
If you need a quick integration and you're already in the Coinbase ecosystem: their product works for demos and low-stakes use cases. But if you're building agents that handle real funds, run autonomously for weeks, or need to survive beyond a single platform's product lifecycle -- you want the keys under your own control.
|
|
344
|
+
|
|
345
|
+
---
|
|
346
|
+
|
|
347
|
+
## Why Non-Custodial Beats Exchange Wallets
|
|
348
|
+
|
|
349
|
+
OKX OnchainOS supports 60+ chains. Coinbase Agentic Wallets are backed by a trillion-dollar exchange. Both look impressive on paper. Here's the problem: **they hold your agent's keys.**
|
|
350
|
+
|
|
351
|
+
That's not a minor implementation detail. It's the entire trust model.
|
|
352
|
+
|
|
353
|
+
### What custody actually means
|
|
354
|
+
|
|
355
|
+
When you use an exchange-based agent wallet, your agent's private key lives on their servers. Every transaction your agent signs goes through their infrastructure. They can:
|
|
356
|
+
- Freeze your agent's wallet for any reason (KYC, compliance, a bad week)
|
|
357
|
+
- Be subpoenaed for your agent's transaction history
|
|
358
|
+
- Get hacked — and your agent's keys go with it
|
|
359
|
+
- Change their API, deprecate their SDK, sunset the product
|
|
360
|
+
|
|
361
|
+
This isn't theoretical. Exchange platforms shut down products, freeze accounts, and go dark. It's happened before. It'll happen again.
|
|
362
|
+
|
|
363
|
+
### The non-custodial difference
|
|
364
|
+
|
|
365
|
+
With `agentwallet-sdk`:
|
|
366
|
+
- Your agent's private key is generated locally and **never transmitted anywhere**
|
|
367
|
+
- The wallet contract lives on-chain — no server to shut down
|
|
368
|
+
- Spend limits are enforced by EVM bytecode, not an API policy
|
|
369
|
+
- You can self-host, self-audit, and self-custody everything
|
|
370
|
+
|
|
371
|
+
```typescript
|
|
372
|
+
// Your keys stay in your environment
|
|
373
|
+
const wallet = createWallet({
|
|
374
|
+
accountAddress: '0xYOUR_CONTRACT',
|
|
375
|
+
walletClient: createWalletClient({
|
|
376
|
+
account: privateKeyToAccount(process.env.AGENT_KEY), // lives here, not on OKX
|
|
377
|
+
transport: http('https://mainnet.base.org'),
|
|
378
|
+
}),
|
|
379
|
+
chain: 'base',
|
|
380
|
+
});
|
|
381
|
+
```
|
|
382
|
+
|
|
383
|
+
The spend limits (`$25/tx`, `$500/day`) are enforced by the contract itself — not by an exchange API that can change its terms. An agent running over-limit? The contract queues it. No custodian involved.
|
|
384
|
+
|
|
385
|
+
### When exchange wallets make sense
|
|
386
|
+
|
|
387
|
+
If you're building a quick demo, need zero infrastructure setup, or are already deep in the Coinbase or OKX ecosystem — their hosted products are fast to integrate. No judgment.
|
|
388
|
+
|
|
389
|
+
But if you're building production agents that handle real funds, run autonomously, or need to survive beyond a single platform's product lifecycle, you want the keys under your own control.
|
|
390
|
+
|
|
391
|
+
That's what this SDK is for.
|
|
392
|
+
|
|
393
|
+
### x402 without custody
|
|
394
|
+
|
|
395
|
+
The x402 protocol is becoming the standard for AI agent payments. Stripe validated it in February 2026. Coinbase built it into Base. Abstract launched their delegated facilitator model this week.
|
|
396
|
+
|
|
397
|
+
Every x402 implementation in `agentwallet-sdk` is non-custodial by design:
|
|
398
|
+
- Solana x402: direct signing from your local keypair
|
|
399
|
+
- Base x402: USDC transfer via your on-chain contract
|
|
400
|
+
- Abstract x402: EIP-712 delegated permit, signed locally — the facilitator executes it, but your key authorizes it
|
|
401
|
+
|
|
402
|
+
OKX OnchainOS supports x402 too — through their custody layer. Your call which model you trust.
|
|
403
|
+
|
|
404
|
+
---
|
|
405
|
+
|
|
286
406
|
## How It Works
|
|
287
407
|
|
|
288
408
|
1. **Deploy** an AgentAccountV2 (ERC-6551 token-bound account tied to an NFT)
|
package/dist/x402/types.d.ts
CHANGED
|
@@ -87,5 +87,5 @@ export interface X402ClientConfig {
|
|
|
87
87
|
/** USDC contract addresses by network */
|
|
88
88
|
export declare const USDC_ADDRESSES: Record<string, Address>;
|
|
89
89
|
/** Default supported networks */
|
|
90
|
-
export declare const DEFAULT_SUPPORTED_NETWORKS: readonly ["base:8453"];
|
|
90
|
+
export declare const DEFAULT_SUPPORTED_NETWORKS: readonly ["base:8453", "etherlink:42793"];
|
|
91
91
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/x402/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/x402/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAI1C,sDAAsD;AACtD,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,4EAA4E;AAC5E,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,iBAAiB,EAAE,MAAM,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC;AAED,8EAA8E;AAC9E,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,OAAO,EAAE,uBAAuB,EAAE,CAAC;IACnC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACtC;AAED,8DAA8D;AAC9D,MAAM,WAAW,kBAAkB;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,gBAAgB,CA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AgB,CAAC,EAAE,MAAM,CAAC;IAC1B,oEAAoE;IACpE,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,kDAAkD;IAClD,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,0DAA0D;IAC1D,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC;IAC5C,6CAA6C;IAC7C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,2DAA2D;IAC3D,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,wDAAwD;IACxD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,uDAAuD;IACvD,eAAe,CAAC,EAAE,CAAC,GAAG,EAAE,uBAAuB,EAAE,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;IAC5F,6BAA6B;IAC7B,iBAAiB,CAAC,EAAE,CAAC,GAAG,EAAE,kBAAkB,KAAK,IAAI,CAAC;CACvD;AAID,yCAAyC;AACzC,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAKzC,CAAC;AAEX,iCAAiC;AACjC,eAAO,MAAM,0BAA0B,2CAA4C,CAAC"}
|
package/dist/x402/types.js
CHANGED
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
export const USDC_ADDRESSES = {
|
|
4
4
|
'base:8453': '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913',
|
|
5
5
|
'base-sepolia:84532': '0x036CbD53842c5426634e7929541eC2318f3dCF7e',
|
|
6
|
+
// Etherlink — x402 compatible as of March 2026
|
|
7
|
+
'etherlink:42793': '0x796Ea11Fa2dD751eD01b53C372fFDB4AAa8f00F9',
|
|
6
8
|
};
|
|
7
9
|
/** Default supported networks */
|
|
8
|
-
export const DEFAULT_SUPPORTED_NETWORKS = ['base:8453'];
|
|
10
|
+
export const DEFAULT_SUPPORTED_NETWORKS = ['base:8453', 'etherlink:42793'];
|
|
9
11
|
//# sourceMappingURL=types.js.map
|
package/dist/x402/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/x402/types.ts"],"names":[],"mappings":"AAoGA,4BAA4B;AAE5B,yCAAyC;AACzC,MAAM,CAAC,MAAM,cAAc,GAA4B;IACrD,WAAW,EAAE,4CAA4C;IACzD,oBAAoB,EAAE,4CAA4C;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/x402/types.ts"],"names":[],"mappings":"AAoGA,4BAA4B;AAE5B,yCAAyC;AACzC,MAAM,CAAC,MAAM,cAAc,GAA4B;IACrD,WAAW,EAAE,4CAA4C;IACzD,oBAAoB,EAAE,4CAA4C;IAClE,+CAA+C;IAC/C,iBAAiB,EAAE,4CAA4C;CACvD,CAAC;AAEX,iCAAiC;AACjC,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,WAAW,EAAE,iBAAiB,CAAU,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agentwallet-sdk",
|
|
3
|
-
"version": "3.4.
|
|
4
|
-
"description": "Non-custodial TypeScript SDK for AI agent wallets
|
|
3
|
+
"version": "3.4.2",
|
|
4
|
+
"description": "Non-custodial TypeScript SDK for AI agent wallets — x402 payments (Solana, Base, Abstract, Polygon), CCTP cross-chain, token swaps. Private keys never leave your environment.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"files": [
|