Skip to main content

Overview

This comprehensive example demonstrates all available functions in the Dynamic TRON SDK, showing the actual API usage patterns and how to handle common operations.

Complete Example Code

Key Differences from Other Chains

  • signTransaction() returns JSON, not a signature: unlike TON (which returns a base64 signature to attach yourself), the TRON client returns the entire signed transaction as a JSON string, ready to POST to /wallet/broadcasttransaction.
  • Unsigned transactions come from a full node: build raw_data with /wallet/createtransaction or /wallet/triggersmartcontract; only raw_data_hex is signed.
  • TIP-191 message signing: signMessage() is the signMessageV2 surface — keccak256 over the \x19TRON Signed Message: prefix, returned as a 0x hex signature.
  • Network is chosen at broadcast time: Mainnet, Shasta, and Nile share address formats; point your full-node calls at the network you want.

Running the Example

  1. Set your environment variables:
  1. Install dependencies:
  1. Run the example:

Next Steps

Last modified on October 15, 2026