繁体   English   中英

显示永恒之塔账户的余额

[英]Display balance from an Aion Account

我正在尝试使用Java API在Aion中获得帐户余额。 无论我做什么,我都无法从account变量中获取值。

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)));

有没有人有任何想法?

您需要在Address.wrap包装您的帐户地址。

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

您还可以尝试使用JSON请求进行RPC API调用: {"jsonrpc":"2.0","method":"eth_getBalance","params":["0x0","latest"],"id":32}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM