Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Blockchain by (4.1k points)

I'm trying to get the balance of an account in Aion using the Java API. No matter what I do I can't get a value from the account variable.

account = "a06f02e986965ddd3398c4de87e3708072ad58d96e9c53e87c31c8c970b211e5";
BigInteger account_balance = api.getChain().getBalance(account).getObject();

System.out.format("%n%s balance is = %d nAmp (over %d AION)%n",
    account,
    account_balance,
    account_balance.divide(BigInteger.TEN.pow(18)));

Has anyone any ideas?

1 Answer

0 votes
by (14.4k points)

The issue can be resolved by wrapping the account address in Address.wrap

You can do that by: 

account = Address.wrap("a06f02e9...");

Related questions

0 votes
1 answer
asked Jul 18, 2019 in Blockchain by Abhishek_31 (12.7k points)
0 votes
1 answer
0 votes
1 answer

Browse Categories

...