Skip to content

java-tron gRPC API

A java-tron node exposes its API over gRPC. This directory lists short reference docs for 82 commonly used gRPC methods, organized by topic.

Services and default ports

Service Default port Description Source
protocol.Wallet 50051 FullNode full-feature service (includes write transactions) framework/src/main/java/org/tron/core/services/RpcApiService.java
protocol.WalletSolidity 50061 Returns solidified data only; read-only framework/src/main/java/org/tron/core/services/interfaceOnSolidity/RpcApiServiceOnSolidity.java

The ports can be overridden via node.rpc.port / node.rpc.solidityPort in the node configuration (see framework/src/main/resources/config.conf).

The proto definition lives in protocol/src/main/protos/api/api.proto.

Calling

gRPC does not use URL paths to distinguish wallet from walletsolidity — they are two independent service stubs reached on different ports:

# Wallet
grpc://<host>:50051   protocol.Wallet/<Method>

# WalletSolidity (read-only)
grpc://<host>:50061   protocol.WalletSolidity/<Method>

Each method doc contains:

  • The method name (top-level heading, PascalCase, identical to the proto)
  • A short description
  • Service support (Wallet / WalletSolidity / both)
  • The matching protobuf signature

Account

Method Description
GetAccount Look up an account by address
GetAccountBalance Query an account's balance at a specific block
GetAccountNet Query an account's bandwidth resource
GetAccountResource Query an account's bandwidth + energy + TronPower
CreateAccount2 Create an account on chain (consumes 1 TRX)
UpdateAccount2 Update the account name
AccountPermissionUpdate Configure multi-sig permissions

Block / transaction query

Method Description
GetNowBlock2 The latest block
GetBlock Generic block lookup (by num/hash)
GetBlockByNum2 Look up a block by height
GetBlockById Look up a block by hash
GetBlockByLimitNext2 Look up a range of blocks
GetBlockByLatestNum2 Get the most recent N blocks
GetBlockBalanceTrace Query account balance changes within a block
GetTransactionCountByBlockNum Number of transactions in a block
GetTransactionById Look up a transaction by txID
GetTransactionInfoById Look up a transaction's receipt by txID
GetTransactionInfoByBlockNum Look up transaction receipts by block
GetPendingSize Pending pool size
GetTransactionFromPending Look up a single pending transaction
GetTransactionListFromPending All pending transaction IDs

Transaction build / broadcast

Method Description
CreateTransaction2 Build a TRX transfer transaction
GetTransactionSignWeight Query the current accumulated multi-sig weight
GetTransactionApprovedList List addresses that have signed a multi-sig transaction
BroadcastTransaction Broadcast a signed transaction (JSON)

TRC10 asset

Method Description
CreateAssetIssue2 Issue a TRC10 token
UpdateAsset2 Update a TRC10's description / URL / bandwidth limit
TransferAsset2 Transfer TRC10
ParticipateAssetIssue2 Participate in a TRC10 sale
UnfreezeAsset2 Unfreeze TRC10 locked by the issuer
GetAssetIssueById Look up TRC10 by id (recommended)
GetAssetIssueByName Look up TRC10 by name (errors on duplicate names)
GetAssetIssueListByName List TRC10s sharing a given name
GetAssetIssueByAccount TRC10s issued by an account
GetAssetIssueList All TRC10s on chain
GetPaginatedAssetIssueList Paginated TRC10 list

Smart contract

Method Description
DeployContract Deploy a contract
TriggerContract Trigger a contract (write)
TriggerConstantContract Read-only contract call
EstimateEnergy Estimate the energy cost of a call
GetContract Query contract metadata
GetContractInfo Query a contract's full runtime info
ClearContractABI Clear a contract's ABI
UpdateSetting Update the user-energy percentage
UpdateEnergyLimit Update the deployer energy limit

Witness / governance

Method Description
CreateWitness2 Apply to become an SR candidate
UpdateWitness2 Update an SR's URL
ListWitnesses List all SR candidates
GetPaginatedNowWitnessList Paginated SR list
VoteWitnessAccount2 Vote for SRs
GetBrokerageInfo An SR's current brokerage rate
UpdateBrokerage An SR updates its brokerage
GetRewardInfo Query claimable voter rewards
WithdrawBalance2 Withdraw block-production rewards / voter rewards
ProposalCreate Create a chain-parameter proposal
ProposalApprove An SR votes on a proposal
ProposalDelete Cancel a proposal you created
ListProposals List proposals
GetProposalById Look up a proposal by ID
GetPaginatedProposalList Paginated proposal list
GetChainParameters Current values of all chain parameters
GetNextMaintenanceTime Time of the next maintenance period

Stake 1.0 (unfreeze and query only)

After proposal #70 UNFREEZE_DELAY_DAYS was passed (mainnet has activated it), new V1 freeze requests are rejected on chain; the unfreeze and query methods remain so legacy positions can still be wound down.

The trailing 2 in file names (e.g. FreezeBalance2) is a historical proto naming suffix (the V1 method that returns TransactionExtention) and is not the same method as Stake 2.0's FreezeBalanceV2.

Method Description
FreezeBalance2 Freeze TRX for resources (V1, chain rejects new requests)
UnfreezeBalance2 Unfreeze matured resources (V1, still usable for legacy unfreezing)
GetDelegatedResource Look up delegation records (V1, read-only)
GetDelegatedResourceAccountIndex Look up delegation counterparty addresses (V1, read-only)

Stake 2.0

Method Description
FreezeBalanceV2 Freeze TRX for resources
UnfreezeBalanceV2 Initiate an unfreeze (14-day wait)
WithdrawExpireUnfreeze Withdraw matured unfreeze
CancelAllUnfreezeV2 Cancel all unmatured unfreezes
DelegateResource Delegate resources to another account
UnDelegateResource Undelegate resources
GetDelegatedResourceV2 Look up delegation records
GetDelegatedResourceAccountIndexV2 Look up delegation counterparty addresses
GetCanDelegatedMaxSize Current maximum delegatable amount
GetAvailableUnfreezeCount Remaining unfreeze slots
GetCanWithdrawUnfreezeAmount Withdrawable amount at a given timestamp

Node / pricing / tools

Method Description
GetNodeInfo Node status
ListNodes Known peer nodes
GetEnergyPrices Historical energy unit prices
GetBandwidthPrices Historical bandwidth unit prices
GetBurnTrx Cumulative burned TRX