Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Tron] How to get balances of a Tron token #16

Open
Kunal0127 opened this issue Dec 7, 2024 · 1 comment
Open

[Tron] How to get balances of a Tron token #16

Kunal0127 opened this issue Dec 7, 2024 · 1 comment

Comments

@Kunal0127
Copy link

Kunal0127 commented Dec 7, 2024

How to get tron token/stable coin's balance?
For ex. - USDT Tron

What i can find it is ...


 Future<double> getTronAccountBalance({required String walletAddress}) async {
    try {
      final response = await tronClient.request(
        TronRequestGetAccountBalance(
          address: TronAddress(walletAddress),
        ),
      );
      dev.log(response);
      final balance = double.parse(response);
      return balance;
    } catch (error) {
      throw ("error in getAccountBalance $error");
    }
  }

Could anyone please provide way to get balance of tron token(not tron native)?
hope you understand!!!

Repository owner deleted a comment Dec 7, 2024
@mrtnetwork
Copy link
Owner

How to get tron token/stable coin's balance? For ex. - USDT Tron

What i can find it is ...


 Future<double> getTronAccountBalance({required String walletAddress}) async {
    try {
      final response = await tronClient.request(
        TronRequestGetAccountBalance(
          address: TronAddress(walletAddress),
        ),
      );
      dev.log(response);
      final balance = double.parse(response);
      return balance;
    } catch (error) {
      throw ("error in getAccountBalance $error");
    }
  }

Could anyone please provide way to get balance of tron token(not tron native)? hope you understand!!!

hi, you can find some contract interaction examples here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants