Queries¶
Read-only lookups for blocks, transactions, chain parameters and resource prices, the current network, connected nodes, and USDT balances.
Queries that take an explicit address generally require no auth. Queries that default to the current
wallet when an address is omitted require auth: get-address always reports the active wallet (and
so always requires auth), while get-balance and get-usdt-balance require auth only when
--address is not supplied.
Account, staking/resource, asset, contract, witness, and proposal queries live on their own pages (Accounts, Staking & Resources, TRC-10 Assets, Smart Contracts, Governance).
Network & chain¶
Current network — current-network / CurrentNetwork¶
Shows which network the client is currently connected to (MAIN, NILE, SHASTA, or CUSTOM).
java -jar build/libs/wallet-cli.jar --network nile current-network
CurrentNetwork
Chain parameters — get-chain-parameters / GetChainParameters¶
Returns the on-chain governance parameters and their current values.
java -jar build/libs/wallet-cli.jar --network nile get-chain-parameters
GetChainParameters
Next maintenance time — get-next-maintenance-time / GetNextMaintenanceTime¶
Returns the timestamp (ms) of the next maintenance period, when SR/voting changes take effect.
java -jar build/libs/wallet-cli.jar --network nile get-next-maintenance-time
GetNextMaintenanceTime
Bandwidth prices — get-bandwidth-prices / GetBandwidthPrices¶
Returns the historical bandwidth price schedule.
java -jar build/libs/wallet-cli.jar --network nile get-bandwidth-prices
GetBandwidthPrices
Energy prices — get-energy-prices / GetEnergyPrices¶
Returns the historical energy price schedule.
java -jar build/libs/wallet-cli.jar --network nile get-energy-prices
GetEnergyPrices
Memo fee — get-memo-fee / GetMemoFee¶
Returns the fee charged for attaching a memo to a transaction.
java -jar build/libs/wallet-cli.jar --network nile get-memo-fee
GetMemoFee
Blocks¶
Get block — get-block / GetBlock¶
Returns a block by number, or the latest block when no number is given.
java -jar build/libs/wallet-cli.jar --network nile get-block --number 1000000
--number(optional) — block number; defaults to the latest block.
GetBlock [BlockNum]
With no argument, returns the current block.
Get block by ID — get-block-by-id / GetBlockById¶
java -jar build/libs/wallet-cli.jar --network nile get-block-by-id --id 00000000000f4240...
--id(required) — the block ID (hash).
GetBlockById block_id
Get block by ID or number — get-block-by-id-or-num / GetBlockByIdOrNum¶
Accepts either a block number or a block ID.
java -jar build/libs/wallet-cli.jar --network nile get-block-by-id-or-num --value 1000000
--value(required) — a block number or block ID.
GetBlockByIdOrNum [idOrNum] [true]
With no argument, returns the current header. A trailing true returns the full block instead
of just the header. Run GetBlockByIdOrNum help for all forms.
Get latest N blocks — get-block-by-latest-num / GetBlockByLatestNum¶
java -jar build/libs/wallet-cli.jar --network nile get-block-by-latest-num --count 5
--count(required) — number of most-recent blocks to return.
GetBlockByLatestNum num
Get block range — get-block-by-limit-next / GetBlockByLimitNext¶
Returns blocks in the half-open range [start, end).
java -jar build/libs/wallet-cli.jar --network nile get-block-by-limit-next \
--start 1000000 --end 1000005
--start(required),--end(required, must be greater thanstart).
GetBlockByLimitNext start_block_number end_block_number
Transaction count in a block — get-transaction-count-by-block-num / GetTransactionCountByBlockNum¶
java -jar build/libs/wallet-cli.jar --network nile \
get-transaction-count-by-block-num --number 1000000
--number(required) — block number.
GetTransactionCountByBlockNum number
Transactions¶
Get transaction — get-transaction-by-id / GetTransactionById¶
Returns the transaction body for a transaction ID.
java -jar build/libs/wallet-cli.jar --network nile get-transaction-by-id --id <txid>
--id(required) — the transaction ID (hash).
GetTransactionById txid
Get transaction info — get-transaction-info-by-id / GetTransactionInfoById¶
Returns the execution result of a transaction: fees, energy/bandwidth usage, contract result, and logs. Use this to read the outcome of a state-changing contract call.
java -jar build/libs/wallet-cli.jar --network nile get-transaction-info-by-id --id <txid>
--id(required).
GetTransactionInfoById txid
Transaction info in a block — GetTransactionInfoByBlockNum (REPL only)¶
Returns the execution results of every transaction in a block.
GetTransactionInfoByBlockNum number
number(required) — block number.
Nodes¶
List nodes — list-nodes / ListNodes¶
Lists the peer nodes the connected node is aware of.
java -jar build/libs/wallet-cli.jar --network nile list-nodes
ListNodes
USDT¶
USDT balance — get-usdt-balance / GetUSDTBalance¶
Returns the USDT (TRC-20) balance of an address. Supported on main, nile, and shasta only.
java -jar build/libs/wallet-cli.jar --network nile get-usdt-balance --address TXyz...
--address(optional) — defaults to the current wallet's address.
GetUSDTBalance [Address]
With no argument, uses the logged-in account's address.
USDT transfer by ID — GetUsdtTransferById (REPL only)¶
Looks up a previously recorded USDT transfer in the local transaction history by its transaction
ID. Supported on main, nile, and shasta only.
GetUsdtTransferById txId
txId(required) — the transaction ID to look up in local history.
Encoding converter — EncodingConverter (REPL only)¶
Interactive helper that converts between address/value encodings (e.g. Base58Check ↔ hex). It prompts for input rather than taking arguments.
EncodingConverter