{"_id":"@auteng/pocket-money","name":"@auteng/pocket-money","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@auteng/pocket-money","version":"1.0.0","description":"Crypto wallets for autonomous AI agents — create, store, and manage USDC wallets on Base","main":"dist/index.js","module":"dist/index.mjs","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"scripts":{"build":"tsup","dev":"tsup --watch","clean":"rimraf dist","test":"vitest run","test:watch":"vitest"},"dependencies":{"viem":"^2.39.0"},"devDependencies":{"@types/node":"^20.0.0","rimraf":"^5.0.10","tsup":"^8.0.0","typescript":"^5.4.5","vitest":"^4.0.18"},"publishConfig":{"access":"public"},"license":"MIT","_id":"@auteng/pocket-money@1.0.0","_nodeVersion":"24.13.1","_npmVersion":"11.8.0","dist":{"integrity":"sha512-R7AmkroTY1AYyd+kc01TS8tXe0hcSJGvudJveNzF8PREUnjyT8XDWxGuhJlN9QdxIx+dQP/PAphkQXl47B+lwQ==","shasum":"a997dcdc0e40be7f48ae5c6bdf45f0c0aec529d0","tarball":"https://registry.npmjs.org/@auteng/pocket-money/-/pocket-money-1.0.0.tgz","fileCount":8,"unpackedSize":53200,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIEnh01cOh4OScpRokl8I8hoxECjK2ThCvN9hURM6oLySAiAcB/DWFVvI32nyqM54NUzeZJ9RNeDVaQojRo3a+fITEg=="}]},"_npmUser":{"name":"operator_at_auteng","email":"operator@auteng.ai"},"directories":{},"maintainers":[{"name":"operator_at_auteng","email":"operator@auteng.ai"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pocket-money_1.0.0_1771899783950_0.14918694150976486"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-24T02:23:03.872Z","1.0.0":"2026-02-24T02:23:04.117Z","modified":"2026-02-24T02:23:04.324Z"},"maintainers":[{"name":"operator_at_auteng","email":"operator@auteng.ai"}],"description":"Crypto wallets for autonomous AI agents — create, store, and manage USDC wallets on Base","license":"MIT","readme":"# @auteng/pocket-money\n\nCrypto wallets for autonomous AI agents. Create, store, and manage USDC wallets on Base. No accounts, no KYC — just wallet addresses and USDC.\n\n## Install\n\n```bash\nnpm install @auteng/pocket-money\n```\n\n## Quick Start\n\n```typescript\nimport { wallet } from '@auteng/pocket-money';\n\nconst w = await wallet.create({ name: \"my-task\" });\nconsole.log(w.address); // 0xABC123...\n\nconst balance = await w.checkBalance();\nconsole.log(balance); // 0n (unfunded)\n```\n\n## Creating Wallets\n\nEach wallet is an independent keypair with its own address and balance. Create as many as you need — one per task, one per month, one per budget.\n\n```typescript\nimport { wallet } from '@auteng/pocket-money';\n\nconst monthly = await wallet.create({ name: \"feb-2026\" });\nconst task    = await wallet.create({ name: \"data-pipeline\" });\n```\n\nWallets are persisted at `.auteng/wallets/<name>.json`. Creating a wallet that already exists loads it from disk.\n\n### Network\n\n```typescript\n// Base mainnet (default)\nconst w = await wallet.create({ name: \"prod\" });\n\n// Base Sepolia testnet\nconst w = await wallet.create({ name: \"test\", network: \"base-sepolia\" });\n```\n\n## Check Balance\n\n```typescript\nconst balance = await w.checkBalance();\n// Returns USDC in minor units (6 decimals)\n// 10_000000n = $10.00 USDC\n```\n\n## Wait for Funding\n\n```typescript\nawait w.waitForFunding(10_000000n);\n// Polls Base every 10s until >= $10 USDC is available\n```\n\nWith timeout:\n\n```typescript\nawait w.waitForFunding(10_000000n, { timeout: 60_000 });\n// Throws after 60s if balance < $10\n```\n\n## Retrieve and List Wallets\n\n```typescript\nconst w = wallet.get(\"feb-2026\");   // load by name\nconst all = wallet.list();           // list all wallets\n\nfor (const w of all) {\n  const bal = await w.checkBalance();\n  console.log(`${w.name}: ${w.address} — ${bal} USDC`);\n}\n```\n\n## Custom Fetch\n\nThe `Wallet.fetch()` method defaults to `globalThis.fetch`. You can inject a custom fetch function (e.g. an x402 payment-wrapped fetch) via the `Wallet` constructor:\n\n```typescript\nimport { Wallet } from '@auteng/pocket-money';\n\nconst w = new Wallet({\n  name: \"custom\",\n  account,\n  privateKey,\n  network: \"base\",\n  fetchFn: myX402PaymentFetch, // handles 402 responses automatically\n});\n\nconst res = await w.fetch('https://api.example.com/endpoint');\n```\n\n## Security & Storage\n\n**Private keys** are stored as unencrypted JSON at `.auteng/wallets/<name>.json` with restricted file permissions (0600). These keys can sign USDC payment authorizations. If the file is leaked or the machine is compromised, funds in that wallet can be stolen. Treat wallet files like passwords.\n\n**Mitigations**:\n- Only fund wallets with small amounts appropriate for the task\n- Create separate wallets for separate budgets\n- Your wallets only need **USDC on Base** — no ETH needed for gas\n\n## Development\n\n```bash\nnpm install          # install dependencies\nnpm run build        # build CJS/ESM/DTS to dist/\nnpm test             # run unit + integration tests\nnpm run test:watch   # run tests in watch mode\n```\n\n## License\n\nMIT\n","readmeFilename":"README.md","_rev":"1-ee9d6175c0fc59b595a42e9ec943c915"}