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 |
| Initializes the AccountInfoQuery object |
new AccountInfoQuery()
Method | Type | Requirement |
| AccountId | Required |
| AccountId | Optional |
| String | Optional |
| boolean | Optional |
| Key | Optional |
| Hbar | Optional |
| boolean | Optional |
| List<LiveHash> | Optional |
| Map<TokenId, TokenRelationships> | Optional |
| Hbar | Optional |
| Hbar | Optional |
| Instant | Optional |
| Hbar | Optional |
| AccountId | Optional |
| Duration | Optional |
Java//Create the account info queryAccountInfoQuery query = new AccountInfoQuery().setAccountId(newAccountId);//Submit the query to a Hedera networkAccountInfo accountInfo = query.execute(client);//Print the account key to the consoleSystem.out.println(accountInfo);//v2.0.0
JavaScript//Create the account info queryconst query = new AccountInfoQuery().setAccountId(newAccountId);//Sign with client operator private key and submit the query to a Hedera networkconst accountInfo = await query.execute(client);//Print the account info to the consoleconsole.log(accountInfo);//v2.0.0
Go//Create the account info queryquery := hedera.NewAccountInfoQuery().SetAccountID(newAccountId)//Sign with client operator private key and submit the query to a Hedera networkaccountInfo, err := query.Execute(client)if err != nil {panic(err)}//Print the account info to the consolefmt.Println(accountInfo)//v2.0.0
{
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="[]
}
Method | Type | Requirement |
| AccountId | Required |
| AccountId | Optional |
| String | Optional |
| boolean | Optional |
| Key | Optional |
| long | Optional |
| boolean | Optional |
| List<LiveHash> | Optional |
| Map<TokenId, TokenRelationships> | Optional |
| long | Optional |
| long | Optional |
| Instant | Optional |
| long | Optional |
| AccountId | Optional |
| Duration | Optional |
Java//Create the account info queryAccountInfoQuery query = new AccountInfoQuery().setAccountId(newAccountId);//Submit the query to a Hedera networkAccountInfo accountInfo = query.execute(client);//Print the account key to the consoleSystem.out.println(accountInfo);//v1.3.2
JavaScript//Create the account info queryconst query = new AccountInfoQuery().setAccountId(newAccountId);//Sign with client operator private key and submit the query to a Hedera networkconst accountInfo = await query.execute(client);//Print the account info to the consoleconsole.log(accountInfo);//v1.4.4
{
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="[]
}