Agent SDK
JSON-friendly SDK wrapper for AI agent consumption
Agent SDK
The SinaiAgent class wraps AksumKit in an interface designed for autonomous agents. Every method returns a structured JSON response and never throws exceptions, making it safe for unsupervised operation.
Installation
Quick Start
SinaiAgent.connect()
Factory method that creates a connected agent instance.
Returns { success: true, data: SinaiAgent } or { success: false, error: string }.
Response Format
Every method returns an AgentResult object:
This means agents can use simple if (result.success) checks instead of try/catch blocks. No method ever throws an exception.
Methods
Token Operations
createToken(params)
mintTokens(params)
transferTokens(params)
burnTokens(params)
getTokenInfo(mint)
Allowlist Management
addToAllowlist(params)
removeFromAllowlist(params)
checkAllowlist(params)
Compliance
getComplianceStatus(params)
Error Handling
SinaiAgent catches all exceptions internally and returns them as structured errors. This is critical for autonomous agents that cannot recover from unhandled throws.
Common error messages:
| Error | Cause |
|---|---|
"Wallet not on allowlist" | Recipient is not KYC-approved |
"Hold period not met" | Recipient's hold period has not elapsed |
"Balance would exceed maximum" | Transfer would exceed the maxBalance cap |
"Insufficient balance" | Source wallet lacks sufficient tokens |
"Invalid mint address" | The provided mint address is not valid |
"Not authorized" | The agent's wallet is not the token authority |
Full Flow Example
Comparison with Raw AksumKit
| Feature | SinaiAgent | AksumKit |
|---|---|---|
| Error handling | Never throws, returns { success, error } | Throws exceptions |
| Response format | JSON-friendly objects | Solana transaction objects |
| Setup | SinaiAgent.connect() | Manual Connection + Keypair setup |
| Compliance checks | Built-in getComplianceStatus | Manual multi-step queries |
| Best for | Autonomous agents, LLM tool calls | Human developers, complex flows |