Skip to content

TRON

Endpointhttps://rpc.lab.au.ro/tron
Protocoljava-tron HTTP API (REST)
Networkmainnet

TRON is REST-style: the java-tron wallet API path goes after the chain segment — POST /tron/wallet/<method>.

Supported methods

Live-verified: wallet/getnowblock, wallet/getblockbynum, wallet/getnodeinfo, wallet/getchainparameters, wallet/getaccount, wallet/gettransactionbyid, wallet/broadcasttransaction — plus the rest of the standard wallet/* surface they represent.

Quick test

bash
curl -X POST https://rpc.lab.au.ro/tron/wallet/getnowblock \
  -H "apikey: $YOUR_API_KEY"
# {"blockID":"0000000004faa27e...","block_header":{"raw_data":{"number":83534462,...}}}

SDK integration — TronWeb

TronWeb accepts our gateway as fullHost with the key as a custom header:

js
import { TronWeb } from 'tronweb'

const tronWeb = new TronWeb({
  fullHost: 'https://rpc.lab.au.ro/tron',
  headers: { apikey: process.env.YOUR_API_KEY }
})

const block = await tronWeb.trx.getCurrentBlock()
console.log('height:', block.block_header.raw_data.number)   // 83534819

Recipes

Account & TRX balance

js
const acc = await tronWeb.trx.getAccount('TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t')
const trx = await tronWeb.trx.getBalance('TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t')

TRC-20 read

js
const usdt = await tronWeb.contract().at('TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t')
const dec = await usdt.decimals().call()

(Contract calls go through wallet/triggerconstantcontract under the hood — 20 CU for trigger-class methods.)

Send TRX (offline signing)

js
const tx = await tronWeb.transactionBuilder.sendTrx(to, amountSun, from)
const signed = await tronWeb.trx.sign(tx, process.env.PRIVATE_KEY)
const receipt = await tronWeb.trx.sendRawTransaction(signed)
// → wallet/broadcasttransaction; malformed payloads return
//   {"code":"SIGERROR"/"TAPOS_ERROR",...} — the node validates first

Limitations

  • walletsolidity/* (solidity node history API) is not routed yet — use wallet/* confirmed-data methods.
  • Event log queries (/event API of tron event server) are not part of java-tron's HTTP API and are not available.