curl --request POST \
--url https://rpc.mainnet.near.org/query \
--header 'Content-Type: application/json' \
--data '
{
"id": "<string>",
"jsonrpc": "<string>",
"method": "query",
"params": {
"block_id": 1,
"account_id": "<string>",
"request_type": "view_account"
}
}
'{
"result": {
"amount": "<string>",
"code_hash": "<string>",
"locked": "<string>",
"storage_usage": 1,
"block_hash": "<string>",
"block_height": 1,
"global_contract_account_id": "<string>",
"global_contract_hash": "<string>",
"storage_paid_at": 0
},
"id": "<string>",
"jsonrpc": "<string>"
}This module allows you to make generic requests to the network.
The RpcQueryRequest struct takes in a BlockReference and a QueryRequest.
The BlockReference enum allows you to specify a block by Finality, BlockId or SyncCheckpoint.
The QueryRequest enum provides multiple variants for performing the following actions:
AccessKey of an accountAccessKeyList of an accountcurl --request POST \
--url https://rpc.mainnet.near.org/query \
--header 'Content-Type: application/json' \
--data '
{
"id": "<string>",
"jsonrpc": "<string>",
"method": "query",
"params": {
"block_id": 1,
"account_id": "<string>",
"request_type": "view_account"
}
}
'{
"result": {
"amount": "<string>",
"code_hash": "<string>",
"locked": "<string>",
"storage_usage": 1,
"block_hash": "<string>",
"block_height": 1,
"global_contract_account_id": "<string>",
"global_contract_hash": "<string>",
"storage_paid_at": 0
},
"id": "<string>",
"jsonrpc": "<string>"
}query Show child attributes