Get account info

A query that returns the current state of the account. This query does not include the list of records associated with the account. Anyone on the network can request an account info for a given account. Queries do not change the state of the account or require network consensus. The information is returned from a single node processing the query.

Account Info Response:

Field

Description

Account ID

The account ID of the account the information was requested for.

Contract Account ID

The Contract Account ID comprising of both the contract instance and the cryptocurrency account owned by the contract instance, in the format used by Solidity.

Key(s)

The keys that are currently on the account.

Balance

The current balance of hbars on the account.

Expiration Time

The account's expiration time.

Auto Renew Period

The duration at which the account is charged to renew.

Deleted

Whether or not the account is marked as deleted.

Receiver Signature

Whether or not the signature of this account is required for other accounts to transfer to it

Proxy Account

The Account ID of the account to which this is proxy staked. If proxyAccountID is null, or is an invalid account, or is an account that isn't a node, then this account is automatically proxy staked to a node chosen by the network, but without earning payments. If the proxyAccountID account refuses to accept proxy staking , or if it is not currently running a node, then it will behave as if proxyAccountID was null.

Proxy Received

The total number of tinybars proxy staked to this account.

LiveHash

All of the livehashes attached to the account (each of which is a hash along with the keys that authorized it and can delete it).

Tokens

All tokens related to this account

Memo

A note or description that is recorded with the account entity

Query Signing Requirements

  • The client operator private key is required to sign the query request

Constructor

Description

new AccountInfoQuery()

Initializes the AccountInfoQuery object

new AccountInfoQuery()

Methods

V2
V1
V2

Method

Type

Requirement

setAccountId(<accountId>)

AccountId

Required

<AccountInfo>.accountId

AccountId

Optional

<AccountInfo>.contractAccountId

String

Optional

<AccountInfo>.isDeleted

boolean

Optional

<AccountInfo>.key

Key

Optional

<AccountInfo>.balance

Hbar

Optional

<AccountInfo>.isReceiverSignatureRequired

boolean

Optional

<AccountInfo>.liveHashes

List<LiveHash>

Optional

<AccountInfo>.tokenRelationships

Map<TokenId, TokenRelationships>

Optional

<AccountInfo>.sendRecordThreshold

Hbar

Optional

<AccountInfo>.receiveRecordThreshold

Hbar

Optional

<AccountInfo>.expirationTime

Instant

Optional

<AccountInfo>.proxyReceived

Hbar

Optional

<AccountInfo>.proxyAccountId

AccountId

Optional

<AccountInfo>.autoRenewPeriod

Duration

Optional

Java
//Create the account info query
AccountInfoQuery query = new AccountInfoQuery()
.setAccountId(newAccountId);
//Submit the query to a Hedera network
AccountInfo accountInfo = query.execute(client);
//Print the account key to the console
System.out.println(accountInfo);
//v2.0.0
JavaScript
//Create the account info query
const query = new AccountInfoQuery()
.setAccountId(newAccountId);
//Sign with client operator private key and submit the query to a Hedera network
const accountInfo = await query.execute(client);
//Print the account info to the console
console.log(accountInfo);
//v2.0.0
Go
//Create the account info query
query := hedera.NewAccountInfoQuery().
SetAccountID(newAccountId)
//Sign with client operator private key and submit the query to a Hedera network
accountInfo, err := query.Execute(client)
if err != nil {
panic(err)
}
//Print the account info to the console
fmt.Println(accountInfo)
//v2.0.0

Sample Output:

{ accountId=0.0.96928, contractAccountId=0000000000000000000000000000000000017aa0, "deleted=false", "proxyAccountId=null", proxyReceived=0 tℏ, key=302a300506032b65700321001a5a62bb9f35990d3fea1a5bb7ef6f1df0a297697ad ef1e04510c9d4ecc5db3f, balance=1 ℏ, sendRecordThreshold=92233720368.54775807 ℏ, receiveRecordThreshold=9223372 0368.54775807 ℏ, "receiverSignatureRequired=false", expirationTime=2021-02-02T19:29:36Z, autoRenewPeriod=PT2160H, "liveHashes="[] }

V1

Method

Type

Requirement

setAccountId(<accountId>)

AccountId

Required

<AccountInfo>.accountId

AccountId

Optional

<AccountInfo>.contractAccountId

String

Optional

<AccountInfo>.isDeleted

boolean

Optional

<AccountInfo>.key

Key

Optional

<AccountInfo>.balance

long

Optional

<AccountInfo>.isReceiverSignatureRequired

boolean

Optional

<AccountInfo>.liveHashes

List<LiveHash>

Optional

<AccountInfo>.tokenRelationships

Map<TokenId, TokenRelationships>

Optional

<AccountInfo>.sendRecordThreshold

long

Optional

<AccountInfo>.receiveRecordThreshold

long

Optional

<AccountInfo>.expirationTime

Instant

Optional

<AccountInfo>.proxyReceived

long

Optional

<AccountInfo>.proxyAccountId

AccountId

Optional

<AccountInfo>.autoRenewPeriod

Duration

Optional

Java
//Create the account info query
AccountInfoQuery query = new AccountInfoQuery()
.setAccountId(newAccountId);
//Submit the query to a Hedera network
AccountInfo accountInfo = query.execute(client);
//Print the account key to the console
System.out.println(accountInfo);
//v1.3.2
JavaScript
//Create the account info query
const query = new AccountInfoQuery()
.setAccountId(newAccountId);
//Sign with client operator private key and submit the query to a Hedera network
const accountInfo = await query.execute(client);
//Print the account info to the console
console.log(accountInfo);
//v1.4.4

Sample Output:

{ accountId=0.0.96928, contractAccountId=0000000000000000000000000000000000017aa0, "deleted=false", "proxyAccountId=null", proxyReceived=0 tℏ, key=302a300506032b65700321001a5a62bb9f35990d3fea1a5bb7ef6f1df0a297697ad ef1e04510c9d4ecc5db3f, balance=1 ℏ, sendRecordThreshold=92233720368.54775807 ℏ, receiveRecordThreshold=9223372 0368.54775807 ℏ, "receiverSignatureRequired=false", expirationTime=2021-02-02T19:29:36Z, autoRenewPeriod=PT2160H, "liveHashes="[] }