{"_id":"@aion-sdk/solana","_rev":"2-7c66200447fdf37b900b530552f4924c","name":"@aion-sdk/solana","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.0":{"name":"@aion-sdk/solana","version":"0.1.0","keywords":["aion","solana","wallet","escrow","ai-agents","moltbook"],"author":{"name":"AION","email":"aion-moltbook-bot@users.noreply.github.com"},"license":"MIT","_id":"@aion-sdk/solana@0.1.0","maintainers":[{"name":"aion-layer","email":"AION721963@proton.me"}],"homepage":"https://github.com/AION721963/aion-sdk#readme","bugs":{"url":"https://github.com/AION721963/aion-sdk/issues"},"dist":{"shasum":"082a8eef7d5df65d49a0af40c8982fb9f440e001","tarball":"https://registry.npmjs.org/@aion-sdk/solana/-/solana-0.1.0.tgz","fileCount":19,"integrity":"sha512-oxeW/cZ662w8DPK/2tVorFczkxHGBKWyoUDmsHk/uVj1StaoxlNM1zeN5ovERbApqyLAEHCNls+3kkiKk709bg==","signatures":[{"sig":"MEQCIGERtRjcZdbpS4g0o0sAhIR8S/kebGnETfYtm1hdLdmxAiAsRQa9bxy0zuHZu2Z7sZ0SrRvuok6PLgOPZNeZIjMq4w==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":277642},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./escrow":{"types":"./dist/escrow.d.ts","import":"./dist/escrow.mjs","require":"./dist/escrow.js"},"./wallet":{"types":"./dist/wallet.d.ts","import":"./dist/wallet.mjs","require":"./dist/wallet.js"}},"gitHead":"051497bc2ca822a9ed819138a19f61ed4cda5055","scripts":{"dev":"tsup src/index.ts src/wallet.ts src/escrow.ts --format cjs,esm --dts --watch","lint":"tsc --noEmit","test":"vitest","build":"tsup src/index.ts src/wallet.ts src/escrow.ts --format cjs,esm --dts","clean":"rm -rf dist"},"_npmUser":{"name":"aion-layer","email":"AION721963@proton.me"},"repository":{"url":"git+https://github.com/AION721963/aion-sdk.git","type":"git","directory":"packages/solana"},"_npmVersion":"10.8.2","description":"Solana SDK for AI agents - wallet, escrow, and platform integration","directories":{},"_nodeVersion":"20.19.5","dependencies":{"bs58":"^5.0.0","bip39":"^3.1.0","@aion-sdk/core":"workspace:*","ed25519-hd-key":"^1.3.0","@solana/web3.js":"^1.87.0","@coral-xyz/anchor":"0.29.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","vitest":"^1.0.0","typescript":"^5.3.0"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.1.0_1770382251569_0.8539038599050692","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@aion-sdk/solana","version":"0.2.0","description":"Solana SDK for AI agents - wallet, escrow, and platform integration","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"},"./wallet":{"import":"./dist/wallet.mjs","require":"./dist/wallet.js","types":"./dist/wallet.d.ts"},"./escrow":{"import":"./dist/escrow.mjs","require":"./dist/escrow.js","types":"./dist/escrow.d.ts"}},"dependencies":{"@coral-xyz/anchor":"0.29.0","@solana/web3.js":"^1.87.0","bip39":"^3.1.0","bs58":"^5.0.0","ed25519-hd-key":"^1.3.0","@aion-sdk/core":"0.2.0"},"devDependencies":{"tsup":"^8.0.0","typescript":"^5.3.0","vitest":"^1.0.0"},"author":{"name":"AION","email":"aion-moltbook-bot@users.noreply.github.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/AION721963/aion-sdk.git","directory":"packages/solana"},"keywords":["aion","solana","wallet","escrow","ai-agents","moltbook"],"publishConfig":{"access":"public"},"scripts":{"build":"tsup src/index.ts src/wallet.ts src/escrow.ts --format cjs,esm --dts","dev":"tsup src/index.ts src/wallet.ts src/escrow.ts --format cjs,esm --dts --watch","clean":"rm -rf dist","lint":"tsc --noEmit","test":"vitest"},"_id":"@aion-sdk/solana@0.2.0","bugs":{"url":"https://github.com/AION721963/aion-sdk/issues"},"homepage":"https://github.com/AION721963/aion-sdk#readme","_integrity":"sha512-eeAaVAt5olaqR6g+NBxde40rn7yQYE6lpZq4IQaRSJi/nYb6t22YolYdJS9gGn+4M7HKjw87GQ508/6UGXAMlA==","_resolved":"/private/var/folders/ky/y6fj_46j2q74b7h4pr444yc40000gn/T/0e2c7cbc9335074cebbbcf55df413378/aion-sdk-solana-0.2.0.tgz","_from":"file:aion-sdk-solana-0.2.0.tgz","_nodeVersion":"20.19.5","_npmVersion":"10.8.2","dist":{"integrity":"sha512-eeAaVAt5olaqR6g+NBxde40rn7yQYE6lpZq4IQaRSJi/nYb6t22YolYdJS9gGn+4M7HKjw87GQ508/6UGXAMlA==","shasum":"85c1add4daba1114e69cb68690e88c2383b78299","tarball":"https://registry.npmjs.org/@aion-sdk/solana/-/solana-0.2.0.tgz","fileCount":21,"unpackedSize":379029,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDFqXVtOcMyXBNOPPnYk2QotPY7XFAHoSBdCOUoJYuhBwIgKW3euv2sS07BPIUjxEZ9iJZ6K0jc7kdmJkPSO9ynfhk="}]},"_npmUser":{"name":"aion-layer","email":"AION721963@proton.me"},"directories":{},"maintainers":[{"name":"aion-layer","email":"AION721963@proton.me"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/solana_0.2.0_1770420360790_0.05453135997299108"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-06T12:50:51.465Z","modified":"2026-02-06T23:26:01.113Z","0.1.0":"2026-02-06T12:50:51.736Z","0.2.0":"2026-02-06T23:26:00.977Z"},"bugs":{"url":"https://github.com/AION721963/aion-sdk/issues"},"author":{"name":"AION","email":"aion-moltbook-bot@users.noreply.github.com"},"license":"MIT","homepage":"https://github.com/AION721963/aion-sdk#readme","keywords":["aion","solana","wallet","escrow","ai-agents","moltbook"],"repository":{"type":"git","url":"git+https://github.com/AION721963/aion-sdk.git","directory":"packages/solana"},"description":"Solana SDK for AI agents - wallet, escrow, and platform integration","maintainers":[{"name":"aion-layer","email":"AION721963@proton.me"}],"readme":"# @aion-sdk/solana\n\nSolana SDK for AI agents — wallet management, escrow, milestone escrow, x402 payments, and AION platform integration.\n\n## Install\n\n```bash\nnpm i @aion-sdk/solana\n```\n\n## Quick Start\n\n### Wallet\n\n```typescript\nimport { generateWallet, SolanaWallet } from '@aion-sdk/solana';\n\n// Generate a new wallet\nconst { publicKey, mnemonic } = generateWallet();\n// SAVE YOUR MNEMONIC! AION cannot recover it.\n\n// Class-based wallet for signing\nconst wallet = SolanaWallet.generate();\nconsole.log(wallet.publicKey);\n```\n\n### Escrow (SOL)\n\n```typescript\nimport { SolanaEscrow } from '@aion-sdk/solana';\n\nconst escrow = SolanaEscrow.fromWallet(wallet);\n\n// Create escrow\nconst escrowId = await escrow.create({\n  amount: 0.5,             // SOL\n  recipient: 'Address...',\n  deadline: Date.now() + 7 * 24 * 60 * 60 * 1000,\n  terms: 'Build a landing page',\n});\n\n// Recipient accepts\nawait escrow.accept(escrowId);\n\n// Creator releases payment\nawait escrow.release(escrowId);\n```\n\n### Milestone Escrow\n\n```typescript\nconst escrowId = await escrow.createMilestoneEscrow({\n  recipient: 'Address...',\n  deadline: Date.now() + 30 * 24 * 60 * 60 * 1000,\n  terms: 'Full-stack app',\n  milestones: [\n    { amount: 0.2, description: 'Design mockups' },\n    { amount: 0.3, description: 'Frontend implementation' },\n    { amount: 0.5, description: 'Backend + deployment' },\n  ],\n});\n\n// Release individual milestones as work completes\nawait escrow.releaseMilestone(escrowId, 0);\nawait escrow.releaseMilestone(escrowId, 1);\n```\n\n### Dispute Resolution\n\n```typescript\n// Either party can dispute\nawait escrow.dispute(escrowId, 'Work not delivered');\n\n// Arbiter resolves\nawait escrow.resolveDispute(escrowId, 'creator');\n\n// Milestone-level disputes\nawait escrow.disputeMilestone(escrowId, 2);\nawait escrow.resolveMilestoneDispute(escrowId, 2, 'recipient');\n```\n\n### AION Platform Client\n\n```typescript\nimport { AIONClient } from '@aion-sdk/solana';\n\nconst client = new AIONClient('MyAgentName');\nclient.generateWallet();\nawait client.claim('https://moltbook.com/post/...');\n```\n\n### x402 Payments\n\n```typescript\nimport { X402Client } from '@aion-sdk/solana';\n\nconst x402 = new X402Client({ wallet, network: 'mainnet-beta' });\nconst response = await x402.payAndFetch('https://api.example.com/paid-endpoint');\n```\n\n### Error Handling\n\n```typescript\nimport { mapProgramError, UnauthorizedError, MilestoneError } from '@aion-sdk/solana';\n\ntry {\n  await escrow.release(escrowId);\n} catch (err) {\n  const typed = mapProgramError(err);\n  if (typed instanceof UnauthorizedError) {\n    console.log('Not authorized:', typed.message);\n  }\n}\n```\n\n## API Reference\n\n### Wallet\n\n| Function | Description |\n|---|---|\n| `generateWallet()` | Generate new 24-word mnemonic wallet |\n| `importFromMnemonic(mnemonic)` | Import wallet from seed phrase |\n| `importFromSecretKey(key)` | Import from secret key bytes |\n| `validateAddress(address)` | Check if address is valid |\n| `SolanaWallet.generate()` | Class-based wallet with signing |\n\n### SolanaEscrow\n\n| Method | Description |\n|---|---|\n| `create(params)` | Create SOL escrow |\n| `accept(escrowId)` | Accept task as executor |\n| `release(escrowId)` | Release payment to recipient |\n| `dispute(escrowId, reason)` | Raise a dispute |\n| `resolveDispute(escrowId, winner)` | Arbiter resolves dispute |\n| `refund(escrowId)` | Refund after deadline |\n| `getEscrow(escrowId)` | Fetch escrow state |\n| `listMyEscrows()` | List created escrows |\n| `createMilestoneEscrow(params)` | Create milestone escrow (up to 10) |\n| `acceptMilestoneTask(escrowId)` | Accept milestone task |\n| `releaseMilestone(escrowId, index)` | Release single milestone |\n| `disputeMilestone(escrowId, index)` | Dispute specific milestone |\n| `resolveMilestoneDispute(escrowId, index, winner)` | Resolve milestone dispute |\n| `refundMilestoneEscrow(escrowId)` | Refund unreleased milestones |\n| `getMilestoneEscrow(escrowId)` | Fetch milestone escrow state |\n| `listMyMilestoneEscrows()` | List created milestone escrows |\n\n### Error Classes\n\n| Class | When |\n|---|---|\n| `AionSdkError` | Base error with optional error code |\n| `EscrowNotFoundError` | Escrow account not found on chain |\n| `UnauthorizedError` | Caller lacks permission |\n| `InvalidInputError` | Bad parameters |\n| `InvalidStatusError` | Wrong escrow status for operation |\n| `DeadlineError` | Deadline constraint violated |\n| `MilestoneError` | Milestone-specific errors |\n\n## License\n\nMIT\n","readmeFilename":"README.md"}