簡體   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