tron-api

API coverage

The Endpoint enum is the source of truth for built-in native and indexed HTTP routes. It declares each route’s HTTP method, node role, path parameters, and GET exceptions. Typed services consume those cases so path strings and FullNode/SolidityNode selection are not duplicated.

The catalog tracks the current java-tron FullNode and SolidityNode HTTP surface. Routes not suitable for a high-level security abstraction, especially shielded key operations, remain available through their Endpoint case and the generic ApiClient.

Typed native services

Accounts and permissions

Transactions and blocks

TRX and TRC-10

Stake 2.0

Stake 1.0 freeze/unfreeze/delegation routes are isolated in LegacyStakeService so new integrations do not use them accidentally.

Contracts

Token wrappers

Witnesses and governance

Network

Native exchanges and market

ABI coverage

AbiCodec supports the Solidity ABI data types used by TVM:

Selectors/topics use Keccak-256. Address values use 20-byte ABI form and are restored to checksum-verified TRON addresses at the boundary. Complex indexed event values remain their irreversible topic hash, and recursive static/dynamic widths and aggregate traversal work are bounded before allocation or offset traversal.

Abi accepts a standard ABI list, the abi list inside a compiler artifact, or java-tron’s on-chain { "entrys": [...] } container.

JSON-RPC coverage

JsonRpcClient provides typed methods for the complete currently documented TRON JSON-RPC set:

Quantity, BlockTag, ByteString, and LogFilter enforce JSON-RPC hex and address conventions. Block queries support latest, earliest, exact quantities, and finalized; state reads deliberately require latest. eth_call additionally accepts a typed block-number or block-hash object that java-tron validates before still executing against latest state. Stateful filters accept only their documented numeric/latest range and reject blockHash; stateless log queries also accept earliest, finalized, and an exclusive block hash. JSON-RPC error objects raise JsonRpcException with their original code/message/data. request() remains available for a newly introduced method while retaining envelope/version/request-ID validation.

BlockTag::Pending remains present only for 6.0 source compatibility and is rejected locally because java-tron does not implement pending-state queries.

Public profiles send JSON-RPC to TronGrid’s /jsonrpc path. Custom profiles use the configured endpoint verbatim, including the root of a self-hosted JSON-RPC port. The endpoint catalog also includes all current TronGrid v1 paths without making native services depend on the built-in adapter.

Indexed-data coverage

The default TronGridProvider implements:

Additional indexed asset/statistics routes exist in Endpoint for low-level access. Indexer schemas are vendor APIs and are not represented as java-tron native capabilities.

Shielded routes

The endpoint catalog includes the currently registered spending/viewing-key derivation, shielded-address, proof-parameter, authorization-signature, and shielded TRC-20 scan/spent/input routes. Legacy shielded-TRX routes whose servlet registrations are disabled in current java-tron are deliberately excluded.

They intentionally do not receive a convenience service that encourages users to send spending keys to a public host. Use an owned node and a separately audited privacy workflow. See Security model.

Forward compatibility

For a future native route:

$response = $tron->api()->request(new ApiRequest(
    NodeRole::FullNode,
    HttpMethod::Post,
    '/wallet/future-route',
    ['visible' => true],
));

This fallback is intentionally explicit: callers choose role, method, path, and payload, and receive a strict ApiResponse instead of an unvalidated mixed HTTP result.