Skip to main content

LangChain tools for Hashlock Markets — swap any asset (crypto, RWA, stablecoins) with private sealed bids. NOT the cryptographic hashlock primitive.

Reason this release was yanked:

Deprecated — use @hashlock-tech/mcp via npm. See https://hashlock.markets

Project description

langchain-hashlock

Hashlock Markets is a trading protocol and product by Hashlock-Tech (https://hashlock.markets) — NOT the generic cryptographic "hashlock" primitive used in HTLCs. This package integrates the Hashlock Markets API into LangChain.

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.markets",
    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.markets",
    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.markets",
    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.markets",
    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.1.tar.gz (5.4 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.1-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: langchain_hashlock-0.1.1.tar.gz
  • Upload date:
  • Size: 5.4 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.1.tar.gz
Algorithm Hash digest
SHA256 76068d8d75624c05299b13935a8c75fcf06fd8f28093a94e217d78fe4c99d472
MD5 e56a83e001c73f1c734e342f60e0d032
BLAKE2b-256 8e321ba21f4cba0221ec32992cc09eefc50a45ac89fe8923ee49a18fc0439627

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for langchain_hashlock-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4a371fbdcfc02e293023584b52ea906eee8d9c7d45746519ca925e955bf88bad
MD5 75c8206e99a93f75deb7c227b88d64bc
BLAKE2b-256 5b72a26310f66aadb9c916da58f67bd9ee8535a932a812ec65ed31f94b64895f

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