SDK
Official TronSave SDKs for buying and managing Energy and Bandwidth on TRON — available for TypeScript, Rust, Python, Java, and PHP.
The TronSave SDKs let you interact with the TronSave API to manage resources (Energy and Bandwidth) on the TRON blockchain. Each SDK exposes strongly-typed functions for estimating costs, buying resources, extending orders, and tracking order status, and integrates cleanly into backend services.
Available SDKs
All SDKs target the v2 API.
Install
npm install tronsave-sdk
# or: yarn add tronsave-sdkRequires Node.js v18.0.0+.
cargo add tronsaveOr in Cargo.toml:
[dependencies]
tronsave = "2.0.0"pip install tronsaveRequires Python 3.9+.
Maven (pom.xml):
<dependency>
<groupId>io.tronsave</groupId>
<artifactId>sdk</artifactId>
<version>2.0.0</version>
</dependency>Gradle (build.gradle):
implementation 'io.tronsave:sdk:2.0.0'composer require tronsave/sdkRequires PHP 8.1+.
Basic usage
The fastest way to get started is the API Key flow: create an SDK instance, estimate the cost, then place an order. Get an API key from the TronSave dashboard — see Authentication.
Set network: "mainnet" for production. The example uses "testnet" (Nile), where everything works the same way but uses no real TRX. See Environments & Networks.
Features
All SDKs provide the following operations:
Buy Resource — buy Energy or Bandwidth.
Estimate Buy Resource — estimate the cost of a purchase before ordering.
Extend Request — extend an existing resource delegation.
Get Extendable Delegates — list delegates that can be extended.
Get User Info — fetch account information and balance.
Get Order / Get Orders — fetch order details and order history.
Get Order Book — read the current order book.
Last updated