Skip to main content

LangChain integration for PowerSun.vip — TRON Energy & Bandwidth marketplace and DEX swap aggregator with 27 MCP tools for AI agents

Project description

langchain-powersun

LangChain integration for PowerSun.vip — the TRON Energy & Bandwidth marketplace and DEX swap aggregator for AI agents.

Install

pip install langchain-powersun

Quick Start

from langchain_powersun import PowerSunToolkit

# Public tools (market data, estimates)
tools = PowerSunToolkit().get_tools()

# With authentication (buy energy, check balance)
tools = PowerSunToolkit(api_key="ps_your_key").get_tools()

# Use with any LangChain agent
from langchain.agents import create_react_agent
from langchain_openai import ChatOpenAI

llm = ChatOpenAI(model="gpt-4o")
agent = create_react_agent(llm, tools)
agent.invoke({"input": "What's the current price of TRON energy on PowerSun?"})

Available Tools (12)

Registration Tools (public, no auth required)

Tool Description
powersun_register Start registration — get a challenge to sign with your TRON wallet
powersun_verify_registration Submit wallet signature → get API key

Market Tools (public, no auth required)

Tool Description
powersun_get_prices Energy & Bandwidth prices for all duration tiers
powersun_estimate_cost Calculate exact cost for transactions
powersun_get_available_resources Available Energy & Bandwidth
powersun_get_market_overview Full market snapshot

Buyer Tools (auth recommended)

Tool Description
powersun_buy_energy Purchase Energy delegation
powersun_get_balance Account balance and deposit info
powersun_get_order_status Order status with delegation progress
powersun_broadcast_transaction Broadcast pre-signed tx with auto Energy

Swap Tools (auth required)

Tool Description
powersun_get_swap_quote Get swap quote for SunSwap DEX (TRX, USDT, USDC, SUN, BTT, WIN, JST, any TRC-20)
powersun_execute_swap Execute signed swap TX with automatic energy delegation

Why PowerSun?

  • Only 10% commission — lowest on the market
  • Save 20-50% on TRON transaction fees
  • Instant delegation — Energy arrives within seconds
  • AI-native — built for autonomous agent workflows

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_powersun-1.2.0.tar.gz (6.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_powersun-1.2.0-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file langchain_powersun-1.2.0.tar.gz.

File metadata

  • Download URL: langchain_powersun-1.2.0.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for langchain_powersun-1.2.0.tar.gz
Algorithm Hash digest
SHA256 93d857f0b6c0d02ccf71580b9ed677f36186913f65455a926ce7531d8e4f1c63
MD5 1c9b94eab7120a2d1f11b10b9f31ed33
BLAKE2b-256 164919fe389cfa126212310514195ad34277c21becc97f261697736919a6685c

See more details on using hashes here.

File details

Details for the file langchain_powersun-1.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for langchain_powersun-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 15a60d3c8ed5668e05359f0b98f64a1241231de4b99bcfabfab4e87e4e206e9b
MD5 63215d0e5bd271d32e5bbef1fe3b5a13
BLAKE2b-256 68bd7f50c67fb254792045977b3235129f03b768b29b3d56f01ba4c521e6bf03

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