Metadata-Version: 2.5
Name: meridian-finance-give-langchain
Version: 0.1.0
Summary: LangChain toolkit for Meridian Give: an agent donates its own USDC to verified charities on Arc, checked on chain.
License-Expression: MIT
License-File: LICENSE
Keywords: ai-agents,arcarius,donations,langchain,meridian,usdc
Requires-Python: >=3.10
Requires-Dist: eth-account>=0.10.0
Requires-Dist: httpx>=0.27.0
Requires-Dist: langchain-core>=0.3.0
Requires-Dist: pydantic>=2.0.0
Provides-Extra: dev
Requires-Dist: pytest; extra == 'dev'
Requires-Dist: ruff; extra == 'dev'
Description-Content-Type: text/markdown

# meridian-finance-give-langchain

LangChain toolkit for [Meridian Give](https://give.themeridian.finance), in Python. An agent finds a verified charity and donates its own USDC on Arc. No API key, no RPC, no contract address to configure.

```sh
pip install meridian-finance-give-langchain langchain-openai langgraph
```

```python
import os
from meridian_finance_give_langchain import GiveToolkit
from langchain_openai import ChatOpenAI
from langgraph.prebuilt import create_react_agent

toolkit = GiveToolkit(private_key=os.environ["AGENT_PRIVATE_KEY"])

agent = create_react_agent(
    model=ChatOpenAI(model="gpt-5"),
    tools=toolkit.get_tools(),
)
```

Without a key the toolkit is read only.

## Tools

| Tool | What it does |
|---|---|
| `give_list_charities` | Charities accepting USDC on Arc, filtered by query, category, country, verified |
| `give_get_charity` | One charity, by escrow address or name |
| `give_get_receipt` | The receipt of a donation, read from the chain |
| `give_get_spend_policy` | The agent's own caps and kill switch, and whether a gift fits |
| `give_protocol_stats` | Totals across Give: donated, released, charities, donors |
| `give_donate` | Gives the agent's own USDC and returns the receipt |

## How a donation works

Give writes a USDC permit for exactly that charity and that amount, the agent signs it locally with `eth-account` (the key never leaves the process), and Give relays the signed gift through GiveRouter and pays the gas. GiveRouter checks the escrow, the Give reference, the agent's ERC-8004 identity and its spend policy in the same transaction as the transfer.

Docs: https://give.themeridian.finance/docs#agents

## License

MIT
