Skip to main content

LangChain tools for Mycelia Signal — cryptographically signed price oracles with automatic x402 (USDC on Base) payment

Project description

langchain-mycelia-signal

LangChain tools for Mycelia Signal — cryptographically signed price oracles with automatic x402 (USDC on Base) payment.

No API keys. No accounts. Install and go.


Installation

pip install langchain-mycelia-signal

For paid mode (signed attestations with automatic x402 payment):

pip install langchain-mycelia-signal[paid]

Quick Start

from langchain_mycelia_signal import MyceliaSignalTools
from langchain.agents import AgentExecutor, create_tool_calling_agent
from langchain_openai import ChatOpenAI

# Get tools
tools = MyceliaSignalTools().as_list()

# Build your agent
llm = ChatOpenAI(model="gpt-4o")
agent = create_tool_calling_agent(llm, tools, prompt)
executor = AgentExecutor(agent=agent, tools=tools)

# Ask naturally
result = executor.invoke({"input": "What is the Bitcoin price right now?"})

Free vs Paid Mode

Free mode (default — no config needed)

Returns price data without a cryptographic signature. Useful for testing and display.

tools = MyceliaSignalTools()
print(tools.mode)  # "free"

Paid mode — signed attestations

Add your Base wallet private key to your .env:

MYCELIA_WALLET_PRIVATE_KEY=0x...

The tool detects the key automatically and switches to paid endpoints. Payment is handled internally — $0.001 USDC per query on Base via x402. No code changes required.

tools = MyceliaSignalTools()
print(tools.mode)  # "paid"

Signed responses include a cryptographic signature verifiable on-chain. See verification docs.


Supported Pairs

Pair Description Cost
BTCUSD Bitcoin / USD spot (median, 9 sources) $0.001
BTCUSD_VWAP Bitcoin / USD 5-min VWAP $0.002
ETHUSD Ethereum / USD spot (median, 5 sources) $0.001
EURUSD Euro / USD spot (median, 8 sources incl. central banks) $0.001
XAUUSD Gold / USD spot (median, 8 sources) $0.001
SOLUSD Solana / USD spot (median, 9 sources) $0.001
BTCEUR Bitcoin / EUR spot (cross-rate + direct feeds) $0.001
BTCEUR_VWAP Bitcoin / EUR 5-min VWAP $0.002
ETHEUR Ethereum / EUR spot (hybrid) $0.001
SOLEUR Solana / EUR spot (hybrid) $0.001
XAUEUR Gold / EUR spot (cross-rate) $0.001

Example Response

Free mode:

Pair:      BTCUSD
Price:     84231.50 USD
Timestamp: 2026-03-05T12:00:00Z
Sources:   Coinbase,Kraken,Bitstamp,Gemini,Bitfinex,Binance,BinanceUS,OKX,Gate.io
Method:    median
Signed:    False

Paid mode:

Pair:      BTCUSD
Price:     84231.50 USD
Timestamp: 2026-03-05T12:00:00Z
Sources:   Coinbase,Kraken,Bitstamp,Gemini,Bitfinex,Binance,BinanceUS,OKX,Gate.io
Method:    median
Signed:    True
Signature: MEUCIQD...
Pubkey:    02abc...
Canonical: v1|BTCUSD|84231.50|USD|2|2026-03-05T12:00:00Z|abc123|Coinbase,...|median

Direct Tool Use

from langchain_mycelia_signal import get_mycelia_price

# Call directly
result = get_mycelia_price.invoke({"pair": "BTCUSD"})
print(result)

Links


License

MIT

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_mycelia_signal-1.0.0.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

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

langchain_mycelia_signal-1.0.0-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file langchain_mycelia_signal-1.0.0.tar.gz.

File metadata

File hashes

Hashes for langchain_mycelia_signal-1.0.0.tar.gz
Algorithm Hash digest
SHA256 c31d4cc99c38e8084c52825a481c28b4d8fa46a5559123e2fb10fd72edc171d2
MD5 0d80d2992775c6c367503ce5b43fadff
BLAKE2b-256 70cc5c4a044edbccbabfb2396690f25a4763aac4fe29dad7c5cd147d9e76e32f

See more details on using hashes here.

File details

Details for the file langchain_mycelia_signal-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for langchain_mycelia_signal-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e9d4e45d5077255a5c208beba227b394d51e0650fcd279911dbc1b5c7742e235
MD5 0c8c909267948ed86da69cadbd757e3c
BLAKE2b-256 7f77b84944249ed132514022198f442566f323740aca78476659a83e61464d60

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