Metadata-Version: 2.5
Name: llama-index-tools-helmswap
Version: 0.1.0
Summary: llama-index tools helmswap integration: swap quotes and unsigned swap transactions (non-custodial)
Project-URL: Homepage, https://helmswap.com
Project-URL: Documentation, https://helmswap.com/developers
Project-URL: Source, https://github.com/gambrelcolby63/llama-index-tools-helmswap
Author-email: HelmSwap <support@helmswap.com>
License-Expression: MIT
License-File: LICENSE
Keywords: agent,defi,helmswap,non-custodial,swap
Requires-Python: <4.0,>=3.9
Requires-Dist: httpx>=0.27
Requires-Dist: llama-index-core<0.15,>=0.13.0
Description-Content-Type: text/markdown

# LlamaIndex Tool: HelmSwap

`HelmSwapToolSpec` gives a LlamaIndex agent two tools for [HelmSwap](https://helmswap.com), a non-custodial swap terminal:

- `get_swap_quote`: exact-input quote with the net output, minimum output after slippage, the disclosed fee and price impact. Read-only.
- `build_swap_transaction`: the same quote, then an **unsigned** transaction (plus any ERC-20 approvals) for the user's own wallet to review and sign.

The tool spec never holds a private key, never signs and never broadcasts, and no tool argument accepts a key. Quotes expire in about 15 seconds. Building is live on Solana, Base, Ethereum, BNB Chain, Robinhood Chain, Ink, HyperEVM, Elysium and Arc; Arbitrum and Polygon are quote-only.

## Install

```bash
pip install llama-index-tools-helmswap
```

## Usage

```python
from llama_index.core.agent.workflow import FunctionAgent
from llama_index.llms.openai import OpenAI
from llama_index.tools.helmswap import HelmSwapToolSpec

tool_spec = HelmSwapToolSpec()  # api_key only needed to build Solana swaps
agent = FunctionAgent(
    tools=tool_spec.to_tool_list(),
    llm=OpenAI(model="gpt-4.1"),
    system_prompt="Quote swaps and build unsigned transactions. Never ask for private keys.",
)
print(await agent.run("Quote 0.01 ETH to USDC on Base"))
```

Amounts are integers in the token's smallest unit (0.01 ETH is `10000000000000000`).

## Configuration

- `HELMSWAP_API_KEY` (optional): free key from https://helmswap.com/developers, sent as the `X-Helm-Key` header. Required only to build Solana transactions. It is an API key, not a wallet key.
- `HELMSWAP_BASE_URL` (optional): API host, default `https://helmswap.com`.
