Skip to main content

LangChain tools for Hashlock — swap any asset (crypto, RWA, stablecoins) with private sealed bids and verified counterparties

Project description

langchain-hashlock

LangChain tool integration for Hashlock — the universal intent protocol for swapping any asset (crypto, RWA, stablecoins) with private sealed bids and verified counterparties.

Installation

pip install langchain-hashlock

Quick Start

from langchain_hashlock import HashlockToolkit

# Initialize the toolkit
toolkit = HashlockToolkit(
    api_url="https://api.hashlock.ai",
    api_key="your-api-key"
)

# Get all tools for use with a LangChain agent
tools = toolkit.get_tools()

Available Tools

Tool Description
CreateIntentTool Create a trading intent to exchange any asset across any chain
CommitIntentTool Submit a sealed-bid commitment with privacy controls
ParseNaturalLanguageTool Convert everyday language into structured intents
ExplainIntentTool Get plain-language explanation of an intent
ValidateIntentTool Check intent validity before submitting

Using with an Agent

from langchain_openai import ChatOpenAI
from langchain.agents import create_openai_functions_agent, AgentExecutor
from langchain_hashlock import HashlockToolkit

llm = ChatOpenAI(model="gpt-4o")
toolkit = HashlockToolkit(
    api_url="https://api.hashlock.ai",
    api_key="your-api-key"
)

agent = create_openai_functions_agent(llm, toolkit.get_tools(), prompt)
executor = AgentExecutor(agent=agent, tools=toolkit.get_tools())
result = executor.invoke({"input": "Sell 10 ETH for USDC above 4000"})

Using Individual Tools

from langchain_hashlock import CreateIntentTool, ParseNaturalLanguageTool

# Parse natural language into a structured intent
parser = ParseNaturalLanguageTool(
    api_url="https://api.hashlock.ai",
    api_key="your-api-key"
)
result = parser.run("swap 5 ETH for USDC on Arbitrum")

# Create a trading intent directly
creator = CreateIntentTool(
    api_url="https://api.hashlock.ai",
    api_key="your-api-key"
)
result = creator.run({
    "give_asset": "ETH",
    "give_amount": "5.0",
    "want_asset": "USDC",
    "chain_id": 42161
})

Configuration

Environment variables:

What is Hashlock?

Hashlock is the universal asset exchange protocol. One address to swap crypto, RWA, and stablecoins with:

  • Private sealed bids — control what you reveal and when
  • Verified counterparties — KYC tiers from anonymous to full verification
  • Cross-chain support — Ethereum, Arbitrum, Base, Polygon, and more
  • Any asset type — ERC-20, NFTs, tokenized real estate, bonds, stablecoins

Links

License

MIT

langchain-hashlock

LangChain tools for Hashlock — swap any asset (crypo, RWA, stablecoins) with private sealed bids and veified counterparties

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

langchain_hashlock-0.1.0.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

langchain_hashlock-0.1.0-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file langchain_hashlock-0.1.0.tar.gz.

File metadata

  • Download URL: langchain_hashlock-0.1.0.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for langchain_hashlock-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7057586881784865bc9ba8588c24be3c214520cf372e4c04e359893a0e8cd037
MD5 a7fddeffa9d02105816d2b4f9b3c74a6
BLAKE2b-256 b3f99e053de3095e444a72952e2657d21fb15001a3e59e49ed29911a5f6ca0aa

See more details on using hashes here.

File details

Details for the file langchain_hashlock-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for langchain_hashlock-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 04fad6893c43652953e1a0ce3ef4c3f501ad6a034f4f5c5f211d0627b16f96ac
MD5 c15935819b421b44b87188bf29f19692
BLAKE2b-256 d1150f19aa784a2bad8a7134cc59b35bfb91fa7269a471f7d1cebcfa8a3e83e2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page