langchain-send21: the agent creates crypto pay links, a human or your own wallet signs (no keys in the agent)

A few threads here (hard spending limits, “can your agent spend without permission”) come back to the same problem, so here is a small toolkit and the pattern behind it.

The split: the agent can prepare a payment, but it never holds keys or funds. It creates a pay link priced in fiat, the payer signs in their own wallet, and the agent tracks the status.

pip install langchain-send21
export SEND21_API_KEY=s21_...   # scopes: drafts:write, drafts:read

from langchain.agents import create_agent
from langchain_send21 import PayOption, Send21Toolkit

tools = Send21Toolkit(receive_options=[
    PayOption(currency="Usdc", network="Solana", address="<your-solana-address>"),
    PayOption(currency="Btc", network="Mainnet", address="name@wallet.com", method="Lightning"),
]).get_tools()

agent = create_agent("openai:gpt-5-mini", tools=tools)
agent.invoke({"messages": [{"role": "user", "content": "Create a pay link for 40 EUR for order inv-1042."}]})

Two tools:

  • send21_create_pay_link(fiat_amount, fiat_currency, order_id?, memo?, decline_note?) returns the link, id, status and expiry.
  • send21_get_pay_link_status(payment_request_id) returns Open / Completed / Cancelled / Expired.

Design choices that matter for the spending-limit question:

  • Receiving addresses come from your code, never from the model. A prompt injection can’t redirect where money goes.
  • The key’s scopes can create a link and read its status. They cannot move money, because nothing on the service side holds keys.
  • Each call uses a fresh idempotency key. With an order_id, a retry returns the open link instead of creating a second one.
  • Unsupported currency/network pairs are refused before any API call (USDT only on Solana and Ethereum, for example).

If you already use MCP, langchain-mcp-adapters can load all 11 tools from the hosted MCP server directly.

This is not an official LangChain package. It’s MIT, and the source is in send21io/send21-examples on GitHub (integrations/langchain). Feedback on the tool schema is welcome, especially from anyone running human-approval flows in LangGraph.

Docs: Crypto payments MCP server for AI agents | send21