{"_id":"@0xshikhar/nexus-agents-atoma","_rev":"3-1b13c2aa195b7ff78d549c957bd28a7a","name":"@0xshikhar/nexus-agents-atoma","dist-tags":{"latest":"1.1.3"},"versions":{"1.0.0":{"name":"@0xshikhar/nexus-agents-atoma","version":"1.0.0","keywords":[],"author":"","license":"MIT","_id":"@0xshikhar/nexus-agents-atoma@1.0.0","maintainers":[{"name":"0xshikhar","email":"shikharsingh336699@gmail.com"}],"dist":{"shasum":"b25e896b1df1199196129ee56f1d127611348476","tarball":"https://registry.npmjs.org/@0xshikhar/nexus-agents-atoma/-/nexus-agents-atoma-1.0.0.tgz","fileCount":35,"integrity":"sha512-ZN1UeFV7yvLiu5u88HWwNfGyC7jbePPsxw4yVI4xc4zP4x82oZb1MleHfUknZ8mticq7hMJ+YxDBCWp0CVXx4w==","signatures":[{"sig":"MEUCIQDQvZSWK/7a5l4gkj8pPoQ62Fw3aFH0fJUJAbUmVH/fwwIgY8Ceh1FOyyqQTnnULfVtCAa0uGwOQk2g/6aqwespWi0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":418679},"main":"./dist/index.js","types":"./dist/index.d.ts","gitHead":"9bab48119a60241ccb0821dbf6dc97806445a906","private":false,"scripts":{"lint":"eslint . --ext .ts","build":"tsc","format":"prettier --write \"src/**/*.{js,ts,json,md}\"","lint:fix":"eslint . --ext .ts --fix","format:check":"prettier --check \"src/**/*.{js,ts,json,md}\""},"_npmUser":{"name":"0xshikhar","email":"shikharsingh336699@gmail.com"},"_npmVersion":"10.1.0","description":"A specialized AI agent package for interacting with the Sui blockchain on top of the Atoma agent with support for Aftermath Finance operations, SuiLend, Navi and Bluefin.","directories":{},"_nodeVersion":"20.9.0","dependencies":{"axios":"^1.7.9","dotenv":"^16.4.7","mongoose":"^8.10.0","navi-sdk":"^1.4.24","atoma-sdk":"github:atoma-network/atoma-sdk-typescript","typescript":"^5.7.3","@mysten/sui":"1.1.0","aftermath-ts-sdk":"^1.2.49","@bluefin-exchange/bluefin-v2-client":"^6.1.29"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^8.57.0","prettier":"^3.4.2","@types/node":"^20.11.19","@types/dotenv":"^8.2.0","@typescript-eslint/parser":"^5.0.0","@typescript-eslint/eslint-plugin":"^5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/nexus-agents-atoma_1.0.0_1739205202717_0.2531234025200291","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@0xshikhar/nexus-agents-atoma","version":"1.1.0","keywords":[],"author":"","license":"MIT","_id":"@0xshikhar/nexus-agents-atoma@1.1.0","maintainers":[{"name":"0xshikhar","email":"shikharsingh336699@gmail.com"}],"dist":{"shasum":"27f4594304dbad09102c28fb0316ec707c4c6d9e","tarball":"https://registry.npmjs.org/@0xshikhar/nexus-agents-atoma/-/nexus-agents-atoma-1.1.0.tgz","fileCount":40,"integrity":"sha512-FVe8qmvSmJxW+QHKMA6gYLQd4bNJzWcS9f3KD8pwgF5ustAKRppdJLHuwSYAzH9Mqgq2PlQ/0C8l5+gPbVRD/w==","signatures":[{"sig":"MEUCIQC6uZKK3QD6yRl/SXTAHawy0Qx0sC7T0qRFPEsDuz78LgIgKDYmowwwCKghl91fUrFFuYzIlSKO84L3iIYRta1rxzY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":602478},"main":"./dist/index.js","types":"./dist/index.d.ts","gitHead":"6bebeced9652c0150cc5ea07c7e3f6af0419a92f","private":false,"scripts":{"lint":"eslint . --ext .ts","build":"tsc","format":"prettier --write \"src/**/*.{js,ts,json,md}\"","lint:fix":"eslint . --ext .ts --fix","format:check":"prettier --check \"src/**/*.{js,ts,json,md}\""},"_npmUser":{"name":"0xshikhar","email":"shikharsingh336699@gmail.com"},"_npmVersion":"10.1.0","description":"A specialized AI agent package for interacting with the Sui blockchain on top of the Atoma agent with support for Aftermath Finance operations, SuiLend, Navi and Bluefin.","directories":{},"_nodeVersion":"20.9.0","dependencies":{"axios":"^1.7.9","dotenv":"^16.4.7","mongoose":"^8.10.0","navi-sdk":"^1.4.24","atoma-sdk":"github:atoma-network/atoma-sdk-typescript","typescript":"^5.7.3","@mysten/sui":"1.1.0","@suilend/sdk":"^1.1.38","aftermath-ts-sdk":"^1.2.49","@bluefin-exchange/bluefin-v2-client":"^6.1.29"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^8.57.0","prettier":"^3.4.2","@types/node":"^20.11.19","@types/dotenv":"^8.2.0","@typescript-eslint/parser":"^5.0.0","@typescript-eslint/eslint-plugin":"^5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/nexus-agents-atoma_1.1.0_1739289838884_0.14745680357326352","host":"s3://npm-registry-packages-npm-production"}},"1.1.1":{"name":"@0xshikhar/nexus-agents-atoma","version":"1.1.1","keywords":[],"author":"","license":"MIT","_id":"@0xshikhar/nexus-agents-atoma@1.1.1","maintainers":[{"name":"0xshikhar","email":"shikharsingh336699@gmail.com"}],"dist":{"shasum":"9ae16005cf1b4da69ad6287d3cf56ab20fc49851","tarball":"https://registry.npmjs.org/@0xshikhar/nexus-agents-atoma/-/nexus-agents-atoma-1.1.1.tgz","fileCount":40,"integrity":"sha512-FeyRRwnz0ZeQd1amsPWS/H+uRgNd9e4SRuzgk23/lplNSoQkeNSLA33EPFS2WX5OkxKHWvP8abd2re0gvEuvTg==","signatures":[{"sig":"MEQCIGb/MsIceKTsnj9Y2rm0M2PvTvcUUoIhRBTZbm6ihJrRAiBZTU0BjxEK9df4XiWQZ8E5+9xmczBHBJTAsAbMpreXoA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":602635},"main":"./dist/index.js","types":"./dist/index.d.ts","gitHead":"6bebeced9652c0150cc5ea07c7e3f6af0419a92f","private":false,"scripts":{"lint":"eslint . --ext .ts","build":"tsc","format":"prettier --write \"src/**/*.{js,ts,json,md}\"","lint:fix":"eslint . --ext .ts --fix","format:check":"prettier --check \"src/**/*.{js,ts,json,md}\""},"_npmUser":{"name":"0xshikhar","email":"shikharsingh336699@gmail.com"},"_npmVersion":"10.1.0","description":"A specialized AI agent package for interacting with the Sui blockchain on top of the Atoma agent with support for Aftermath Finance operations, SuiLend, Navi and Bluefin.","directories":{},"_nodeVersion":"20.9.0","dependencies":{"axios":"^1.7.9","dotenv":"^16.4.7","mongoose":"^8.10.0","navi-sdk":"^1.4.24","atoma-sdk":"github:atoma-network/atoma-sdk-typescript","typescript":"^5.7.3","@mysten/sui":"^0.50.1","@suilend/sdk":"^1.1.38","aftermath-ts-sdk":"^1.2.49","@bluefin-exchange/bluefin-v2-client":"^6.1.29"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^8.57.0","prettier":"^3.4.2","@types/node":"^20.11.19","@types/dotenv":"^8.2.0","@typescript-eslint/parser":"^5.0.0","@typescript-eslint/eslint-plugin":"^5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/nexus-agents-atoma_1.1.1_1739309026110_0.4468744395951487","host":"s3://npm-registry-packages-npm-production"}},"1.1.3":{"name":"@0xshikhar/nexus-agents-atoma","version":"1.1.3","private":false,"main":"./dist/index.js","types":"./dist/index.d.ts","scripts":{"build":"tsc","format":"prettier --write \"src/**/*.{js,ts,json,md}\"","format:check":"prettier --check \"src/**/*.{js,ts,json,md}\"","lint":"eslint . --ext .ts","lint:fix":"eslint . --ext .ts --fix"},"keywords":[],"author":"","license":"MIT","description":"A specialized AI agent package for interacting with the Sui blockchain on top of the Atoma agent with support for Aftermath Finance operations, SuiLend, Navi and Bluefin.","dependencies":{"@bluefin-exchange/bluefin-v2-client":"^6.1.29","@mysten/sui":"1.20.0","@suilend/sdk":"^1.1.38","aftermath-ts-sdk":"^1.2.49","atoma-sdk":"github:atoma-network/atoma-sdk-typescript","axios":"^1.7.9","dotenv":"^16.4.7","mongoose":"^8.10.0","navi-sdk":"^1.4.24","typescript":"^5.7.3"},"devDependencies":{"@types/dotenv":"^8.2.0","@types/node":"^20.11.19","@typescript-eslint/eslint-plugin":"^5.0.0","@typescript-eslint/parser":"^5.0.0","eslint":"^8.57.0","prettier":"^3.4.2"},"_id":"@0xshikhar/nexus-agents-atoma@1.1.3","gitHead":"6bebeced9652c0150cc5ea07c7e3f6af0419a92f","_nodeVersion":"20.9.0","_npmVersion":"10.1.0","dist":{"integrity":"sha512-O2T1u3nvFAsqzq0fp2/4ymsAuGMM6OjPJZrV72XcwUlo9IjZU0+e/NT1G8Ajo6k/W/eCoExWfTeMLoT/lNIZSg==","shasum":"b80bf25bda001080e5310aadd9b1b83b63f7222d","tarball":"https://registry.npmjs.org/@0xshikhar/nexus-agents-atoma/-/nexus-agents-atoma-1.1.3.tgz","fileCount":38,"unpackedSize":363093,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIGBlO8hozyauOHWiA2EqF4pBaGK3D3b8at8gV13DwwUMAiAcrKkKRzO6tGdVGOeW6lqVl8uyb8ThQzfSXuNDooVbGA=="}]},"_npmUser":{"name":"0xshikhar","email":"shikharsingh336699@gmail.com"},"directories":{},"maintainers":[{"name":"0xshikhar","email":"shikharsingh336699@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/nexus-agents-atoma_1.1.3_1739313683360_0.3593461591000098"},"_hasShrinkwrap":false}},"time":{"created":"2025-02-10T16:33:22.637Z","modified":"2025-02-11T22:41:23.810Z","1.0.0":"2025-02-10T16:33:22.970Z","1.1.0":"2025-02-11T16:03:59.121Z","1.1.1":"2025-02-11T21:23:46.294Z","1.1.3":"2025-02-11T22:41:23.632Z"},"license":"MIT","keywords":[],"description":"A specialized AI agent package for interacting with the Sui blockchain on top of the Atoma agent with support for Aftermath Finance operations, SuiLend, Navi and Bluefin.","maintainers":[{"name":"0xshikhar","email":"shikharsingh336699@gmail.com"}],"readme":"# Nexus Agent Package\n\nA specialized AI agent package for interacting with the Sui blockchain on top of the Atoma agent with support for Aftermath Finance operations, SuiLend, Navi and Bluefin.\n\n## Features\n\n### Price Operations\n\n- Get single token prices\n- Get multiple token prices in one query\n- Price tracking and historical data\n\n### Pool Operations\n\n- Get detailed pool information\n- List all available pools\n- Get pool events (deposits/withdrawals)\n- Rank pools by various metrics (APR, TVL, fees, volume)\n- Filter pools by criteria (min TVL, min APR, tokens)\n\n### Trading Operations\n\n- Get spot prices between tokens\n- Calculate trade outputs\n- Find optimal trade routes\n- Generate deposit transactions\n- Generate withdrawal transactions\n\n### Transaction Operations\n\n- Transfer single coins\n- Multi-coin transfers\n- Merge coins\n- Estimate gas costs\n\n## Technical Details\n\n### Environment Setup\n\nCreate a `.env` file in the `sui-agent` directory with the following variables:\n\n```env\nPORT=2512\nATOMASDK_BEARER_AUTH=your_atoma_sdk_auth_token\n```\n\n### API Endpoints\n\n#### Query Endpoint\n\n```\nPOST /query\nContent-Type: application/json\n```\n\nRequest Body:\n\n```json\n{\n  \"prompt\": \"your natural language query here\"\n}\n```\n\n### Tool Registry\n\nThe agent uses a tool registry system for managing different operations. Each tool follows this structure:\n\n```typescript\n{\n  name: string; // Unique identifier for the tool\n  description: string; // What the tool does\n  parameters: {\n    // Parameters the tool accepts\n    name: string;\n    type: string;\n    description: string;\n    required: boolean;\n  }\n  [];\n  process: Function; // The actual implementation\n}\n```\n\n### Supported Token Types\n\nThe agent supports various token types on Sui, including:\n\n- SUI\n- USDC\n- BTC\n- AFSUI\n- MSUI\n- And many more (see `@types/interface.ts` for full list)\n\n## Example Usage\n\n### Get Token Prices\n\n```bash\ncurl -X POST http://localhost:2512/query \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"prompt\": \"what is the current price of SUI and USDC\"}'\n```\n\n### Get Pool Information\n\n```bash\ncurl -X POST http://localhost:2512/query \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"prompt\": \"show me information for pool 0x123...\"}'\n```\n\n### Get Top Pools\n\n```bash\ncurl -X POST http://localhost:2512/query \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"prompt\": \"show me the top 5 pools by APR\"}'\n```\n\n### Deposit into Top Pools\n\n```bash\n# Deposit into top APR pools\ncurl -X POST http://localhost:2512/query \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"prompt\": \"deposit 1 SUI into each of the top 5 pools by APR with 1% slippage from my wallet 0x123...\"}'\n\n# Deposit into top TVL pools\ncurl -X POST http://localhost:2512/query \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"prompt\": \"find the top 3 pools by TVL and deposit 0.5 SUI into each from wallet 0x123... with 0.5% slippage\"}'\n\n# Deposit into top fee-generating pools\ncurl -X POST http://localhost:2512/query \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"prompt\": \"deposit 2 SUI each into the top 10 pools by fees from my wallet 0x123... using 1% slippage\"}'\n```\n\n### Withdraw from Pools\n\n```bash\ncurl -X POST http://localhost:2512/query \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"prompt\": \"withdraw 1000000 LP tokens from pool 0xabc... using wallet 0x123... with 0.5% slippage\"}'\n```\n\n### Staking Operations\n\n```bash\n# Get staking positions\ncurl -X POST http://localhost:2512/query \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"prompt\": \"show me the staking positions for wallet 0x123...\"}'\n\n# Get total SUI TVL in staking\ncurl -X POST http://localhost:2512/query \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"prompt\": \"what is the total SUI TVL in staking?\"}'\n\n# Get afSUI exchange rate\ncurl -X POST http://localhost:2512/query \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"prompt\": \"what is the current afSUI to SUI exchange rate?\"}'\n\n# Create staking transaction\ncurl -X POST http://localhost:2512/query \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"prompt\": \"stake 100 SUI from wallet 0x123... with validator 0xabc...\"}'\n```\n\n### Transfer Tokens\n\n```bash\ncurl -X POST http://localhost:2512/query \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"prompt\": \"transfer 1 SUI from 0xsender to 0xrecipient\"}'\n```\n\n## Adding New Tools\n\n1. Create a new file in the appropriate directory under `src/`\n2. Implement your tool function:\n\n```typescript\nexport async function yourTool(param1: string): Promise<string> {\n  try {\n    // Your implementation\n    return JSON.stringify([\n      {\n        reasoning: 'Explanation of what happened',\n        response: 'The result',\n        status: 'success',\n        query: 'Original query',\n        errors: [],\n      },\n    ]);\n  } catch (error) {\n    return JSON.stringify([\n      {\n        reasoning: 'What went wrong',\n        response: 'Error message',\n        status: 'failure',\n        query: 'Original query',\n        errors: [error.message],\n      },\n    ]);\n  }\n}\n```\n\n3. Register your tool in `src/tools/ToolRegistry.ts`:\n\n```typescript\ntools.registerTool(\n  'your_tool_name',\n  'Description of your tool',\n  [\n    {\n      name: 'param1',\n      type: 'string',\n      description: 'Parameter description',\n      required: true,\n    },\n  ],\n  yourTool,\n);\n```\n\n## Error Handling\n\nThe agent uses a standardized error response format:\n\n```typescript\n{\n  reasoning: string;     // Why the error occurred\n  response: string;      // User-friendly error message\n  status: \"failure\";     // Error status\n  query: string;         // Original query\n  errors: string[];      // Array of error messages\n}\n```\n\n## Development\n\n### Running Tests\n\n```bash\nnpm test\n```\n\n### Building\n\n```bash\nnpm run build\n```\n\n### Development Server\n\n```bash\nnpm run dev\n```\n\n## Dependencies\n\n- aftermath-ts-sdk: Aftermath Finance SDK\n- @mysten/sui.js: Sui blockchain interaction\n- express: API server\n- atoma-sdk: AI capabilities\n- typescript: Type safety and development\n\n## Contributing\n\n1. Fork the repository\n2. Create your feature branch\n3. Implement your changes\n4. Add tests if applicable\n5. Submit a pull request\n\n## License\n\nApache License 2.0. See [LICENSE](../LICENSE) for details.\n\n```\n\n```\n","readmeFilename":"README.md"}