Skip to main content

TRON

TRON is a decentralized blockchain platform that focuses on high-throughput, scalability, and content distribution. The DEMOS TRON SDK lets you prepare and sign TRX transfer payloads from a Demos transaction. The SDK is built on top of TronWeb and exposes a small set of helpers covering the common operations.

Setting up a wallet

Install the TronLink wallet extension or any wallet that exposes a TRON private key. You will need the raw private key (with or without a leading 0x) to connect the SDK.

Creating the SDK instance

You need a TRON HTTP RPC endpoint. The TRON Foundation provides public mainnet and testnet endpoints; alternatively, TronGrid and GetBlock offer hosted endpoints.

Connecting your wallet

The private key may be passed with or without a leading 0x; whitespace is trimmed automatically.

Getting your address

Getting your balance

Creating a transaction

preparePay produces a signed TRX transfer ready to broadcast. The amount is specified in SUN (the smallest TRX unit, where 1 TRX = 1,000,000 SUN):
For multiple transfers in one batch, use preparePays:

Broadcasting a transaction

Signing messages

Hacking

The DEMOS TRON SDK is a thin wrapper around TronWeb. For advanced operations (smart contracts, TRC10/TRC20 tokens, resources, etc.) you can access the underlying TronWeb instance directly:

Resources

  1. Official TRON Website
  2. Official TRON Developer Docs
  3. TronWeb GitHub
  4. Tronscan Block Explorer
  5. Shasta Testnet Faucet

API Reference

https://kynesyslabs.github.io/demosdk-api-ref/classes/xmwebsdk.TRON.html