Skip to main content
POST
/
EXPERIMENTAL_view_code
View Contract Code
curl --request POST \
  --url https://rpc.mainnet.near.org/EXPERIMENTAL_view_code \
  --header 'Content-Type: application/json' \
  --data '
{
  "id": "<string>",
  "jsonrpc": "<string>",
  "method": "EXPERIMENTAL_view_code",
  "params": {
    "block_id": 1,
    "account_id": "<string>"
  }
}
'
{
  "result": {
    "block_hash": "<string>",
    "block_height": 1,
    "code_base64": "<string>",
    "hash": "<string>"
  },
  "id": "<string>",
  "jsonrpc": "<string>"
}

Body

application/json
id
string
required
jsonrpc
string
required
method
enum<string>
required
Available options:
EXPERIMENTAL_view_code
params
RpcViewCodeRequest · object
required

Response

200 - application/json
result
object
required

A view of the contract code.

id
string
required
jsonrpc
string
required