Download the PHP package iexbase/tron-api without Composer

On this page you can find all versions of the php package iexbase/tron-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package tron-api

TronAPI 6.0

Latest Stable Version CI PHP

TronAPI 6.0 is a strictly typed PHP 8.4 SDK for TRON FullNode, SolidityNode, JSON-RPC, smart contracts, tokens, staking, governance, indexed data, local signing, and hierarchical wallets.

Version 6.0 is a complete architecture rewrite. It is not source-compatible with 5.x. The new API deliberately removes global address/private-key state, floating-point asset values, duplicated route logic, and any native-service dependency on TronGrid.

The default dependency resolution uses Guzzle 8. Applications whose ecosystem still requires the current Guzzle 7 line can use it without replacing the TronAPI transport API.

Requirements

Install the package without bypassing platform checks:

Quick start

The public-network profiles use TronGrid as the default hosted endpoint and indexer adapter. The SDK core is not coupled to it. A local FullNode, a separate SolidityNode, another JSON-RPC server, and any custom indexer can be composed independently:

jsonRpcUri is the complete endpoint. Use the dedicated port root for a self-hosted java-tron node (for example http://full-node.internal:8545) or the provider's exact path when it exposes JSON-RPC through a gateway.

See Node providers for role routing and custom adapter contracts.

Exact values and addresses

TRX values are never represented by float. Amount stores an exact non-negative decimal count of sun and converts decimal text without precision loss:

Address accepts checksum-verified Base58Check, 21-byte TRON hex, or explicit 20-byte ABI/EVM hex. Conversion never relies on an external node.

Safe transaction lifecycle

A state-changing service builds a transaction and approves its local TransactionIntent only after the returned node payload is checked against the requested owner, recipient/contract, amount, token ID, permission, memo, and fee limit. The SDK also reconstructs the official protobuf Transaction.raw bytes and requires an exact match with raw_data_hex, so displayed JSON cannot hide a different payload. Signing occurs locally and broadcasting is a separate explicit action.

Imported transactions have no trusted local intent and therefore require an explicit TransactionIntent before signing. Permission-aware multisignature workflows use the same verifier and append signatures immutably.

Before signing, estimateBandwidth() calculates the official protobuf size for the expected signature count. maximumBandwidthBurn() combines it with $tron->network()->bandwidthUnitPrice(); the result deliberately excludes available staked/free resources, Energy, account activation, memo, multisignature, and other operation-specific fixed fees.

Hierarchical wallets and message signatures

The wallet module implements BIP-39, BIP-32, the TRON BIP-44 path m/44'/195'/account'/change/index, xprv/xpub import/export, and public-only non-hardened address derivation.

Recovery phrases, passphrases, private keys, xprv chain codes, and provider API keys are redacted from debugger output. Private signers and wallet objects reject serialization. See Security model.

Smart contracts and tokens

The ABI subsystem supports overloaded functions, constructors, nested tuples, fixed/dynamic arrays, signed and unsigned integers, bytes, strings, addresses, return values, custom errors, revert reasons, anonymous events, and indexed log topics. Solidity aliases are expanded to their canonical types before selector hashing, and recursive encoded data is bounded before allocation. Complete calldata can be resolved by its four-byte selector and decoded with ContractService::decodeFunctionCall().

Typed contract services provide:

Runnable examples are documented in examples/README.md, including local key generation, balances, contract reads/writes, deployment, token standards, ABI events, and revert decoding.

Service map

Entry point Responsibility
$tron->accounts() Accounts, resources, activation, names, IDs, exact TRC-10 balances
$tron->blocks() Latest, confirmed, hash/number/range, transaction counts
$tron->transactions() Lookup, local signing, intent verification, multisig, broadcast, receipts
$tron->transfers() Verified TRX transfers
$tron->assets() TRC-10 issue/update/query/transfer/participation
$tron->stake() Stake 2.0 freeze, unfreeze, cancel, delegate, reclaim, resource queries
$tron->legacyStake() Explicit Stake 1.0 compatibility operations
$tron->contracts() ABI calls, estimation, writes, deployment, settings, tokens, events
$tron->permissions() Owner/active/witness permissions and operation bitmaps
$tron->network() Node state, peers, chain parameters, prices, synchronization
$tron->witnesses() Super Representatives, votes, rewards, brokerage, candidacy
$tron->governance() Proposals, approvals, cancellation, maintenance schedule
$tron->exchanges() Protocol-native exchange operations
$tron->market() Native market orders and order-book queries
$tron->jsonRpc() Complete documented TRON Ethereum-compatible JSON-RPC surface
$tron->accountHistory() Optional provider-neutral indexed account history
$tron->events() Optional provider-neutral indexed event discovery
$tron->tokenIndex() Optional provider-neutral indexed token discovery
$tron->api() Strict role-aware access to any new native endpoint

The complete coverage map is documented in API coverage.

Examples

Every example is executable and defaults to Shasta for read operations. Any broadcast requires TRON_BROADCAST=1; transaction examples read private keys only from the environment and never send them to a node. Examples 01 and 18 print newly generated local private/public values for direct inspection.

The numbered examples cover:

  1. local account/private-key generation, addresses, and exact amounts;
  2. accounts, blocks, and network information;
  3. custom node topology;
  4. build, verify, sign, and optionally broadcast;
  5. multisignature permissions;
  6. TRC-10;
  7. Stake 2.0;
  8. contract reads;
  9. contract writes;
  10. contract deployment;
  11. ABI function calldata and event decoding;
  12. TRC-20, TRC-721, and TRC-1155;
  13. provider-neutral indexed history;
  14. JSON-RPC;
  15. witnesses and governance;
  16. native exchanges and market orders;
  17. low-level/current-future endpoint access and active shielded TRC-20 routes;
  18. BIP-39/BIP-32/xprv/xpub wallets and local key output;
  19. Message Signature V2.

Documentation

The protocol reference used by this project is the official TRON developer documentation, current java-tron HTTP API implementation, and TronWeb interoperability behavior.

Development and verification

composer check runs syntax validation, PHPStan at maximum level, and the full PHPUnit suite. Network-independent tests use deterministic transports and official protocol vectors; they never broadcast funds.

License

TronAPI is released under the MIT License.

Copyright (c) 2018-2026 iEXBase.


All versions of tron-api with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
ext-bcmath Version *
ext-ctype Version *
ext-curl Version *
ext-filter Version *
ext-gmp Version *
ext-hash Version *
ext-json Version *
ext-mbstring Version *
guzzlehttp/guzzle Version ^7.15 || ^8.0
kornrunner/keccak Version ^1.1
nyra/bip39 Version ^1.0
simplito/elliptic-php Version ^1.0.12
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package iexbase/tron-api contains the following files

Loading the files please wait ...