POSTcall_function
https://near-mainnet.nodit.io/Executes a contract's view method in read-only mode and returns its return value as a byte array and the logs emitted during execution as an array of strings. Because it does not change state, no transaction, signature, or gas fee is required.
Call the query method with request_type: "call_function". Pass the method arguments as a JSON string encoded in base64 in args_base64. For a method without arguments, pass e30=, which is {} encoded in base64. The returned result is an array of the bytes returned by the contract (usually UTF-8 JSON); convert the bytes to a UTF-8 string and parse it as JSON to get the original value. Decoding the result in the example yields {"spec":"ft-1.0.0","name":"Wrapped NEAR fungible token","symbol":"wNEAR","icon":null,"reference":null,"reference_hash":null,"decimals":24}.
Calling an account that does not exist returns the UNKNOWN_ACCOUNT error. If the method does not exist, no contract is deployed, or execution panics, the response carries the failure reason as a string in result.error instead of an RPC error (for example, wasm execution failed with error: MethodResolveError(MethodNotFound)).
Request ID. Any string; it is returned unchanged in the response.
Query type. Fixed to call_function for calling a contract view method.
Specifies the block finality. Cannot be used together with block_id.
optimistic: the latest block the node has received (may be reorganized)near-final: a Doomslug-final block (not reverted in most cases)final: a fully finalized block
Specifies the block to query by block height (integer) or block hash (base58 string).
Cannot be used together with finality.
NEAR account ID. A human-readable name (e.g. wrap.near) or a 64-character hex implicit account ID.
Name of the contract method to call
Method arguments (a JSON string encoded in base64). If there are no arguments, pass e30=, which is {} encoded in base64.
JSON-RPC version
Request ID
Byte array of the method's return value (each element is an integer from 0 to 255). Convert the bytes to a UTF-8 string, then parse it as JSON. Methods without a return value return an empty array.
Logs emitted by the contract during execution. An empty array if there are no logs.
Failure reason when contract execution fails (for example, method not found, no contract, or panic). Present only on failure, in which case the result field is absent.
Block height.
Example: 220785385
Base58-encoded 32-byte hash (block hash, chunk hash, transaction hash, etc.).
Example: 8EjuQRnAJiWkRmqxfexQFJWXXonuSMbz5AZziJLCWnWS
Error class. REQUEST_VALIDATION_ERROR (invalid request), HANDLER_ERROR (processing error), INTERNAL_ERROR (node internal error)
The specific cause of the error.
Name of the error cause (e.g. UNKNOWN_BLOCK, UNKNOWN_ACCOUNT, PARSE_ERROR)
Additional information about the error (block hash, height, account ID, etc.)
Legacy JSON-RPC error code (e.g. -32000 server error, -32700 parse error, -32601 method not found)
Legacy error message
Legacy error details