Skip to main content

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

Metadata

Release files for langchain-powersun 1.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for langchain-powersun 1.3.0
File Size Uploaded Provenance Actions
langchain_powersun-1.3.0.tar.gz 6.7 kB Without provenance Details for langchain_powersun-1.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for langchain-powersun 1.3.0
File Interpreter ABI Platform Actions
langchain_powersun-1.3.0-py3-none-any.whl Python 3 none any Details for langchain_powersun-1.3.0-py3-none-any.whl

Total release size: 14.3 kB

Release files / langchain_powersun-1.3.0.tar.gz

Download URL langchain_powersun-1.3.0.tar.gz
Size 6.7 kB
Tags Source
SHA-256 checksum
How to use checksums
b8b53fbcc035cc1f58b981a89752ef3ecc9e9a0081d7d1a8c3d979504b67a0cb
BLAKE2b-256 checksum
How to use checksums
a32414027a7795089c8f891cb24f9b6b3d9cabc3a1fb841624fac897df83e0ee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / langchain_powersun-1.3.0-py3-none-any.whl

Download URL langchain_powersun-1.3.0-py3-none-any.whl
Size 7.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d444eccdb93896d142e41442d792f9220b80496fcc28bcae3e4f37f3640b2cae
BLAKE2b-256 checksum
How to use checksums
ffe43b0a75c552b6c50a1e4d364f1241cf1b3e5214d12abd27dfeae1289b3795
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Security for langchain-powersun 1.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page