Skip to content
All library documents

Using FMZ to Query Tron and Interact with TRC20 Contracts

Article FMZ digest · Author: 发明者量化-小小梦

Summary

This tutorial describes how to configure FMZ for the Tron network and use its interfaces to inspect accounts, blocks, transactions, and TRC20 tokens. It also explains querying TRX balances through a JSON-RPC endpoint, including converting wallet address formats and scaling raw integer balances using the token’s decimal precision. The examples cover account and network information, token metadata and balances, contract calls, transaction construction, ABI retrieval, and data encoding and decoding.

The final example reads SunSwap factory data to obtain the pool count and a pool address, presenting this as an initial exploration rather than a complete decentralized exchange strategy. Evidence consists of sample requests and returned fields, including a balance comparison with a block explorer. The article is implementation-oriented: it does not evaluate trading profitability, transaction costs, security practices, or reliability across RPC providers, and its SunSwap discussion stops before executing a swap.

Key ideas

  • FMZ can be configured with a Tron wallet and node to support on-chain queries and contract interaction.
  • Raw TRX balances returned by JSON-RPC require conversion from hexadecimal and scaling by the token’s decimal precision.
  • The platform’s Tron interface exposes methods for retrieving account, block, transaction, network, and TRC20 information.
  • Contract calls can be encoded and decoded, and read-only calls can return results without broadcasting a transaction.
  • The SunSwap example reads factory contract data but does not demonstrate a full trading strategy or swap.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.