You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi!
I'm new to the blockchain technology, and I'm currently building a simple wallet using flutter.
I can get the balance of my wallet with below code.
Future<EtherAmount> getBalance(
{requiredString privateKey, requiredString rpcUrl}) async {
final client =Web3Client(rpcUrl, Client());
final credentials =EthPrivateKey.fromHex(privateKey);
final address = credentials.address;
final balance =await client.getBalance(address);
debugPrint(balance.toString());
return balance;
}
Next, I want to implement the add token just like in metamask. How do do that? I see that we need to supply the contract address. Then how do we get the balance of that token?
The text was updated successfully, but these errors were encountered:
Hi!
I'm new to the blockchain technology, and I'm currently building a simple wallet using flutter.
I can get the balance of my wallet with below code.
Next, I want to implement the add token just like in metamask. How do do that? I see that we need to supply the contract address. Then how do we get the balance of that token?
The text was updated successfully, but these errors were encountered: