PHPackages                             tronsave/sdk - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. tronsave/sdk

ActiveLibrary[API Development](/categories/api)

tronsave/sdk
============

Fully-typed PHP SDK for the Tronsave v2 API (TRON Energy &amp; Bandwidth).

v2.0.0(1mo ago)01↓90%MITPHPPHP &gt;=8.1

Since Jun 3Pushed 1mo agoCompare

[ Source](https://github.com/tronsave/tronsave-sdk-php)[ Packagist](https://packagist.org/packages/tronsave/sdk)[ Docs](https://github.com/tronsave/tronsave-sdk)[ RSS](/packages/tronsave-sdk/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (5)Versions (2)Used By (0)

tronsave/sdk (PHP)
==================

[](#tronsavesdk-php)

Fully-typed PHP SDK for the [Tronsave](https://tronsave.io) v2 API (TRON Energy &amp; Bandwidth). PHP 8.1+, PSR-18 HTTP client (Guzzle by default).

Install
-------

[](#install)

```
composer require tronsave/sdk
```

Quick start
-----------

[](#quick-start)

```
use Tronsave\TronsaveClient;
use Tronsave\Network;

$sdk = new TronsaveClient(
    apiKey: getenv('TRONSAVE_API_KEY'),
    network: Network::Mainnet, // or Network::Testnet
);

$me = $sdk->getUserInfo();

$est = $sdk->estimateBuyResource([
    'receiver' => 'TFwUFWr3QV376677Z8VWXxGUAMFSrq1MbM',
    'resourceType' => 'ENERGY',
    'resourceAmount' => 65000, // ENERGY must be > 64000
    'durationSec' => 3600,
]);

$order = $sdk->buyResource(
    ['receiver' => 'TFwUFWr3QV376677Z8VWXxGUAMFSrq1MbM', 'resourceAmount' => 65000, 'durationSec' => 3600],
    ['allowPartialFill' => true, 'maxPriceAccepted' => 100],
);

$status = $sdk->getOrder($order->orderId);
echo $status->fulfilledPercent; // 100 = fully delegated
```

Errors
------

[](#errors)

```
use Tronsave\{TronsaveBusinessException, TronsaveRateLimitException};

try {
    $sdk->buyResource(['receiver' => 'T...', 'resourceAmount' => 65000]);
} catch (TronsaveBusinessException $e) {
    // $e->code, $e->status, $e->raw
} catch (TronsaveRateLimitException $e) {
    // $e->retryAfterMs
}
```

All exceptions extend `Tronsave\TronsaveException` (`->code`, `->status`, `->raw`). Classes: `TronsaveAuthException` (401), `TronsaveValidationException` / `TronsaveBusinessException` (400), `TronsaveRateLimitException` (429), `TronsaveNetworkException` (transport).

Notes
-----

[](#notes)

- Defaults: `resourceType=ENERGY`, `unitPrice=MEDIUM`, `durationSec=259200`.
- ENERGY `resourceAmount` must be **&gt; 64000** (rejected client-side).
- `extendTo` is a **Unix timestamp in seconds**.
- Rate limits enforced client-side (15/s; 1/s for `getExtendableDelegates`).

Develop
-------

[](#develop)

```
composer install
composer test   # runs the shared conformance suite (needs Node.js for the mock server)
```

See [`../../spec/PARITY.md`](../../spec/PARITY.md) for cross-language behavior parity.

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance90

Actively maintained with recent releases

Popularity1

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

52d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e35ea2bdbb8699921c450ce5c5c5e2c3303483ea30c90cda8ac1cb44ccfb220a?d=identicon)[tronsave](/maintainers/tronsave)

---

Tags

sdkbandwidthtronenergytronsave

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/tronsave-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/tronsave-sdk/health.svg)](https://phpackages.com/packages/tronsave-sdk)
```

###  Alternatives

[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k16](/packages/tempest-framework)[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.2k543.5M2.7k](/packages/aws-aws-sdk-php)[telnyx/telnyx-php

Official Telnyx PHP SDK — APIs for Voice, SMS, MMS, WhatsApp, Fax, SIP Trunking, Wireless IoT, Call Control, and more. Build global communications on Telnyx's private carrier-grade network.

36789.4k2](/packages/telnyx-telnyx-php)[typo3/cms

TYPO3 CMS is a free open source Content Management Framework initially created by Kasper Skaarhoj and licensed under GNU/GPL.

1.2k1.9M122](/packages/typo3-cms)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k656.1k46](/packages/neuron-core-neuron-ai)[flow-php/flow

PHP ETL - Extract Transform Load - Data processing framework

85036.3k](/packages/flow-php-flow)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
