{"_id":"@aegis-ai/sdk","name":"@aegis-ai/sdk","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@aegis-ai/sdk","version":"0.1.0","description":"TypeScript SDK for the Aegis node API — structured intents for autonomous agents on Solana","type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"import":"./dist/index.js","types":"./dist/index.d.ts"},"./intents":{"import":"./dist/intents.js","types":"./dist/intents.d.ts"}},"scripts":{"build":"tsc","dev":"tsc --watch","prepublishOnly":"npm run build"},"keywords":["solana","ai-agents","autonomous","wallet","structured-intents","defi","web3"],"license":"MIT","author":{"name":"Aegis"},"homepage":"https://github.com/Coding-With-Josh/aegis#readme","repository":{"type":"git","url":"git+https://github.com/Coding-With-Josh/aegis.git","directory":"sdk"},"bugs":{"url":"https://github.com/Coding-With-Josh/aegis/issues"},"engines":{"node":">=18"},"devDependencies":{"typescript":"^5.0.0"},"gitHead":"bdf12dd3fdd31da4693c85b021b88c56d050ca25","_id":"@aegis-ai/sdk@0.1.0","_nodeVersion":"24.10.0","_npmVersion":"11.6.1","dist":{"integrity":"sha512-9fgV2JDD903SEq/GrWHLL6OfwCOdoSLrcjxbWFaLE9b7k8j7cLOBPFscjJQH3ovxIXMqpyrLoTd99rFx/UiklQ==","shasum":"b2dbc9a33f3c05ffb1cfb390c6593264134aa5b6","tarball":"https://registry.npmjs.org/@aegis-ai/sdk/-/sdk-0.1.0.tgz","fileCount":14,"unpackedSize":17313,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCMJZf41Xyw2YPIOB3x7d++0t3FSE/SNePTJnGP7o8nfgIgbicKzfAp3e+4edVTrkZ1ZfnrelKZ6A1gN2szItRrhto="}]},"_npmUser":{"name":"codingwithjoshh","email":"codewithjoshh@gmail.com"},"directories":{},"maintainers":[{"name":"codingwithjoshh","email":"codewithjoshh@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk_0.1.0_1771863158985_0.9223036921077428"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-23T16:12:38.861Z","0.1.0":"2026-02-23T16:12:39.135Z","modified":"2026-02-23T16:12:39.428Z"},"maintainers":[{"name":"codingwithjoshh","email":"codewithjoshh@gmail.com"}],"description":"TypeScript SDK for the Aegis node API — structured intents for autonomous agents on Solana","homepage":"https://github.com/Coding-With-Josh/aegis#readme","keywords":["solana","ai-agents","autonomous","wallet","structured-intents","defi","web3"],"repository":{"type":"git","url":"git+https://github.com/Coding-With-Josh/aegis.git","directory":"sdk"},"author":{"name":"Aegis"},"bugs":{"url":"https://github.com/Coding-With-Josh/aegis/issues"},"license":"MIT","readme":"# @aegis-ai/sdk\n\nTypeScript SDK for the [Aegis](https://github.com/Coding-With-Josh/aegis) node API. Send structured intents to autonomous Solana agents — transfers, swaps, staking, lending, flash loans, and raw CPI calls — with full type safety and no raw `fetch` calls.\n\n## install\n\n```bash\nnpm install @aegis-ai/sdk\n```\n\n## quick start\n\n```typescript\nimport { AegisClient, transfer, swap, stake } from \"@aegis-ai/sdk\";\n\nconst client = new AegisClient({\n  baseUrl: \"https://aegis-ycdm.onrender.com\",\n  apiKey: \"your-api-key\",\n});\n\n// create an agent\nconst { agentId, apiKey } = await client.createAgent({\n  policy: { maxTxAmountSOL: 0.5, dailySpendLimitSOL: 2 },\n});\n\n// fund it on devnet\nawait client.airdrop(agentId, 2);\n\n// execute intents\nawait client.execute(agentId, transfer({ to: \"<address>\", amount: 0.1 }), \"rebalancing\");\nawait client.execute(agentId, swap({ fromMint: \"SOL\", toMint: \"USDC\", amount: 0.5 }), \"spread detected\");\nawait client.execute(agentId, stake({ amount: 1, voteAccount: \"<vote_account>\" }), \"earning yield\");\n\n// read state\nconst agent = await client.getAgent(agentId);     // reputationScore, lastActivityAt, policy\nconst balance = await client.getBalance(agentId);\nconst txs = await client.getTransactions(agentId, 20);\n\n// pause the agent\nawait client.updateStatus(agentId, \"paused\");\n```\n\n## intent types\n\n| intent | params |\n|---|---|\n| `transfer` | `to`, `amount`, `mint?` (default SOL), `decimals?` (default 6) |\n| `swap` | `fromMint`, `toMint`, `amount`, `slippageBps?` (default 50) |\n| `stake` | `amount`, `voteAccount` |\n| `lend` | `protocol` (marginfi\\|solend), `mint`, `amount`, `decimals?` |\n| `flash` | `mint`, `amount`, `instructions[]` |\n| `cpi` | `programId`, `data` (base64), `accounts[]` |\n\n## client methods\n\n```typescript\nclient.health()\nclient.createAgent(options?)\nclient.getAgents()\nclient.getAgent(agentId)\nclient.updateStatus(agentId, \"active\" | \"paused\" | \"suspended\")\nclient.getBalance(agentId)\nclient.getTransactions(agentId, limit?)\nclient.airdrop(agentId, amount?)\nclient.execute(agentId, intent, reasoning?)\n```\n\n## error handling\n\npolicy violations throw `AegisError` with a typed `violations` array:\n\n```typescript\nimport { AegisError } from \"@aegis-ai/sdk\";\n\ntry {\n  await client.execute(agentId, transfer({ to: \"...\", amount: 999 }));\n} catch (e) {\n  if (e instanceof AegisError) {\n    console.log(e.status);      // 403\n    console.log(e.violations);  // [{ code: \"AMOUNT_EXCEEDS_TX_CAP\", message: \"...\" }]\n  }\n}\n```\n\n## policy\n\nagents enforce policy on every intent before touching the chain:\n\n```typescript\nawait client.createAgent({\n  policy: {\n    allowedIntents: [\"transfer\", \"swap\"],\n    allowedMints: [\"SOL\", \"USDC\"],\n    maxTxAmountSOL: 1,\n    dailySpendLimitSOL: 5,\n    maxSlippageBps: 100,\n    requireSimulation: true,\n    cooldownMs: 5000,\n    maxRiskScore: 50,\n  },\n});\n```\n\n## license\n\nMIT\n","readmeFilename":"README.md","_rev":"1-428564642088c03fe985f943d9a8bf3b"}