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 (API key, x402, or 402)

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 auto Energy (API key, x402, or 402)

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.3.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.3.0-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: langchain_powersun-1.3.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.3.0.tar.gz
Algorithm Hash digest
SHA256 b8b53fbcc035cc1f58b981a89752ef3ecc9e9a0081d7d1a8c3d979504b67a0cb
MD5 fa5070df0de120e85ea41b1a093bd282
BLAKE2b-256 a32414027a7795089c8f891cb24f9b6b3d9cabc3a1fb841624fac897df83e0ee

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for langchain_powersun-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d444eccdb93896d142e41442d792f9220b80496fcc28bcae3e4f37f3640b2cae
MD5 87800feab210f42db7f981117f9ca12c
BLAKE2b-256 ffe43b0a75c552b6c50a1e4d364f1241cf1b3e5214d12abd27dfeae1289b3795

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