{"_id":"@altheia-xyz/sui","_rev":"3-68acac35842a04457b3e6032c882284d","name":"@altheia-xyz/sui","dist-tags":{"latest":"0.0.3"},"versions":{"0.0.1":{"name":"@altheia-xyz/sui","version":"0.0.1","keywords":["sui","move","deepbook","ai","agent","policy","altheia","ptb"],"license":"Apache-2.0","_id":"@altheia-xyz/sui@0.0.1","maintainers":[{"name":"altheia","email":"hello@altheia.xyz"}],"homepage":"https://docs.altheia.xyz","bugs":{"url":"https://github.com/altheia-xyz/altheia-sdk/issues"},"dist":{"shasum":"d19380bc44c5a2a8d2ae09d41ddcd371757cf166","tarball":"https://registry.npmjs.org/@altheia-xyz/sui/-/sui-0.0.1.tgz","fileCount":3,"integrity":"sha512-Zo3qVYR7qY4Be6N1BO8vLNf0PvRB+uBdxGvT33CrAqvjdfij4y5onMnOedc5QLW4Lwyrlek/BZjaAJeu2u3wQQ==","signatures":[{"sig":"MEUCID9NTZzpwpsAUxqbhe0fBTG3IYCgInbHNLQw8UF+q2L3AiEA4Y5uN2fOqe65ZtpjbUOvvFg8Aenx33B28JOdVYW+1UA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":38467},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"4dc2f7428e0eababb1d8626c3b6703f6427e1686","scripts":{"dev":"tsup src/index.ts --format esm --dts --watch","test":"vitest run","build":"tsup src/index.ts --format esm --dts --clean","typecheck":"tsc --noEmit"},"_npmUser":{"name":"altheia","email":"hello@altheia.xyz"},"repository":{"url":"git+https://github.com/altheia-xyz/altheia-sdk.git","type":"git","directory":"packages/sui"},"_npmVersion":"11.3.0","description":"AI agents you can fire — Altheia on Sui. Capped-budget, protocol-scoped, revocable agent wallets via Move policy objects + DeepBook adapter. PTB builders, the developer deploys nothing.","directories":{},"_nodeVersion":"24.2.0","dependencies":{"@mysten/sui":"^2.19.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.0","vitest":"^2.1.0","typescript":"^5.6.0"},"_npmOperationalInternal":{"tmp":"tmp/sui_0.0.1_1782079665956_0.8799679336149167","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@altheia-xyz/sui","version":"0.0.2","keywords":["sui","move","deepbook","ai","agent","policy","altheia","ptb"],"license":"Apache-2.0","_id":"@altheia-xyz/sui@0.0.2","maintainers":[{"name":"altheia","email":"hello@altheia.xyz"}],"homepage":"https://docs.altheia.xyz","bugs":{"url":"https://github.com/altheia-xyz/altheia-sdk/issues"},"dist":{"shasum":"15adce060d89180d283b83ab89e27be83fa3fff7","tarball":"https://registry.npmjs.org/@altheia-xyz/sui/-/sui-0.0.2.tgz","fileCount":5,"integrity":"sha512-qfQ92PtUiK1loedBMHizigBPbVyIHORYz7lDV6vLXj95BXb3T58QcluU0xH0UHRHrHJv0ZaUEj1nF6Wo9Lhi6g==","signatures":[{"sig":"MEUCIB2laerv+T4VA8AfE7zFH0OKAh+m58c7tbGm+vnJ9H56AiEA0/GNq+pq2Z5PBYtTh/MIlDZmueplEy2wBN9rCVCx5pg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":51343},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"4dc2f7428e0eababb1d8626c3b6703f6427e1686","scripts":{"dev":"tsup src/index.ts --format esm --dts --watch","test":"vitest run","build":"tsup src/index.ts --format esm --dts --clean","typecheck":"tsc --noEmit"},"_npmUser":{"name":"altheia","email":"hello@altheia.xyz"},"repository":{"url":"git+https://github.com/altheia-xyz/altheia-sdk.git","type":"git","directory":"packages/sui"},"_npmVersion":"11.3.0","description":"AI agents you can fire — Altheia on Sui. Capped-budget, protocol-scoped, revocable agent wallets via Move policy objects + DeepBook adapter. PTB builders, the developer deploys nothing.","directories":{},"_nodeVersion":"24.2.0","dependencies":{"@mysten/sui":"^2.19.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.0","vitest":"^2.1.0","typescript":"^5.6.0"},"_npmOperationalInternal":{"tmp":"tmp/sui_0.0.2_1782080003262_0.9143522284529602","host":"s3://npm-registry-packages-npm-production"}},"0.0.3":{"name":"@altheia-xyz/sui","version":"0.0.3","description":"AI agents you can fire — Altheia on Sui. Capped-budget, protocol-scoped, revocable agent wallets via Move policy objects + DeepBook adapter. PTB builders, the developer deploys nothing.","license":"Apache-2.0","homepage":"https://docs.altheia.xyz","repository":{"type":"git","url":"git+https://github.com/altheia-xyz/altheia-sdk.git","directory":"packages/sui"},"keywords":["sui","move","deepbook","ai","agent","policy","altheia","ptb"],"type":"module","main":"./dist/index.js","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"build":"tsup src/index.ts --format esm --dts --clean","dev":"tsup src/index.ts --format esm --dts --watch","test":"vitest run","typecheck":"tsc --noEmit"},"dependencies":{"@mysten/sui":"^2.19.0"},"devDependencies":{"tsup":"^8.3.0","typescript":"^5.6.0","vitest":"^2.1.0"},"_id":"@altheia-xyz/sui@0.0.3","gitHead":"8ed003893cd119cb9b3c18f9e09c03e4f341fdda","bugs":{"url":"https://github.com/altheia-xyz/altheia-sdk/issues"},"_nodeVersion":"24.2.0","_npmVersion":"11.3.0","dist":{"integrity":"sha512-HPg9yI55HtWX3gsajMjSxA24YR0vRf0x7i4hifReKGRNhfpmLUkOfYjeolC7LmBoDPi1R+SQ3kqDD82Q+lpmEA==","shasum":"63430f59fbfbc79fd1d1af9761063389f072a83a","tarball":"https://registry.npmjs.org/@altheia-xyz/sui/-/sui-0.0.3.tgz","fileCount":5,"unpackedSize":51612,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIFQcXH1NOc7HD546GslMCvVMwXtFGsiiK/Tu7I7xM38PAiEAzpdVUoHnnHgkOf4NU8VaRwlHLjayL7U0EQDxOmHW2wU="}]},"_npmUser":{"name":"altheia","email":"hello@altheia.xyz"},"directories":{},"maintainers":[{"name":"altheia","email":"hello@altheia.xyz"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sui_0.0.3_1782083211113_0.46145691285762136"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-21T22:07:45.819Z","modified":"2026-06-21T23:06:51.412Z","0.0.1":"2026-06-21T22:07:46.099Z","0.0.2":"2026-06-21T22:13:23.412Z","0.0.3":"2026-06-21T23:06:51.283Z"},"bugs":{"url":"https://github.com/altheia-xyz/altheia-sdk/issues"},"license":"Apache-2.0","homepage":"https://docs.altheia.xyz","keywords":["sui","move","deepbook","ai","agent","policy","altheia","ptb"],"repository":{"type":"git","url":"git+https://github.com/altheia-xyz/altheia-sdk.git","directory":"packages/sui"},"description":"AI agents you can fire — Altheia on Sui. Capped-budget, protocol-scoped, revocable agent wallets via Move policy objects + DeepBook adapter. PTB builders, the developer deploys nothing.","maintainers":[{"name":"altheia","email":"hello@altheia.xyz"}],"readme":"# @altheia-xyz/sui\n\nTypeScript SDK for altheia on Sui: a non-custodial control plane for on-chain AI agents.\n\nAn agent gets its own key and a vault governed by an on-chain Move Policy object:\nper-transaction and per-day spend caps, allowed protocols, an expiry, and instant\nrevocation. This SDK builds the policy-gated transactions; the chain enforces the\npolicy. An over-budget or out-of-scope action reverts on-chain.\n\n## Install\n\n```bash\nnpm i @altheia-xyz/sui\n```\n\n## An agent in about five lines\n\n```ts\nimport {\n  SuiJsonRpcClient, getJsonRpcFullnodeUrl, Ed25519Keypair, decodeSuiPrivateKey,\n  AltheiaSui, keypairExecutor, agentRefs, decodePolicyAbort,\n} from \"@altheia-xyz/sui\";\n\nconst client = new SuiJsonRpcClient({ url: getJsonRpcFullnodeUrl(\"testnet\"), network: \"testnet\" });\nconst kp = Ed25519Keypair.fromSecretKey(decodeSuiPrivateKey(process.env.AGENT_PRIVKEY!).secretKey);\n\nconst refs  = await agentRefs(client, kp.getPublicKey().toSuiAddress()); // vault/policy/cap, from the key\nconst agent = new AltheiaSui(client, refs, keypairExecutor(client, kp));\n\ntry {\n  const r = await agent.swap(50_000_000n);          // 0.05 SUI; gated by the policy\n  console.log(\"allowed\", r.digest);\n} catch (e) {\n  const ab = decodePolicyAbort(e);                  // over_per_tx_cap, policy_revoked, ...\n  console.log(\"denied\", ab?.reason_code);\n}\n```\n\nThe agent needs only its private key. `agentRefs` derives the rest from the\n`AgentCap` it owns on chain.\n\n## Exports\n\n- `AltheiaSui` — high-level client (`swap`, ...)\n- `agentRefs(client, address)` — derive the agent's vault/policy/cap from its key\n- `keypairExecutor(client, signer)` — Node executor (a dapp-kit browser executor is also provided)\n- PTB builders — `buildSwap`, `buildSellSwap`, `buildPlaceLimit`, `buildCancelAll`,\n  `buildRevoke`, `buildKillDrain`, `buildPause`, `buildUnpause`, `buildSetActions`,\n  `buildSetValueGuard`, and the provision builders\n- Chain reads — `readPolicyObject`, `vaultBalances`\n- `decodePolicyAbort`, `dryRunResult`, `guardedSubmit`\n- `SUI_TESTNET` — the deployed testnet package ids\n\n## Links\n\n- Contracts (Move): https://github.com/altheia-xyz/altheia-sui\n- Demo agent: https://github.com/altheia-xyz/altheia-sui-demo\n\nSui-native; also on Solana.\n","readmeFilename":"README.md"}