Skip to main content

query-{view_state} RPC Method

Returns the contract state (key value pairs) based on the key prefix encoded in base64. In order to return the entire state, pass an empty string to prefix_base64. Please note that the returned state will be base64 encoded as well.

Updated on
Oct 04, 2023

Parameters

request_type
string

The type of request i.e view_state

finality
string

The assurance that the transaction cannot be altered, reversed, or canceled after they are completed. For finality=final, it means that it has been validated on at least 66% of the nodes in the network and for finality=optimistic, it uses the latest block recorded on the node that responded to the query passed

block_id
integer/string

The block id, it could be either block number or block hash

account_id
string

The id of the account associcated with the transaction

prefix_base64
string

The key prefix encoded in base64

after_key_base64
string

(Optional) A pagination cursor encoded in base64. Pass the last_key returned by the previous response to fetch the next page of state entries. Added in nearcore v2.13.0.

limit
integer

(Optional) The maximum number of state entries to return in a single page. Added in nearcore v2.13.0.

Returns

block_hash
string

The hash of the block this transaction was associated with

block_height
integer

The height of the block this transactions was associated with

proof
array

(Optional) The proof

last_key
string

(Optional) A pagination cursor encoded in base64, present when more state entries remain and absent when the listing is complete. Pass it as after_key_base64 in a subsequent request to fetch the next page. Added in nearcore v2.13.0.

values
array

An array of values that are sent with the transaction

key
string

The signer key

value
string

Integer of the value sent with this transaction encoded as a hexadecimal

proof
array

The proof encoded in hexadecimal form

Request
Don't have an account yet?
Create your Quicknode endpoint in seconds and start building
Get started for free