Overview
Retrieves comprehensive information about a NEAR account, including total and available balance, storage usage, and contract deployment details.Method Signatures
Throwable Variant
Safe Variant
Result object that contains either the success value or error, never throws.
Parameters
The account ID to query information for.
Query account state at a specific block. Can be:
'LatestOptimisticBlock'- Latest optimistic block (default)'LatestNearFinalBlock'- Latest near-final block'LatestFinalBlock'- Latest final block{ blockHash: BlockHash }- Specific block by hash{ blockHeight: BlockHeight }- Specific block by height'EarliestAvailableBlock'- Earliest available block'GenesisBlock'- Genesis block
Configuration for transport behavior.
Transport-specific policies like retry behavior and timeout settings.
Additional execution options.
AbortSignal to cancel the request.
Return Type
Hash of the block where the account state was queried.
Height of the block where the account state was queried.
The queried account ID.
Detailed account information.
Balance breakdown for the account.
Total balance including locked funds.
Available balance that can be transferred or used.
Locked balance details.
Total locked amount.
Number of bytes used for account storage.
Hash of the deployed contract code (if account has a contract).
Hash of the global contract (if using shared contract).
Account ID of the global contract owner (if using shared contract).
Raw RPC result from the NEAR node.
Error Codes
When usingsafeGetAccountInfo, the following error codes may be returned:
Client Errors
Client.GetAccountInfo.Args.InvalidSchema- Invalid arguments providedClient.GetAccountInfo.StoragePricePerByte.NotLoaded- Storage price data not loadedClient.GetAccountInfo.PreferredRpc.NotFound- Preferred RPC endpoint not foundClient.GetAccountInfo.Timeout- Request timed outClient.GetAccountInfo.Aborted- Request was abortedClient.GetAccountInfo.Exhausted- All retry attempts exhausted
RPC Errors
Client.GetAccountInfo.Rpc.Account.NotFound- Account does not exist at specified blockClient.GetAccountInfo.Rpc.NotSynced- Node is not syncedClient.GetAccountInfo.Rpc.Shard.NotTracked- Shard is not tracked by this nodeClient.GetAccountInfo.Rpc.Block.GarbageCollected- Block has been garbage collectedClient.GetAccountInfo.Rpc.Block.NotFound- Block not found
Internal Errors
Client.GetAccountInfo.Internal- Internal library error