### Active example request for GET /v1/ft/wrap.near/top Source: https://docs.fastnear.com/api/v1/ft-top Example request body for the Mainnet network. The path parameter token_id is set to 'wrap.near'. ```json { "body": null, "headers": {}, "path": { "token_id": "wrap.near" }, "query": {} } ``` -------------------------------- ### GET /status Request Example Source: https://docs.fastnear.com/api/system/status Example request body for the GET /status endpoint on Mainnet. It shows the expected structure with empty body, headers, path, and query parameters. ```json { "body": null, "headers": {}, "path": {}, "query": {} } ``` -------------------------------- ### Example request body for GET /v1/account/{account_id}/ft Source: https://docs.fastnear.com/api/v1/account-ft Shows the JSON structure of the request body for the mainnet example. The path parameter account_id is set to 'root.near'. ```json { "body": null, "headers": {}, "path": { "account_id": "root.near" }, "query": {} } ``` -------------------------------- ### Request example for GET /v1/public_key/{public_key}/all Source: https://docs.fastnear.com/api/v1/public-key-all Example request body for the V1 public key lookup-all endpoint. The path parameter `public_key` is set to a NEAR public key in `ed25519:...` form. The body and query are empty. ```json { "body": null, "headers": {}, "path": { "public_key": "ed25519:CCaThr3uokqnUs6Z5vVnaDcJdrfuTpYJHJWcAGubDjT" }, "query": {} } ``` -------------------------------- ### Active example request reference Source: https://docs.fastnear.com/tx/transactions Full request reference showing the body, headers, path, and query for the active example. ```json { "body": { "tx_hashes": [ "FDrh13CdfGPXsmwUpZLfkZCoXWfpQmaFGj4zYWc1qfh", "Eq1a46bynaBAjoSxd2XGWdCxkZdrMvN9jMZVdZfPSjM5" ] }, "headers": {}, "path": {}, "query": {} } ``` -------------------------------- ### Mainnet Request Example Source: https://docs.fastnear.com/openapi/rpc/EXPERIMENTAL_light_client_proof.yaml Example request body for the EXPERIMENTAL_light_client_proof method on mainnet. Includes the light_client_head, sender_id, transaction_hash, and type parameters. ```json { "jsonrpc": "2.0", "id": "fastnear", "method": "EXPERIMENTAL_light_client_proof", "params": { "light_client_head": "9XN7MvfDywZ6xT6Ky1MT2iCZkKuHikJXmNazxdZ4x6T", "sender_id": "escrow.ai.near", "transaction_hash": "34E7KweCDqXh3xPKdBgSWRqo44yTWjbka9deMK8JbAxx", "type": "transaction" } } ``` -------------------------------- ### Testnet Request Example Source: https://docs.fastnear.com/openapi/rpc/EXPERIMENTAL_light_client_proof.yaml Example request body for the EXPERIMENTAL_light_client_proof method on testnet. Includes the light_client_head, sender_id, transaction_hash, and type parameters. ```json { "jsonrpc": "2.0", "id": "fastnear", "method": "EXPERIMENTAL_light_client_proof", "params": { "light_client_head": "6JYj6i1FaUCzqoy41CqUcZJxa5n9EmLEENRDH2gLm5u", "sender_id": "near-mpc-staking4all-01.testnet", "transaction_hash": "9LPJkwHYgda7KHrUR6cJozBcpdA1kUMSEwm81JPz", "type": "transaction" } } ``` -------------------------------- ### Mainnet Request Example Source: https://docs.fastnear.com/openapi/rpc/EXPERIMENTAL_light_client_block_proof.json Example request for the mainnet endpoint. Uses the method EXPERIMENTAL_light_client_block_proof with block_hash and light_client_head parameters. ```json { "jsonrpc": "2.0", "id": "fastnear", "method": "EXPERIMENTAL_light_client_block_proof", "params": { "block_hash": "64utzv4G8AwNSxVnjKPwU46VL435jQbQokbaYFtZ6V", "light_client_head": "9XNMt7DywvfGx6TKy1iCZkKuHikJXmNazxdZ4x6T" } } ``` -------------------------------- ### Testnet Request Example Source: https://docs.fastnear.com/openapi/rpc/EXPERIMENTAL_light_client_block_proof.json Example request for the testnet endpoint. Uses the method EXPERIMENTAL_light_client_block_proof with block_hash and light_client_head parameters. ```json { "jsonrpc": "2.0", "id": "fastnear", "method": "EXPERIMENTAL_light_client_block_proof", "params": { "block_hash": "GTnMamkzwhTdaZ48g7BvFALJ4ECZYJZA9aagejnAinp", "light_client_head": "6JYj6i1FaUCzdoqy41CqUcZJ5n9EmLEENRDH2gLm5u" } } ``` -------------------------------- ### Mainnet request for EXPERIMENTAL_light_client_proof Source: https://docs.fastnear.com/openapi/rpc/EXPERIMENTAL_light_client_proof.json Example request to the mainnet endpoint to get a light client execution proof for a transaction. The `type` parameter is set to `transaction`. ```json { "jsonrpc": "2.0", "id": "fastnear", "method": "EXPERIMENTAL_light_client_proof", "params": { "light_client_head": "9XN7MtDywZvfGx6TKy1MT2iCZkKuHikJXmNazxdZ4x6T", "sender_id": "escrow.ai.near", "transaction_hash": "34E7weKCDqXh3xPKdBgSWRqo44yTWjbka9deMK8JbAxx", "type": "transaction" } } ``` -------------------------------- ### POST / Source: https://docs.fastnear.com/openapi/rpc/EXPERIMENTAL_protocol_config.yaml Fetch the runtime protocol config at a chosen block — gas costs, storage prices, and limits currently in force. ```APIDOC ## [POST] / ### Description Fetch the runtime protocol config at a chosen block — gas costs, storage prices, and limits currently in force. ### Method POST ### Endpoint / ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **jsonrpc** (string) - Required - Must be "2.0" - **id** (string) - Required - Client-generated identifier (e.g., "fastnear") - **method** (string) - Required - Must be "EXPERIMENTAL_protocol_config" - **params** (object) - Required - One of multiple possible types. Example: { "finality": "final" } ### Request Example { "jsonrpc": "2.0", "id": "fastnear", "method": "EXPERIMENTAL_protocol_config", "params": { "finality": "final" } } ### Response #### Success Response (200) - **jsonrpc** (string) - Always "2.0" - **id** (string or number) - Echo of the request id - **result** (object) - Protocol config object - **block_producer_kickout_threshold** (integer) - Threshold for kicking out block producers, between 0 and 100. - **chain_id** (string) - ID of the blockchain. Must be unique for every blockchain. - **chunk_producer_kickout_threshold** (integer) - Threshold for kicking out chunk producers, between 0 and 100. - **chunk_validator_only_kickout_threshold** (integer) - Threshold for kicking out nodes which are only chunk validators, between 0 and 100. - **dynamic_resharding** (boolean) - Enable dynamic re-sharding. - **epoch_length** (integer) - Epoch length counted in block heights. - **fishermen_threshold** (string) - Amount in yoctoNEAR - **gas_limit** (string) - Gas amount - **gas_price_adjustment_rate** (array of integers) - Gas price adjustment rate #### Response Example { "jsonrpc": "2.0", "id": "fastnear", "result": { "block_producer_kickout_threshold": 90, "chain_id": "mainnet", "chunk_producer_kickout_threshold": 90, "chunk_validator_only_kickout_threshold": 90, "dynamic_resharding": false, "epoch_length": 43200, "fishermen_threshold": "1000000000000000000000", "gas_limit": "100000000000000", "gas_price_adjustment_rate": [1, 100] } } ### Error Handling #### 403 Forbidden - **Description**: The supplied API key was not recognized. - **Response Body** (text/plain): `Invalid API key` ### Authentication - **None** (optional) - No authentication required. - **BearerAuth** (optional) - FastNEAR API key as an `Authorization: Bearer` header. Preferred for backends, workers, and proxies because it keeps the key out of URLs and logs. - **ApiKeyAuth** (optional) - FastNEAR API key as the `apiKey` query parameter. Handy for curl or clients that cannot set headers, but the key can end up in URLs, logs, and shell history. ### Servers - https://rpc.mainnet.fastnear.com (Mainnet) - https://rpc.testnet.fastnear.com (Testnet) - https://archival-rpc.mainnet.fastnear.com (Mainnet Archival) - https://archival-rpc.testnet.fastnear.com (Testnet Archival) ``` -------------------------------- ### GET /v0/first_block Source: https://docs.fastnear.com/assets/files/neardata-3ad3f0506033a28203f9dec32a5664c8.json Redirect to the first block after genesis. Useful for indexers starting from the beginning of the chain. ```APIDOC ## [GET] /v0/first_block ### Description Redirect to the chain's first post-genesis block — a starting cursor for indexers backfilling from the beginning. ### Method GET ### Endpoint /v0/first_block ### Parameters #### Query Parameters - **apiKey** (string) - Optional - FastNEAR subscription API key. Invalid values may return `401` before redirect handling. ### Response #### Success Response (200) - **BlockDocument** (object, nullable) - Full block document returned after automatic redirect following. #### Redirect Response (302) - **Location** (string) - Redirect to the canonical first block URL. #### Error Responses - **401** (text/plain) - Invalid or unauthorized API key. Example: `Unauthorized` ``` -------------------------------- ### GET /v0/history/{current_account_id}/{predecessor_id}/{key} Source: https://docs.fastnear.com/fastdata/kv/get-history-key Performs a GET request to fetch historical writes for the specified key. The example uses social.near as the current account, james.near as the predecessor, and graph%2Ffollow%2Fsleet.near as the key. ```http GET /v0/history/social.near/james.near/graph%2Ffollow%2Fsleet.near ``` -------------------------------- ### Testnet maintenance_windows request Source: https://docs.fastnear.com/openapi/rpc/maintenance_windows.yaml Example JSON-RPC request to get maintenance windows for account root.testnet on the testnet endpoint. ```json { "jsonrpc": "2.0", "id": "fastnear", "method": "maintenance_windows", "params": { "account_id": "root.testnet" } } ``` -------------------------------- ### network_info request example (mainnet) Source: https://docs.fastnear.com/openapi/rpc/network_info.yaml Example JSON-RPC request body for the `network_info` method on the mainnet endpoint. The `params` array must be empty. ```json { "jsonrpc": "2.0", "id": "fastnear", "method": "network_info", "params": [] } ``` -------------------------------- ### Mainnet maintenance_windows request Source: https://docs.fastnear.com/openapi/rpc/maintenance_windows.yaml Example JSON-RPC request to get maintenance windows for account root.near on the mainnet endpoint. ```json { "jsonrpc": "2.0", "id": "fastnear", "method": "maintenance_windows", "params": { "account_id": "root.near" } } ``` -------------------------------- ### POST / Source: https://docs.fastnear.com/openapi/rpc/view_access_key_list.yaml Structured API documentation for the view_access_key_list RPC endpoint. ```APIDOC ## POST / ### Description Fetch every access key attached to an account, each with its permissions and nonce. ML-DSA-65 keys are listed by their ml-dsa-65-hash: handle; to query one with view_access_key, or to reference it in an action, use the full ml-dsa-65: public key instead. ### Method POST ### Endpoint / ### Parameters #### Request Body - **jsonrpc** (string) - Required - Must be "2.0". - **id** (string) - Required - Request identifier, e.g., "fastnear". - **method** (string) - Required - Must be "query". - **params** (object) - Required - Parameters for the query. - **account_id** (string) - Required - NEAR account ID. - **request_type** (string) - Required - Must be "view_access_key_list". - **finality** (string) - Required - Block finality: "final", "near-final", or "optimistic". ### Request Example { "jsonrpc": "2.0", "id": "fastnear", "method": "query", "params": { "account_id": "root.near", "request_type": "view_access_key_list", "finality": "final" } } ### Response #### Success Response (200) - **jsonrpc** (string) - Must be "2.0". - **id** (string or number) - Request identifier. - **result** (object) - Lists access keys. - **keys** (array) - Array of access key objects. #### Response Example { "jsonrpc": "2.0", "id": "fastnear", "result": { "keys": [] } } #### Error Response (403) - **description** - The supplied API key was not recognized. - **example** - "Invalid API key" ``` -------------------------------- ### GET /v0/first_block Source: https://docs.fastnear.com/openapi/neardata.json Redirects to the chain's first post-genesis block, providing a starting cursor for indexers backfilling from the beginning. ```APIDOC ## GET /v0/first_block ### Description Redirects to the chain's first post-genesis block, providing a starting cursor for indexers backfilling from the beginning. ### Method GET ### Endpoint /v0/first_block ### Parameters #### Query Parameters - **apiKey** (string) - Optional - FastNEAR subscription API key. Invalid values may return `401` before redirect handling. ### Response #### Success Response (200) - **BlockDocument** (object, nullable) - Full block document returned after automatic redirect following. #### Response Example ```json { "block": {} } ``` #### Redirect Response (302) - **Location** (string) - Redirect to the canonical first block URL. #### Error Response (401) - **message** (string) - Unauthorized ``` -------------------------------- ### POST / Source: https://docs.fastnear.com/openapi/rpc/EXPERIMENTAL_protocol_config.json This endpoint fetches the runtime protocol config at a chosen block, including gas costs, storage prices, and limits. It requires a JSON-RPC request with the method EXPERIMENTAL_protocol_config and supports both finality and block height parameters. ```APIDOC ## POST / ### Description Fetch the runtime protocol config at a chosen block — gas costs, storage prices, and limits currently in force. ### Method POST ### Endpoint / ### Parameters #### Request Body - **jsonrpc** (string) - Required - Must be "2.0". - **id** (string) - Required - Request identifier, e.g., "fastnear". - **method** (string) - Required - Must be "EXPERIMENTAL_protocol_config". - **params** (object) - Required - One of multiple possible types. Example: {"finality": "final"}. ### Request Example { "jsonrpc": "2.0", "id": "fastnear", "method": "EXPERIMENTAL_protocol_config", "params": { "finality": "final" } } ### Response #### Success Response (200) - **jsonrpc** (string) - Must be "2.0". - **id** (string or number) - Request identifier. - **result** (object) - Protocol config details, including block_producer_kickout_threshold (integer, 0-100). #### Response Example { "jsonrpc": "2.0", "id": "fastnear", "result": { "block_producer_kickout_threshold": 90 } } #### Error Response (403) - **description** - The supplied API key was not recognized. - **example** - "Invalid API key" ``` -------------------------------- ### GET /v0/first_block Source: https://docs.fastnear.com/assets/files/neardata-27b34e725bdee087f59eee697c4f4ad5.yaml Redirects to the chain's first post-genesis block — a starting cursor for indexers backfilling from the beginning. ```APIDOC ## GET /v0/first_block ### Description Redirects to the chain's first post-genesis block — a starting cursor for indexers backfilling from the beginning. ### Method GET ### Endpoint /v0/first_block ### Parameters #### Query Parameters - **apiKey** (string) - Optional - FastNEAR subscription API key. Invalid values may return `401` before redirect handling. ### Response #### Success Response (200) - **BlockDocument** (object, nullable) - Full block document returned after automatic redirect following #### Response Example ```json { "block": {} } ``` #### Redirect Response (302) - **Location** (string) - Redirect to the canonical first block URL #### Error Responses - **401** - Invalid or unauthorized API key ``` -------------------------------- ### Mainnet request example for EXPERIMENTAL_light_client_block_proof Source: https://docs.fastnear.com/openapi/rpc/EXPERIMENTAL_light_client_block_proof.yaml Example JSON-RPC request body for the mainnet endpoint. Uses the method EXPERIMENTAL_light_client_block_proof with block_hash and light_client_head parameters. ```json { "jsonrpc": "2.0", "id": "fastnear", "method": "EXPERIMENTAL_light_client_block_proof", "params": { "block_hash": "64utzv4G8AwNSxVnj23KPwU46VL435jQbQokbaYFtZ6V", "light_client_head": "9XN7MtDywZvfGx6TKy1MT2iCZkKuHikJXmNazxdZ4x6T" } } ``` -------------------------------- ### GET /v0/first_block Source: https://docs.fastnear.com/openapi/neardata/get_first_block.yaml Redirects to the first post-genesis block, serving as a starting cursor for indexers. Optionally accepts an API key for authentication. ```APIDOC ## GET /v0/first_block ### Description Redirect to the chain's first post-genesis block — a starting cursor for indexers backfilling from the beginning. ### Method GET ### Endpoint /v0/first_block ### Parameters #### Query Parameters - **apiKey** (string) - Optional - Optional FastNEAR subscription API key. Invalid values may return `401` before redirect handling. ### Response #### Success Response (200) - **block** (BlockEnvelope) - Block-level payload returned by neardata. - **shards** (array of ShardDocument) - Per-shard payloads. #### Response Example ```json { "block": { "author": "string", "chunks": [ { "chunk_hash": "string", "prev_block_hash": "string", "prev_state_root": "string", "encoded_merkle_root": "string", "encoded_length": 0, "height_created": 0, "height_included": 0, "shard_id": 0, "outcome_root": "string", "outgoing_receipts_root": "string", "tx_root": "string", "signature": "string", "timestamp": 0, "gas_used": 0, "gas_limit": 0, "balance_burnt": "string", "validator_proposals": [], "validator_reward": "string" } ], "header": { "chunks_included": 0, "epoch_id": "string", "gas_price": "string", "hash": "string", "height": 0, "next_epoch_id": "string", "prev_hash": "string", "prev_height": 0, "timestamp": 0, "timestamp_nanosec": "string", "total_supply": "string" } }, "shards": [ { "author": "string", "header": { "chunk_hash": "string", "prev_block_hash": "string", "prev_state_root": "string", "encoded_merkle_root": "string", "encoded_length": 0, "height_created": 0, "height_included": 0, "shard_id": 0, "outcome_root": "string", "outgoing_receipts_root": "string", "tx_root": "string", "signature": "string", "timestamp": 0, "gas_used": 0, "gas_limit": 0, "balance_burnt": "string", "validator_proposals": [], "validator_reward": "string" }, "receipts": [ { "receipt": { "Action": { "actions": [ {} ], "gas_price": "string", "input_data_ids": [ "string" ], "is_promise_yield": true, "output_data_receivers": [ { "data_id": "string", "receiver_id": "string" } ], "signer_id": "string", "signer_public_key": "string" } }, "receipt_id": "string", "receiver_id": "string" } ], "transactions": [ { "outcome": { "executor_id": "string", "gas_burnt": 0, "logs": [ "string" ], "metadata": { "version": 0, "gas_profile": [ {} ] }, "receipt_ids": [ "string" ], "status": {}, "tokens_burnt": "string" }, "transaction": { "actions": [ {} ], "hash": "string", "nonce": 0, "priority_fee": 0, "public_key": "string", "receiver_id": "string", "signature": "string", "signer_id": "string" } } ] } ] } ``` #### Redirect Response (302) - **Location** (string) - Redirect to the canonical first block URL #### Unauthorized Response (401) - **text/plain** - Invalid or unauthorized API key #### Response Example (401) ```text Unauthorized ``` ``` -------------------------------- ### POST / Source: https://docs.fastnear.com/openapi/rpc/view_access_key.yaml Fetch one access key's permissions and nonce by public key on a given account. Pass the full public key with its type prefix. For an ML-DSA-65 key that is the full ml-dsa-65: key, not the ml-dsa-65-hash: handle that view_access_key_list reports; the handle is rejected with a parse error (unknown key type). ```APIDOC ## POST / ### Description Fetch one access key's permissions and nonce by public key on a given account. Pass the full public key with its type prefix. For an ML-DSA-65 key that is the full ml-dsa-65: key, not the ml-dsa-65-hash: handle that view_access_key_list reports; the handle is rejected with a parse error (unknown key type). ### Method POST ### Endpoint / ### Parameters #### Request Body - **jsonrpc** (string) - Required - Must be "2.0" - **id** (string) - Required - Example: fastnear - **method** (string) - Required - Must be "query" - **params** (object) - Required - Parameters for the query - **account_id** (string) - Required - NEAR account ID - **public_key** (string) - Required - Public key with its type prefix: ed25519:, secp256k1:, or the full ml-dsa-65: key (never the ml-dsa-65-hash: handle). - **request_type** (string) - Required - Must be "view_access_key" - **finality** (string) - Required - Block finality. Allowed values: final, near-final, optimistic ### Request Example ```json { "jsonrpc": "2.0", "id": "fastnear", "method": "query", "params": { "account_id": "root.near", "public_key": "ed25519:6666666666666666666666666666666666666666666", "request_type": "view_access_key", "finality": "final" } } ``` ### Response #### Success Response (200) - **jsonrpc** (string) - Required - Must be "2.0" - **id** (string or number) - Required - The request ID - **result** (object) - Optional - The access key details #### Response Example ```json { "jsonrpc": "2.0", "id": "fastnear", "result": {} } ``` ### Error Responses #### 403 Forbidden - **description**: The supplied API key was not recognized. - **content**: text/plain - **example**: Invalid API key ### Security - **BearerAuth**: FastNEAR API key as an `Authorization: Bearer` header. Preferred for backends, workers, and proxies because it keeps the key out of URLs and logs. - **ApiKeyAuth**: FastNEAR API key as the `apiKey` query parameter. Handy for curl or clients that cannot set headers, but the key can end up in URLs, logs, and shell history. ### Servers - https://rpc.mainnet.fastnear.com (Mainnet) - https://rpc.testnet.fastnear.com (Testnet) - https://archival-rpc.mainnet.fastnear.com (Mainnet Archival) - https://archival-rpc.testnet.fastnear.com (Testnet Archival) ``` -------------------------------- ### POST / Source: https://docs.fastnear.com/openapi/rpc/view_access_key.json Fetch one access key's permissions and nonce by public key on a given account. Pass the full public key with its type prefix. For an ML-DSA-65 key that is the full ml-dsa-65: key, not the ml-dsa-65-hash: handle that view_access_key_list reports; the handle is rejected with a parse error (unknown key type). ```APIDOC ## [POST] / ### Description Fetch one access key's permissions and nonce by public key on a given account. Pass the full public key with its type prefix. For an ML-DSA-65 key that is the full ml-dsa-65: key, not the ml-dsa-65-hash: handle that view_access_key_list reports; the handle is rejected with a parse error (unknown key type). ### Method POST ### Endpoint / ### Parameters #### Request Body - **jsonrpc** (string) - Required - Must be "2.0" - **id** (string) - Required - Example: "fastnear" - **method** (string) - Required - Must be "query" - **params** (object) - Required - **account_id** (string) - Required - NEAR account ID - **public_key** (string) - Required - Public key with its type prefix: ed25519:, secp256k1:, or the full ml-dsa-65: key (never the ml-dsa-65-hash: handle). - **request_type** (string) - Required - Must be "view_access_key" - **finality** (string) - Required - Block finality. Allowed values: "final", "near-final", "optimistic" ### Request Example { "jsonrpc": "2.0", "id": "fastnear", "method": "query", "params": { "account_id": "root.near", "public_key": "ed25519:6666666666666666666666666666666666666666666", "request_type": "view_access_key", "finality": "final" } } ### Response #### Success Response (200) - **content** (application/json) - Successful response #### Response Example { "content": { "application/json": {} } } ``` -------------------------------- ### GET /v0/first_block Source: https://docs.fastnear.com/openapi/neardata/get_first_block.json Redirects to the chain's first post-genesis block. This is useful as a starting cursor for indexers backfilling from the beginning of the chain. ```APIDOC ## GET /v0/first_block ### Description Redirect to the chain's first post-genesis block — a starting cursor for indexers backfilling from the beginning. ### Method GET ### Endpoint /v0/first_block ### Parameters #### Query Parameters - **apiKey** (string) - Optional - Optional FastNEAR subscription API key. Invalid values may return `401` before redirect handling. ### Response #### Success Response (200) Full block document returned after automatic redirect following. The response body is a BlockDocument object (nullable). #### Response Example ```json { "block": { "author": "string", "chunks": [ { "chunk_hash": "string" } ], "header": { "height": 0 } }, "shards": [ { "shard_id": 0 } ] } ``` #### Success Response (302) Redirect to the canonical first block URL. The `Location` header contains the redirect URL. #### Error Response (401) Invalid or unauthorized API key. The response body is plain text with the message "Unauthorized". ### Servers - **Mainnet**: https://mainnet.neardata.xyz - **Testnet**: https://testnet.neardata.xyz ``` -------------------------------- ### Get block by hash (Testnet) - Request Source: https://docs.fastnear.com/openapi/rpc/block_by_id.json Example request to fetch a block by its hash on the testnet network. The `block_id` parameter is the Base58-encoded block hash. ```json { "jsonrpc": "2.0", "id": "fastnear", "method": "block", "params": { "block_id": "CoPszhGFqsz9L1HQYM62gUjxM3ZD8RiZL6QdpBZXA4" } } ``` -------------------------------- ### Get block by hash (Mainnet) - Request Source: https://docs.fastnear.com/openapi/rpc/block_by_id.json Example request to fetch a block by its hash on the mainnet network. The `block_id` parameter is the Base58-encoded block hash. ```json { "jsonrpc": "2.0", "id": "fastnear", "method": "block", "params": { "block_id": "EPnLgE7iEq9s7yTkos96M3cWymH5avBAPm3qx3NXqR8H" } } ``` -------------------------------- ### Get block by height (Testnet) - JSON-RPC Request Source: https://docs.fastnear.com/openapi/rpc/block_by_height.json Example request to fetch block 245254793 on testnet. Uses the 'block' method with a block_id parameter. ```json { "jsonrpc": "2.0", "id": "fastnear", "method": "block", "params": { "block_id": 245254793 } } ``` -------------------------------- ### Testnet request example for EXPERIMENTAL_light_client_block_proof Source: https://docs.fastnear.com/openapi/rpc/EXPERIMENTAL_light_client_block_proof.yaml Example JSON-RPC request body for the testnet endpoint. Uses the method EXPERIMENTAL_light_client_block_proof with block_hash and light_client_head parameters. ```json { "jsonrpc": "2.0", "id": "fastnear", "method": "EXPERIMENTAL_light_client_block_proof", "params": { "block_hash": "GTnMamkzwhsTdaZ48g7BvFALJ4ECZYJ9aagejnAinp", "light_client_head": "6JYj6i1FaUCzdoqy41CqUcZJxa5n9EmLEENRDH2gLm5u" } } ``` -------------------------------- ### Get block by height (Mainnet) - JSON-RPC Request Source: https://docs.fastnear.com/openapi/rpc/block_by_height.json Example request to fetch block 9820210 on mainnet. Uses the 'block' method with a block_id parameter. ```json { "jsonrpc": "2.0", "id": "fastnear", "method": "block", "params": { "block_id": 9820210 } } ``` -------------------------------- ### Testnet request for EXPERIMENTAL_light_client_proof Source: https://docs.fastnear.com/openapi/rpc/EXPERIMENTAL_light_client_proof.json Example request to the testnet endpoint to get a light client execution proof for a transaction. The `type` parameter is set to `transaction`. ```json { "jsonrpc": "2.0", "id": "fastnear", "method": "EXPERIMENTAL_light_client_proof", "params": { "light_client_head": "6JYj6i1FaUCzdoqy41CqUcZJxa5n9EmLEENRDH2gLm5u", "sender_id": "near-mpc-staking4all-01.testnet", "transaction_hash": "9LPbkwJ26HYgda7KHrURc6jozBcpdA1kUMSEzwm81JPx", "type": "transaction" } } ``` -------------------------------- ### POST / Source: https://docs.fastnear.com/openapi/rpc/EXPERIMENTAL_light_client_block_proof.json This snippet documents the POST / endpoint for the EXPERIMENTAL_light_client_block_proof RPC method, including request body parameters and response examples. ```APIDOC ## [POST] / ### Description Fetch a Merkle proof — by Base58 block and light-client-head hashes — that the block is included in the light client's verified chain. ### Method POST ### Endpoint / ### Parameters #### Request Body - **jsonrpc** (string) - Required - Must be "2.0". - **id** (string) - Required - Request identifier, e.g., "fastnear". - **method** (string) - Required - Must be "EXPERIMENTAL_light_client_block_proof". - **params** (object) - Required - Object containing: - **block_hash** (string) - Required - Base58-encoded hash. - **light_client_head** (string) - Required - Base58-encoded hash. ### Request Example { "jsonrpc": "2.0", "id": "fastnear", "method": "EXPERIMENTAL_light_client_block_proof", "params": { "block_hash": "64utzv4G8AwNSxVnj23KPwU46VL435jQbQokbaYFtZ6V", "light_client_head": "9XN7MtDywZvfGx6TKy1MT2iCZkKuHikJXmNazxdZ4x6T" } } ### Response #### Success Response (200) - **result** (object) - The Merkle proof data. #### Response Example { "jsonrpc": "2.0", "id": "fastnear", "result": {} } #### Error Response (403) - **message** (string) - Error message, e.g., "Invalid API key". #### Error Example Invalid API key ``` -------------------------------- ### Get congestion level (Testnet) - Request Source: https://docs.fastnear.com/openapi/rpc/EXPERIMENTAL_congestion_level.json Request example for testnet. Uses block_id as a base58-encoded block hash and shard_id as an integer. The method is EXperimental_congestion_level. ```json { "jsonrpc": "2.0", "id": "fastnear", "method": "EXPERIMENTAL_congestion_level", "params": { "block_id": "6JYj6i1FaUCzdoqy41CqUcZJxa5n9EmLEENRDH2gLm5u", "shard_id": 10 } } ``` -------------------------------- ### Full request reference for POST /v0/account Source: https://docs.fastnear.com/tx/account Complete request reference showing the body, headers, path, and query objects. The body matches the active example; headers, path, and query are empty objects. ```json { "body": { "account_id": "intents.near", "desc": true, "is_real_signer": true, "is_success": true, "limit": 50 }, "headers": {}, "path": {}, "query": {} } ``` -------------------------------- ### Request reference for POST /v0/blocks Source: https://docs.fastnear.com/tx/blocks Full request reference showing the body, headers, path, and query objects for the active example. The body matches the request body example. ```json { "body": { "desc": false, "from_block_height": 193916402, "limit": 10, "to_block_height": 193916411 }, "headers": {}, "path": {}, "query": {} } ``` -------------------------------- ### Get congestion level (Mainnet) - Request Source: https://docs.fastnear.com/openapi/rpc/EXPERIMENTAL_congestion_level.json Request example for mainnet. Uses block_id as a base58-encoded block hash and shard_id as an integer. The method is EXperimental_congestion_level. ```json { "jsonrpc": "2.0", "id": "fastnear", "method": "EXPERIMENTAL_congestion_level", "params": { "block_id": "9XN7MtDywZvfGx6TKy1MTiCZkKuHikJXmNazZxd4x6T", "shard_id": 10 } } ``` -------------------------------- ### GET /maintenance_windows Source: https://docs.fastnear.com/openapi/rpc/maintenance_windows.json Retrieves maintenance window information for validators. The response includes the start and end times of the maintenance window, or an error if the request fails. ```APIDOC ## GET /maintenance_windows ### Description Retrieves maintenance window information for validators. The response includes the start and end times of the maintenance window, or an error if the request fails. ### Method GET ### Endpoint /maintenance_windows ### Response #### Success Response (200) - **result** (object) - Contains the maintenance window details. - **end** (integer, uint64) - End timestamp of the maintenance window. - **start** (integer, uint64) - Start timestamp of the maintenance window. #### Response Example { "result": { "start": 0, "end": 0 } } #### Error Response - **error** (object) - Contains error details. - **code** (integer) - Error code. - **message** (string) - Error message. - **data** (object) - Additional error data. #### Error Example { "error": { "code": 0, "message": "string", "data": {} } } ``` -------------------------------- ### POST / Source: https://docs.fastnear.com/openapi/rpc/view_code.yaml Fetch the compiled WebAssembly bytes deployed directly to a single account. This endpoint accepts a JSON-RPC request with the method 'query' and request_type 'view_code'. ```APIDOC ## [POST] [https://rpc.mainnet.fastnear.com/](https://rpc.mainnet.fastnear.com/) ### Description Fetch the compiled WebAssembly bytes deployed directly to a single account. ### Method POST ### Endpoint `https://rpc.mainnet.fastnear.com/` (also available on testnet and archival servers) ### Parameters #### Request Body - **jsonrpc** (string) - Required - Must be "2.0". - **id** (string) - Required - Example: "fastnear". - **method** (string) - Required - Must be "query". - **params** (object) - Required - Contains: - **account_id** (string) - Required - NEAR account ID. - **request_type** (string) - Required - Must be "view_code". - **finality** (string) - Required - Block finality. Allowed values: `final`, `near-final`, `optimistic`. ### Request Example ```json { "jsonrpc": "2.0", "id": "fastnear", "method": "query", "params": { "account_id": "intents.near", "request_type": "view_code", "finality": "final" } } ``` ### Response #### Success Response (200) - **jsonrpc** (string) - Must be "2.0". - **id** (string or number) - The request id. - **result** (object) - A view of the contract code. - **code_base64** (string) - The base64-encoded compiled WebAssembly code. - **hash** (string) - Base58-encoded hash. - **error** (object, optional) - Error information. - **code** (integer) - Error code. - **message** (string) - Error message. - **data** (object) - Additional error data. #### Response Example ```json { "jsonrpc": "2.0", "id": "fastnear", "result": { "code_base64": "AGFzbQEAAAAB...", "hash": "A1AbC..." } } ``` ### Error Handling - **403 Forbidden**: The supplied API key was not recognized. - Example response: `Invalid API key` - This occurs when using an invalid API key. ### Authentication - **None** (optional) - **BearerAuth**: HTTP bearer token authentication. The FastNEAR API key as an `Authorization: Bearer` header. Preferred for backends, workers, and proxies because it keeps the key out of URLs and logs. - **ApiKeyAuth**: API key in the query parameter `apiKey`. Handy for curl or clients that cannot set headers, but the key can end up in URLs, logs, and shell history. ``` -------------------------------- ### POST / Source: https://docs.fastnear.com/openapi/rpc/block_effects.json Summarize every state change in a block — which accounts, keys, and contract-state entries were touched. ```APIDOC ## POST / ### Description Summarize every state change in a block — which accounts, keys, and contract-state entries were touched. ### Method POST ### Endpoint / ### Parameters #### Request Body - **jsonrpc** (string) - Required - Must be "2.0". - **id** (string) - Required - Request identifier, e.g., "fastnear". - **method** (string) - Required - Must be "block_effects". - **params** (object) - Required - Parameters for the block effects query. - **block_id** (integer or string) - Optional - Block height (integer) or block hash (string). - **finality** (string) - Optional - Block finality: "final", "near-final", or "optimistic". ### Request Example { "jsonrpc": "2.0", "id": "fastnear", "method": "block_effects", "params": { "finality": "final" } } ### Response #### Success Response (200) Successful response containing the block effects. #### Response Example { "jsonrpc": "2.0", "id": "fastnear", "result": { "block_hash": "...", "block_height": 123, "effects": [] } } #### Error Response (403) The supplied API key was not recognized. #### Error Response Example Invalid API key ``` -------------------------------- ### Get state changes (Testnet) - JSON-RPC request Source: https://docs.fastnear.com/openapi/rpc/changes.yaml Example request body for the changes method on testnet, filtering by account_changes for root.testnet with finality set to final. ```json { "jsonrpc": "2.0", "id": "fastnear", "method": "changes", "params": { "finality": "final", "changes_type": "account_changes", "account_ids": [ "root.testnet" ] } } ```