Metadata-Version: 2.4
Name: crewai-powersun
Version: 1.2.0
Summary: CrewAI integration for PowerSun.vip — TRON Energy & Bandwidth marketplace and DEX swap aggregator with 27 MCP tools for AI agents
Author: PowerSun.vip
License: MIT
Project-URL: Homepage, https://powersun.vip
Project-URL: Repository, https://github.com/Hovsteder/powersun-tron-mcp
Project-URL: Documentation, https://powersun.vip/api-docs
Keywords: crewai,tron,tron-energy,tron-bandwidth,ai-agent,mcp,blockchain,powersun,sunswap,dex-swap,trc20-swap,token-swap
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: crewai[tools]>=0.60.0
Requires-Dist: httpx>=0.25.0

# crewai-powersun

CrewAI integration for [PowerSun.vip](https://powersun.vip) — the TRON Energy & Bandwidth marketplace and DEX swap aggregator for AI agents.

## Install

```bash
pip install crewai-powersun
```

## Quick Start

```python
from crewai import Agent, Task, Crew
from crewai_powersun import PowerSunEstimateCostTool, PowerSunBuyEnergyTool

# Create an agent with PowerSun tools
energy_manager = Agent(
    role="TRON Energy Manager",
    goal="Minimize transaction costs by renting energy instead of burning TRX",
    backstory="Expert in TRON network resource management",
    tools=[
        PowerSunEstimateCostTool(),
        PowerSunBuyEnergyTool(api_key="ps_your_key"),
    ],
)

# Create a task
task = Task(
    description="Estimate cost and buy 65000 energy for address TYourAddress for 1 hour",
    agent=energy_manager,
)

crew = Crew(agents=[energy_manager], tasks=[task])
result = crew.kickoff()
```

## Environment Variable

Set `POWERSUN_API_KEY` to avoid passing the key to each tool:

```bash
export POWERSUN_API_KEY=ps_your_key
```

## Available Tools (9)

| Tool | Auth | Description |
|------|------|-------------|
| `PowerSunRegisterTool` | No | Start registration — get challenge to sign |
| `PowerSunVerifyRegistrationTool` | No | Submit signature → get API key |
| `PowerSunMarketOverviewTool` | No | Market snapshot: prices, availability, stats |
| `PowerSunEstimateCostTool` | No | Calculate energy rental cost |
| `PowerSunBuyEnergyTool` | Yes | Purchase energy delegation |
| `PowerSunGetBalanceTool` | Yes | Account balance and deposit info |
| `PowerSunGetOrderStatusTool` | Yes | Order status with delegation progress |
| `PowerSunGetSwapQuoteTool` | Yes | Get swap quote for SunSwap DEX (TRX, USDT, USDC, SUN, BTT, WIN, JST) |
| `PowerSunExecuteSwapTool` | Yes | Execute signed swap TX with automatic energy delegation |

## Links

- **Platform:** [powersun.vip](https://powersun.vip)
- **MCP Server:** [powersun.vip/mcp](https://powersun.vip/mcp)
- **API Docs:** [powersun.vip/api-docs](https://powersun.vip/api-docs)

## License

MIT
