langchain-send21
send21 tools for LangChain. Crypto pay links and API for people and AI agents. Let an agent prepare a pay link and check its status without holding keys.
send21 is non-custodial software that prepares payment instructions. It never holds keys or funds, never signs and never broadcasts. The scoped API key this package uses can create a pay link but cannot move money: the payer signs in their own wallet.
Not an official LangChain package. Questions: info@send21.io
- Website: https://send21.io
- Docs: https://send21.io/docs (MCP server: https://send21.io/docs/mcp, webhooks: https://send21.io/docs/webhooks)
- Examples and source: https://github.com/send21io/send21-examples
Install
pip install langchain-send21
export SEND21_API_KEY=s21_... # scopes: drafts:write, drafts:read (https://send21.io/api-keys)
Use
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."}]})
send21_create_pay_link(fiat_amount, fiat_currency, order_id?, memo?, decline_note?)returnspay_link,payment_request_id,status,expires_at. Receiving addresses come from your code, never from the model. Each call uses a fresh idempotency key, and with anorder_ida retry returns the open link instead of creating a second one.send21_get_pay_link_status(payment_request_id)returnsOpen,Completed,CancelledorExpiredplus any "what changed" notes.
Supported pairs: BTC on Bitcoin and Lightning; wrapped BTC on Solana and WBTC on Ethereum (currency Btc); USDC on Solana, Ethereum, Base, Arbitrum, Polygon; USDT on Solana and Ethereum; EURC on Solana, Ethereum, Base; SOL; ETH on Ethereum, Base, Arbitrum. Others are refused before any API call.
New send21 accounts only accept receiving addresses the owner approved: approve each receive_options address in send21 first (sign in, passkey or authenticator code). A 422 address_not_approved or 403 owner_not_confirmed comes back as a plain explanation the agent can relay, and nothing is created.
This toolkit calls the send21 REST API with a scoped API key. MCP clients, for example LangChain through langchain-mcp-adapters, can instead load all 14 send21 MCP tools: https://send21.io/mcp with the same API key, or https://send21.io/mcp/oauth with sign-in (OAuth), no key to copy.
MCP via langchain-mcp-adapters
pip install langchain-mcp-adapters
With an API key, on https://send21.io/mcp:
import os
from langchain_mcp_adapters.client import MultiServerMCPClient
client = MultiServerMCPClient({"send21": {
"transport": "streamable_http",
"url": "https://send21.io/mcp",
"headers": {"Authorization": f"Bearer {os.environ['SEND21_API_KEY']}"},
}})
tools = await client.get_tools() # 14 tools: create_payment_request, get_payment_request, create_draft, ...
With sign-in, on https://send21.io/mcp/oauth: the owner signs in to send21 in the browser and approves the app. The MCP Python SDK's OAuthClientProvider handles discovery, client registration and PKCE; you supply token storage and the browser redirect/callback.
from mcp.client.auth import OAuthClientProvider
from mcp.shared.auth import OAuthClientMetadata
auth = OAuthClientProvider(
server_url="https://send21.io/mcp/oauth",
client_metadata=OAuthClientMetadata(
client_name="My LangChain agent",
redirect_uris=["http://localhost:3030/callback"],
grant_types=["authorization_code", "refresh_token"],
response_types=["code"],
),
storage=my_token_storage, # your mcp.client.auth.TokenStorage
redirect_handler=open_in_browser, # async (url) -> None
callback_handler=wait_for_callback, # async () -> (code, state)
)
client = MultiServerMCPClient({"send21": {
"transport": "streamable_http",
"url": "https://send21.io/mcp/oauth",
"auth": auth,
}})
tools = await client.get_tools()
A connected app only ever uses receiving addresses the owner approved, and the owner can disconnect it under https://send21.io/api-keys. Tools: create_draft, get_draft, get_draft_status, list_draft_quotes, get_transaction_template, submit_lightning_proof, create_payment_request, get_payment_request, list_address_book, propose_receiving_address, get_account_status, create_account, get_rate, get_fee_schedule. Details: https://send21.io/docs/mcp
Develop
pip install -e '.[test]' && pytest # offline, mocked HTTP
MIT
Metadata
Release files for langchain-send21 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| langchain_send21-0.1.4.tar.gz | 6.3 kB | Without provenance | Details for langchain_send21-0.1.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| langchain_send21-0.1.4-py3-none-any.whl | Python 3 | none | any | Details for langchain_send21-0.1.4-py3-none-any.whl |
Total release size: 12.4 kB
Release files / langchain_send21-0.1.4.tar.gz
| Download URL | langchain_send21-0.1.4.tar.gz |
|---|---|
| Size | 6.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
55db96034dfe1c798c66001cae59e3cde061a838cea6616618947f4b699958bb
|
|
BLAKE2b-256 checksum How to use checksums |
68e64ecf587611acc29e144f4839a303418edd407ced9a60313bb90cdc217d80
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.5
|
Release files / langchain_send21-0.1.4-py3-none-any.whl
| Download URL | langchain_send21-0.1.4-py3-none-any.whl |
|---|---|
| Size | 6.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
631cdca6ac04c61d107b15f137e2361fc984833b1551683cac1660918c592617
|
|
BLAKE2b-256 checksum How to use checksums |
2d471a196460a86343b4480ba9eb94e1e49d9f5f385f3cef824321ebb399f178
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.5
|
Security for langchain-send21 0.1.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.