langchain-paylobster
LangChain integration for PayLobster - AI agent payment escrow on Base.
Installation
pip install langchain-paylobster
Quick Start
from langchain_paylobster import (
PayLobsterCreateEscrow,
PayLobsterReleaseEscrow,
PayLobsterCheckReputation,
PayLobsterRegisterAgent,
PayLobsterGetBalance,
)
from langchain.agents import initialize_agent, AgentType
from langchain_openai import ChatOpenAI
# Initialize tools
tools = [
PayLobsterCreateEscrow(),
PayLobsterReleaseEscrow(),
PayLobsterCheckReputation(),
PayLobsterRegisterAgent(),
PayLobsterGetBalance(),
]
# Create agent
llm = ChatOpenAI(temperature=0, model="gpt-4")
agent = initialize_agent(
tools,
llm,
agent=AgentType.OPENAI_FUNCTIONS,
verbose=True
)
# Use the agent
response = agent.run(
"Check the reputation of agent 0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb"
)
print(response)
Available Tools
PayLobsterCreateEscrow
Create a payment escrow that locks USDC funds until work is completed.
Parameters:
worker_address: Ethereum address of the workeramount_usdc: Amount in USDC (e.g., 100.50)deadline_hours: Hours until deadline (default: 24)description: Description of the workprivate_key: Your private key (client)
PayLobsterReleaseEscrow
Release payment to the worker after work is completed.
Parameters:
escrow_id: ID of the escrow to releaseprivate_key: Your private key (must be the client)
PayLobsterCheckReputation
Check an agent's reputation score and task history.
Parameters:
agent_address: Ethereum address of the agent
PayLobsterRegisterAgent
Register your agent on the PayLobster identity system.
Parameters:
metadata: JSON string with agent info (capabilities, contact, etc.)private_key: Your agent's private key
PayLobsterGetBalance
Check USDC balance of any address on Base.
Parameters:
address: Ethereum address to check
Example: Negotiating Agent
See examples/negotiating_agent.py for a complete example of an agent that can:
- Negotiate work terms
- Create escrow for agreed payment
- Track reputation of potential workers
- Release payment upon completion
Contract Addresses (Base Mainnet)
- Identity:
0xA174ee274F870631B3c330a85EBCad74120BE662 - Reputation:
0x02bb4132a86134684976E2a52E43D59D89E64b29 - Escrow:
0x703B528C1b07cd27992af9Ae11DD67bE685E489e - Credit:
0x4c22B52eacAB9eD2Ce018d032739a93eC68eD27a - USDC:
0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
Security
⚠️ Never hardcode private keys in production! Use environment variables or secure key management:
import os
private_key = os.environ.get("AGENT_PRIVATE_KEY")
License
MIT
Metadata
Release files for langchain-paylobster 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| langchain_paylobster-0.1.0.tar.gz | 6.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| langchain_paylobster-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.7 kB
Release files / langchain_paylobster-0.1.0.tar.gz
| Download URL | langchain_paylobster-0.1.0.tar.gz |
|---|---|
| Size | 6.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d920a0058146216f947db48a4025882115e7db6da5da0d163483b901584a2fb9
|
|
BLAKE2b-256 checksum How to use checksums |
1631889fc0e97c67b20dd9685c8017d56c9d69891e7f0d93fcd98ddc4e99e5b4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|
Release files / langchain_paylobster-0.1.0-py3-none-any.whl
| Download URL | langchain_paylobster-0.1.0-py3-none-any.whl |
|---|---|
| Size | 7.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
96f9cb86e9fab9c65a4d2a5216dae283cac913ef4fed254f62ec542b1c6e64eb
|
|
BLAKE2b-256 checksum How to use checksums |
d61859f0c1bb5df58526a1cbc06c115f9bedf14e41a6a34fbe20c2b6a4a01ad0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|