import { getTronWeb, isTronWalletAccount } from "@dynamic-labs-sdk/tron";
import { getPrimaryWalletAccount } from "@dynamic-labs-sdk/client";
const walletAccount = getPrimaryWalletAccount();
if (walletAccount && isTronWalletAccount(walletAccount)) {
const tronWeb = await getTronWeb({ walletAccount });
// Use TronWeb to interact with the Tron blockchain
const balance = await tronWeb.trx.getBalance(walletAccount.address);
console.log("Balance in SUN:", balance);
// Convert to TRX
const balanceInTrx = tronWeb.fromSun(balance);
console.log("Balance in TRX:", balanceInTrx);
}