{"_id":"@1xmint/clawnet-sdk","name":"@1xmint/clawnet-sdk","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@1xmint/clawnet-sdk","version":"1.0.0","description":"TypeScript SDK for the ClawNet AI agent orchestration API","main":"dist/index.js","module":"dist/index.mjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.mjs","require":"./dist/index.js","types":"./dist/index.d.ts"}},"scripts":{"build":"node build.mjs","prepublishOnly":"npm run build"},"keywords":["clawnet","ai","agent","orchestration","sdk","api","x402","crypto"],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/1xmint/claw-net.git","directory":"packages/sdk"},"homepage":"https://claw-net.org","devDependencies":{"esbuild":"^0.20.0"},"_id":"@1xmint/clawnet-sdk@1.0.0","gitHead":"b4a59d4dcdcf7a0b9c089aff34be2768987a11e1","bugs":{"url":"https://github.com/1xmint/claw-net/issues"},"_nodeVersion":"22.22.1","_npmVersion":"10.9.4","dist":{"integrity":"sha512-/TjWNlIgnNYSDCzp7i6WAFRFrEOhJa3u9C8jxQGSRwT7XKVCHeVKyTFJZjX6fVsgeKbjinD5ObE+Qd+5yMtHXQ==","shasum":"32e7e8609796ae03416f296b6df5fa1163fdf009","tarball":"https://registry.npmjs.org/@1xmint/clawnet-sdk/-/clawnet-sdk-1.0.0.tgz","fileCount":6,"unpackedSize":44147,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDjAVrtVYIDJKLIEFw9dQz0u4rL1b8H8zTeDe+v5oibOAIhAPOXm9A3Hq/XxOHRHZ0wFQegUK0FOYYP0JWuIRu9+u1q"}]},"_npmUser":{"name":"1xmint","email":"jfair1028@gmail.com"},"directories":{},"maintainers":[{"name":"1xmint","email":"jfair1028@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/clawnet-sdk_1.0.0_1774058509017_0.4317917905471429"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-21T02:01:48.937Z","1.0.0":"2026-03-21T02:01:49.181Z","modified":"2026-03-21T02:01:49.407Z"},"maintainers":[{"name":"1xmint","email":"jfair1028@gmail.com"}],"description":"TypeScript SDK for the ClawNet AI agent orchestration API","homepage":"https://claw-net.org","keywords":["clawnet","ai","agent","orchestration","sdk","api","x402","crypto"],"repository":{"type":"git","url":"git+https://github.com/1xmint/claw-net.git","directory":"packages/sdk"},"bugs":{"url":"https://github.com/1xmint/claw-net/issues"},"license":"MIT","readme":"# @clawnet/sdk\n\nTypeScript SDK for the [ClawNet](https://claw-net.org) AI agent orchestration API.\n\nZero dependencies. Works in Node.js 18+ and any runtime with a global `fetch`.\n\n## Install\n\n```bash\nnpm install @clawnet/sdk\n```\n\n## Quick Start\n\n```typescript\nimport { ClawNet } from '@clawnet/sdk';\n\nconst claw = new ClawNet({ apiKey: 'cn-xxxx' });\n\n// Orchestrate a query (AI selects the best API endpoints)\nconst result = await claw.orchestrate('What is the price of SOL?');\nconsole.log(result.answer);\nconsole.log(`Cost: ${result.totalCredits} credits`);\n```\n\n## Configuration\n\n```typescript\nconst claw = new ClawNet({\n  apiKey: 'cn-xxxx',           // Required - your ClawNet API key\n  baseUrl: 'https://claw-net.org', // Optional - defaults to production\n  cache: 'smart',             // Optional - 'prefer' | 'fresh' | 'smart'\n  diff: false,                // Optional - return diffs for changed data\n});\n```\n\n## Methods\n\n### Core\n\n```typescript\n// Orchestrate with budget control\nconst result = await claw.orchestrate('SOL price', {\n  maxCredits: 5,\n  strategy: 'cheapest', // 'cheapest' | 'balanced' | 'fastest' | 'reliable'\n});\n\n// Estimate cost before running\nconst estimate = await claw.estimate('SOL price history');\n\n// Check your balance\nconst balance = await claw.getBalance();\n```\n\n### Skills\n\n```typescript\n// List available skills (with optional filters)\nconst skills = await claw.listSkills({ tag: 'defi', type: 'data' });\n\n// Invoke a prompt skill\nconst invoke = await claw.invokeSkill('skill-id', { token: 'SOL' });\n\n// Query a data skill\nconst data = await claw.queryDataSkill('skill-id', { chain: 'solana' });\n```\n\n### Discovery\n\n```typescript\n// Search for skills by natural language\nconst found = await claw.discover('DeFi yield farming');\n\n// Get personalized recommendations\nconst recs = await claw.getRecommendations();\n\n// Browse trending skills\nconst trending = await claw.getTrending();\n```\n\n### Economy\n\n```typescript\n// Transfer credits to another key\nawait claw.transferCredits('cn-recipient-key', 100);\n\n// Get transaction receipts (with cryptographic hashes)\nconst receipts = await claw.getReceipts(10);\n```\n\n### Cache\n\n```typescript\n// View cache performance\nconst stats = await claw.getCacheStats();\n\n// Get TTL optimization suggestions\nconst suggestions = await claw.getCacheOptimizer();\n```\n\n### Static Methods (No Auth Required)\n\n```typescript\n// Self-service onboarding - get an API key\nconst { apiKey, credits } = await ClawNet.onboard({\n  name: 'My Agent',\n  email: 'agent@example.com',\n});\n\n// Fetch the API manifest\nconst manifest = await ClawNet.getManifest();\n```\n\n## Error Handling\n\n```typescript\nimport { ClawNet, ClawNetError } from '@clawnet/sdk';\n\ntry {\n  await claw.orchestrate('query');\n} catch (err) {\n  if (err instanceof ClawNetError) {\n    console.error(`${err.code}: ${err.message} (HTTP ${err.status})`);\n  }\n}\n```\n\n## x402 Mode\n\nClawNet supports the x402 payment protocol for pay-per-call API access using USDC on Solana. Surcharges are automatically handled server-side -- no SDK changes needed.\n\n## Documentation\n\nFull API reference: [https://claw-net.org/docs](https://claw-net.org/docs)\n","readmeFilename":"README.md","_rev":"1-031ef477eb0d37ab5131f2cb3c264881"}