Skip to content

v1.4.0 — Resource Bundle: Buy Energy + Bandwidth in One Call

Latest

Choose a tag to compare

@tron-energy-market tron-energy-market released this 05 May 13:17

What's New

Resource Bundle

The SDK now provides a createResourceBundleTransaction() method that purchases energy and bandwidth in a single transaction via the new resource_bundle service. Use it when you need both
resources at once instead of making two separate calls.

Example

$bundle = $client->createResourceBundleTransaction(
    'TKuV4gsNRCqEZwS8zRuHJHnCgvNBce7MPe', // TRON address                                                                                                                                               
    65000,        // energy amount                                                                                                                                                                      
    350,         // bandwidth amount                                                                                                                                                                   
    1,            // duration (hours)                                                                                                                                                                   
    'bundle-1',   // external ID (optional)                                                                                                                                                             
    true          // activate address (optional)                                                                                                                                                        
);                                                                                                                                                                                                      

New Error Codes

Added support for the latest API error codes:

Code Constant Description
21 CANNOT_STOP_SUBSCRIPTION Subscription cannot be stopped
50 INVALID_BANDWIDTH_AMOUNT Bandwidth amount is invalid

Internal: amounts payload

createEnergyTransaction() and createBandwidthTransaction() now send params.amounts.{energy,bandwidth} instead of the deprecated energy_amount field, matching the recommended API contract.
Public method signatures are unchanged.

Bug Fixes

  • Fix Undefined constant CURLE_PEER_FAILED_VERIFICATION on production environments where some PHP/libcurl builds don't define the symbolic CURLE_* constants (e.g. minimal Docker images).
    Network exception classification now uses numeric libcurl error codes, which are stable across builds.

Upgrade Notes

This release is fully backward compatible. No changes required to existing code.