Documentation
¶
Overview ¶
Package tron reads a Tron wallet (Ledger, TronLink…) from its public address: TRX and TRC-20 history and balances. Nothing is signed and no secret is needed.
Data comes from TronGrid's v1 API (/v1/accounts/{address}, …/transactions, …/transactions/trc20), which answers without a key at a low rate; a free TronGrid key raises the limit.
Limits of this first version:
- a swap on a DEX shows as its two legs (a Withdrawal of what was sent and a Deposit of what was received), not as a Trade;
- TRC-10 tokens (TransferAssetContract) are ignored: nearly all are airdropped junk;
- spam TRC-20 tokens are skipped by heuristics (see spam), and well-known symbols (USDT, USDC, USDD…) only count from their canonical contract, so a counterfeit "USDT" airdrop is ignored;
- TRX frozen for energy or bandwidth (Stake 1.0 and 2.0), delegated to another account or waiting to be unfrozen still counts in the balance: it is still the owner's;
- voting rewards are read when claimed (WithdrawBalanceContract), with one extra call per claim for the amount; unclaimed rewards are not counted.
Index ¶
Constants ¶
View Source
const Network = "tron"
Network is the chain name set on activities.
Variables ¶
This section is empty.
Functions ¶
func FromHex ¶
FromHex converts the hex form raw transactions use (41 + 20 bytes, or the 20 bytes alone as in EVM-style logs) to base58check; anything else comes back unchanged, so a base58 address passes through.
Types ¶
Click to show internal directories.
Click to hide internal directories.