Skip to main content

Recommended: JavaScript SDK with React Hooks

For new React apps, we recommend the JavaScript SDK with React Hooks (@dynamic-labs-sdk/react-hooks) instead of the legacy React SDK documented here. The JS SDK comes with many benefits such as a much smaller bundle size and other optimizations. Use the React quickstart (JavaScript SDK) to get started.
Dynamic offers full Tron wallet support through the @dynamic-labs/tron package, enabling seamless integration with Tron network wallets using the industry-standard TronWallet Adapter. This provides access to 9+ Tron wallets through a single, unified interface.

Installation

First, install the Tron wallet connector package:

Supported Wallets

This package supports the following Tron wallets through TronWallet Adapter:

Supported Networks

Basic Integration

To use Tron wallets in your app, add the Tron wallet connectors to your Dynamic configuration:
React

Check if a wallet is a Tron wallet

The first thing you should do is check if the wallet is a Tron wallet. You can use the isTronWallet helper method for that. That way, TypeScript will know which methods etc. are available to you.
React

Fetch the wallet address

You can get the wallet address using the wallet.address property:
React

Send TRX

To send TRX (the native Tron currency) to another address, use the sendTrx method:
React

Send TRC20 Tokens

To send TRC20 tokens (like USDT) to another address, use the sendTrc20 method:
React

Sign Messages

Tron wallets support message signing for authentication using signMessageV2:
React

Get Balance

To get the TRX balance of an address, use the getBalance method:
React

Get Token Balance

To get the balance of a TRC20 token, use the getTokenBalance method:
React

Access TronWeb

You can get direct access to the TronWeb instance for advanced operations:
React

Get Network Details

To get information about the current network, use the getNetworkDetails method:
React

API Reference

Core Methods

  • getAddress(): Promise<string> - Get the wallet address
  • getNetwork(): Promise<string | number | undefined> - Get current network
  • signMessage(message: string | Uint8Array): Promise<string> - Sign a message
  • getBalance(address?: string): Promise<string | undefined> - Get TRX balance (in SUN)
  • sendTrx(to: string, amount: number, options?: { from?: string }): Promise<BroadcastReturn> - Send TRX
  • sendTrc20(params): Promise<string | undefined> - Send TRC20 tokens
  • getTokenBalance(tokenId: string, address?: string): Promise<number> - Get TRC20 token balance
  • getNetworkDetails(): Promise<{ chainId: string; name: string }> - Get network info
  • getTronWeb(): TronWeb | undefined - Get TronWeb instance

Type Definitions

  • TronWallet - The main wallet class for Tron wallets
  • isTronWallet - Type guard to check if a wallet is a Tron wallet

Resources

Last modified on June 25, 2026