Welcome to FMZ Quant Trading Platform
Programming Languages
Key Security
Live Trading
Strategy Library
Docker
Exchange
Strategy Editor
Backtesting System
Backtesting System Modes
Impact of Backtest Data Granularity on Backtesting
Backtesting System Supports Multiple Programming Languages
Exchanges Supported by Backtesting System
Backtest System Parameter Optimization
Save Backtest Settings
Custom Data Source
Local Backtesting Engine
Backtest Page Shortcuts
Backtest Data Download
Backtest System Sharpe Ratio Algorithm
Strategy Entry Functions
Strategy Framework and API Functions
Template Library
Strategy Parameters
Interactive Controls
Options Trading
C++ Strategy Writing Guide
JavaScript Strategy Writing Guide
Web3
Built-in Libraries
Extended API Interface
MCP Service
Trading Terminal
Data Explorer
Alpha Factor Analysis Tool
General Protocol
Debugging Tool
Remote Editing
Import and Export of Complete Strategies
Multi-language Support
Live Trading and Strategy Grouping
Live Trading Display
Strategy Sharing and Renting
Live Trading Message Push
Common Causes of Live Trading Errors and Abnormal Exits
Exchange-Specific Notes
Calling TRON RPC Methods
Use the exchange.IO() function to call TRON RPC methods. For methods requiring signatures, the underlying layer has automatically encapsulated the signing operations. The following lists commonly used methods. For other methods, please refer to the official TRON project documentation.
- GetAccountjavascriptexchange.IO("api", "tron", "GetAccount", "TKCG...") // "TKCG..." is the TRON wallet address, this function returns the account information for the "TKCG..." address.
- GetAccountResourcejavascriptexchange.IO("api", "tron", "GetAccountResource", "TKCG...") // Get resources for the specified wallet address, including energy and bandwidth.
- GetContractABIjavascriptexchange.IO("api", "tron", "GetContractABI", "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t") // Get USDT TRC20 contract ABI
- GetAssetIssueByNamejavascriptexchange.IO("api", "tron", "GetAssetIssueByName", "TRX") // Get token asset information by token name
- GetNowBlockjavascriptexchange.IO("api", "tron", "GetNowBlock") // Get current block information
- GetBlockByNumjavascriptexchange.IO("api", "tron", "GetBlockByNum", 70624300)
- GetTransactionByIDjavascriptexchange.IO("api", "tron", "GetTransactionByID", "05a8fae2cd1cbf36b61d12e219588d25b4826436f055f93388a96e620ec3f3f2") // Get Transaction by transaction hash
- TRC20ContractBalancejavascriptexchange.IO("api", "tron", "TRC20ContractBalance", "TKCG...", "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t") // Get wallet USDT balance, note that the returned data is not precision-processed, for example, returned data: ```6890251``` means ```6.890251 USDT```.
- TriggerConstantContractjavascriptfunction main() { let ret = exchange.IO("api", "tron", "TriggerConstantContract", "", "TSUUVjysXV8YqHytSNjfkNXnnB49QDvZpx", "token0()", "") // Call the token0() method of the smart contract, TriggerConstantContract is used to call read-only methods let data = exchange.IO("decode", "address", Encode("raw", "raw", "hex", ret["constant_result"][0])) // Decode data return data // data: 0x891cdb91d149f23b1a45d9c5ca78a88d0cb44c18 }
- TRC20Calljavascriptfunction main() { let ret = exchange.IO("api", "tron", "TRC20Call", "", "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t", "0x06fdde03", true, 0) // Use TRC20Call to call read-only method 0x06fdde03 let data = Encode("raw", "raw", "hex", ret.constant_result[0]) return exchange.IO("api", "tron", "ParseTRC20StringProperty", data) // Tether USD }
- Transferjavascriptexchange.IO("api", "tron", "Transfer", "TWTbn...", "TKCG...", 1000000) // Use Transfer method to transfer TRX, from "TWTbn..." to "TKCG...", 1000000 equals 1 TRX.