Queries
Cryptocurrency Accounts
Consensus
Tokens
File Service
Smart Contracts
Schedule Service
Get Query Cost
Method
Type
Description
//Create the query request
AccountBalanceQuery query = new AccountBalanceQuery()
.setAccountId(accountId);
//Get the cost of the query
Hbar queryCost = query.getCost(client);
System.out.println("The account balance query cost is " +queryCost);
//v2.0.0//Create the query request
const query = new AccountBalanceQuery()
.setAccountId(accountId);
//Get the cost of the query
const queryCost = await query.getCost(client);
console.log("The account balance query cost is " +queryCost);
//v2.0.0//Create the query request
query := hedera.NewAccountBalanceQuery().
SetAccountID(newAccountId)
//Get the cost of the query
cost, err := query.GetCost(client)
if err != nil {
panic(err)
}
fmt.Printf("The account balance query cost is: %v\n ", cost.String())
//v2.0.0Last updated