Files
hash-wallet/cw_tron
malik1004xandGitHub 5099fa3b9c tx-confirmation-options-on-dev [cw-1463] (#3289)
* add note and contact options to tx confirmation screen

* fix closing animation for confirm sheet

* fix note button for lightning

* sizing fix

* add local tx info for evm/sol/trx

* fix for xmr/zec

* merge

* fixes
2026-06-04 11:32:19 +02:00
..
2024-05-03 21:00:05 +03:00
2024-05-03 21:00:05 +03:00
2024-05-03 21:00:05 +03:00
2024-05-03 21:00:05 +03:00
2024-05-03 21:00:05 +03:00
2026-01-17 21:04:49 +01:00

cw_tron

TRON wallet module for Cake Wallet. Implements TRX and TRC-20 token support on top of on_chain (Tron), with transaction history and fee estimation via TronGrid.

Features

  • Connect to TRON nodes over HTTP(S) via TronProvider/TronHTTPProvider.
  • Fetch TRX balance and TRC-20 token balances.
  • Estimate fees using bandwidth/energy and memo fee; accounts for available account resources.
  • Create and sign TRX and TRC-20 transfers (supports send-all and optional memo).
  • Broadcast signed transactions.
  • Load account history (TRX and TRC-20), filtering spam and TRC10-only events.
  • Manage TRC-20 tokens: add/remove tokens and fetch token metadata.
  • Sign/verify messages.
  • Node health checks for both native and token balance endpoints.

Getting started

Provide a TRON RPC endpoint and a TronGrid API key. Add a secrets file:

// cw_tron/lib/.secrets.g.dart   (DO NOT COMMIT)
const String tronGridApiKey = 'YOUR_TRONGRID_API_KEY';

Basic connect and sync:

final service = TronWalletService(walletInfoBox, client: TronClient(), isDirect: true);
final wallet = await service.create(TronNewWalletCredentials(name: 'My TRON', password: 'secret'));
await wallet.connectToNode(node: Node(uriRaw: 'api.trongrid.io', isSSL: true));
await wallet.startSync();
final trxBalance = wallet.balance[CryptoCurrency.trx];

Usage

Send TRX:

final pending = await wallet.createTransaction(
  TronTransactionCredentials.single(
    address: 'T...',
    cryptoAmount: '1.5',
    currency: CryptoCurrency.trx,
  ),
);
final txHash = await pending.commit();

Add USDT (TRC-20):

final usdt = await wallet.getTronToken('TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t');
if (usdt != null) {
  await wallet.addTronToken(usdt);
}

Additional information

  • History and token queries use TronGrid; set tronGridApiKey.
  • See lib/ for APIs: TronClient, TronWallet, TronWalletService, and credential types.