# FastNear Builder Docs Full Documentation Archive AI-readable Markdown mirrors for authored docs plus canonical `/rpcs/**` and `/apis/**` routes. --- ## RPC / API Reference - HTML path: https://docs.fastnear.com/ - Markdown path: https://docs.fastnear.com/index.md **Source:** [https://docs.fastnear.com/](https://docs.fastnear.com/) FastNear docs overview Choosing the FastNear API or reference. Use RPC for canonical JSON-RPC state reads, contract calls, and transaction submission. Use indexed APIs for balances, holdings, activity history, and recent block-family data. [Start with FastNear API](https://docs.fastnear.com/api) [Start with RPC](https://docs.fastnear.com/rpc) [Get API key](https://docs.fastnear.com/auth) Authentication FastNear API keys work across the RPC and APIs. Header Authorization: Bearer ... Query parameter ?apiKey=... Quick routing Most teams start here [FastNear API](https://docs.fastnear.com/api) Indexed account, asset, staking, and public-key endpoints for account-centric application reads. Protocol-native [RPC Reference](https://docs.fastnear.com/rpc) Canonical JSON-RPC methods for blocks, contract calls, validators, and transaction submission. Execution history [Transactions API](https://docs.fastnear.com/tx) Account activity, receipts, transaction lookups, and block-scoped history from indexed execution data. Low-latency reads [NEAR Data API](https://docs.fastnear.com/neardata) Recent optimistic and finalized blocks, headers, and redirect helpers for polling and lightweight monitoring. Main APIs and references These are the main FastNear entry points. Start with the API or reference section that matches the data you need, then move into the detailed reference for the specific endpoint. Indexed account views [FastNear API](https://docs.fastnear.com/api) Use indexed REST endpoints for balances, NFTs, staking positions, and public-key lookups without raw JSON-RPC request and response envelopes. Try out [Full account state](https://docs.fastnear.com/api/v1/account-full) [Fungible token balances](https://docs.fastnear.com/api/v1/account-ft) [NFT holdings](https://docs.fastnear.com/api/v1/account-nft) [Public key lookups](https://docs.fastnear.com/api/v1/public-key) Canonical JSON-RPC [RPC Reference](https://docs.fastnear.com/rpc) Use protocol-native methods for direct state reads, transaction submission, contract calls, and chain inspection. Try out [Account state](https://docs.fastnear.com/rpc/account/view-account) [Block lookups](https://docs.fastnear.com/rpc/block/block-by-id) [Contract view calls](https://docs.fastnear.com/rpc/contract/call-function) [Validator data](https://docs.fastnear.com/rpc/validators/validators-current) Execution history [Transactions API](https://docs.fastnear.com/tx) Use indexed endpoints for account activity, receipts, transaction lookups, and block-scoped execution history. Try out [Account activity](https://docs.fastnear.com/tx/account) [Transaction lookups](https://docs.fastnear.com/tx/transactions) [Receipt tracing](https://docs.fastnear.com/tx/receipt) [Block transaction history](https://docs.fastnear.com/tx/blocks) Recent block-family reads [NEAR Data API](https://docs.fastnear.com/neardata) Use NEAR Data for recent optimistic and finalized blocks, block headers, and latest-block helper routes when you need near-realtime reads or lightweight monitoring. Try out [Optimistic block reads](https://docs.fastnear.com/neardata/block-optimistic) [Latest finalized block](https://docs.fastnear.com/neardata/last-block-final) [Block header polling](https://docs.fastnear.com/neardata/block-headers) Ops and access What teams ask before going live. Keep these close when you are moving from exploration to production. Higher limits [Auth & Access](https://docs.fastnear.com/auth) Use one FastNear API key across both the RPC and REST APIs. Keys and billing [FastNear Dashboard](https://dashboard.fastnear.com) Sign in, create keys, and move to higher-limit usage patterns when you need them. Live operations [Status](https://status.fastnear.com) Check incidents or degraded service before you start debugging application behavior. Infra bootstrap [Snapshots](https://docs.fastnear.com/snapshots) Stand up RPC or archival infrastructure faster without replaying the chain from scratch. Agents and automation Building with AI agents or background workers? Use the agent docs for credential posture, routing logic, and prompt-friendly markdown exports. [Open Agents hub](https://docs.fastnear.com/agents) [Routing guide](https://docs.fastnear.com/agents/choosing-surfaces) --- ## Agents on FastNear - HTML path: https://docs.fastnear.com/agents - Markdown path: https://docs.fastnear.com/agents.md **Source:** [https://docs.fastnear.com/agents](https://docs.fastnear.com/agents) # Agents on FastNear This page is the operational starting point for AI agents, crawlers, and automation runtimes using FastNear. The goal is simple: identify the user's actual task, choose one FastNear API first, fetch the smallest useful result, and only widen to another API when there is a clear missing piece. ## If you only need the next step - Need to decide which FastNear API to start with? Use [Choosing the Right Surface](https://docs.fastnear.com/agents/choosing-surfaces). - Need credential handling rules? Use [Auth for Agents](https://docs.fastnear.com/agents/auth). - Need example multi-step workflows? Use [Agent Playbooks](https://docs.fastnear.com/agents/playbooks). - Need exact endpoint docs now? Go directly to [RPC Reference](https://docs.fastnear.com/rpc), [FastNear API](https://docs.fastnear.com/api), [Transactions API](https://docs.fastnear.com/tx), [Transfers API](https://docs.fastnear.com/transfers), [NEAR Data API](https://docs.fastnear.com/neardata), or [KV FastData API](https://docs.fastnear.com/fastdata/kv). ## FastNear for agents in one minute - Use indexed APIs when the user wants a product-shaped answer such as balances, holdings, account history, or transfer history. - Use [RPC Reference](https://docs.fastnear.com/rpc) when the user needs canonical protocol-native fields, contract calls, or transaction submission. - If you are using the hosted JS runtime at [js.fastnear.com](https://js.fastnear.com), start with low-level methods such as `near.view`, `near.queryAccount`, and `near.tx.*`, and use `near.recipes.*` only when a task helper is the shortest path to the answer. - Use [NEAR Data API](https://docs.fastnear.com/neardata) when the question is about recent optimistic or finalized blocks and explicit polling. - Use [Snapshots](https://docs.fastnear.com/snapshots) for operator workflows, not application-level data reads. - One FastNear API key works across the RPC and API endpoints. - Stop after the first sufficient answer. Do not collect from multiple APIs unless the current result is insufficient. ## What to resolve before the first request Try to identify these inputs before you make a call: - **Network**: mainnet or testnet. - **Primary identifier**: account ID, public key, transaction hash, receipt ID, block height/hash, contract ID plus storage key, or node/bootstrap task. - **Answer shape**: summary, history, canonical protocol output, or operator instructions. - **Freshness requirement**: historical, current, optimistic/latest, or finalized/latest. - **Precision requirement**: indexed summary is acceptable, or exact canonical node semantics are required. If one of these is missing, make a small assumption when the likely starting API does not change. Ask a clarifying question only when the wrong API choice would materially change the result. ## FastNear APIs at a glance | API | Start here when... | Typical inputs | Widen only if... | | --- | --- | --- | --- | | [FastNear API](https://docs.fastnear.com/api) | The user wants balances, NFTs, staking, public-key resolution, or an account summary | `account_id`, public key | The user needs exact canonical node fields | | [RPC Reference](https://docs.fastnear.com/rpc) | The user wants canonical protocol output, contract calls, validator data, or transaction submission | `account_id`, block height/hash, method-specific params | The user also needs a higher-level summary or indexed history | | [Transactions API](https://docs.fastnear.com/tx) | The user wants transaction, receipt, account, or block execution history | transaction hash, receipt ID, `account_id`, block identifiers | The user needs exact RPC-level follow-up or finality semantics | | [Transfers API](https://docs.fastnear.com/transfers) | The user wants transfer-only history | `account_id`, transfer filters | The question broadens to general execution context | | [NEAR Data API](https://docs.fastnear.com/neardata) | The user wants recent optimistic or finalized blocks, headers, or latest-block helpers | block height/hash, freshness requirement | The user needs exact canonical block/state follow-up | | [KV FastData API](https://docs.fastnear.com/fastdata/kv) | The user wants indexed contract key history or latest indexed key-value state | contract ID, storage key | The user needs exact on-chain current state | | [Snapshots](https://docs.fastnear.com/snapshots) | The user is standing up infrastructure | network, node type, operator goal | The user shifts to application-level chain questions | ## Default workflow Use this loop unless the task clearly needs something more specialized: 1. Translate the user's wording into the task they actually need solved. Examples: account summary, canonical state inspection, transaction investigation, transfer-only history, recent block monitoring, or node bootstrap. 2. Pick one FastNear API first. Do not gather from multiple APIs until the first result proves insufficient. 3. Pull the smallest relevant docs context. Use the API index page, endpoint page, or Markdown mirror instead of broad unrelated docs. 4. Make the first request that matches the user's identifier and expected answer shape. 5. Stop if the result is already sufficient to answer the user's question. 6. Widen only when you can name the missing piece precisely. Examples: canonical confirmation, broader execution history, fresher block-family data, or exact protocol fields. ## Good defaults When the user's wording is short but the intent is common, these defaults are usually correct: - "Check this account" usually starts with [FastNear API](https://docs.fastnear.com/api). - "Check this public key" usually starts with [FastNear API](https://docs.fastnear.com/api) for key-to-account resolution. - "Check this transaction" usually starts with [Transactions API](https://docs.fastnear.com/tx). - "Check this receipt" usually starts with [Transactions API](https://docs.fastnear.com/tx). - "Check this block" usually starts with [NEAR Data API](https://docs.fastnear.com/neardata) for recent-block monitoring or [RPC Reference](https://docs.fastnear.com/rpc) for exact canonical block data. - "Check this contract key/history" usually starts with [KV FastData API](https://docs.fastnear.com/fastdata/kv). - "Help me bootstrap a node" starts with [Snapshots](https://docs.fastnear.com/snapshots). Full routing rules and tradeoffs live in [Choosing the Right Surface](https://docs.fastnear.com/agents/choosing-surfaces). ## Widen carefully Good escalation patterns: - Start with [FastNear API](https://docs.fastnear.com/api), then move to [RPC Reference](https://docs.fastnear.com/rpc) if the user asks for exact canonical confirmation. - Start with [Transactions API](https://docs.fastnear.com/tx), then move to [RPC Reference](https://docs.fastnear.com/rpc) if the user needs protocol-level transaction or receipt follow-up. - Start with [Transfers API](https://docs.fastnear.com/transfers), then widen to [Transactions API](https://docs.fastnear.com/tx) if the user broadens the question beyond transfer events. - Start with [NEAR Data API](https://docs.fastnear.com/neardata), then move to [RPC Reference](https://docs.fastnear.com/rpc) if the user needs exact canonical block or state inspection. Bad pattern: - Pull from several FastNear APIs before you know what the user actually needs. That usually produces a noisier answer, not a better one. ## Authenticate once, reuse everywhere Start with a FastNear API key and reuse it across every FastNear API above, including the regular and archival RPC hosts. Send it either as an HTTP header or a URL parameter: ```bash title="Authorization header" : "${FASTNEAR_API_KEY:?Set FASTNEAR_API_KEY in your shell before running this example.}" curl "https://rpc.mainnet.fastnear.com" \ -H "Authorization: Bearer $FASTNEAR_API_KEY" \ -H "Content-Type: application/json" \ --data '{"method":"block","params":{"finality":"final"},"id":1,"jsonrpc":"2.0"}' ``` ```bash title="URL parameter" : "${FASTNEAR_API_KEY:?Set FASTNEAR_API_KEY in your shell before running this example.}" curl "https://rpc.mainnet.fastnear.com?apiKey=$FASTNEAR_API_KEY" ``` Get your API key from [FastNear Dashboard](https://dashboard.fastnear.com). Operational posture for non-interactive runtimes: [Auth for Agents](https://docs.fastnear.com/agents/auth) — keys go in env vars or a secret manager, never in browser storage, chat logs, or prompts. Full flow and header details: [Auth & Access](https://docs.fastnear.com/auth). ## Pull clean docs into a prompt - Every page has a **Copy Markdown** button in the top-right toolbar. It emits a navigation-chrome-free Markdown version of the page, ready to paste into a prompt or RAG store. - The `llms.txt` convention is mirrored here: - [`/llms.txt`](https://docs.fastnear.com/llms.txt) — index of pages and short descriptions. - [`/llms-full.txt`](https://docs.fastnear.com/llms-full.txt) — the full docs corpus concatenated into one file. - Russian-locale equivalents live at [`/ru/llms.txt`](https://docs.fastnear.com/llms.txt) and [`/ru/llms-full.txt`](https://docs.fastnear.com/llms-full.txt). - Machine-readable site structure for graph-aware ingestion: [`/structured-data/site-graph.json`](https://docs.fastnear.com/structured-data/site-graph.json) (mirrored in `/ru/`). - Per-page Markdown mirrors live under the same slug with a `.md` suffix if you prefer direct fetches over the Copy Markdown button. ## Per-call hints an agent should know - Parameter names, response fields, and example payloads are rendered live on each endpoint page. The underlying registry lives at `src/data/generatedFastnearPageModels.json` if you are mirroring schema into another system. - `?network=testnet` is supported on specific pages only. Each page calls out its network support in the **Auth and availability** section; do not assume it works globally. - Pagination tokens (`resume_token`, `page_token`) are opaque. Reuse them verbatim and only with the endpoint plus filter set that produced them. - Status routes: every REST family ships a `/status` and `/health` path for liveness and sync-latency inspection. ## What a useful agent answer should contain - A brief statement of which FastNear API was used and why, especially if the choice was an inference. - The answer in the shape the user is likely to need next: summary first for humans, exact fields or next-call guidance when the caller is technical. - Any important caveat about freshness, canonicality, pagination, or network choice. - A follow-up path only when it is likely to help. Examples: "use RPC for canonical confirmation" or "use Transactions API if you need broader execution context." Avoid dumping raw payloads when the user is really asking for interpretation. ## Next docs by need - Need routing depth and tradeoffs? [Choosing the Right Surface](https://docs.fastnear.com/agents/choosing-surfaces) - Need credential posture and secret handling? [Auth for Agents](https://docs.fastnear.com/agents/auth) - Need example workflows? [Agent Playbooks](https://docs.fastnear.com/agents/playbooks) --- ## Auth for Agents - HTML path: https://docs.fastnear.com/agents/auth - Markdown path: https://docs.fastnear.com/agents/auth.md **Source:** [https://docs.fastnear.com/agents/auth](https://docs.fastnear.com/agents/auth) # Auth for Agents Agents should authenticate to FastNear the same way production backends do. Do not copy the browser-demo posture used by the docs UI into an agent, worker, or automation runtime. One FastNear API key works across the RPC and API endpoints. For agents, the important question is not whether auth exists. It is where the credential lives, how it gets attached to requests, and how to avoid leaking it into prompts, logs, or browser state. ## If you only need the rule - Store the key in an env var or secret manager. - Inject it server-side or from the worker runtime. - Prefer the `Authorization: Bearer ...` header. - Apply the same key and transport rules to both regular and archival RPC hosts. - Never ask a user to paste a FastNear key into chat, a prompt, or a browser-only agent. ## Recommended runtime patterns Use one of these patterns: - **Server-side worker or automation**: load the key from env vars or a secret manager and attach it directly to outbound FastNear requests. - **Thin backend proxy**: if the user-facing app runs in the browser, send the request to your backend first and let the backend inject the FastNear credential. - **Multi-tenant service**: keep per-tenant keys in a proper secrets store and make the agent select the right credential by tenant or project context. Avoid browser-only agent architectures that need the FastNear key in client-side storage. ## Choose the credential transport | Transport | Use it when... | Notes | | --- | --- | --- | | `Authorization: Bearer ${FASTNEAR_API_KEY}` | you control the HTTP client or backend | Best default for agents. Less likely to leak into URL logs, analytics, or copied links. | | `?apiKey=${FASTNEAR_API_KEY}` | you are using simple curl or a system that cannot easily set headers | Still valid, but URLs tend to travel further through logs and tooling. Use it intentionally. | If you have a choice, use the header form. ## Minimum secure flow 1. Read the key from an env var or secret manager at runtime. 2. Attach it to the request as a header or query parameter. 3. Keep prompts, traces, and logs scrubbed so the raw key never lands in transcripts. 4. Rotate the key if it appears in a prompt, debug trace, browser storage, or a copied URL. Example: ```js const apiKey = process.env.FASTNEAR_API_KEY; const response = await fetch('https://rpc.mainnet.fastnear.com', { method: 'POST', headers: { 'Authorization': `Bearer ${apiKey}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ jsonrpc: '2.0', id: 1, method: 'block', params: {finality: 'final'}, }), }); ``` ## If the runtime is missing the key Agents should normally start with a configured FastNear API key. Some public FastNear reads may still work without one, but that should not be the default operating posture. If the configured runtime does not have the key yet: - tell the user to create or retrieve a key from [FastNear Dashboard](https://dashboard.fastnear.com) - ask them to configure it in an env var, secret manager, or backend configuration - do not ask them to paste the raw key into chat so the agent can carry it around If the agent cannot access the configured secret, it should say that clearly and stop rather than improvising insecure storage. ## Do not do this - Do not lift a key out of browser `localStorage` and treat it as an agent credential. - Do not embed keys into browser-delivered agent apps. - Do not keep keys in prompts, notebook cells, or plaintext config checked into source control. - Do not prefer `?apiKey=` just because it is shorter if your infrastructure logs full URLs aggressively. ## What the agent should tell a user When auth is relevant, a useful agent answer usually contains: - whether the current request can proceed unauthenticated - whether the user needs to configure a FastNear API key next - where that key should live, usually env vars, a secret manager, or a backend proxy - which transport the agent is using, usually `Authorization: Bearer ...` ## Related guides - [Auth & Access](https://docs.fastnear.com/auth) - [Agents on FastNear](https://docs.fastnear.com/agents) - [Choosing the Right Surface](https://docs.fastnear.com/agents/choosing-surfaces) --- ## Choosing the Right Surface - HTML path: https://docs.fastnear.com/agents/choosing-surfaces - Markdown path: https://docs.fastnear.com/agents/choosing-surfaces.md **Source:** [https://docs.fastnear.com/agents/choosing-surfaces](https://docs.fastnear.com/agents/choosing-surfaces) # Choosing the Right Surface Do not start by exposing every FastNear API to an agent. Start by translating the user's request into the job they actually want done, then pick the one FastNear API or reference section that most directly answers that job. For agents, the important question is usually not "which endpoint exists?" It is "what kind of answer will help the user next?" ## What decides the route Before you pick an API, identify four things: - **Object**: account, public key, transaction hash, receipt, block, contract storage, or infrastructure setup. - **Answer shape**: product-style summary, execution history, canonical protocol output, or operator instructions. - **Freshness**: historical, current, or latest/near-realtime. - **Exactness**: indexed summary is acceptable, or canonical node-shaped correctness is required. In practice: - account plus summary usually means [FastNear API](https://docs.fastnear.com/api) - account plus exact canonical state usually means [RPC Reference](https://docs.fastnear.com/rpc) - transaction or receipt usually means [Transactions API](https://docs.fastnear.com/tx) - transfer-only history usually means [Transfers API](https://docs.fastnear.com/transfers) - newest blocks usually means [NEAR Data API](https://docs.fastnear.com/neardata) - contract key history usually means [KV FastData API](https://docs.fastnear.com/fastdata/kv) - node bootstrap usually means [Snapshots](https://docs.fastnear.com/snapshots) ## Start from user intent - If the user wants a wallet-style or explorer-style answer, prefer indexed APIs. - If the user wants canonical protocol behavior or exact node-shaped state, use raw [RPC Reference](https://docs.fastnear.com/rpc). - If the user wants history, receipts, or event sequences, use history-oriented APIs before falling back to RPC. - If the user wants the newest block-family data, use [NEAR Data API](https://docs.fastnear.com/neardata) for polling-oriented freshness. - If the user wants infrastructure bootstrap instructions, route them to [Snapshots](https://docs.fastnear.com/snapshots) instead of application query surfaces. ## Decision ladder Use this order of operations before you pick a surface: 1. Is the user trying to stand up infrastructure rather than query chain data? If yes, use [Snapshots](https://docs.fastnear.com/snapshots). 2. Is the user asking for a product-shaped summary such as balances, NFTs, staking, or account holdings? If yes, start with [FastNear API](https://docs.fastnear.com/api). 3. Is the user asking what happened over time: transactions, receipts, transfers, or activity history? If yes, start with [Transactions API](https://docs.fastnear.com/tx) or [Transfers API](https://docs.fastnear.com/transfers) for transfer-only questions. 4. Is the user focused on the newest blocks or low-latency block-family reads? If yes, use [NEAR Data API](https://docs.fastnear.com/neardata). 5. Does correctness depend on canonical node behavior, protocol fields, or exact on-chain state? If yes, use [RPC Reference](https://docs.fastnear.com/rpc). 6. Is the user asking about indexed key-value storage history or latest indexed contract state? If yes, use [KV FastData API](https://docs.fastnear.com/fastdata/kv). If more than one surface could work, prefer the one that gives the most directly useful answer with the least reconstruction by the agent. ## Before the first call Try to resolve these inputs before you make a request: - network: mainnet or testnet - primary identifier: account ID, public key, transaction hash, receipt ID, block height/hash, contract ID plus storage key - expected output: summary, history, canonical fields, or operator steps - freshness requirement: latest, finalized, historical, or "whatever is current" If one of these is missing: - make a small assumption when the likely starting API does not change - ask a clarifying question only when the wrong choice would materially change the result ## Route common user asks | If the user says... | They probably want... | Start here | Only switch when... | | --- | --- | --- | --- | | "What is the exact on-chain account state?" | Canonical protocol-native state | [RPC Reference](https://docs.fastnear.com/rpc) | You also need a higher-level summary for humans. | | "What does this account own?" | Product-shaped balances, NFTs, staking, and holdings | [FastNear API](https://docs.fastnear.com/api) | You need exact node fields the indexed view does not expose. | | "What activity touched this account?" | Indexed transaction and receipt history | [Transactions API](https://docs.fastnear.com/tx) | The user only wants transfer events, or you need canonical protocol follow-up details. | | "Show me transfers only." | Account-centric transfer history | [Transfers API](https://docs.fastnear.com/transfers) | The user actually needs broader transaction execution context. | | "What changed in the latest blocks?" | Fresh optimistic or finalized block-family reads | [NEAR Data API](https://docs.fastnear.com/neardata) | You need canonical RPC details for a specific block or state read. | | "What is the contract storage history here?" | Indexed key-value state history | [KV FastData API](https://docs.fastnear.com/fastdata/kv) | You need current canonical on-chain state rather than indexed history. | | "Why did this transaction fail?" | An execution timeline first, then canonical details | [Transactions API](https://docs.fastnear.com/tx) | You need RPC-level confirmation of final protocol status or transaction submission behavior. | | "How do I submit a transaction or inspect a protocol field?" | Canonical node behavior | [RPC Reference](https://docs.fastnear.com/rpc) | You later need to summarize the resulting account state or activity for a human. | | "How do I bootstrap a node or archival setup?" | Infrastructure workflow, not app data | [Snapshots](https://docs.fastnear.com/snapshots) | The user then starts asking application-level chain questions. | ## When the identifier is the clue If the user's wording is vague but the identifier is clear, let the identifier shape your first move: | If you have... | Default first move | Why | | --- | --- | --- | | an `account_id` | Start with [FastNear API](https://docs.fastnear.com/api) for summaries, or [RPC Reference](https://docs.fastnear.com/rpc) if the user explicitly asks for exact state | Account questions usually mean balances/holdings first unless the user says canonical. | | a public key | Start with [FastNear API](https://docs.fastnear.com/api) for key-to-account resolution | This is usually an account discovery task, not an RPC-first task. | | a transaction hash | Start with [Transactions API](https://docs.fastnear.com/tx) | Most users want execution context and readable history before raw protocol fields. | | a receipt ID | Start with [Transactions API](https://docs.fastnear.com/tx) | Receipt tracing is already indexed there. | | a block height or block hash | Start with [NEAR Data API](https://docs.fastnear.com/neardata) for freshness-oriented monitoring, or [RPC Reference](https://docs.fastnear.com/rpc) for exact canonical block data | The user's need is usually either recency or canonicality. | | a contract ID plus storage key | Start with [KV FastData API](https://docs.fastnear.com/fastdata/kv) for indexed key history, or [RPC Reference](https://docs.fastnear.com/rpc) for exact current chain state | The storage question usually decides whether indexed history or canonical state matters. | | a node or archival setup task | Start with [Snapshots](https://docs.fastnear.com/snapshots) | This is operator workflow, not application data access. | ## What each surface is best at ### RPC Reference Use [RPC Reference](https://docs.fastnear.com/rpc) when the user needs exact protocol-native data or behavior: - exact account state, access keys, validators, chunks, blocks, protocol metadata - contract view calls and transaction submission - answers where field names and semantics should stay close to NEAR nodes Do not lead with RPC when the user really wants a clean summary of holdings or history. That forces the agent to rebuild a product-shaped answer from lower-level data. ### FastNear API Use [FastNear API](https://docs.fastnear.com/api) when the user wants an answer that already looks like application data: - balances - NFTs - staking positions - public-key lookups - combined account snapshots This should usually be the first stop for wallet, portfolio, explorer, and account overview requests. ### Transactions API Use [Transactions API](https://docs.fastnear.com/tx) when the user wants execution history: - account activity - transaction lookup - receipt tracing - block-scoped transaction history This is the default history surface when the user asks "what happened?" rather than "what exists right now?" ### Transfers API Use [Transfers API](https://docs.fastnear.com/transfers) when the user's question is explicitly about transfer events and not full execution context: - incoming and outgoing transfers - transfer-centric pagination flows - transfer-only account activity views If the user starts asking about receipts, non-transfer actions, or full transaction behavior, move up to [Transactions API](https://docs.fastnear.com/tx). ### NEAR Data API Use [NEAR Data API](https://docs.fastnear.com/neardata) when freshness matters more than a product-shaped summary: - optimistic or recently finalized blocks - latest block-family reads - explicit polling workflows Do not present this as a websocket or webhook product. It is a polling-oriented read surface. ### KV FastData API Use [KV FastData API](https://docs.fastnear.com/fastdata/kv) when the question is about indexed contract storage history or latest indexed key-value state: - storage analysis - key history - contract state lookups where indexed key-value access is the right abstraction ### Snapshots Use [Snapshots](https://docs.fastnear.com/snapshots) when the workflow is about operators standing up infrastructure: - mainnet or testnet bootstrap - RPC or archival node initialization - operator runbooks This is not an application query path. ## Immediate next steps after choosing Once you choose a starting API, the next move should also be predictable: | Chosen API | First thing to do | What success looks like | Widen only if... | | --- | --- | --- | --- | | [FastNear API](https://docs.fastnear.com/api) | Pick the endpoint that matches the user's identifier or summary request | You can answer balances, holdings, staking, or account-summary questions directly | The user needs exact canonical node fields or protocol-native confirmation | | [RPC Reference](https://docs.fastnear.com/rpc) | Choose the exact RPC method that matches the object and the required canonical field set | You can return protocol-native fields or perform the exact state/submit action requested | The user also needs a higher-level summary or indexed history | | [Transactions API](https://docs.fastnear.com/tx) | Start from the transaction hash, receipt, account history, or block-history endpoint that matches the question | You can explain what happened and in what order | The user needs exact RPC-level finality or submission semantics | | [Transfers API](https://docs.fastnear.com/transfers) | Fetch transfer history for the account or asset scope in question | You can answer transfer-only questions without unrelated execution detail | The user broadens the question to receipts, actions, or full transaction context | | [NEAR Data API](https://docs.fastnear.com/neardata) | Fetch the latest optimistic or finalized block-family data that matches the freshness requirement | You can answer "what changed recently?" or "what is the latest block-family state?" | The user needs exact canonical block/state follow-up | | [KV FastData API](https://docs.fastnear.com/fastdata/kv) | Fetch latest indexed key-value state or indexed key history | You can answer contract storage inspection questions in indexed form | The user needs exact on-chain current state instead of indexed storage views | | [Snapshots](https://docs.fastnear.com/snapshots) | Choose the right network and node type, then follow the bootstrap guide | You can give operator steps, prerequisites, and bootstrap guidance | The user shifts from infra setup to application-level chain queries | ## Stop conditions before you widen Do not widen to a second API just because it exists. Stay on the first API when: - the answer already matches the user's expected shape - the current API already exposes the fields the user asked about - the user asked for history and you already have indexed history - the user asked for a summary and you already have a summary Widen when: - the user explicitly asks for canonical confirmation - the current API lacks the field, freshness, or execution detail required - the user broadens from transfer-only history to general transaction behavior - the user broadens from summary output to protocol-native inspection ## Combine surfaces only when it helps the user Good multi-surface patterns: - Start with [FastNear API](https://docs.fastnear.com/api), then drop to [RPC Reference](https://docs.fastnear.com/rpc) if the user asks for exact canonical confirmation. - Start with [Transactions API](https://docs.fastnear.com/tx), then use [RPC Reference](https://docs.fastnear.com/rpc) if you need final protocol details for a specific transaction or receipt. - Start with [NEAR Data API](https://docs.fastnear.com/neardata) for the newest blocks, then use [RPC Reference](https://docs.fastnear.com/rpc) for exact follow-up inspection of a specific block or state query. - Start with [Transfers API](https://docs.fastnear.com/transfers) for transfer-only questions, then widen to [Transactions API](https://docs.fastnear.com/tx) if the user asks for more execution context. Bad multi-surface pattern: - Pull data from several surfaces before you know what the user actually wants. That usually produces a noisier answer, not a better one. ## What the agent should infer from common phrasing - "What does this wallet have?" usually means balances, NFTs, staking, and maybe public-key resolution. Start with [FastNear API](https://docs.fastnear.com/api). - "Why did this transaction fail?" usually means the user wants a readable execution story first, not raw protocol output. Start with [Transactions API](https://docs.fastnear.com/tx). - "Is this the exact chain state?" usually means canonical correctness matters more than convenience. Start with [RPC Reference](https://docs.fastnear.com/rpc). - "What just happened in the last block?" usually means freshness is the main requirement. Start with [NEAR Data API](https://docs.fastnear.com/neardata). - "How do I get a node online quickly?" is an operator workflow. Start with [Snapshots](https://docs.fastnear.com/snapshots). ## Common routing mistakes - Do not start with RPC just because it is canonical. Canonical is not the same as helpful for every user task. - Do not use snapshots for application-level reads. - Do not describe [NEAR Data API](https://docs.fastnear.com/neardata) as a streaming surface. - Do not widen from transfer history to full transaction history unless the user's question actually broadens. - Do not switch away from an indexed API just because raw RPC exists. Switch only when the indexed answer is insufficient. ## If user intent is ambiguous When the user is vague, make the smallest useful routing assumption: - "Check this account" should usually begin with [FastNear API](https://docs.fastnear.com/api), because most users want a readable account summary. - "Check this transaction" should usually begin with [Transactions API](https://docs.fastnear.com/tx), because most users want execution context, not only protocol fields. - "Check this block" can start with [NEAR Data API](https://docs.fastnear.com/neardata) for recency-oriented monitoring or [RPC Reference](https://docs.fastnear.com/rpc) when the user explicitly cares about canonical node output. If you do make an assumption, state it briefly in the answer and move forward. Ask for clarification only when choosing the wrong surface would materially change the result. ## What the agent should do after the first result After the first response comes back: 1. Check whether you can now answer the user's question directly. 2. If yes, answer in the user's expected shape instead of collecting more data. 3. If no, name the missing piece precisely. Examples: canonical confirmation, broader history, fresher block data, exact protocol field, or infra-specific context. 4. Only then switch APIs. The goal is not to prove that multiple FastNear APIs exist. The goal is to answer the user's next real question with the fewest necessary steps. ## Related guides - [Agents on FastNear](https://docs.fastnear.com/agents) for the full surface map, base URLs, and prompt-ingestion hints. - [Auth for Agents](https://docs.fastnear.com/agents/auth) for credential handling and runtime posture. - [Agent Playbooks](https://docs.fastnear.com/agents/playbooks) for example multi-step workflows. --- ## Agent Playbooks - HTML path: https://docs.fastnear.com/agents/playbooks - Markdown path: https://docs.fastnear.com/agents/playbooks.md **Source:** [https://docs.fastnear.com/agents/playbooks](https://docs.fastnear.com/agents/playbooks) # Agent Playbooks Use this page when the agent already knows the kind of task it is handling and needs the default next steps. Each playbook starts with one FastNear API, names the minimum useful inputs, and tells you when to stop versus when to widen. The core rule stays the same across all playbooks: start with one API, get the smallest useful result, and only widen when you can name the missing piece. ## How to use these playbooks 1. Match the user's request to the closest playbook below. 2. Gather the minimum inputs. 3. Make the first request from the suggested starting API. 4. Stop as soon as you can answer in the shape the user actually needs. 5. Widen only for a specific missing field, freshness requirement, or canonicality requirement. ## Quick map | If the user wants... | Start with... | Widen only if... | | --- | --- | --- | | account balances, holdings, staking, or wallet-style summary | [FastNear API](https://docs.fastnear.com/api) | exact canonical node fields are required | | transaction, receipt, or account execution history | [Transactions API](https://docs.fastnear.com/tx) | exact RPC-level status or submission semantics are required | | transfer-only history | [Transfers API](https://docs.fastnear.com/transfers) | the question broadens beyond transfers | | latest optimistic or finalized blocks | [NEAR Data API](https://docs.fastnear.com/neardata) | exact canonical block or state follow-up is required | | indexed contract key state or key history | [KV FastData API](https://docs.fastnear.com/fastdata/kv) | exact current on-chain state is required | | node bootstrap or operator setup | [Snapshots](https://docs.fastnear.com/snapshots) | the task shifts back to application-level chain data | If you still are not sure which one applies, use [Choosing the Right Surface](https://docs.fastnear.com/agents/choosing-surfaces) first. ## Account summary and holdings Use this when the user says things like "check this account", "what does this wallet hold", "what NFTs does this account have", or "which account does this key belong to?" **Minimum inputs** - network - `account_id` or public key - whether the user wants a broad summary or one specific asset class **Start here** - [V1 Full Account View](https://docs.fastnear.com/api/v1/account-full) for the broad account summary - [V1 Public Key Lookup](https://docs.fastnear.com/api/v1/public-key) when the starting identifier is a public key - [FastNear API index](https://docs.fastnear.com/api) when you need to choose a narrower endpoint first **Default sequence** 1. If the starting identifier is a public key, resolve it to one or more account IDs with [V1 Public Key Lookup](https://docs.fastnear.com/api/v1/public-key). 2. Fetch the broadest useful account view with [V1 Full Account View](https://docs.fastnear.com/api/v1/account-full). 3. If the user asked for only one asset family or needs narrower detail, move to the targeted endpoints such as [FT balances](https://docs.fastnear.com/api/v1/account-ft), [NFT holdings](https://docs.fastnear.com/api/v1/account-nft), or [staking positions](https://docs.fastnear.com/api/v1/account-staking). 4. Stop once you can answer the holdings question directly. **Widen only if** - the user asks for exact canonical state fields rather than indexed summary data - the user needs protocol-native account or access-key semantics When that happens, widen to [View Account](https://docs.fastnear.com/rpc/account/view-account) or other relevant pages in [RPC Reference](https://docs.fastnear.com/rpc). **A useful answer should contain** - the account identity you resolved - the balances or holdings the user asked about - a brief note if the answer is indexed summary data rather than raw RPC state ## Transaction or receipt investigation Use this when the user says things like "did this transaction succeed", "why did it fail", "what happened to this receipt", or "show recent activity for this account." **Minimum inputs** - network - transaction hash, receipt ID, or `account_id` - whether the user wants one item inspected or a history range **Start here** - [Transactions by Hash](https://docs.fastnear.com/tx/transactions) for a transaction hash - [Receipt Lookup](https://docs.fastnear.com/tx/receipt) for a receipt ID - [Account History](https://docs.fastnear.com/tx/account) for account-centric activity **Default sequence** 1. Choose the starting endpoint that matches the identifier you already have. 2. Fetch the indexed execution record and reconstruct the execution story in readable order. 3. Pull out the status, affected accounts, major receipts, and the block context if that is relevant. 4. Stop if you can explain what happened without needing canonical RPC confirmation. **Widen only if** - the user explicitly asks for exact RPC status semantics - the indexed record is not enough to answer a protocol-level question - the question shifts into transaction submission behavior When that happens, widen to [Transaction Status](https://docs.fastnear.com/rpc/transaction/tx-status) or another relevant method in [RPC Reference](https://docs.fastnear.com/rpc). **A useful answer should contain** - whether the transaction or receipt succeeded, failed, or is still pending - the main execution takeaway first, before raw fields - any follow-up path only if it adds value, such as "use RPC for canonical confirmation" ## Transfer-only history Use this when the user cares about asset movement and does not need broader receipt or action context. **Minimum inputs** - network - `account_id` - optional filters such as token, direction, or time range **Start here** - [Query Transfers](https://docs.fastnear.com/transfers/query) - [Transfers API index](https://docs.fastnear.com/transfers) **Default sequence** 1. Query transfer history for the relevant account and filters. 2. Use pagination only as far as needed to answer the question. 3. Keep the answer focused on transfers rather than reconstructing the full transaction story. 4. Stop if the user only asked who sent what, when, and in what asset. **Widen only if** - the user starts asking about non-transfer actions - the user needs receipt traces or broader execution context - the user wants to explain why an action happened, not just that a transfer occurred When that happens, widen to [Account History](https://docs.fastnear.com/tx/account) or another relevant page in [Transactions API](https://docs.fastnear.com/tx). **A useful answer should contain** - the incoming or outgoing transfer events that matter - any filter assumptions you made - a note that this is transfer history, not full execution history ## Recent block monitoring Use this when the user wants the latest optimistic or finalized block-family data, or asks "what changed recently?" **Minimum inputs** - network - freshness requirement: optimistic or finalized - optional block height or hash if the user is anchoring to a specific block **Start here** - [Last Final Block Redirect](https://docs.fastnear.com/neardata/last-block-final) for the latest finalized head - [Optimistic Block by Height](https://docs.fastnear.com/neardata/block-optimistic) when the workflow is explicitly optimistic - [Block Headers](https://docs.fastnear.com/neardata/block-headers) when header-level polling is enough - [NEAR Data API index](https://docs.fastnear.com/neardata) when you need to choose among these **Default sequence** 1. Decide whether the user needs optimistic freshness or finalized stability. 2. Use the latest-block helper or block-family route that matches that freshness requirement. 3. Poll explicitly and keep the answer clear about what freshness mode you used. 4. Stop if the user only needs recent block-family information and not canonical protocol follow-up. **Widen only if** - the user asks for exact canonical block output - the user wants to inspect state or protocol fields beyond the block-family data - the user needs exact RPC semantics for a specific block follow-up When that happens, widen to [RPC Reference](https://docs.fastnear.com/rpc), usually starting with [Block by Height](https://docs.fastnear.com/rpc/block/block-by-height) or [Block by Id](https://docs.fastnear.com/rpc/block/block-by-id). **A useful answer should contain** - whether the data came from optimistic or finalized reads - the latest block or header details that actually answer the user's question - a note when a deeper canonical follow-up would materially change interpretation ## Contract storage inspection Use this when the user wants indexed contract key history, latest indexed key state, or contract-storage analysis by key. **Minimum inputs** - network - contract ID - exact key, key prefix, or account/predecessor scope - whether the user wants latest indexed state or historical key changes **Start here** - [GET Latest by Exact Key](https://docs.fastnear.com/fastdata/kv/get-latest-key) for one exact key - [KV FastData API index](https://docs.fastnear.com/fastdata/kv) when the question is broader than one key **Default sequence** 1. Decide whether the user wants one key, a key family, or account-scoped storage history. 2. Fetch the smallest indexed key-value view that matches that scope. 3. If the user needs history rather than the latest value, stay inside [KV FastData API](https://docs.fastnear.com/fastdata/kv) and switch to the matching history endpoint. 4. Stop if indexed key-value data already answers the question. **Widen only if** - the user needs exact current on-chain state rather than indexed storage state - the user needs protocol-native contract-state semantics - the indexed storage view is insufficient for the exact key or prefix requested When that happens, widen to [View State](https://docs.fastnear.com/rpc/contract/view-state) in [RPC Reference](https://docs.fastnear.com/rpc). **A useful answer should contain** - the contract and key scope you inspected - whether the result is latest indexed state or key history - a note if canonical RPC state would differ in freshness or semantics ## Node bootstrap and operator setup Use this when the user is trying to get infrastructure online rather than query chain data. **Minimum inputs** - network - node type, such as RPC or archival - whether the goal is bootstrap speed, sync recovery, or an operational runbook **Start here** - [Snapshots](https://docs.fastnear.com/snapshots) **Default sequence** 1. Route immediately to the relevant snapshot or operator guide. 2. Keep the answer focused on prerequisites, bootstrap path, and operational next steps. 3. Do not pull application-level APIs unless the user later changes the task. **Widen only if** - the user stops asking about infrastructure and starts asking about chain data itself When that happens, return to [Choosing the Right Surface](https://docs.fastnear.com/agents/choosing-surfaces) and pick the correct data API from there. **A useful answer should contain** - the network and node type you are assuming - the operator steps the user should follow next - any clear prerequisite or caveat that changes the bootstrap path ## Cross-playbook rules - State the network if you had to infer it. - State the API you chose if the choice was an inference. - Prefer one sufficient answer over an exhaustive multi-API answer. - Treat pagination tokens as opaque and reuse them only with the endpoint and filter set that produced them. - Do not widen just because a more canonical API exists. ## If no playbook fits cleanly If the request is still ambiguous after reading this page: - use [Choosing the Right Surface](https://docs.fastnear.com/agents/choosing-surfaces) to pick the first API - use [Auth for Agents](https://docs.fastnear.com/agents/auth) if the blocker is credential handling - return to [Agents on FastNear](https://docs.fastnear.com/agents) for the default workflow and answer-shape rules --- ## FastNear API - HTML path: https://docs.fastnear.com/api - Markdown path: https://docs.fastnear.com/api.md **Source:** [https://docs.fastnear.com/api](https://docs.fastnear.com/api) # FastNear API FastNear API is the indexed REST family for builder-facing account views. It is the fastest way to answer questions like "what does this account own?" or "which accounts map to this public key?" without stitching together raw RPC calls. ## Base URLs ```bash title="FastNear API Mainnet" https://api.fastnear.com ``` ```bash title="FastNear API Testnet" https://test.api.fastnear.com ``` ## Best fit - Wallet balances and asset overviews. - NFT and fungible-token account views. - Public-key to account lookups. - Combined account snapshots for dashboards, explorers, and agents. ## When not to use it - Use [RPC Reference](https://docs.fastnear.com/rpc) when you need protocol-native JSON-RPC methods. - Use [Transactions API](https://docs.fastnear.com/tx) when the primary job is transaction or receipt history. - Use [NEAR Data API](https://docs.fastnear.com/neardata) when the job is block-family polling and freshness checks. ## Auth and network availability - FastNear public REST endpoints often work without an API key. - The same FastNear key format still works across API endpoints when you want a consistent authenticated posture or higher limits, and the docs UI can forward it for interactive examples. - Add `?network=testnet` to move compatible pages to the testnet backend and seeded testnet defaults. ## Shareable live examples - Use `Copy example URL` on any interactive API page to share the selected network and filled request state. - Shared example URLs run automatically on load whenever they include operation state. - Saved API keys and tokens are never included in those shared docs URLs. ## Common starting points - [V1 full account view](https://docs.fastnear.com/api/v1/account-full) for a combined account snapshot. - [V1 account FT](https://docs.fastnear.com/api/v1/account-ft) and [V1 account NFT](https://docs.fastnear.com/api/v1/account-nft) for product-facing asset views. - [V1 public key](https://docs.fastnear.com/api/v1/public-key) when you need account resolution from a key. - [V1 FT top holders](https://docs.fastnear.com/api/v1/ft-top) for token-distribution views. ## Need a workflow? Use [FastNear API Examples](https://docs.fastnear.com/api/examples) for worked examples like account summaries, key-to-account resolution, and asset-specific follow-up. ## Troubleshooting ### I only need one low-level value from chain state Use raw RPC instead. The indexed surface is optimized for product views, not for mirroring every RPC method. ### My page is still on mainnet data Check whether the page supports `?network=testnet`. Some flows are mainnet-only; the docs call that out when it applies. ### I need transactions, not balances Move to [Transactions API](https://docs.fastnear.com/tx) so you do not overload the account-view surface with history queries. --- ## API Examples - HTML path: https://docs.fastnear.com/api/examples - Markdown path: https://docs.fastnear.com/api/examples.md **Source:** [https://docs.fastnear.com/api/examples](https://docs.fastnear.com/api/examples) ## Examples All shell examples below work on the public FastNear API hosts as-is. If `FASTNEAR_API_KEY` is set in your shell, they pass it as an `apiKey` query parameter automatically; if it is unset, they fall back to the public unauthenticated path. Bearer auth with `Authorization: Bearer ${FASTNEAR_API_KEY}` is also supported when headers fit your client better. ### Summarize one account in one call `/v1/account/{id}/full` is the FastNear API's account aggregator — one call bundles the account's NEAR state, every FT contract it's touched, every NFT collection it's received, and every validator pool it's delegated to. When you already have the `account_id`, this is the fastest "what does this account look like?" read. ```bash ACCOUNT_ID=root.near curl -s "https://api.fastnear.com/v1/account/$ACCOUNT_ID/full?apiKey=${FASTNEAR_API_KEY:-}" \ | jq '{ account_id, near_balance_yocto: .state.balance, ft_contracts: (.tokens | length), nft_contracts: (.nfts | length), staking_pool_contracts: (.pools | length) }' ``` For `root.near`: 150 FT contracts in the list, 102 NFT collections, 2 staking pools. The contract counts alone tell you this is a busy mainnet account. Every example below drills into one of those surfaces — start here when all you have is the account ID. ### Resolve a public key, then fetch the account snapshot Look up which account a key belongs to, then read that account's holdings in one call. ```bash PUBLIC_KEY='ed25519:CCaThr3uokqnUs6Z5vVnaDcJdrfuTpYJHJWcAGubDjT' LOOKUP="$(curl -s "https://api.fastnear.com/v1/public_key/$(jq -rn --arg k "$PUBLIC_KEY" '$k | @uri')?apiKey=${FASTNEAR_API_KEY:-}")" echo "$LOOKUP" | jq '{matched: (.account_ids | length), account_ids}' ACCOUNT_ID="$(echo "$LOOKUP" | jq -r '.account_ids[0]')" curl -s "https://api.fastnear.com/v1/account/$ACCOUNT_ID/full?apiKey=${FASTNEAR_API_KEY:-}" \ | jq '{account_id, state, tokens: (.tokens|length), nfts: (.nfts|length), pools: (.pools|length)}' ``` If `matched` is greater than 1, switch to [V1 Public Key Lookup All](https://docs.fastnear.com/api/v1/public-key-all) and loop over every returned account. ### How much of this account's NEAR is actually spendable? NEAR account state has three buckets that wallet UIs tend to conflate: `balance` is the unstaked amount, `locked` is NEAR tied up in validator stake or a lockup contract, and `storage_bytes` implies a separate amount pinned to the trie at the current rate of 10^19 yoctoNEAR per byte. One pipeline over `/full` breaks them apart. ```bash ACCOUNT_ID=root.near curl -s "https://api.fastnear.com/v1/account/$ACCOUNT_ID/full?apiKey=${FASTNEAR_API_KEY:-}" \ | jq ' (.state.balance | tonumber) as $amount | (.state.locked | tonumber) as $locked | (.state.storage_bytes * 10000000000000000000) as $pinned | 1e24 as $ynear | { account_id, near: { total_owned: (($amount + $locked) / $ynear), unstaked: ($amount / $ynear), stake_or_lockup: ($locked / $ynear), pinned_to_storage: ($pinned / $ynear), spendable: (($amount - $pinned) / $ynear) } }' ``` For `root.near`: ~3914.67 NEAR total, all unstaked, ~0.28677 NEAR pinned to 28,677 bytes of on-chain state, and ~3914.38 NEAR spendable. New accounts feel this most acutely — a fresh named account of ~182 bytes has ~0.00182 NEAR stuck to storage, which is why CLI tools refuse to let you send an account's full balance. Point the same pipeline at a validator pool like `astro-stakers.poolv1.near` and the numbers invert: ~730 K unstaked, ~27.68 M in `locked`. That `locked` is the pool's own protocol-level validator stake, not the delegators' funds (those are tracked inside the pool contract's state). The same field means different things on different account types. jq uses IEEE-754 doubles, so the NEAR values above are display-precision only — keep the raw yocto strings if you need exact bookkeeping. ### When did anything about this account last change? Every entry under `/full`'s `tokens`, `nfts`, and `pools` arrays carries its own `last_update_block_height` — the block at which the indexer last saw that row change for this account. Taking the max across all three arrays gives a cheap "latest activity" signal without touching the transaction API. ```bash ACCOUNT_ID=root.near curl -s "https://api.fastnear.com/v1/account/$ACCOUNT_ID/full?apiKey=${FASTNEAR_API_KEY:-}" \ | jq ' [ (.tokens // [])[].last_update_block_height, (.nfts // [])[].last_update_block_height, (.pools // [])[].last_update_block_height ] as $heights | ($heights | map(select(. != null))) as $tracked | { account_id, total_entries: ($heights | length), tracked_entries: ($tracked | length), most_recent_block: ($tracked | max), oldest_tracked_block: ($tracked | min) }' ``` For `root.near`, this returns 254 total entries across FT, NFT, and pool contracts, 158 with a tracked block, and a most-recent block of `194301659`. That's enough to tell you the wallet is still active without touching transaction history. This is the right question for "has this wallet been recently active?" or "has anything moved since block X?" — cheap, one call, no transaction history needed. For the transaction that caused the latest change, widen to the [Transactions API](https://docs.fastnear.com/tx). Entries with `last_update_block_height: null` predate the indexer's per-row tracking (typically older airdrops) and are ignored here rather than counted as recent. ### Show NFT collections this wallet holds from a specific publisher NEAR account names encode a hierarchy: `mint.sharddog.near` is a subaccount of `sharddog.near`, which is a subaccount of `near`. Publishers that ship multiple NFT collections usually deploy each one as its own subaccount, so a single suffix filter over the account's NFT list recovers everything under one publisher tree — no external collection registry required. ```bash ACCOUNT_ID=root.near PUBLISHER=sharddog.near curl -s "https://api.fastnear.com/v1/account/$ACCOUNT_ID/nft?apiKey=${FASTNEAR_API_KEY:-}" \ | jq --arg publisher "$PUBLISHER" ' ("." + $publisher) as $suffix | { account_id: .account_id, publisher: $publisher, collections: [ .tokens[] | select(.contract_id | endswith($suffix)) | { contract_id, last_update_block_height, status: (if .last_update_block_height == null then "dormant" else "active" end) } ] | sort_by(.last_update_block_height // 0) }' ``` For `root.near` and `sharddog.near`, this returns four subaccount contracts: `ndcconstellationnft`, `mint`, `harvestmoon`, and `claim`. Only `claim` carries a non-null `last_update_block_height` (`131402024`), so that's the one contract where the wallet's position clearly changed. The others are dormant — common for drop-era contracts an account received into but never interacted with again. Swap `PUBLISHER` to any account to scope the filter to a different publisher tree. ### Does this wallet show direct staking, liquid staking tokens, or both? Direct pool positions live on `/staking`; liquid staking tokens (stNEAR, LiNEAR, etc.) sit on `/ft` like any other FT. Read both, classify the wallet — `root.near` shows up as `mixed`. ```bash ACCOUNT_ID=root.near LIQUID_PROVIDERS_JSON='["meta-pool.near","lst.rhealab.near","linear-protocol.near"]' STAKING="$(curl -s "https://api.fastnear.com/v1/account/$ACCOUNT_ID/staking?apiKey=${FASTNEAR_API_KEY:-}")" FT="$(curl -s "https://api.fastnear.com/v1/account/$ACCOUNT_ID/ft?apiKey=${FASTNEAR_API_KEY:-}")" jq -n \ --argjson staking "$STAKING" \ --argjson ft "$FT" \ --argjson providers "$LIQUID_PROVIDERS_JSON" ' ($staking.pools // []) as $direct | (($ft.tokens // []) | map(select(.contract_id as $id | $providers | index($id)))) as $liquid | { classification: ( if ($direct|length)>0 and ($liquid|length)>0 then "mixed" elif ($direct|length)>0 then "direct_only" elif ($liquid|length)>0 then "liquid_only" else "no_visible_staking_position" end ), direct_pools: ($direct | map(.pool_id)), liquid_tokens: ($liquid | map({contract_id, balance})) }' ``` The classifier only knows what you teach it — extend `LIQUID_PROVIDERS_JSON` as new liquid-staking products ship, and treat the result as observational rather than exhaustive. ## Common mistakes - Leading with the broad account snapshot when the user only asked about one asset family. - Using FastNear API when the user explicitly needs exact RPC fields or permissions. - Staying in account-summary pages after the question turns into transaction history. ## Related guides - [FastNear API](https://docs.fastnear.com/api) - [API Reference](https://docs.fastnear.com/api/reference) - [RPC Reference](https://docs.fastnear.com/rpc) - [Transactions API](https://docs.fastnear.com/tx) - [Choosing the Right Surface](https://docs.fastnear.com/agents/choosing-surfaces) - [Agent Playbooks](https://docs.fastnear.com/agents/playbooks) --- ## API Reference - HTML path: https://docs.fastnear.com/api/reference - Markdown path: https://docs.fastnear.com/api/reference.md **Source:** [https://docs.fastnear.com/api/reference](https://docs.fastnear.com/api/reference) # API Reference This route explains what belongs in FastNear's REST layer and how to choose among the REST families before dropping to raw JSON-RPC. The `/api` sidebar is intentionally the **FastNear API** sidebar, not a catch-all REST sidebar. Other REST families such as [Transactions API](https://docs.fastnear.com/tx), [Transfers API](https://docs.fastnear.com/transfers), [NEAR Data API](https://docs.fastnear.com/neardata), and [KV FastData API](https://docs.fastnear.com/fastdata/kv) each live at their own top-level section. ## REST families at a glance | Family | Start here when... | Move elsewhere when... | | --- | --- | --- | | [FastNear API](https://docs.fastnear.com/api) | you want indexed account, token, NFT, staking, or public-key views | you need canonical protocol-native RPC semantics | | [Transactions API](https://docs.fastnear.com/tx) | you want transaction, receipt, account, or block history | you only need transfer events or exact RPC-level behavior | | [Transfers API](https://docs.fastnear.com/transfers) | the question is specifically about NEAR or FT movement | the question broadens to general execution history | | [NEAR Data API](https://docs.fastnear.com/neardata) | you want recent optimistic or finalized block-family reads | you need exact canonical block or state follow-up | | [KV FastData API](https://docs.fastnear.com/fastdata/kv) | you want indexed key-value history or latest indexed key state | you need exact current on-chain contract state | ## What `/api` itself is for Use the [FastNear API](https://docs.fastnear.com/api) section when the user wants a product-shaped answer without stitching raw node responses together: - account summaries - FT balances - NFT holdings - staking positions - public-key to account resolution Good starting pages in this sidebar: - [V1 Full Account View](https://docs.fastnear.com/api/v1/account-full) - [V1 Account FT](https://docs.fastnear.com/api/v1/account-ft) - [V1 Account NFT](https://docs.fastnear.com/api/v1/account-nft) - [V1 Account Staking](https://docs.fastnear.com/api/v1/account-staking) - [V1 Public Key](https://docs.fastnear.com/api/v1/public-key) ## When not to use `/api` Do not start in this sidebar when: - the primary job is history; use [Transactions API](https://docs.fastnear.com/tx) or [Transfers API](https://docs.fastnear.com/transfers) - the primary job is recent block polling; use [NEAR Data API](https://docs.fastnear.com/neardata) - the answer must stay close to canonical node request and response shapes; use [RPC Reference](https://docs.fastnear.com/rpc) ## For agents If the caller is an AI agent and the choice is still unclear, use: - [Agents on FastNear](https://docs.fastnear.com/agents) - [Choosing the Right Surface](https://docs.fastnear.com/agents/choosing-surfaces) --- ## Auth & Access - HTML path: https://docs.fastnear.com/auth - Markdown path: https://docs.fastnear.com/auth.md **Source:** [https://docs.fastnear.com/auth](https://docs.fastnear.com/auth) # Auth & Access One FastNear API key works across the RPC and API endpoints. Keep the auth model simple: use the same credential everywhere and send it either as a Bearer header or an `apiKey` query parameter. Get a key in [FastNear Dashboard](https://dashboard.fastnear.com). Live example pages also support `Copy example URL` for sharing prefilled requests. Shared example URLs run automatically on load whenever they include operation state, and saved API keys and tokens are never included in those public docs URLs. ## If you only need the rule - One FastNear API key works across RPC and API endpoints. - Set `FASTNEAR_API_KEY` in your shell, runtime, or secret manager. - Prefer `Authorization: Bearer ${FASTNEAR_API_KEY}` for production backends. - Use `?apiKey=${FASTNEAR_API_KEY}` when headers are awkward or you are doing quick curl/debug work. - Agents and automations should keep the key in env vars or a secret manager, not in browser storage. ## Choose the auth form | Form | Best for | Notes | | --- | --- | --- | | `Authorization: Bearer ${FASTNEAR_API_KEY}` | production backends, workers, automations, and proxies | Best default. Keeps credentials out of copied URLs and most URL logs. | | `?apiKey=${FASTNEAR_API_KEY}` | simple curl, one-off debugging, systems that cannot set headers easily | Valid, but the key may end up in shell history, logs, analytics, or copied links. | If you control the client, use the header form. ## Authorization header example ```bash : "${FASTNEAR_API_KEY:?Set FASTNEAR_API_KEY in your shell before running this example.}" curl "https://rpc.mainnet.fastnear.com" \ -H "Authorization: Bearer $FASTNEAR_API_KEY" \ -H "Content-Type: application/json" \ --data '{"method":"block","params":{"finality":"final"},"id":1,"jsonrpc":"2.0"}' ``` ## `?apiKey=` query parameter example ```bash : "${FASTNEAR_API_KEY:?Set FASTNEAR_API_KEY in your shell before running this example.}" curl "https://rpc.mainnet.fastnear.com?apiKey=$FASTNEAR_API_KEY" \ -H "Content-Type: application/json" \ --data '{"method":"block","params":{"finality":"final"},"id":1,"jsonrpc":"2.0"}' ``` ## Where this applies - [RPC Reference](https://docs.fastnear.com/rpc) uses the shared FastNear key model on both the regular and archival hosts. - API families reuse the same key shape across the REST surfaces. - The docs UI can forward a saved FastNear key for supported pages, but that browser storage behavior is a docs convenience, not a production pattern. For agent and automation runtimes, use [Auth for Agents](https://docs.fastnear.com/agents/auth). ## Production defaults Use these defaults unless you have a specific reason not to: - keep the key in an env var or secret manager - inject it at the backend, worker, or proxy layer - prefer the Bearer header over the query parameter - rotate the key if it leaks into a prompt, URL, or debug log ## Common failure modes ### The request works without a key in one context but not another That usually means you moved from public traffic to a higher-limit or authenticated path. Add the same FastNear key you use elsewhere. ### I switched from regular RPC to archival RPC Use the same FastNear key and the same header or query-param transport on both hosts. Only the retention profile changes. ### My key is showing up in logs Switch to the `Authorization` header if you are currently using `?apiKey=`. URLs tend to travel through more logging and observability systems. ### The docs UI worked, but my backend does not Do not rely on browser storage behavior from the docs UI. Production backends should inject credentials explicitly. ### I am building an agent or automation Use [Auth for Agents](https://docs.fastnear.com/agents/auth) for the runtime posture. Browser `localStorage` is a docs convenience, not an agent secret store. --- ## KV FastData API - HTML path: https://docs.fastnear.com/fastdata/kv - Markdown path: https://docs.fastnear.com/fastdata/kv.md **Source:** [https://docs.fastnear.com/fastdata/kv](https://docs.fastnear.com/fastdata/kv) # KV FastData API KV FastData API is the indexed key-value family. Use it when you already know the contract, account, predecessor, or key scope you want to inspect and you want indexed rows without building your own storage indexing layer. ## Base URLs ```bash title="KV FastData API Mainnet" https://kv.main.fastnear.com ``` ```bash title="KV FastData API Testnet" https://kv.test.fastnear.com ``` ## Quick start If you already know one exact key, start with the latest indexed row and stop as soon as it answers the question. ```bash CURRENT_ACCOUNT_ID=social.near PREDECESSOR_ID=james.near KEY='graph/follow/sleet.near' AUTH_HEADER=() if [ -n "${FASTNEAR_API_KEY:-}" ]; then AUTH_HEADER=(-H "Authorization: Bearer $FASTNEAR_API_KEY"); fi ENCODED_KEY="$(jq -rn --arg key "$KEY" '$key | @uri')" curl -s "https://kv.main.fastnear.com/v0/latest/$CURRENT_ACCOUNT_ID/$PREDECESSOR_ID/$ENCODED_KEY" \ "${AUTH_HEADER[@]}" \ | jq '{ latest: ( .entries[0] | { current_account_id, predecessor_id, block_height, key, value } ) }' ``` This is the narrowest useful KV read: one exact key, one latest indexed row. If the next question becomes “how did this key change over time?”, move to [GET History by Exact Key](https://docs.fastnear.com/fastdata/kv/get-history-key) or the fuller [KV FastData Examples](https://docs.fastnear.com/fastdata/kv/examples). ## Use this API when - you want latest indexed state for one key or a known key family - you want historical key changes by account, key, or predecessor - you want batch lookups for known exact keys - you are debugging contract storage in indexed form ## Do not start here when - you need balances, token holdings, NFTs, or account summaries - you need recent block-family data - you need exact current on-chain state with canonical RPC semantics Use [FastNear API](https://docs.fastnear.com/api) for higher-level account views, [NEAR Data API](https://docs.fastnear.com/neardata) for block-family reads, and [RPC Reference](https://docs.fastnear.com/rpc) for canonical contract-state inspection. ## Minimum useful inputs - network - contract ID or another precise scope such as account, predecessor, or exact key - whether the user needs the latest indexed value or historical changes ## Choose a query shape - [GET Latest by Exact Key](https://docs.fastnear.com/fastdata/kv/get-latest-key) when you already know one exact key - [GET History by Exact Key](https://docs.fastnear.com/fastdata/kv/get-history-key) when you need the change history for one exact key - [Latest by Account](https://docs.fastnear.com/fastdata/kv/latest-by-account) or [History by Account](https://docs.fastnear.com/fastdata/kv/history-by-account) when the scope is account-centric - [All by Predecessor](https://docs.fastnear.com/fastdata/kv/all-by-predecessor) or [History by Predecessor](https://docs.fastnear.com/fastdata/kv/history-by-predecessor) when the predecessor is the right scope - [Multi Lookup](https://docs.fastnear.com/fastdata/kv/multi) when you already know several exact keys ## Need a workflow? Use [KV FastData Examples](https://docs.fastnear.com/fastdata/kv/examples) for worked examples like exact-key lookups, key-history investigation, predecessor-scoped inspection, and canonical RPC follow-up. ## Default workflow 1. Pick the narrowest scope that matches the user's question. 2. Stay within KV FastData first when the question is still about indexed key-value data. 3. Use the latest endpoints for current indexed views and the history endpoints only when the user needs change-over-time answers. 4. Stop once the indexed rows already answer the storage question. ## Auth and availability - Public indexed storage reads often work without a key. - If you standardize on one FastNear API key across FastNear surfaces, reuse the same header or query-param shape here too. - Add `?network=testnet` to switch the page to the testnet backend where supported. - List responses omit `page_token` when there are no more results. ## Widen only if - the user needs exact current on-chain state rather than indexed storage data - the user needs canonical contract-state semantics - the indexed storage view is the wrong abstraction for the question When that happens, widen to [View State](https://docs.fastnear.com/rpc/contract/view-state) in [RPC Reference](https://docs.fastnear.com/rpc). ## Troubleshooting ### My pagination token stopped working Treat `page_token` values as opaque and reuse them only with the same endpoint and filters. ### I need product-facing account balances instead of raw key-value rows Move up to [FastNear API](https://docs.fastnear.com/api). --- ## KV FastData Examples - HTML path: https://docs.fastnear.com/fastdata/kv/examples - Markdown path: https://docs.fastnear.com/fastdata/kv/examples.md **Source:** [https://docs.fastnear.com/fastdata/kv/examples](https://docs.fastnear.com/fastdata/kv/examples) ## Examples All shell examples below work on the public KV FastData hosts as-is. If `FASTNEAR_API_KEY` is set in your shell, they pass it as an `apiKey` query parameter automatically; if it is unset, they fall back to the public unauthenticated path. Bearer auth with `Authorization: Bearer ${FASTNEAR_API_KEY}` is also supported when headers fit your client better. ### Check one exact key, then replay its history When you already know the contract, predecessor, and exact key, start narrow. `latest` answers the present-tense question; `history` shows whether that one row changed over time. ```bash CURRENT_ACCOUNT_ID=social.near PREDECESSOR_ID=james.near KEY='graph/follow/sleet.near' ENCODED_KEY="$(jq -rn --arg key "$KEY" '$key | @uri')" LATEST="$(curl -s "https://kv.main.fastnear.com/v0/latest/$CURRENT_ACCOUNT_ID/$PREDECESSOR_ID/$ENCODED_KEY?apiKey=${FASTNEAR_API_KEY:-}")" echo "$LATEST" | jq '{ latest: ( .entries[0] | { current_account_id, predecessor_id, block_height, key, value } ) }' curl -s "https://kv.main.fastnear.com/v0/history/$CURRENT_ACCOUNT_ID/$PREDECESSOR_ID/$ENCODED_KEY?apiKey=${FASTNEAR_API_KEY:-}" \ | jq '{writes: [.entries[] | {block_height, value}]}' ``` For an exact follow-edge style key like this, `latest` tells you the current indexed value in one row and `history` shows whether the edge was written once or toggled over time. Start here when you already know the storage path; widen to predecessor scans only when you need discovery rather than proof. ### Inspect one predecessor's indexed writes, then narrow to the key that changed `all-by-predecessor` returns the latest indexed writes one account made across every contract it touched. Lift an interesting key and replay it through `history` to see how that row changed over time. ```bash PREDECESSOR_ID=jemartel.near FIRST="$(curl -s "https://kv.main.fastnear.com/v0/all/$PREDECESSOR_ID?apiKey=${FASTNEAR_API_KEY:-}" \ -H 'content-type: application/json' \ --data '{"include_metadata":true,"limit":10}')" echo "$FIRST" | jq '{ page_token, entries: [.entries[] | {current_account_id, predecessor_id, block_height, key, value, tx_hash}] }' ``` For `jemartel.near`, the listing mixes an `account_id` identity assertion on `contextual.near` with a run of `graph/follow/*` additions to the same contract. The `tx_hash` on each row is the direct handoff into [/tx/examples](https://docs.fastnear.com/tx/examples#i-have-one-transaction-hash-what-happened) if you want the full transaction story behind any write. Lift the most recent row and replay it through `history`: ```bash PREDECESSOR_ID=jemartel.near FIRST="$(curl -s "https://kv.main.fastnear.com/v0/all/$PREDECESSOR_ID?apiKey=${FASTNEAR_API_KEY:-}" \ -H 'content-type: application/json' \ --data '{"include_metadata":true,"limit":10}')" CURRENT_ACCOUNT_ID="$(echo "$FIRST" | jq -r '.entries[0].current_account_id')" EXACT_KEY="$(echo "$FIRST" | jq -r '.entries[0].key')" ENCODED_KEY="$(jq -rn --arg key "$EXACT_KEY" '$key | @uri')" curl -s "https://kv.main.fastnear.com/v0/history/$CURRENT_ACCOUNT_ID/$PREDECESSOR_ID/$ENCODED_KEY?apiKey=${FASTNEAR_API_KEY:-}" \ | jq '{entries: [.entries[] | {block_height, value}]}' ``` For the `account_id` row, `history` returns a single write at block `185965311` with value `"jemartel.near:mainnet"` — the identity assertion stands, stable since that block. KV preserves every write equally: a quiet key shows one row, a busy key shows many — same shape, no summarization. ## Common mistakes - Starting with broad account or predecessor scans when an exact key is already known. - Using KV FastData when the user really wants balances or holdings. - Confusing indexed history with exact current chain state. - Reusing pagination tokens or changing filters mid-scan. ## Related guides - [KV FastData API](https://docs.fastnear.com/fastdata/kv) - [RPC Reference](https://docs.fastnear.com/rpc) - [FastNear API](https://docs.fastnear.com/api) - [Choosing the Right Surface](https://docs.fastnear.com/agents/choosing-surfaces) - [Agent Playbooks](https://docs.fastnear.com/agents/playbooks) --- ## Internationalization Playbook - HTML path: https://docs.fastnear.com/internationalization - Markdown path: https://docs.fastnear.com/internationalization.md **Source:** [https://docs.fastnear.com/internationalization](https://docs.fastnear.com/internationalization) This playbook documents the locale framework in `builder-docs`. Russian is the first full implementation, but it is no longer a one-off rollout. The goal is that every later locale follows the same system: - shared locale registry - locale-owned glossary and policy files - non-destructive bootstrap scaffolding - wave-based editorial QA - locale-safe routing, SEO, and discovery artifacts - localized FastNear overlay catalogs that never mutate generated English source data ## Design Goals This framework is meant to keep future locale work mostly about content, not about infrastructure. The non-negotiable rules are: - English stays the default locale at `/` - localized docs publish at `//...` - canonical technical identifiers stay stable - slugs - endpoint paths - payload keys - schema property names - operation IDs - generated localization remains an overlay, never an in-place edit of vendored generated data ## Core Files ### Locale registry Supported locales live in `src/data/localeRegistry.json`. That registry is the shared source of truth for: - Docusaurus locale config - locale-aware route helpers - bootstrap and audit tooling - client-side hidden-section metadata ### Locale-owned glossary Each non-default locale owns `i18n//glossary.yml`. The glossary is the terminology contract for both humans and scripts. It keeps translation decisions out of scattered JS arrays and prose docs. Current schema: - `preserve` Terms that must remain literal or canonical, such as `RPC`, `API`, `JSON-RPC`, `GET`, `POST`, `FastNear`, `mainnet`, and code-ish identifiers. - `translate` Preferred exact and word-level mappings for recurring UI and docs phrases. - `transliterate` Preferred transliterations for integrated jargon when that is better than keeping Latin script. - `notes` Human guidance that explains the editorial intent but is not required by scripts. ### Locale-owned translation policy Each non-default locale also owns `i18n//translation-policy.yml`. This file defines editorial scope and workflow policy: - `waves.wave1` Required-for-ship docs and page-model IDs. This is the CI-enforced editorial bar. - `waves.wave2` Expanded public surface for follow-up editorial passes. - `hiddenSections` Route prefixes and doc path prefixes that are intentionally out of editorial scope until they become public. - `bootstrap` Locale-owned route labels and translation JSON overrides used by the scaffold flow. For Russian, `/transaction-flow` is the first hidden section tracked this way. ## Shared Tooling The locale framework now uses generic commands instead of Russian-only scripts. ```bash yarn bootstrap:i18n --locale yarn bootstrap:i18n:reseed --locale yarn audit:i18n --locale --wave <1|2|all> yarn audit:i18n:all ``` What they do: - `bootstrap:i18n` Safe scaffold refresh. It fills in missing locale files and keys without overwriting curated content. - `bootstrap:i18n:reseed` Explicit destructive path when you intentionally want to reseed a locale from the bootstrap heuristics. - `audit:i18n` Glossary-aware editorial QA for a single locale and wave. - `audit:i18n:all` CI-oriented wave-1 audit for every configured non-default locale. Russian compatibility aliases still exist and remain supported: ```bash yarn bootstrap:i18n:ru yarn bootstrap:i18n:ru:reseed yarn audit:i18n:ru ``` Those are convenience wrappers. The generic commands are now canonical. ## Bootstrap Behavior `scripts/bootstrap-i18n.js` is intentionally non-destructive by default. For a locale such as `ru`, it: - runs `write-translations --locale ru` - scaffolds missing docs into `i18n/ru/docusaurus-plugin-content-docs/current` - preserves existing curated locale docs instead of overwriting them - merges missing runtime translation keys into locale JSON catalogs - refreshes `src/data/fastnearTranslations..json` without discarding curated overlay entries - applies locale-owned route labels and JSON overrides from `translation-policy.yml` This keeps scaffold freshness and editorial curation compatible with each other. ## Audit Behavior `scripts/audit-i18n.js` is the lightweight editorial gate. It reads: - the locale glossary for allowed literal terms - the locale translation policy for wave scope and hidden-section exclusions - locale docs under `i18n//...` - locale runtime translation catalogs - locale FastNear overlay catalogs The audit flags suspicious English leftovers while respecting allowed literals such as: - protocol names - HTTP verbs - product names - code identifiers - canonical path fragments This is meant to be practical QA, not language-policing for every long-tail page on day one. ## Wave Policy Every locale should use the same editorial policy: ### Wave 1 Wave 1 is the shipping bar. It should include: - homepage and primary decision pages - top-level auth, API, RPC, and transaction entry points - the most visible generated operation wrappers and overlay entries - live runtime UI strings on those pages Wave 1 is the only translation scope enforced in CI. ### Wave 2 Wave 2 is the broader public-surface pass. It should include: - more leaf docs - long-tail overview pages - additional generated overlay entries - lower-priority but still public runtime copy Wave 2 is important, but it is intentionally non-blocking. ### Long tail Long-tail work is ongoing polish: - maintainer docs - obscure leaf pages - rarely surfaced theme strings - low-traffic generated pages That work should keep improving, but it should not block shipping a healthy locale. ## Hidden Sections Hidden sections must be explicit so we do not confuse file coverage with editorial readiness. The source of truth is `translation-policy.yml.hiddenSections`. Those prefixes drive two things: - they are excluded from wave-1 editorial requirements - docs pages under those prefixes render a visible banner explaining that editorial and translation polish are intentionally deferred until the section becomes public Today, `/transaction-flow` is the first section using this rule. ## Runtime, Routing, And Discovery The locale framework also covers the non-prose surfaces that future locales should inherit automatically. Important files: - `docusaurus.config.js` - `src/utils/localizedRoutes.js` - `src/utils/fastnearLocalization.js` - `scripts/generate-ai-surfaces.js` - `plugins/finalizeLocalizedStaticAssets.cjs` Together they ensure: - locale dropdown and locale-aware routing work consistently - root-relative links preserve the active locale - generated FastNear overlays localize operation content without touching source page models - localized Markdown mirrors, `llms.txt`, and site-graph output ship from the correct locale root - structured data and SEO emit localized URLs and `inLanguage` ## Lean CI Gate The locale-quality gate is intentionally small. The required workflow runs: ```bash yarn audit:i18n:all yarn build node scripts/audit-indexing-surface.js ``` That is enough to protect: - wave-1 locale quality - build correctness - discovery/indexing correctness It intentionally does not include Playwright, relevance scoring, or heavier editorial sweeps. ## Adding A New Locale Use this checklist when adding the next language: 1. Add the locale to `src/data/localeRegistry.json`. 2. Create `i18n//glossary.yml`. 3. Create `i18n//translation-policy.yml`. 4. Run `yarn bootstrap:i18n --locale `. 5. Curate the generated `i18n//code.json` and docs tree. 6. Add `src/data/fastnearTranslations..json` for generated FastNear overlays. 7. Run `yarn audit:i18n --locale --wave 1`. 8. Run `yarn build` and `node scripts/audit-indexing-surface.js`. 9. Add targeted browser checks only if the locale introduces new runtime behavior worth smoke-testing. If those steps are followed, later locales should mostly be editorial work layered onto a stable framework. --- ## NEAR Data API - HTML path: https://docs.fastnear.com/neardata - Markdown path: https://docs.fastnear.com/neardata.md **Source:** [https://docs.fastnear.com/neardata](https://docs.fastnear.com/neardata) # NEAR Data API NEAR Data API is the recent block and shard surface. Use it when you want fresh block slices, contract-touch monitoring, helper redirects, or optimistic-versus-finalized confirmation without turning the product into a streaming API. ## Base URLs ```bash title="NEAR Data API Mainnet" https://mainnet.neardata.xyz ``` ```bash title="NEAR Data API Testnet" https://testnet.neardata.xyz ``` ## Best fit - Polling for recent finalized or optimistic blocks. - Detecting whether a live contract showed up or changed state in a recent block. - Comparing optimistic signals with finalized confirmation. - Inspecting one recent shard after you already know which block matters. ## When not to use it - Use [RPC Reference](https://docs.fastnear.com/rpc) for canonical JSON-RPC methods and transaction submission. - Use [Snapshots](https://docs.fastnear.com/snapshots) for infrastructure bootstrap rather than live reads. ## Auth and availability - The same FastNear API key works here too; public reads can still use an optional `apiKey` query parameter on supported traffic. - An invalid API key returns `401` before the redirect helpers run, so invalid-key debugging will not surface the canonical target URL. - Add `?network=testnet` to switch compatible pages to testnet defaults. ## Common starting points - [Last final block redirect](https://docs.fastnear.com/neardata/last-block-final) and [Last optimistic block redirect](https://docs.fastnear.com/neardata/last-block-optimistic) when you want the newest recent block quickly. - [Final block by height](https://docs.fastnear.com/neardata/block) for one recent hydrated block document with shard payloads attached. - [Block Shard](https://docs.fastnear.com/neardata/block-shard) when a recent block already identified the shard you need to inspect more closely. - [Block Headers](https://docs.fastnear.com/neardata/block-headers) when head progression matters more than the wider block payload. ## Need a workflow? Use [NEAR Data API Examples](https://docs.fastnear.com/neardata/examples) for worked examples like contract-touch detection, optimistic-versus-finalized comparison, and shard-local change inspection. ## Troubleshooting ### Some endpoints redirect instead of returning the final payload directly That is expected on redirect-style helpers. Follow the canonical target if your client needs the final resource. ### A block response is `null` That usually means the requested height does not exist on that network or the request is outside the expected freshness/archive range. ### I need streaming, not polling This surface is for polling-oriented near-realtime reads. Do not position it as a websocket or webhook product. --- ## NEAR Data Examples - HTML path: https://docs.fastnear.com/neardata/examples - Markdown path: https://docs.fastnear.com/neardata/examples.md **Source:** [https://docs.fastnear.com/neardata/examples](https://docs.fastnear.com/neardata/examples) ## Examples NEAR Data returns each block fully hydrated as one JSON document — header plus per-shard chunks, receipts, execution outcomes, and state changes — so a single `curl` gives you everything you need to filter for a specific contract without a second call. All shell examples below work on the public NEAR Data hosts as-is. If `FASTNEAR_API_KEY` is set in your shell, they pass it as an `apiKey` query parameter automatically; if it is unset, they fall back to the public unauthenticated path. Bearer auth with `Authorization: Bearer ${FASTNEAR_API_KEY}` is also supported when headers fit your client better. ### What block is NEAR on right now? `/v0/last_block/final` 302-redirects to the current finalized block. Before filtering for a specific contract, it's worth seeing what one block looks like at the protocol level: transactions arrive sharded, so the tx count for a block is a sum across shards — not a single top-level number. ```bash curl -sL "https://mainnet.neardata.xyz/v0/last_block/final?apiKey=${FASTNEAR_API_KEY:-}" \ | jq '{ height: .block.header.height, timestamp_nanosec: .block.header.timestamp_nanosec, txs_per_shard: [.shards[] | {shard_id, tx_count: (.chunk.transactions | length)}], total_txs: ([.shards[].chunk.transactions[]?] | length) }' ``` A live block shows 9 shards and a handful of transactions scattered across them — most shards are empty in any given block, and activity tends to cluster on whichever shards host the busy contracts. `timestamp_nanosec` is a Unix time in nanoseconds (divide by 1e9 for seconds). With this one call you already have everything needed to dig deeper — the filtering examples below are just jq over this same response. ### Did my contract get touched in the latest finalized block? `/v0/last_block/final` 302-redirects to the current finalized block. Contracts can show up in a chunk's `transactions` (when they are the `receiver_id`) or in its `receipts` (when a cross-shard call lands), so one jq pass over the shards covers both. ```bash TARGET_CONTRACT=intents.near curl -sL "https://mainnet.neardata.xyz/v0/last_block/final?apiKey=${FASTNEAR_API_KEY:-}" \ | jq --arg contract "$TARGET_CONTRACT" '{ height: .block.header.height, contract: $contract, touched_shards: [ .shards[] | { shard_id, txs: [.chunk.transactions[]? | select(.transaction.receiver_id == $contract) | .transaction.hash], receipts: [.chunk.receipts[]? | select(.receiver_id == $contract) | .receipt_id] } | select((.txs | length) + (.receipts | length) > 0) ] }' ``` `touched_shards: []` is a complete answer for a quiet block. A non-empty list names the shards where the contract showed up and gives you the concrete `tx` hashes or `receipt_id`s — pipe a hash into the [Transactions API](https://docs.fastnear.com/tx) when you want the human-readable story. Receipts without matching `txs` are normal: a cross-contract call shows up as an incoming receipt in this block even if the originating transaction landed earlier. ### Did activity show up optimistically, and did finality catch up? Optimistic blocks ship at `/v0/block_opt/{height}` about a second ahead of `/v0/block/{height}`. A monitoring loop can act on the optimistic signal and expect the same answer to arrive at the finalized endpoint one block later — unless network stress widens the gap, in which case the finalized fetch returns `null` and you wait. ```bash TARGET_CONTRACT=intents.near count_touches() { jq --arg contract "$1" ' [.shards[] | ([.chunk.transactions[]? | select(.transaction.receiver_id == $contract)] | length) + ([.chunk.receipts[]? | select(.receiver_id == $contract)] | length)] | add // 0' } OPT_LOCATION="$( curl -s -D - -o /dev/null "https://mainnet.neardata.xyz/v0/last_block/optimistic?apiKey=${FASTNEAR_API_KEY:-}" \ | awk 'tolower($1) == "location:" {print $2}' | tr -d '\r' )" OPT_PATH="${OPT_LOCATION%%\?*}" OPT_HEIGHT="${OPT_PATH##*/}" echo "optimistic @ $OPT_HEIGHT: $(curl -s "https://mainnet.neardata.xyz$OPT_PATH?apiKey=${FASTNEAR_API_KEY:-}" | count_touches "$TARGET_CONTRACT") touches" FINAL="$(curl -s "https://mainnet.neardata.xyz/v0/block/$OPT_HEIGHT?apiKey=${FASTNEAR_API_KEY:-}")" if [ "$(printf '%s' "$FINAL" | jq 'type')" = '"null"' ]; then echo "finalized @ $OPT_HEIGHT: not caught up yet" else echo "finalized @ $OPT_HEIGHT: $(printf '%s' "$FINAL" | count_touches "$TARGET_CONTRACT") touches" fi ``` On a healthy mainnet the two counts match within a second. The value is in the *pattern* — the optimistic stream gives you an answer you can act on immediately, with the finalized stream arriving a block later as durable confirmation. ### Which shard actually changed my contract's state? Most finalized blocks show no state mutation for any given contract — activity is sparse and shard-local. Walk back from the finalized head until the contract's state actually changes, then open that shard for the mutation payload. The block-level call tells you *which* shard; the shard-level call tells you *how*. ```bash TARGET_CONTRACT=intents.near HEAD="$(curl -sL "https://mainnet.neardata.xyz/v0/last_block/final?apiKey=${FASTNEAR_API_KEY:-}" | jq '.block.header.height')" FOUND_HEIGHT="" FOUND_SHARD="" for OFFSET in $(seq 0 15); do H=$((HEAD - OFFSET)) SHARD="$(curl -s "https://mainnet.neardata.xyz/v0/block/$H?apiKey=${FASTNEAR_API_KEY:-}" \ | jq -r --arg contract "$TARGET_CONTRACT" ' .shards[] | select([.state_changes[]? | select(.change.account_id? == $contract)] | length > 0) | .shard_id ' | head -1)" if [ -n "$SHARD" ]; then FOUND_HEIGHT=$H; FOUND_SHARD=$SHARD break fi done if [ -z "$FOUND_HEIGHT" ]; then echo "no state mutation for $TARGET_CONTRACT in the last 16 finalized blocks" else curl -s "https://mainnet.neardata.xyz/v0/block/$FOUND_HEIGHT/shard/$FOUND_SHARD?apiKey=${FASTNEAR_API_KEY:-}" \ | jq --arg contract "$TARGET_CONTRACT" --argjson height "$FOUND_HEIGHT" --argjson shard_id "$FOUND_SHARD" '{ height: $height, shard_id: $shard_id, state_changes: [.state_changes[] | select(.change.account_id? == $contract) | {type, cause: (.cause | keys[0])}][0:3], execution_outcomes: [.receipt_execution_outcomes[] | select(.execution_outcome.outcome.executor_id == $contract) | {receipt_id: .execution_outcome.id, status: (.execution_outcome.outcome.status | keys[0])}][0:3] }' fi ``` On mainnet, `intents.near` lives on shard 7, so the walk typically lands within a handful of blocks. The shard payload names the actual state-change types (`account_update`, `data_update`, etc.) and the receipt outcomes that caused them — shard-local proof without guessing. Widen the offset range for contracts with lighter traffic. ## When to widen - Use the [Transactions API](https://docs.fastnear.com/tx) once you have a `tx_hash` and want the human-readable transaction story. - Use the [RPC Reference](https://docs.fastnear.com/rpc) when the next question is about exact protocol-native receipt or block semantics. - Use [Block Headers](https://docs.fastnear.com/neardata/block-headers) when you only need head progression or finality lag, not contract-touch inspection. --- ## redocly-config - HTML path: https://docs.fastnear.com/redocly-config - Markdown path: https://docs.fastnear.com/redocly-config.md **Source:** [https://docs.fastnear.com/redocly-config](https://docs.fastnear.com/redocly-config) # Legacy Redocly Backend Notes This document is historical context for the legacy Redocly backend in `mike-docs`. ## Current Reality The public docs no longer use Redocly as their primary runtime. - Public API and RPC pages render directly in `builder-docs` - Canonical `/rpcs/...` and `/apis/...` routes are hosted by `builder-docs` - `mike-docs` keeps Redocly only for verification, parity checks, and migration cleanup ## Where Redocly Still Matters Use the Redocly path only when you need to validate: - `@theme/ext/configure.ts` behavior - request-shaping inputs such as `preset`, `body`, `path.*`, `query.*`, and `header.*` - local parity between the direct runtime and the legacy portal Local commands: ```bash cd /Users/mikepurvis/near/mike-docs npm run preview:headless npm run preview:portal ``` ## Current Auth Notes The shared browser auth contract is: 1. `?apiKey=` 2. `localStorage.fastnear:apiKey` 3. legacy `localStorage.fastnear_api_key` Bearer tokens continue to use: 1. `?token=` 2. `localStorage.fastnear:bearer` ## Current Source Of Truth For current implementation details, use: - `mike-docs/README.md` - `mike-docs/INTEGRATION_GUIDE.md` - `builder-docs/CLAUDE.md` --- ## RPC Reference - HTML path: https://docs.fastnear.com/rpc - Markdown path: https://docs.fastnear.com/rpc.md **Source:** [https://docs.fastnear.com/rpc](https://docs.fastnear.com/rpc) # RPC Reference FastNear RPC gives you direct JSON-RPC access to NEAR nodes for state queries, block and chunk inspection, transaction submission, validator data, and protocol introspection. ## Base URLs Regular RPCs keep the most recent epochs of state and are the default choice for most application traffic: ```bash title="Mainnet Regular RPC" https://rpc.mainnet.fastnear.com ``` ```bash title="Testnet Regular RPC" https://rpc.testnet.fastnear.com ``` Archival RPCs expose the full chain history when you need older blocks, receipts, or historical contract state: ```bash title="Mainnet Archival RPC" https://archival-rpc.mainnet.fastnear.com ``` ```bash title="Testnet Archival RPC" https://archival-rpc.testnet.fastnear.com ``` ## Common starting points - [`view_account`](https://docs.fastnear.com/rpc/account/view-account), [`view_access_key`](https://docs.fastnear.com/rpc/account/view-access-key), [`view_access_key_list`](https://docs.fastnear.com/rpc/account/view-access-key-list) for account and key-list queries. - [`block`](https://docs.fastnear.com/rpc/block/block-by-id) for height or hash lookup; [`block_effects`](https://docs.fastnear.com/rpc/block/block-effects) for changes within a block. - [`call_function`](https://docs.fastnear.com/rpc/contract/call-function), [`view_code`](https://docs.fastnear.com/rpc/contract/view-code), [`view_state`](https://docs.fastnear.com/rpc/contract/view-state) for contract introspection. - [`status`](https://docs.fastnear.com/rpc/protocol/status), [`health`](https://docs.fastnear.com/rpc/protocol/health), [`gas_price`](https://docs.fastnear.com/rpc/protocol/gas-price) for node and protocol diagnostics. - [`send_tx`](https://docs.fastnear.com/rpc/transaction/send-tx) for transaction submission; [`tx`](https://docs.fastnear.com/rpc/transaction/tx-status) for execution status. - [`validators`](https://docs.fastnear.com/rpc/validators/validators-current) for the current epoch's validator set. ## Need a workflow? Use [RPC Examples](https://docs.fastnear.com/rpc/examples) for worked examples like exact state checks, block inspection, contract view calls, and send-and-confirm transaction work. ## Use RPC when - You want protocol-native request and response shapes. - You need canonical node-backed behavior for state queries or block lookups. - You are submitting transactions or inspecting execution outcomes. - You want the lowest-level surface before adding indexed or product-specific views. ## Skip RPC when - You want wallet-style balances, NFTs, staking positions, or public-key lookups in one call. - You need indexed transaction history by account instead of polling and stitching together node responses. - You are optimizing for product simplicity over raw protocol control. In those cases, move to the indexed REST families such as [FastNear API](https://docs.fastnear.com/api), [Transactions API](https://docs.fastnear.com/tx), or [NEAR Data API](https://docs.fastnear.com/neardata). ## Auth and limits - FastNear API keys are optional; the public endpoints work without one. - Higher-limit or standardized authenticated access goes through [Auth & Access](https://docs.fastnear.com/auth), where the same key works on both the regular and archival RPC hosts as either an `Authorization: Bearer` header or an `?apiKey=` URL parameter. ## Shareable live examples - Use `Copy example URL` on any interactive RPC page to share the selected network, example tab, finality, and filled inputs. - Shared example URLs run automatically on load whenever they include operation state. - Saved API keys and tokens are never included in those shared docs URLs. ## Troubleshooting ### My request worked locally but fails in production Check whether you relied on the docs UI to append an API key for you. Production backends should inject credentials explicitly and never depend on browser storage. ### I need older state than the default RPC returns Switch from the regular RPC endpoint to the archival RPC endpoint. The same FastNear key and the same header or query-param transport work on both hosts. ### I need a simpler response than JSON-RPC gives me That usually means you want an indexed REST family instead of raw RPC. Use the chooser page to pick the higher-level surface. --- ## RPC Examples - HTML path: https://docs.fastnear.com/rpc/examples - Markdown path: https://docs.fastnear.com/rpc/examples.md **Source:** [https://docs.fastnear.com/rpc/examples](https://docs.fastnear.com/rpc/examples) # RPC Examples Start with the RPC method that answers the question. Use `tx` to track inclusion and finality from a tx hash, and widen only when you need receipt trees, raw state, or shard-level tracing. All shell examples below work on the public RPC hosts as-is. If `FASTNEAR_API_KEY` is set in your shell, they pass it as an `apiKey` query parameter automatically; if it is unset, they fall back to the public unauthenticated path. Bearer auth with `Authorization: Bearer ${FASTNEAR_API_KEY}` is also supported when headers fit your client better. ## Account State ### Show an account's balance and storage at finality `view_account` is the canonical RPC query for an account's current state. One call returns the unstaked balance, any stake-locked amount, storage consumed, and the block the reading was taken at. `finality: "final"` ensures you're reading stable state, not an optimistic view. ```bash ACCOUNT_ID=root.near curl -s "https://rpc.mainnet.fastnear.com?apiKey=${FASTNEAR_API_KEY:-}" \ -H 'content-type: application/json' \ --data "$(jq -nc --arg account_id "$ACCOUNT_ID" '{ jsonrpc:"2.0",id:"fastnear",method:"query", params:{request_type:"view_account",account_id:$account_id,finality:"final"} }')" \ | jq '.result | {amount, locked, storage_usage, block_height, block_hash}' ``` For `root.near`, this returns `amount` (yoctoNEAR held unstaked), `locked: "0"` (nothing in validator stake or a lockup contract), and `storage_usage: 28677` — about 28.7 KB of on-chain state. The `block_height`/`block_hash` pair anchors the reading; to read multiple accounts at the *same* block, reuse the returned `block_hash` as `block_id` on follow-up queries. ## Transaction Inclusion and Finality ### Track a transaction from hash to finality Have a tx hash? Poll `tx` with the smallest `wait_until` threshold that answers your question. ```bash TX_HASH=CVyG2xLJ6fuKCtULAxMnWTh2GL5ey2UUiTcgYT3M6Pow SIGNER_ACCOUNT_ID=mike.testnet curl -s "https://archival-rpc.testnet.fastnear.com?apiKey=${FASTNEAR_API_KEY:-}" \ -H 'content-type: application/json' \ --data "$(jq -nc --arg tx_hash "$TX_HASH" --arg signer_id "$SIGNER_ACCOUNT_ID" '{ jsonrpc: "2.0", id: "fastnear", method: "tx", params: {tx_hash: $tx_hash, sender_account_id: $signer_id, wait_until: "INCLUDED"} }')" \ | jq '{ asked: "INCLUDED", final_execution_status: .result.final_execution_status, status_class: (.result.status | keys[0]), receipts_outcome_count: (.result.receipts_outcome | length) }' ``` For the pinned historical tx (a 1-yocto self-transfer from `mike.testnet`), the response comes back `FINAL` even though we asked for `INCLUDED`. That's the rule: **`wait_until` is a minimum threshold, not a target.** The node returns whatever stage the tx actually reached — for a historical tx that's always `FINAL`; for one in flight, pick `INCLUDED` when you only need inclusion and want the earliest return, or `FINAL` when the real question is "is it done?" Two handoffs from here: - **Submitting live?** [`broadcast_tx_async`](https://docs.fastnear.com/rpc/transaction/broadcast-tx-async) returns the hash as soon as the node accepts the payload — track separately with `tx`. [`send_tx`](https://docs.fastnear.com/rpc/transaction/send-tx) submits and blocks on your chosen `wait_until` in a single call. - **Need the receipt tree, not just outcomes?** `tx` already includes `receipts_outcome`; widen to [`EXPERIMENTAL_tx_status`](https://docs.fastnear.com/rpc/transaction/experimental-tx-status) only when you also need the raw receipt records. ## Tip Block Inspection ### Describe the first action of the first transaction at the current tip A NEAR block is a header over N shard chunks, not a flat list of transactions. `block` returns chunk headers; the transactions live one level down, inside `chunk`. There's no `block → tx` shortcut — the block doesn't carry transaction hashes, so `tx` (which needs a hash) doesn't enter this flow at all. The canonical walk is `status` → `block` → `chunk`, skipping empty chunks along the way. Most chunks in a tip block are empty — their `tx_root` is the sentinel `11111111111111111111111111111111` — so the selector has to filter. ```bash EMPTY_TX_ROOT=11111111111111111111111111111111 BLOCK_HASH="$(curl -s "https://rpc.mainnet.fastnear.com?apiKey=${FASTNEAR_API_KEY:-}" -H 'content-type: application/json' \ --data '{"jsonrpc":"2.0","id":"fastnear","method":"status","params":[]}' \ | jq -r '.result.sync_info.latest_block_hash')" CHUNK_HASH="$(curl -s "https://rpc.mainnet.fastnear.com?apiKey=${FASTNEAR_API_KEY:-}" -H 'content-type: application/json' \ --data "$(jq -nc --arg block_hash "$BLOCK_HASH" '{ jsonrpc:"2.0",id:"fastnear",method:"block",params:{block_id:$block_hash} }')" \ | jq -r --arg empty "$EMPTY_TX_ROOT" ' first(.result.chunks[] | select(.tx_root != $empty) | .chunk_hash) // empty')" if [ -z "$CHUNK_HASH" ]; then echo "tip block had no transactions in any chunk — rerun on the next head" else curl -s "https://rpc.mainnet.fastnear.com?apiKey=${FASTNEAR_API_KEY:-}" -H 'content-type: application/json' \ --data "$(jq -nc --arg chunk_hash "$CHUNK_HASH" '{ jsonrpc:"2.0",id:"fastnear",method:"chunk",params:{chunk_id:$chunk_hash} }')" \ | jq '{ chunk_shard: .result.header.shard_id, chunk_height: .result.header.height_included, first_tx: { hash: .result.transactions[0].hash, signer_id: .result.transactions[0].signer_id, receiver_id: .result.transactions[0].receiver_id }, first_action: ( .result.transactions[0].actions[0] as $a | if ($a | type) == "string" then {kind: $a} elif $a.FunctionCall then {kind: "FunctionCall", method_name: $a.FunctionCall.method_name} else {kind: ($a | keys[0])} end ) }' fi ``` A live run returns the current tip's first chunk, first transaction, and first action — often a `FunctionCall` on a bridge or tg-bot contract (mainnet is active). A tip block can be valid and still have no transactions in any chunk, which is why the empty branch stays; it's the honest answer for a quiet moment on the network. ## Account and Key Mechanics ### Identify function-call keys you might want to remove Every wallet, gateway, and dapp session you sign into tends to leave behind a function-call key. Most of them you'll never use again. `view_access_key_list` returns every key on an account; the structure of the nonce tells you which ones are stale. New keys start at `block_height * 10^6` and the value increments by one per transaction the key signs, so: - `nonce / 10^6` → the block the key was added at - `nonce % 10^6` → the number of times the key has been used Any key with `tx_count: 0` was created and never used — the clearest candidate for cleanup. Keys scoped to a contract you no longer interact with are the next tier. The filter below narrows to `social.near`, but `RECEIVER_ID` is the only line that changes to audit a different contract. ```bash ACCOUNT_ID=root.near RECEIVER_ID=social.near curl -s "https://rpc.mainnet.fastnear.com?apiKey=${FASTNEAR_API_KEY:-}" \ -H 'content-type: application/json' \ --data "$(jq -nc --arg account_id "$ACCOUNT_ID" '{ jsonrpc:"2.0",id:"fastnear",method:"query", params:{request_type:"view_access_key_list",account_id:$account_id,finality:"final"} }')" \ | jq --arg receiver "$RECEIVER_ID" ' { total_keys: (.result.keys | length), fcks_for_receiver: [ .result.keys[] | select((.access_key.permission | type) == "object") | select(.access_key.permission.FunctionCall.receiver_id == $receiver) | { public_key, added_at_block: (.access_key.nonce / 1000000 | floor), tx_count: (.access_key.nonce % 1000000), method_names: (.access_key.permission.FunctionCall.method_names | if . == [] then "ANY" else . end), allowance: (.access_key.permission.FunctionCall.allowance // "unlimited") } ] | sort_by(.tx_count) }' ``` For `root.near`, this returns 235 total keys, including 34 function-call keys for `social.near`; 21 of those were created and never used (`tx_count: 0`) and are prime cleanup candidates. `method_names: "ANY"` means the key can call any method on `social.near`; a narrowed list like `["find_grants", "insert_grant", "delete_grant"]` means the key was scoped to one dapp's write surface. To remove one, sign a `DeleteKey` action with a **full-access** key (a function-call key cannot authorize `DeleteKey`) and submit via [`send_tx`](https://docs.fastnear.com/rpc/transaction/send-tx). Re-run the query to confirm the key is gone. ## Contract Reads and Raw State ### Read a contract's storage without executing it A view method like `get_num` still makes the node load the contract's wasm and run it. If you already know the storage key, `view_state` returns the raw serialized bytes directly — no execution, and no dependency on whether the contract exposes a getter for that field at all. Contracts built with `near-sdk-rs` store the top-level `#[near_bindgen]` struct under the key `STATE`. Pass `STATE` as `prefix_base64` (`U1RBVEU=` is base64 for those four ASCII bytes) and the node returns the serialized value. ```bash CONTRACT_ID=counter.near-examples.testnet RAW_B64="$(curl -s "https://rpc.testnet.fastnear.com?apiKey=${FASTNEAR_API_KEY:-}" -H 'content-type: application/json' \ --data "$(jq -nc --arg contract "$CONTRACT_ID" '{ jsonrpc:"2.0",id:"fastnear",method:"query", params:{request_type:"view_state",account_id:$contract,prefix_base64:"U1RBVEU=",finality:"final"} }')" \ | jq -r '.result.values[0].value')" DECODED_I8="$(python3 -c "import base64; print(int.from_bytes(base64.b64decode('$RAW_B64'),'little',signed=True))")" jq -n --arg raw "$RAW_B64" --argjson val "$DECODED_I8" '{raw_bytes_base64: $raw, decoded_i8: $val}' ``` For the live counter, this returns `"CQ=="` — one byte `0x09`, decoded as signed i8 to `9`. That's the same number `get_num` would return, but read straight from the trie without running any contract code. `signed=True` matters: a negative counter serializes as `"/w=="` (byte `0xff` → i8 `-1`, not u8 `255`). Reach for `view_state` when a contract doesn't expose a view method for the data you need, or when you want a key family the contract doesn't publish. For most reads `call_function` is still lower ceremony. If the question turns historical rather than current, widen to [KV FastData API](https://docs.fastnear.com/fastdata/kv). ## NEAR Social and BOS Exact Reads These stay on exact SocialDB reads and on-chain readiness checks until the question turns historical. ### Can this account still publish to NEAR Social right now? `social.near` knows two things a wallet UI can only guess at: how much storage each account has left, and whether a delegated signer is allowed to write under it. Two view calls collapse the readiness question to a single boolean. ```bash ACCOUNT_ID=root.near # account you're writing under SIGNER_ACCOUNT_ID=root.near # account signing the transaction STORAGE_ARGS_B64="$(jq -nc --arg account_id "$ACCOUNT_ID" '{account_id:$account_id}' | base64 | tr -d '\n')" STORAGE="$(curl -s "https://rpc.mainnet.fastnear.com?apiKey=${FASTNEAR_API_KEY:-}" -H 'content-type: application/json' \ --data "$(jq -nc --arg args "$STORAGE_ARGS_B64" '{ jsonrpc:"2.0",id:"fastnear",method:"query", params:{request_type:"call_function",account_id:"social.near",method_name:"get_account_storage",args_base64:$args,finality:"final"} }')" \ | jq '.result.result | implode | fromjson')" if [ "$SIGNER_ACCOUNT_ID" = "$ACCOUNT_ID" ]; then PERMISSION=true else PERM_ARGS_B64="$(jq -nc --arg pred "$SIGNER_ACCOUNT_ID" --arg key "$ACCOUNT_ID" '{predecessor_id:$pred,key:$key}' | base64 | tr -d '\n')" PERMISSION="$(curl -s "https://rpc.mainnet.fastnear.com?apiKey=${FASTNEAR_API_KEY:-}" -H 'content-type: application/json' \ --data "$(jq -nc --arg args "$PERM_ARGS_B64" '{ jsonrpc:"2.0",id:"fastnear",method:"query", params:{request_type:"call_function",account_id:"social.near",method_name:"is_write_permission_granted",args_base64:$args,finality:"final"} }')" \ | jq '.result.result | implode | fromjson')" fi jq -n --argjson storage "$STORAGE" --argjson permission "$PERMISSION" \ --arg account_id "$ACCOUNT_ID" --arg signer "$SIGNER_ACCOUNT_ID" '{ account_id: $account_id, signer_account_id: $signer, storage: $storage, permission_granted: $permission, ready_to_publish: (($storage.available_bytes // 0) > 0 and $permission) }' ``` For `root.near` signing under itself, this returns `storage: {used_bytes: 136245, available_bytes: 42484}`, `permission_granted: true` (owner write), and `ready_to_publish: true`. If `storage` comes back `null` or `available_bytes: 0`, the account needs a `storage_deposit` on `social.near` before any new write can stick. If the signer differs from the target, the permission branch asks `is_write_permission_granted({predecessor_id, key})` — the same on-chain answer a dapp sees before writing on a user's behalf. See the [SocialDB API](https://github.com/NearSocial/social-db#api) for the full contract surface. ### What does `mob.near/widget/Profile` actually contain right now? SocialDB stores BOS widgets as `/widget/` keys on `social.near`. One `keys` call with the `BlockHeight` return type returns the catalog plus per-widget last-write anchors; one `get` call returns the exact source. ```bash ACCOUNT_ID=mob.near WIDGET_NAME=Profile KEYS_ARGS="$(jq -nc --arg account_id "$ACCOUNT_ID" '{ keys: [($account_id + "/widget/*")], options: {return_type: "BlockHeight"} }' | base64 | tr -d '\n')" curl -s "https://rpc.mainnet.fastnear.com?apiKey=${FASTNEAR_API_KEY:-}" -H 'content-type: application/json' \ --data "$(jq -nc --arg args "$KEYS_ARGS" '{ jsonrpc:"2.0",id:"fastnear",method:"query", params:{request_type:"call_function",account_id:"social.near",method_name:"keys",args_base64:$args,finality:"final"} }')" \ | jq --arg account_id "$ACCOUNT_ID" --arg widget "$WIDGET_NAME" ' .result.result | implode | fromjson | .[$account_id].widget as $map | { total_widgets: ($map | length), most_recently_written: ($map | to_entries | sort_by(-.value) | .[0:5] | map({widget: .key, last_write_block: .value})), target_last_write_block: $map[$widget] }' GET_ARGS="$(jq -nc --arg account_id "$ACCOUNT_ID" --arg widget "$WIDGET_NAME" '{ keys: [($account_id + "/widget/" + $widget)] }' | base64 | tr -d '\n')" curl -s "https://rpc.mainnet.fastnear.com?apiKey=${FASTNEAR_API_KEY:-}" -H 'content-type: application/json' \ --data "$(jq -nc --arg args "$GET_ARGS" '{ jsonrpc:"2.0",id:"fastnear",method:"query", params:{request_type:"call_function",account_id:"social.near",method_name:"get",args_base64:$args,finality:"final"} }')" \ | jq -r --arg account_id "$ACCOUNT_ID" --arg widget "$WIDGET_NAME" ' .result.result | implode | fromjson | .[$account_id].widget[$widget] | split("\n")[0:20] | join("\n")' ``` For `mob.near`, the catalog shows 264 widgets; `Profile` last wrote at block `86494825` — years ago, stable since — and the source begins with `const accountId = props.accountId ?? context.accountId;`. The `BlockHeight` return type costs nothing extra and turns the key listing into a cheap staleness check. Keep the last-write block if you later want to prove *which transaction* wrote this version — hand it to [Advanced SocialDB write lookup](https://docs.fastnear.com/tx/socialdb-proofs). ## Common mistakes - Starting in RPC when the user really wants a holdings summary or indexed history. - Forgetting to switch from regular RPC to archival RPC for older state. - Treating docs UI browser auth as a production backend pattern. - Staying in low-level transaction status calls after the question becomes forensic or history-oriented. ## Related guides - [RPC Reference](https://docs.fastnear.com/rpc) - [Auth & Access](https://docs.fastnear.com/auth) - [FastNear API](https://docs.fastnear.com/api) - [Transactions API](https://docs.fastnear.com/tx) - [Choosing the Right Surface](https://docs.fastnear.com/agents/choosing-surfaces) - [Agent Playbooks](https://docs.fastnear.com/agents/playbooks) --- ## Validator snapshots - HTML path: https://docs.fastnear.com/snapshots - Markdown path: https://docs.fastnear.com/snapshots.md **Source:** [https://docs.fastnear.com/snapshots](https://docs.fastnear.com/snapshots) # Blockchain snapshots This section is for node operators who are bootstrapping or recovering NEAR infrastructure. It is not an application-data surface. If the job is reading balances, history, blocks, or contract state, use the API and RPC docs instead of snapshot workflows. :::warning[Free snapshots are deprecated] The free nearcore data snapshots have been deprecated. The NEAR Infrastructure Committee and Near One recommend Epoch Sync plus decentralized state sync. Use [NEAR Nodes](https://near-nodes.io) for the current operator guidance and recommended bootstrap posture. ::: ## Use this section when - you need to bootstrap a mainnet or testnet node from snapshot data - you are recovering an RPC or archival node - you already know you want the FastNear snapshot download path ## Do not use this section when - you are trying to query chain data for an application - you need recent blocks, balances, history, or contract state - you are looking for general product API guidance rather than operator setup In those cases, use [RPC Reference](https://docs.fastnear.com/rpc), [FastNear API](https://docs.fastnear.com/api), [Transactions API](https://docs.fastnear.com/tx), or [NEAR Data API](https://docs.fastnear.com/neardata). ## Before you download - Choose the network first: mainnet or testnet. - Decide whether you need regular RPC data or archival data. - Make sure you understand where hot and cold data must live before starting an archival download. - Install `rclone`, because the download scripts depend on it. :::info[Getting `rclone`] Install `rclone` with: ```bash sudo -v ; curl https://rclone.org/install.sh | sudo bash ``` ::: ## What each path covers - **Mainnet** includes optimized `fast-rpc`, standard RPC, and archival hot/cold download paths. - **Testnet** includes RPC and archival snapshot paths for testnet operators. See [nearcore](https://github.com/near/nearcore?tab=readme-ov-file#about-near) for node requirements, and [fastnear/static](https://github.com/fastnear/static) for the snapshot download script source used by these guides. ## Need a workflow? Use [Snapshot Examples](https://docs.fastnear.com/snapshots/examples) for worked operator examples like choosing between optimized `fast-rpc`, standard RPC recovery, and archival hot/cold snapshot paths. ## Choose a network - [Mainnet Snapshots](https://docs.fastnear.com/snapshots/mainnet) - [Testnet Snapshots](https://docs.fastnear.com/snapshots/testnet) --- ## Snapshot Examples - HTML path: https://docs.fastnear.com/snapshots/examples - Markdown path: https://docs.fastnear.com/snapshots/examples.md **Source:** [https://docs.fastnear.com/snapshots/examples](https://docs.fastnear.com/snapshots/examples) ## Mainnet recovery paths Pick one class — optimized `fast-rpc`, standard RPC, or archival — and run only that path's commands. Mixing classes produces inconsistent node data. FastNear maintains these helpers for recovery speed. If your environment requires change review, fetch the script and inspect it before running it (instead of piping straight to `bash`). ### Optimized mainnet `fast-rpc` ```bash DATA_PATH=~/.near/data curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/fastnear/static/refs/heads/main/down_rclone.sh \ | DATA_PATH="$DATA_PATH" CHAIN_ID=mainnet RPC_TYPE=fast-rpc bash ``` ### Standard mainnet RPC ```bash DATA_PATH=~/.near/data curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/fastnear/static/refs/heads/main/down_rclone.sh \ | DATA_PATH="$DATA_PATH" CHAIN_ID=mainnet bash ``` ### Mainnet archival Archival needs two downloads that must come from the *same* snapshot cut. Capture one `LATEST` value and reuse it for both hot and cold data — mixing heights yields an internally inconsistent dataset and surprises nearcore at config time. ```bash HOT_DATA_PATH=~/.near/data COLD_DATA_PATH=/mnt/hdds/cold-data LATEST="$(curl -s "https://snapshot.neardata.xyz/mainnet/archival/latest.txt")" echo "Latest archival mainnet snapshot block: $LATEST" curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/fastnear/static/refs/heads/main/down_rclone_archival.sh \ | DATA_TYPE=hot-data DATA_PATH="$HOT_DATA_PATH" CHAIN_ID=mainnet BLOCK="$LATEST" bash curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/fastnear/static/refs/heads/main/down_rclone_archival.sh \ | DATA_TYPE=cold-data DATA_PATH="$COLD_DATA_PATH" CHAIN_ID=mainnet BLOCK="$LATEST" bash ``` ## Common mistakes - Using snapshot docs when the task is really about reading chain data. - Choosing archival recovery when a standard or optimized RPC path would do. - Forgetting the hot/cold storage split for archival data. - Jumping into commands before deciding the network and node goal. ## Related guides - [Snapshots overview](https://docs.fastnear.com/snapshots) - [Mainnet snapshots](https://docs.fastnear.com/snapshots/mainnet) - [Testnet snapshots](https://docs.fastnear.com/snapshots/testnet) - [RPC Reference](https://docs.fastnear.com/rpc) - [NEAR Data API](https://docs.fastnear.com/neardata) --- ## mainnet - HTML path: https://docs.fastnear.com/snapshots/mainnet - Markdown path: https://docs.fastnear.com/snapshots/mainnet.md **Source:** [https://docs.fastnear.com/snapshots/mainnet](https://docs.fastnear.com/snapshots/mainnet) # Mainnet ## Optimized Mainnet Snapshot This is likely the preferred approach for syncing, as opposed to downloading an archival snapshot, which is significantly larger and more special-purpose. Nodes with sufficient resources can take advantage of setting the `$RPC_TYPE` flag to `fast-rpc`. (Default is `rpc`) Before running the snapshot download script, you can set the following environment variables: - `CHAIN_ID` to either `mainnet` or `testnet`. (default: `mainnet`) - `RPC_TYPE` to either `rpc` (default) or `fast-rpc` - `THREADS` to the number of threads you want to use for downloading. Use `128` for 10Gbps, and `16` for 1Gbps (default: `128`). - `TPSLIMIT` to the maximum number of HTTP new actions per second. (default: `4096`) - `BWLIMIT` to the maximum bandwidth to use for download in case you want to limit it. (default: `10G`) - `DATA_PATH` to the path where you want to download the snapshot (default: `~/.near/data`) - `BLOCK` to the block height of the snapshot you want to download. If not set, it will download the latest snapshot. **Run this command to download the RPC Mainnet snapshot:** :::info We will set the following environment variables: - `DATA_PATH=~/.near/data` - the standard nearcore path - `CHAIN_ID=mainnet` - to explicitly specify the mainnet data - `RPC_TYPE=fast-rpc` - select optimized approach ::: `RPC Mainnet Snapshot » ~/.near/data`: ```bash curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/fastnear/static/refs/heads/main/down_rclone.sh | DATA_PATH=~/.near/data CHAIN_ID=mainnet RPC_TYPE=fast-rpc bash ``` ## RPC Mainnet Snapshot This is the standard method to obtain a snapshot without the high performance from the previous section covering optimized snapshots. Before running the snapshot download script, you can set the following environment variables: - `CHAIN_ID` to either `mainnet` or `testnet`. (default: `mainnet`) - `RPC_TYPE` to either `rpc` (default) or `fast-rpc` - `THREADS` to the number of threads you want to use for downloading. Use `128` for 10Gbps, and `16` for 1Gbps (default: `128`). - `TPSLIMIT` to the maximum number of HTTP new actions per second. (default: `4096`) - `BWLIMIT` to the maximum bandwidth to use for download in case you want to limit it. (default: `10G`) - `DATA_PATH` to the path where you want to download the snapshot (default: `~/.near/data`) - `BLOCK` to the block height of the snapshot you want to download. If not set, it will download the latest snapshot. **Run this command to download the RPC Mainnet snapshot:** :::info We will set the following environment variables: - `DATA_PATH=~/.near/data` - the standard nearcore path - `CHAIN_ID=mainnet` - to explicitly specify the mainnet data ::: `RPC Mainnet Snapshot » ~/.near/data`: ```bash curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/fastnear/static/refs/heads/main/down_rclone.sh | DATA_PATH=~/.near/data CHAIN_ID=mainnet bash ``` ## Archival Mainnet snapshot :::warning **Time and storage intensive.** Be prepared for a large download and the inherent time constraints involved. The snapshot size is ~60Tb and contains more than 1M files. ::: Before running the download script, you can set the following environment variables: - `CHAIN_ID` to either `mainnet` or `testnet`. (default: `mainnet`) - `THREADS` to the number of threads you want to use for downloading. Use `128` for 10Gbps, and `16` for 1Gbps (default: `128`). - `TPSLIMIT` to the maximum number of HTTP new actions per second. (default: `4096`) - `DATA_TYPE` to either `hot-data` or `cold-data` (default: `cold-data`) - `BWLIMIT` to the maximum bandwidth to use for download in case you want to limit it. (default: `10G`) - `DATA_PATH` to the path where you want to download the snapshot (default: `/mnt/nvme/data/$DATA_TYPE`) - `BLOCK` to the block height of the snapshot you want to download. If not set, it will download the latest snapshot. By default, the script assumes the paths for the data: - Hot data (has to be on NVME): `/mnt/nvme/data/hot-data` - Cold data (can be on HDDs): `/mnt/nvme/data/cold-data` **Run the following commands to download the Archival Mainnet snapshot:** 1. Download the latest snapshot block height: `Latest archival mainnet snapshot block`: ```bash LATEST=$(curl -s "https://snapshot.neardata.xyz/mainnet/archival/latest.txt") echo "Latest snapshot block: $LATEST" ``` 2. Download the HOT data from the snapshot. It has to be placed on NVME. :::info We will set the following environment variables: - `DATA_TYPE=hot-data` - downloads the Hot data - `DATA_PATH=~/.near/data` - the standard nearcore path - `CHAIN_ID=mainnet` - to explicitly specify the mainnet data - `BLOCK=$LATEST` - specify the snapshot block ::: `Archival Mainnet Snapshot (hot-data) » ~/.near/data`: ```bash curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/fastnear/static/refs/heads/main/down_rclone_archival.sh | DATA_TYPE=hot-data DATA_PATH=~/.near/data CHAIN_ID=mainnet BLOCK=$LATEST bash ``` 3. Download the COLD data from the snapshot. It can be placed on HDDs. :::info We will set the following environment variables: - `DATA_TYPE=cold-data` - downloads the Hot data - `DATA_PATH=/mnt/hdds/cold-data` - the path where to place cold data. **Note**: the nearcore config should point cold data store to the same path. - `CHAIN_ID=mainnet` - to explicitly specify the mainnet data - `BLOCK=$LATEST` - specify the snapshot block ::: `Archival Mainnet Snapshot (cold-data) » /mnt/hdds/cold-data`: ```bash curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/fastnear/static/refs/heads/main/down_rclone_archival.sh | DATA_TYPE=cold-data DATA_PATH=/mnt/hdds/cold-data CHAIN_ID=mainnet BLOCK=$LATEST bash ``` --- ## testnet - HTML path: https://docs.fastnear.com/snapshots/testnet - Markdown path: https://docs.fastnear.com/snapshots/testnet.md **Source:** [https://docs.fastnear.com/snapshots/testnet](https://docs.fastnear.com/snapshots/testnet) # Testnet ## RPC Testnet Snapshot This is likely the preferred approach for syncing, as opposed to downloading an archival snapshot, which is significantly larger and more special-purpose. Before running the snapshot download script, you can set the following environment variables: - `CHAIN_ID` to either `mainnet` or `testnet`. (default: `mainnet`) - `THREADS` to the number of threads you want to use for downloading. Use `128` for 10Gbps, and `16` for 1Gbps (default: `128`). - `TPSLIMIT` to the maximum number of HTTP new actions per second. (default: `4096`) - `BWLIMIT` to the maximum bandwidth to use for download in case you want to limit it. (default: `10G`) - `DATA_PATH` to the path where you want to download the snapshot (default: `~/.near/data`) - `BLOCK` to the block height of the snapshot you want to download. If not set, it will download the latest snapshot. **Run this command to download the RPC Testnet snapshot:** :::info We will set the following environment variables: - `DATA_PATH=~/.near/data` - the standard nearcore path - `CHAIN_ID=testnet` - to explicitly specify the testnet data ::: `RPC Testnet Snapshot » ~/.near/data`: ```bash curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/fastnear/static/refs/heads/main/down_rclone.sh | DATA_PATH=~/.near/data CHAIN_ID=testnet bash ``` ## Archival Testnet snapshot :::warning **Time and storage intensive.** Be prepared for a large download and the inherent time constraints involved. ::: Before running the download script, you can set the following environment variables: - `CHAIN_ID` to either `mainnet` or `testnet`. (default: `mainnet`) - `THREADS` to the number of threads you want to use for downloading. Use `128` for 10Gbps, and `16` for 1Gbps (default: `128`). - `TPSLIMIT` to the maximum number of HTTP new actions per second. (default: `4096`) - `DATA_TYPE` to either `hot-data` or `cold-data` (default: `cold-data`) - `BWLIMIT` to the maximum bandwidth to use for download in case you want to limit it. (default: `10G`) - `DATA_PATH` to the path where you want to download the snapshot (default: `/mnt/nvme/data/$DATA_TYPE`) - `BLOCK` to the block height of the snapshot you want to download. If not set, it will download the latest snapshot. By default the script assumes the paths for the data: - Hot data (has to be on NVME): `/mnt/nvme/data/hot-data` **Run the following commands to download the Archival Testnet snapshot:** 1. Download the latest snapshot block height: `Latest archival testnet snapshot block`: ```bash LATEST=$(curl -s "https://snapshot.neardata.xyz/testnet/archival/latest.txt") echo "Latest snapshot block: $LATEST" ``` 2. Download the HOT data from the snapshot. It has to be placed on NVME. :::info We will set the following environment variables: - `DATA_TYPE=hot-data` - downloads the Hot data - `DATA_PATH=~/.near/data` - the standard nearcore path - `CHAIN_ID=testnet` - set to testnet network - `BLOCK=$LATEST` - specify the snapshot block ::: `Archival Testnet Snapshot (hot-data) » ~/.near/data`: ```bash curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/fastnear/static/refs/heads/main/down_rclone_archival.sh | DATA_TYPE=hot-data DATA_PATH=~/.near/data CHAIN_ID=testnet BLOCK=$LATEST bash ``` --- ## Transfers API - HTML path: https://docs.fastnear.com/transfers - Markdown path: https://docs.fastnear.com/transfers.md **Source:** [https://docs.fastnear.com/transfers](https://docs.fastnear.com/transfers) # Transfers API Transfers API is the narrowest FastNear history surface. Start here when the question is specifically about asset movement and not about the broader execution story behind that movement. ## Base URL ```bash title="Transfers API Mainnet" https://transfers.main.fastnear.com ``` This surface is mainnet-only today. `?network=testnet` does not switch the backend. ## Use this API when - you want account-centric NEAR or FT transfer history - you are building wallet feeds or transfer-only activity views - you are answering support or compliance questions about sends and receives ## Do not start here when - you need broader transaction or receipt history - you need balances, holdings, NFTs, or staking views - you need testnet traffic Use [Transactions API](https://docs.fastnear.com/tx) for broader execution history and [FastNear API](https://docs.fastnear.com/api) for account-state style answers. ## Minimum useful inputs - `account_id` - optional asset, direction, amount, or time filters - whether the user wants just a few events or a longer history scan ## Default workflow 1. Start with [Query Transfers](https://docs.fastnear.com/transfers/query) using the narrowest filter set that still answers the question. 2. Read the returned events as transfer history only. Do not reconstruct a full receipt timeline unless the user asks for it. 3. Reuse the opaque `resume_token` exactly as returned when paging further. 4. Stop once you can answer who sent what, when, and in what asset. ## Auth and availability - Public transfer-history reads often work without a key. - If you standardize on one FastNear API key across FastNear surfaces, reuse the same header or query-param shape here too. - Responses include an opaque `resume_token` for pagination. - The service is mainnet-only today. ## Widen only if - the user starts asking about receipts or non-transfer actions - the user wants the broader transaction context behind a transfer - the user is really asking for balances or current holdings rather than movement When that happens, widen to [Transactions API](https://docs.fastnear.com/tx) or [FastNear API](https://docs.fastnear.com/api) instead of overloading the transfer view. ## Common starting points - [Query Transfers](https://docs.fastnear.com/transfers/query) for the account-centric feed with direction, asset, amount, and time filters ## Need a workflow? Use [Transfers API Examples](https://docs.fastnear.com/transfers/examples) for worked examples like narrow transfer searches, `resume_token` pagination, and escalation into broader transaction investigation. ## Troubleshooting ### I need full transaction metadata Move to [Transactions API](https://docs.fastnear.com/tx) if transfer history alone is too narrow. ### My `resume_token` stopped working Treat the token as opaque and reuse it only with the same endpoint and filters that produced it. --- ## Transfers Examples - HTML path: https://docs.fastnear.com/transfers/examples - Markdown path: https://docs.fastnear.com/transfers/examples.md **Source:** [https://docs.fastnear.com/transfers/examples](https://docs.fastnear.com/transfers/examples) ## Examples These shell examples work on the public Transfers and Transactions endpoints. If `FASTNEAR_API_KEY` is set in your shell, the snippets pass it as an `apiKey` query parameter automatically; if it is unset, they fall back to the public unauthenticated path. Bearer auth with `Authorization: Bearer ${FASTNEAR_API_KEY}` is also supported when headers fit your client better. ### What's this account's recent transfer activity? `/v0/transfers` with just `account_id` and `desc: true` returns the most recent transfers touching that account across every asset type, both directions mixed. Each row already carries `human_amount`, `asset_id`, and `transaction_id`, so the feed doubles as a quick activity scan before you reach for filters. ```bash ACCOUNT_ID=root.near curl -s "https://transfers.main.fastnear.com/v0/transfers?apiKey=${FASTNEAR_API_KEY:-}" \ -H 'content-type: application/json' \ --data "$(jq -nc --arg account_id "$ACCOUNT_ID" '{account_id: $account_id, desc: true, limit: 5}')" \ | jq '{ recent: [.transfers[] | { block_height, asset_id, human_amount, other_account_id, transfer_type, tx: .transaction_id }] }' ``` For `root.near`, the latest rows mix `FtTransfer` and `MtTransfer` assets. `asset_id` uses NEP-standard URIs (`native:near`, `nep141:...`, `nep245:...`), so one field tells you which standard to reach for next. Positive `human_amount` means the account received; negative means it sent. `other_account_id: null` is normal for multi-token shapes where the counterparty sits inside a contract boundary rather than as a top-level account. ### Filter and page a transfer feed for one account `/v0/transfers` returns a filtered feed plus a `resume_token` you replay with *unchanged* filters to keep paging. Each row already carries `human_amount`, `usd_amount`, `transaction_id`, and `receipt_id`, so most audit questions land without a second call. ```bash ACCOUNT_ID=root.near FEED="$(curl -s "https://transfers.main.fastnear.com/v0/transfers?apiKey=${FASTNEAR_API_KEY:-}" \ -H 'content-type: application/json' \ --data "$(jq -nc --arg account_id "$ACCOUNT_ID" '{ account_id: $account_id, direction: "receiver", asset_id: "native:near", min_amount: "1000000000000000000000000", desc: true, limit: 10 }')")" echo "$FEED" | jq '{ resume_token, transfers: [.transfers[] | {block_height, amount, human_amount, usd_amount, other_account_id, transaction_id, receipt_id}] }' ``` For the pinned account this returns recent incoming native-NEAR transfers of at least 1 NEAR — sample rows are native transfers from `escrow.ai.near` with USD already computed. To page, resend the same body with a top-level `resume_token: ""`; changing any other filter invalidates the token. When one row needs its execution anchor, take its `receipt_id` straight to `/v0/receipt`: ```bash ACCOUNT_ID=root.near FEED="$(curl -s "https://transfers.main.fastnear.com/v0/transfers?apiKey=${FASTNEAR_API_KEY:-}" \ -H 'content-type: application/json' \ --data "$(jq -nc --arg account_id "$ACCOUNT_ID" '{ account_id: $account_id, direction: "receiver", asset_id: "native:near", min_amount: "1000000000000000000000000", desc: true, limit: 10 }')")" RECEIPT_ID="$(echo "$FEED" | jq -r '.transfers[0].receipt_id')" curl -s "https://tx.main.fastnear.com/v0/receipt?apiKey=${FASTNEAR_API_KEY:-}" \ -H 'content-type: application/json' \ --data "$(jq -nc --arg receipt_id "$RECEIPT_ID" '{receipt_id: $receipt_id}')" \ | jq '.receipt | {receipt_id, transaction_hash, receiver_id, predecessor_id, tx_block_height, is_success}' ``` That's the same handoff covered in [Turn one receipt ID into a readable transaction story](https://docs.fastnear.com/tx/examples#receipt-id-to-readable-story) — one call gets the receipt and its full parent transaction. ## Common mistakes - Using Transfers API when the user really wants balances, holdings, or account summaries. - Treating transfer history as full execution history. - Reusing a `resume_token` with different filters. ## Related guides - [Transfers API](https://docs.fastnear.com/transfers) - [Transactions API](https://docs.fastnear.com/tx) - [FastNear API](https://docs.fastnear.com/api) - [Choosing the Right Surface](https://docs.fastnear.com/agents/choosing-surfaces) - [Agent Playbooks](https://docs.fastnear.com/agents/playbooks) --- ## Transactions API - HTML path: https://docs.fastnear.com/tx - Markdown path: https://docs.fastnear.com/tx.md **Source:** [https://docs.fastnear.com/tx](https://docs.fastnear.com/tx) # Transactions API Transactions API is the history surface. Use it when you want indexed transaction or receipt views without repeatedly polling raw RPC methods and joining the results yourself. ## Base URLs ```bash title="Transactions API Mainnet" https://tx.main.fastnear.com ``` ```bash title="Transactions API Testnet" https://tx.test.fastnear.com ``` ## Best fit - Account activity feeds. - Debugging and support tooling. - Transaction and receipt lookups by hash. - Block and block-range history queries. ## When not to use it - Use [FastNear API](https://docs.fastnear.com/api) when you need balances, NFTs, staking, or public-key lookups. - Use [RPC Reference](https://docs.fastnear.com/rpc) when you need canonical node behavior or transaction submission. ## Auth and availability - Public history reads often work without a key. - If your integration standardizes on one FastNear API key across FastNear surfaces, reuse the same header or query-param shape here too. - Testnet uses `https://tx.test.fastnear.com`, and receipt lookup is available there as well. - The service is built for indexed history access rather than transaction submission. ## Common starting points - [Transactions by hash](https://docs.fastnear.com/tx/transactions) when you already know the transaction ID. - [Account history](https://docs.fastnear.com/tx/account) for activity feeds and account debugging. - [Receipt lookup](https://docs.fastnear.com/tx/receipt) for execution-flow investigation. - [Block range](https://docs.fastnear.com/tx/blocks) when you want a bounded history scan. ## Need a workflow? Use [Transactions API Examples](https://docs.fastnear.com/tx/examples) for worked examples like transaction lookups, receipt investigation, account activity, and block-window history. ## Troubleshooting ### I expected to submit a transaction here This family is for indexed history queries, not for sending signed transactions. Use raw RPC for submission. ### I need pagination guidance `/v0/account` uses an opaque `resume_token`, while `/v0/blocks` is range and limit based. Reuse opaque tokens exactly as returned. ### Need one canonical transaction status result? Use raw RPC instead of the indexed history family. --- ## Transactions Examples - HTML path: https://docs.fastnear.com/tx/examples - Markdown path: https://docs.fastnear.com/tx/examples.md **Source:** [https://docs.fastnear.com/tx/examples](https://docs.fastnear.com/tx/examples) ## Start Here All shell examples below work on the public Transactions API hosts as-is. If `FASTNEAR_API_KEY` is set in your shell, they pass it as an `apiKey` query parameter automatically; if it is unset, they fall back to the public unauthenticated path. Bearer auth with `Authorization: Bearer ${FASTNEAR_API_KEY}` is also supported when headers fit your client better. ### I have one transaction hash. What happened? Paste the hash into `POST /v0/transactions` and one response usually holds the whole story. ```bash TX_HASH=7ZKnhzt2MqMNmsk13dV8GAjGu3Db8aHzSBHeNeu9MJCq curl -s "https://tx.main.fastnear.com/v0/transactions?apiKey=${FASTNEAR_API_KEY:-}" \ -H 'content-type: application/json' \ --data "$(jq -nc --arg tx_hash "$TX_HASH" '{tx_hashes: [$tx_hash]}')" \ | jq '{ hash: .transactions[0].transaction.hash, signer_id: .transactions[0].transaction.signer_id, receiver_id: .transactions[0].transaction.receiver_id, included_block_height: .transactions[0].execution_outcome.block_height, actions: (.transactions[0].transaction.actions | map(if type == "string" then . else keys[0] end)), first_receipt_id: .transactions[0].execution_outcome.outcome.status.SuccessReceiptId, receipt_count: (.transactions[0].receipts | length) }' ``` For the pinned hash, `root.near` sent a single `Transfer` to `escrow.ai.near` in block `188976785`, handing off into receipt `B8QzHQZ6VnUVy8zaVXCEkWuSs7MPb34yoHYixZV3Zdj1`. When `receipt_count > 1` or the next question is about receipt-level behavior, jump to [Which receipt emitted this log or event?](#which-receipt-emitted-this-log-or-event) or [`POST /v0/receipt`](https://docs.fastnear.com/tx/receipt). ### Which receipt emitted this log or event? List every logged receipt in the transaction with a flag for whether its logs contain your fragment. The match is provable rather than guessed: this pinned tx logs a `Transfer` on one receipt and a `Refund` on another, and only the `Refund` side flips to `true`. ```bash TX_HASH=2KhhB1uDScGCFQfVchep7DiZTGTxMcgfUYHNzwf5e6uL LOG_FRAGMENT=Refund curl -s "https://tx.main.fastnear.com/v0/transactions?apiKey=${FASTNEAR_API_KEY:-}" \ -H 'content-type: application/json' \ --data "$(jq -nc --arg tx_hash "$TX_HASH" '{tx_hashes: [$tx_hash]}')" \ | jq --arg fragment "$LOG_FRAGMENT" ' [ .transactions[0].receipts[] | select((.execution_outcome.outcome.logs | length) > 0) | { receipt_id: .receipt.receipt_id, receiver_id: .receipt.receiver_id, method_name: (.receipt.receipt.Action.actions[0] | if type == "string" then . else (.FunctionCall.method_name // keys[0]) end), matches_fragment: any(.execution_outcome.outcome.logs[]?; contains($fragment)), logs: .execution_outcome.outcome.logs } ]' ``` The `Refund` fragment attributes to receipt `9sLHQpaGz3NnMNMn8zGrDUSyktR1q6ts2otr9mHkfD1w` on `wrap.near`, method `ft_resolve_transfer`. Receipt logs live on receipts, not on the transaction, so this single pass is enough — no deeper async trace needed. ### Turn one receipt ID into a readable transaction story {#receipt-id-to-readable-story} `POST /v0/receipt` returns the receipt record **and** its full parent transaction in one response, so a single call covers the whole story — no follow-up `/v0/transactions` fetch needed. ```bash RECEIPT_ID=B8QzHQZ6VnUVy8zaVXCEkWuSs7MPb34yoHYixZV3Zdj1 curl -s "https://tx.main.fastnear.com/v0/receipt?apiKey=${FASTNEAR_API_KEY:-}" \ -H 'content-type: application/json' \ --data "$(jq -nc --arg receipt_id "$RECEIPT_ID" '{receipt_id: $receipt_id}')" \ | jq '{ receipt: { receipt_id: .receipt.receipt_id, type: .receipt.receipt_type, is_success: .receipt.is_success, receipt_block: .receipt.block_height, tx_block: .receipt.tx_block_height, predecessor_id: .receipt.predecessor_id, receiver_id: .receipt.receiver_id, transaction_hash: .receipt.transaction_hash }, parent_transaction: { signer_id: .transaction.transaction.signer_id, receiver_id: .transaction.transaction.receiver_id, action_types: (.transaction.transaction.actions | map(if type == "string" then . else keys[0] end)) } }' ``` For the pinned receipt, this returns an `Action` receipt from `root.near` to `escrow.ai.near` that executed successfully in block `188976786`, one block after its parent tx `7ZKnhzt2…` landed — a single `Transfer` (3.5 NEAR, visible as `3500000000000000000000000` yocto in the raw `.transaction.transaction.actions`). If the parent tx becomes the interesting anchor, you already have the hash — reuse it with [I have one transaction hash. What happened?](#i-have-one-transaction-hash-what-happened). ## Failure and Async ### Prove that one failed action reverted the whole batch One batch submitted `CreateAccount → Transfer → AddKey → FunctionCall` and the final call hit a missing method. The indexed tx record already carries the ordered batch *and* the exact receipt-level failure, so one call answers "what was tried and what broke"; a `view_account` check then proves the earlier actions rolled back. ```bash TX_HASH=CrhH3xLzbNwNMGgZkgptXorwh8YmqxRGuA6Mc11MkU6M NEW_ACCOUNT_ID=rollback-mo4vmkig.temp.mike.testnet curl -s "https://tx.test.fastnear.com/v0/transactions?apiKey=${FASTNEAR_API_KEY:-}" \ -H 'content-type: application/json' \ --data "$(jq -nc --arg tx_hash "$TX_HASH" '{tx_hashes: [$tx_hash]}')" \ | jq '{ action_types: (.transactions[0].transaction.actions | map(if type == "string" then . else keys[0] end)), final_method: .transactions[0].transaction.actions[3].FunctionCall.method_name, tx_handoff: .transactions[0].execution_outcome.outcome.status, receipt_failure: ( first( .transactions[0].receipts[] | select(.execution_outcome.outcome.status.Failure != null) | .execution_outcome.outcome.status.Failure.ActionError ) ) }' ``` The tx-level status is `SuccessReceiptId` — the transaction successfully handed its batched actions off to a receipt. The failure lives one layer down on that receipt: `index: 3` (the `FunctionCall`), kind `CodeDoesNotExist` on `rollback-mo4vmkig.temp.mike.testnet`. `SuccessReceiptId` on the tx outcome means "handoff worked," not "everything finished" — a real trap if you only look at the tx-level status. Now prove the earlier actions rolled back by asking for the account the batch *tried* to create: ```bash NEW_ACCOUNT_ID=rollback-mo4vmkig.temp.mike.testnet curl -s "https://rpc.testnet.fastnear.com?apiKey=${FASTNEAR_API_KEY:-}" \ -H 'content-type: application/json' \ --data "$(jq -nc --arg account_id "$NEW_ACCOUNT_ID" '{ jsonrpc: "2.0", id: "fastnear", method: "query", params: {request_type: "view_account", account_id: $account_id, finality: "final"} }')" \ | jq '{error: .error.cause.name, requested_account_id: .error.cause.info.requested_account_id}' ``` `UNKNOWN_ACCOUNT` is the proof. If `CreateAccount` had stuck, `view_account` would resolve; because it does not, the earlier `Transfer` and `AddKey` from the same batched receipt did not stick either. ### When a tx looks successful, what actually happened? A tx's outer `execution_outcome.outcome.status` reports `SuccessReceiptId` whenever the first receipt handoff worked — it says nothing about whether downstream receipts succeeded or whether the origin callback ran. One pipeline over `/v0/transactions` answers all three questions at once. ```bash TX_HASH=2KhhB1uDScGCFQfVchep7DiZTGTxMcgfUYHNzwf5e6uL ORIGIN_CONTRACT_ID=wrap.near CALLBACK_METHOD=ft_resolve_transfer curl -s "https://tx.main.fastnear.com/v0/transactions?apiKey=${FASTNEAR_API_KEY:-}" \ -H 'content-type: application/json' \ --data "$(jq -nc --arg tx_hash "$TX_HASH" '{tx_hashes: [$tx_hash]}')" \ | jq --arg origin "$ORIGIN_CONTRACT_ID" --arg callback "$CALLBACK_METHOD" '{ outer: { method: .transactions[0].transaction.actions[0].FunctionCall.method_name, tx_handoff: (.transactions[0].execution_outcome.outcome.status | keys[0]) }, callback: { expected_on: $origin, method: $callback, ran: any( .transactions[0].receipts[]; .receipt.receiver_id == $origin and (.receipt.receipt.Action.actions[0].FunctionCall.method_name // "") == $callback ) }, descendant_failures: [ .transactions[0].receipts[] | select(.execution_outcome.outcome.status.Failure != null) | { receiver_id: .receipt.receiver_id, method: (.receipt.receipt.Action.actions[0].FunctionCall.method_name // "system"), cause: .execution_outcome.outcome.status.Failure } ] }' ``` For the pinned tx, `outer.method` is `ft_transfer_call` and `outer.tx_handoff` is `SuccessReceiptId` — the tx kicked off its first receipt cleanly, and read alone you'd call it a win. `descendant_failures` tells a second story: `ft_on_transfer` on `v2.ref-finance.near` panicked with `E51: contract paused` — the DEX was paused when this swap ran, so it couldn't accept the wrapped NEAR. `callback.ran: true` tells a third: `wrap.near`'s `ft_resolve_transfer` fired anyway. A downstream failure never prevents the origin contract's callback from running — that's the mechanism by which NEP-141 refunds the sender when the receiver rejects. Receipt success is not transitive. A protocol can hand off cleanly and still see the detached work fail later; the origin callback runs either way. Read these three fields together and the async story is legible without chasing the receipt chain by hand. To surface the `Refund` log line itself, pivot to [Which receipt emitted this log or event?](#which-receipt-emitted-this-log-or-event). ### Pair one OutLayer request with its TEE worker resolution [OutLayer](https://outlayer.fastnear.com) splits one logical call across two transactions: a user signs `request_execution` on `outlayer.near`, an Intel TDX worker runs the requested WASM off-chain, then `worker.outlayer.near` submits the result with `submit_execution_output_and_resolve`. Both halves carry the same `request_id` — passing the two tx hashes to `/v0/transactions` in one call and extracting that field from each proves the pair. ```bash REQUEST_TX=BZDQAxEdpQ9wUGXmXTa2APwFLDTTqTy5ucrBPsfgZeyz WORKER_TX=3NYD4Mkn5cwkuVkGP9PPoiJ9PB5Vr7v6r8CwSswtHVA3 curl -s "https://tx.main.fastnear.com/v0/transactions?apiKey=${FASTNEAR_API_KEY:-}" \ -H 'content-type: application/json' \ --data "$(jq -nc --arg a "$REQUEST_TX" --arg b "$WORKER_TX" '{tx_hashes: [$a, $b]}')" \ | jq '[ .transactions[] | { role: (if .transaction.actions[0].FunctionCall.method_name == "request_execution" then "request" else "worker" end), hash: .transaction.hash, signer: .transaction.signer_id, method: .transaction.actions[0].FunctionCall.method_name, block: .execution_outcome.block_height, request_id: ( if .transaction.actions[0].FunctionCall.method_name == "request_execution" then (.receipts[0].execution_outcome.outcome.logs[] | select(startswith("EVENT_JSON")) | sub("EVENT_JSON:"; "") | fromjson | .data[0].request_data | fromjson | .request_id) else (.receipts[0].receipt.receipt.Action.actions[0].FunctionCall.args | @base64d | fromjson | .request_id) end ) } ]' ``` Both rows carry `request_id: 1868`, confirming the pair. The request half, signed by `retrorn.near` in block `194832281`, lives in an `EVENT_JSON:` log on its receipt (that's NEAR's yield/resume pattern — the on-chain promise pauses while the TDX worker runs). The worker half lands 11 blocks later with `submit_execution_output_and_resolve`, signed by `worker.outlayer.near`, and its `request_id` decodes straight out of the base64 `FunctionCall.args`. The same two payloads also carry the richer fingerprint — `sender_id`, `project_id`, `code_hash`, `resources_used.instructions`, `resources_used.time_ms`, encrypted-result byte count — if you want to audit what actually ran; this minimal pipeline just confirms they belong together. `/v0/transactions` serves historical pairs indefinitely, so you don't need archival RPC weeks later. ## Common mistakes - Trying to submit a transaction from the history API instead of raw RPC. - Using Transactions API when the user only wants current balances or holdings. - Dropping to raw RPC before indexed history has answered the readable "what happened?" question. ## Related guides - [Transactions API](https://docs.fastnear.com/tx) - [RPC Reference](https://docs.fastnear.com/rpc) - [FastNear API](https://docs.fastnear.com/api) - [NEAR Data API](https://docs.fastnear.com/neardata) - [Berry Club: live board and one historical reconstruction path](https://docs.fastnear.com/tx/examples/berry-club) - [Advanced SocialDB write lookup](https://docs.fastnear.com/tx/socialdb-proofs) - [Choosing the Right Surface](https://docs.fastnear.com/agents/choosing-surfaces) - [Agent Playbooks](https://docs.fastnear.com/agents/playbooks) --- ## Berry Club: Read the live board, then reconstruct one era - HTML path: https://docs.fastnear.com/tx/examples/berry-club - Markdown path: https://docs.fastnear.com/tx/examples/berry-club.md **Source:** [https://docs.fastnear.com/tx/examples/berry-club](https://docs.fastnear.com/tx/examples/berry-club) # Berry Club: Read the live board, then reconstruct one era Use this walkthrough when the live board is easy to read, but you need one historical reconstruction path behind it. Start with the live board. If that already answers the question, stop there. Only switch to Transactions API when the question becomes historical: “what did Berry Club look like during one older era, and which `draw` calls made it look that way?” These shell examples work against the public RPC and Transactions endpoints. If `FASTNEAR_API_KEY` is already set in your shell, the FastNear calls will forward it automatically as a bearer header. Live board card: fetches `berryclub.ek.near` `get_lines` from mainnet RPC and renders the current 50x50 grid in the docs UI. ## 1. Read the live board This is the shortest useful read: ```bash ARGS_BASE64="$(jq -nc '{lines: [range(0;50)]}' | base64 | tr -d '\n')" AUTH_HEADER=() if [ -n "${FASTNEAR_API_KEY:-}" ]; then AUTH_HEADER=(-H "Authorization: Bearer $FASTNEAR_API_KEY"); fi curl -sS https://rpc.mainnet.fastnear.com \ "${AUTH_HEADER[@]}" \ -H 'content-type: application/json' \ --data "{ \"jsonrpc\": \"2.0\", \"id\": \"berry-live-board\", \"method\": \"query\", \"params\": { \"request_type\": \"call_function\", \"finality\": \"final\", \"account_id\": \"berryclub.ek.near\", \"method_name\": \"get_lines\", \"args_base64\": \"$ARGS_BASE64\" } }" | jq '.result | {block_height, line_count: (.result | implode | fromjson | length)}' ``` That gives you the current 50x50 board from the contract itself. The only decode step is turning each returned base64 line into 50 pixel colors. ## 2. Reconstruct one older era When you need history, keep the flow short: 1. bound one era 2. list candidate `draw` transactions for `berryclub.ek.near` 3. hydrate those hashes 4. replay the `pixels` arrays oldest-first This example uses a narrow window around block `97601515`: ```bash AUTH_HEADER=() if [ -n "${FASTNEAR_API_KEY:-}" ]; then AUTH_HEADER=(-H "Authorization: Bearer $FASTNEAR_API_KEY"); fi curl -sS https://tx.main.fastnear.com/v0/account \ "${AUTH_HEADER[@]}" \ -H 'content-type: application/json' \ --data '{ "account_id": "berryclub.ek.near", "is_function_call": true, "is_receiver": true, "is_real_receiver": true, "from_tx_block_height": 97576515, "to_tx_block_height": 97601516, "desc": false, "limit": 200 }' | jq '.account_txs | map({transaction_hash, tx_block_height}) | .[-5:]' ``` If you do not know the window yet, [`/v0/blocks`](https://docs.fastnear.com/tx/blocks) can help you choose one first. It is not part of the core Berry Club flow. Hydrate the candidate hashes and keep only top-level `draw` calls: ```bash AUTH_HEADER=() if [ -n "${FASTNEAR_API_KEY:-}" ]; then AUTH_HEADER=(-H "Authorization: Bearer $FASTNEAR_API_KEY"); fi curl -sS https://tx.main.fastnear.com/v0/transactions \ "${AUTH_HEADER[@]}" \ -H 'content-type: application/json' \ --data '{ "tx_hashes": [ "Hq5qwsuiM2emJrqczWM9awCa7o6sTBYqYpcifUX2SUhQ", "8tBip5M2TrozhSyepAA3tYXpyKooi5t7b9c64wXjFvfL" ] }' | jq '.transactions[] | select(.transaction.receiver_id == "berryclub.ek.near") | .transaction.actions[]?.FunctionCall | select(.method_name == "draw") | {method_name, args: (.args | @base64d | fromjson)}' ``` Replay the `pixels` arrays oldest-first: ```javascript const board = Array.from({ length: 50 }, () => Array(50).fill(0)); for (const drawTx of drawTransactionsOldestFirst) { for (const pixel of drawTx.args.pixels) { if (pixel.x < 0 || pixel.x >= 50 || pixel.y < 0 || pixel.y >= 50) { continue; } board[pixel.y][pixel.x] = pixel.color; } } ``` That is the whole historical pattern. Berry Club does not expose a ready-made “board at block N” endpoint, so older eras come from replaying `draw` writes. ## Related guides - [RPC: call_function](https://docs.fastnear.com/rpc/contract/call-function) - [Transactions API: Account History](https://docs.fastnear.com/tx/account) - [Transactions API: Transactions by Hash](https://docs.fastnear.com/tx/transactions) --- ## Advanced SocialDB Write Lookup - HTML path: https://docs.fastnear.com/tx/socialdb-proofs - Markdown path: https://docs.fastnear.com/tx/socialdb-proofs.md **Source:** [https://docs.fastnear.com/tx/socialdb-proofs](https://docs.fastnear.com/tx/socialdb-proofs) # Advanced SocialDB Write Lookup Use this page only when the starting point is already a readable SocialDB value from `api.near.social` and the next question is historical write lookup. These shell steps work against the public SocialDB and FastNear endpoints. If `FASTNEAR_API_KEY` is already set in your shell, the FastNear calls will forward it automatically as a bearer header. For FastNear-first jobs, start with [Transactions Examples](https://docs.fastnear.com/tx/examples). Come here only when the question has become "which write made this readable SocialDB value true?" ## Canonical example: prove that `root.near` set `profile.name` to `Illia` Use this when the readable fact is already "the current `profile.name` is `Illia`" and the remaining question is which write made that field true. This is the one SocialDB nuance worth keeping: for historical proof, the field-level `:block` is usually the right bridge, not the parent object's `:block`. For this live anchor: - current `profile.name`: `Illia` - field-level SocialDB write block: `75590392` - receipt ID: `GYvnvBxWA46UGa3aGEkqUBeT7hxhVXk2iZScJFZWU8Se` - originating transaction hash: `7HtFWv51k5Bispmh1WYPbAVkxr2X4AL6n98DhcQwVw7w` - outer transaction block: `75590391` ### Shell walkthrough 1. Read the field from NEAR Social and capture the field-level write block. ```bash ACCOUNT_ID=root.near PROFILE_FIELD=profile/name PROFILE="$(curl -s "https://api.near.social/get" \ -H 'content-type: application/json' \ --data "$(jq -nc --arg account_id "$ACCOUNT_ID" --arg profile_field "$PROFILE_FIELD" '{ keys: [($account_id + "/" + $profile_field)], options: {with_block_height: true} }')")" echo "$PROFILE" | jq --arg account_id "$ACCOUNT_ID" '{ current_name: .[$account_id].profile.name[""], field_block_height: .[$account_id].profile.name[":block"], parent_profile_block_height: .[$account_id].profile[":block"] }' PROFILE_BLOCK_HEIGHT="$(echo "$PROFILE" | jq -r --arg account_id "$ACCOUNT_ID" '.[$account_id].profile.name[":block"]')" ``` 2. Reuse that field-level block in FastNear block receipts and recover the receipt plus tx hash. ```bash ACCOUNT_ID=root.near PROFILE_FIELD=profile/name AUTH_HEADER=() if [ -n "${FASTNEAR_API_KEY:-}" ]; then AUTH_HEADER=(-H "Authorization: Bearer $FASTNEAR_API_KEY"); fi PROFILE_BLOCK_HEIGHT="$( curl -s "https://api.near.social/get" \ -H 'content-type: application/json' \ --data "$(jq -nc --arg account_id "$ACCOUNT_ID" --arg profile_field "$PROFILE_FIELD" '{ keys: [($account_id + "/" + $profile_field)], options: {with_block_height: true} }')" \ | jq -r --arg account_id "$ACCOUNT_ID" '.[$account_id].profile.name[":block"]' )" BLOCK_RECEIPTS="$(curl -s "https://tx.main.fastnear.com/v0/block" \ "${AUTH_HEADER[@]}" \ -H 'content-type: application/json' \ --data "$(jq -nc --argjson block_id "$PROFILE_BLOCK_HEIGHT" '{ block_id: $block_id, with_transactions: false, with_receipts: true }')")" echo "$BLOCK_RECEIPTS" | jq --arg account_id "$ACCOUNT_ID" '{ profile_receipt: ( first( .block_receipts[] | select(.predecessor_id == $account_id and .receiver_id == "social.near") | {receipt_id, transaction_hash, block_height, tx_block_height} ) ) }' PROFILE_TX_HASH="$(echo "$BLOCK_RECEIPTS" | jq -r --arg account_id "$ACCOUNT_ID" ' first( .block_receipts[] | select(.predecessor_id == $account_id and .receiver_id == "social.near") | .transaction_hash )')" ``` 3. Reuse that tx hash in `POST /v0/transactions` and decode the SocialDB write payload. ```bash ACCOUNT_ID=root.near PROFILE_FIELD=profile/name AUTH_HEADER=() if [ -n "${FASTNEAR_API_KEY:-}" ]; then AUTH_HEADER=(-H "Authorization: Bearer $FASTNEAR_API_KEY"); fi PROFILE_BLOCK_HEIGHT="$( curl -s "https://api.near.social/get" \ -H 'content-type: application/json' \ --data "$(jq -nc --arg account_id "$ACCOUNT_ID" --arg profile_field "$PROFILE_FIELD" '{ keys: [($account_id + "/" + $profile_field)], options: {with_block_height: true} }')" \ | jq -r --arg account_id "$ACCOUNT_ID" '.[$account_id].profile.name[":block"]' )" PROFILE_TX_HASH="$( curl -s "https://tx.main.fastnear.com/v0/block" \ "${AUTH_HEADER[@]}" \ -H 'content-type: application/json' \ --data "$(jq -nc --argjson block_id "$PROFILE_BLOCK_HEIGHT" '{ block_id: $block_id, with_transactions: false, with_receipts: true }')" \ | jq -r --arg account_id "$ACCOUNT_ID" ' first( .block_receipts[] | select(.predecessor_id == $account_id and .receiver_id == "social.near") | .transaction_hash )' )" curl -s "https://tx.main.fastnear.com/v0/transactions" \ "${AUTH_HEADER[@]}" \ -H 'content-type: application/json' \ --data "$(jq -nc --arg tx_hash "$PROFILE_TX_HASH" '{tx_hashes: [$tx_hash]}')" \ | jq --arg account_id "$ACCOUNT_ID" '{ transaction: { hash: .transactions[0].transaction.hash, signer_id: .transactions[0].transaction.signer_id, receiver_id: .transactions[0].transaction.receiver_id, included_block_height: .transactions[0].execution_outcome.block_height }, write_proof: ( .transactions[0].receipts[0].receipt.receipt.Action.actions[0].FunctionCall | (.args | @base64d | fromjson | .data[$account_id].profile) as $profile | { method_name, profile_name: $profile.name, image_fields: (($profile.image // {}) | keys), linktree_keys: (($profile.linktree // {}) | keys) } ) }' ``` That is the whole lookup pattern: readable value, field-level block, receipt bridge, and transaction payload. The same bridge works for other readable SocialDB values too: - follow edge variant: `root.near -> mob.near`, block `79152039`, tx `DvNoqtDrruhmcq7mPpxdFacph2ZCqSzMFF5ZqMRFG78q` - widget source variant: `root.near/widget/Profile`, block `76029540`, tx `ELS3DrE4Upoc91ZnBh4thVugxCUBAbaLFB4nyKsoyRNP` The key idea does not change: start from the readable value and its write block, recover the `*.near -> social.near` receipt from the block, then decode the `social.near set` payload from the originating transaction. --- ## NEAR Protocol RPC: View access key - HTML path: https://docs.fastnear.com/rpcs/account/view_access_key - Markdown path: https://docs.fastnear.com/rpcs/account/view_access_key.md # NEAR Protocol RPC: View access key View access key Fetch one access key's permissions and nonce by public key on a given account. ## Source links - https://docs.fastnear.com/rpcs/account/view_access_key - https://docs.fastnear.com/rpcs/account/view_access_key/other/view_access_key - https://docs.fastnear.com/reference/operation/view_access_key ## Operation - Transport: json-rpc - Method: POST - Path: `/` - Source spec: `rpcs/account/view_access_key.yaml` ## Networks - Mainnet: https://rpc.mainnet.fastnear.com/ - Testnet: https://rpc.testnet.fastnear.com/ ## Auth - API key via query `apiKey`: The OpenAPI contract describes the FastNEAR API key as a query parameter named apiKey. - This export intentionally omits any locally saved credentials ## Current request - Network: Mainnet - Finality: final - Endpoint: https://rpc.mainnet.fastnear.com/ ### Request body ```json { "jsonrpc": "2.0", "id": "fastnear", "method": "query", "params": { "account_id": "root.near", "public_key": "ed25519:6666666666666666666666666666666666666666666", "request_type": "view_access_key", "finality": "final" } } ``` ## Request reference ### Active example ```json { "body": { "jsonrpc": "2.0", "id": "fastnear", "method": "query", "params": { "account_id": "root.near", "public_key": "ed25519:6666666666666666666666666666666666666666666", "request_type": "view_access_key", "finality": "final" } }, "headers": {}, "path": {}, "query": {} } ``` ### Inputs - `account_id` (body, required, string): NEAR account ID - `public_key` (body, required, string): ed25519: or secp256k1: prefixed public key ### Request schema ```json { "type": "object", "required": [ "jsonrpc", "id", "method", "params" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "type": "string", "example": "fastnear" } }, { "name": "method", "required": true, "schema": { "type": "string", "enum": [ "query" ] } }, { "name": "params", "required": true, "schema": { "type": "object", "required": [ "request_type", "account_id", "public_key", "finality" ], "properties": [ { "name": "account_id", "required": true, "schema": { "type": "string", "description": "NEAR account ID" } }, { "name": "public_key", "required": true, "schema": { "type": "string", "description": "ed25519: or secp256k1: prefixed public key" } }, { "name": "request_type", "required": true, "schema": { "type": "string", "enum": [ "view_access_key" ] } }, { "name": "finality", "required": true, "schema": { "type": "string", "description": "Block finality", "enum": [ "final", "near-final", "optimistic" ] } } ] } } ] } ``` ## Response reference - Status: 200 - Media type: application/json - Summary: Successful response ### Response schema ```json { "type": "object", "required": [ "jsonrpc", "id" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "oneOf": [ { "type": "string" }, { "type": "number" } ] } }, { "name": "result", "required": false, "schema": { "type": "object", "description": "Describes access key permission scope and nonce.", "required": [ "nonce", "permission" ], "properties": [ { "name": "nonce", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "permission", "required": true, "schema": { "type": "object", "description": "One of multiple possible types" } } ] } }, { "name": "error", "required": false, "schema": { "type": "object", "properties": [ { "name": "code", "required": false, "schema": { "type": "integer" } }, { "name": "message", "required": false, "schema": { "type": "string" } }, { "name": "data", "required": false, "schema": { "type": "object" } } ] } } ], "refName": "JsonRpcResponse" } ``` --- ## NEAR Protocol RPC: View access key list - HTML path: https://docs.fastnear.com/rpcs/account/view_access_key_list - Markdown path: https://docs.fastnear.com/rpcs/account/view_access_key_list.md # NEAR Protocol RPC: View access key list View access key list Fetch every access key attached to an account, each with its permissions and nonce. ## Source links - https://docs.fastnear.com/rpcs/account/view_access_key_list - https://docs.fastnear.com/rpcs/account/view_access_key_list/other/view_access_key_list - https://docs.fastnear.com/reference/operation/view_access_key_list ## Operation - Transport: json-rpc - Method: POST - Path: `/` - Source spec: `rpcs/account/view_access_key_list.yaml` ## Networks - Mainnet: https://rpc.mainnet.fastnear.com/ - Testnet: https://rpc.testnet.fastnear.com/ ## Auth - API key via query `apiKey`: The OpenAPI contract describes the FastNEAR API key as a query parameter named apiKey. - This export intentionally omits any locally saved credentials ## Current request - Network: Mainnet - Finality: final - Endpoint: https://rpc.mainnet.fastnear.com/ ### Request body ```json { "jsonrpc": "2.0", "id": "fastnear", "method": "query", "params": { "account_id": "root.near", "request_type": "view_access_key_list", "finality": "final" } } ``` ## Request reference ### Active example ```json { "body": { "jsonrpc": "2.0", "id": "fastnear", "method": "query", "params": { "account_id": "root.near", "request_type": "view_access_key_list", "finality": "final" } }, "headers": {}, "path": {}, "query": {} } ``` ### Inputs - `account_id` (body, required, string): NEAR account ID ### Request schema ```json { "type": "object", "required": [ "jsonrpc", "id", "method", "params" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "type": "string", "example": "fastnear" } }, { "name": "method", "required": true, "schema": { "type": "string", "enum": [ "query" ] } }, { "name": "params", "required": true, "schema": { "type": "object", "required": [ "request_type", "account_id", "finality" ], "properties": [ { "name": "account_id", "required": true, "schema": { "type": "string", "description": "NEAR account ID" } }, { "name": "request_type", "required": true, "schema": { "type": "string", "enum": [ "view_access_key_list" ] } }, { "name": "finality", "required": true, "schema": { "type": "string", "description": "Block finality", "enum": [ "final", "near-final", "optimistic" ] } } ] } } ] } ``` ## Response reference - Status: 200 - Media type: application/json - Summary: Successful response ### Response schema ```json { "type": "object", "required": [ "jsonrpc", "id" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "oneOf": [ { "type": "string" }, { "type": "number" } ] } }, { "name": "result", "required": false, "schema": { "type": "object", "description": "Lists access keys", "required": [ "keys" ], "properties": [ { "name": "keys", "required": true, "schema": { "type": "array", "items": { "type": "object", "description": "Describes information about an access key including the public key." } } } ] } }, { "name": "error", "required": false, "schema": { "type": "object", "properties": [ { "name": "code", "required": false, "schema": { "type": "integer" } }, { "name": "message", "required": false, "schema": { "type": "string" } }, { "name": "data", "required": false, "schema": { "type": "object" } } ] } } ], "refName": "JsonRpcResponse" } ``` --- ## NEAR Protocol RPC: View account - HTML path: https://docs.fastnear.com/rpcs/account/view_account - Markdown path: https://docs.fastnear.com/rpcs/account/view_account.md # NEAR Protocol RPC: View account View account Fetch an account's balance, storage usage, and code hash at a chosen block or finality. ## Source links - https://docs.fastnear.com/rpcs/account/view_account - https://docs.fastnear.com/rpcs/account/view_account/other/view_account - https://docs.fastnear.com/reference/operation/view_account ## Operation - Transport: json-rpc - Method: POST - Path: `/` - Source spec: `rpcs/account/view_account.yaml` ## Networks - Mainnet: https://rpc.mainnet.fastnear.com/ - Testnet: https://rpc.testnet.fastnear.com/ ## Auth - API key via query `apiKey`: The OpenAPI contract describes the FastNEAR API key as a query parameter named apiKey. - This export intentionally omits any locally saved credentials ## Current request - Network: Mainnet - Finality: final - Endpoint: https://rpc.mainnet.fastnear.com/ ### Request body ```json { "jsonrpc": "2.0", "id": "fastnear", "method": "query", "params": { "account_id": "root.near", "request_type": "view_account", "finality": "final" } } ``` ## Request reference ### Active example ```json { "body": { "jsonrpc": "2.0", "id": "fastnear", "method": "query", "params": { "account_id": "root.near", "request_type": "view_account", "finality": "final" } }, "headers": {}, "path": {}, "query": {} } ``` ### Inputs - `account_id` (body, required, string): NEAR account ID ### Request schema ```json { "type": "object", "required": [ "jsonrpc", "id", "method", "params" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "type": "string", "example": "fastnear" } }, { "name": "method", "required": true, "schema": { "type": "string", "enum": [ "query" ] } }, { "name": "params", "required": true, "schema": { "type": "object", "required": [ "request_type", "account_id", "finality" ], "properties": [ { "name": "account_id", "required": true, "schema": { "type": "string", "description": "NEAR account ID" } }, { "name": "request_type", "required": true, "schema": { "type": "string", "enum": [ "view_account" ] } }, { "name": "finality", "required": true, "schema": { "type": "string", "description": "Block finality", "enum": [ "final", "near-final", "optimistic" ] } } ] } } ] } ``` ## Response reference - Status: 200 - Media type: application/json - Summary: Successful response ### Response schema ```json { "type": "object", "required": [ "jsonrpc", "id" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "oneOf": [ { "type": "string" }, { "type": "number" } ] } }, { "name": "result", "required": false, "schema": { "type": "object", "description": "A view of the account", "required": [ "amount", "locked", "code_hash", "storage_usage" ], "properties": [ { "name": "amount", "required": true, "schema": { "type": "string", "description": "Amount in yoctoNEAR" } }, { "name": "code_hash", "required": true, "schema": { "type": "string", "description": "Base58-encoded hash" } }, { "name": "global_contract_account_id", "required": false, "schema": { "type": "string", "nullable": true, "description": "NEAR account ID" } }, { "name": "global_contract_hash", "required": false, "schema": { "type": "string", "nullable": true, "description": "Base58-encoded hash" } }, { "name": "locked", "required": true, "schema": { "type": "string", "description": "Amount in yoctoNEAR" } }, { "name": "storage_paid_at", "required": false, "schema": { "type": "integer", "description": "TODO(2271): deprecated.", "format": "uint64", "default": 0 } }, { "name": "storage_usage", "required": true, "schema": { "type": "integer", "format": "uint64" } } ] } }, { "name": "error", "required": false, "schema": { "type": "object", "properties": [ { "name": "code", "required": false, "schema": { "type": "integer" } }, { "name": "message", "required": false, "schema": { "type": "string" } }, { "name": "data", "required": false, "schema": { "type": "object" } } ] } } ], "refName": "JsonRpcResponse" } ``` --- ## NEAR Protocol RPC: Get block by height - HTML path: https://docs.fastnear.com/rpcs/block/block_by_height - Markdown path: https://docs.fastnear.com/rpcs/block/block_by_height.md # NEAR Protocol RPC: Get block by height Get block by height Fetch a block's header and chunk summaries by its height in the chain. ## Source links - https://docs.fastnear.com/rpcs/block/block_by_height - https://docs.fastnear.com/rpcs/block/block_by_height/other/block_by_height - https://docs.fastnear.com/reference/operation/block_by_height ## Operation - Transport: json-rpc - Method: POST - Path: `/` - Source spec: `rpcs/block/block_by_height.yaml` ## Networks - Mainnet: https://rpc.mainnet.fastnear.com/ - Testnet: https://rpc.testnet.fastnear.com/ ## Auth - API key via query `apiKey`: The OpenAPI contract describes the FastNEAR API key as a query parameter named apiKey. - This export intentionally omits any locally saved credentials ## Current request - Network: Mainnet - Finality: final - Endpoint: https://rpc.mainnet.fastnear.com/ ### Request body ```json { "jsonrpc": "2.0", "id": "fastnear", "method": "block", "params": { "block_id": 9820210 } } ``` ## Request reference ### Active example ```json { "body": { "jsonrpc": "2.0", "id": "fastnear", "method": "block", "params": { "block_id": 9820210 } }, "headers": {}, "path": {}, "query": {} } ``` ### Inputs - `block_id` (body, required, integer): Block height to query ### Request schema ```json { "type": "object", "required": [ "jsonrpc", "id", "method", "params" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "type": "string", "example": "fastnear" } }, { "name": "method", "required": true, "schema": { "type": "string", "enum": [ "block" ] } }, { "name": "params", "required": true, "schema": { "type": "object", "required": [ "block_id" ], "properties": [ { "name": "block_id", "required": true, "schema": { "type": "integer", "description": "Block height to query" } } ] } } ] } ``` ## Response reference - Status: 200 - Media type: application/json - Summary: Successful response ### Response schema ```json { "type": "object", "required": [ "jsonrpc", "id" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "oneOf": [ { "type": "string" }, { "type": "number" } ] } }, { "name": "result", "required": false, "schema": { "type": "object" } }, { "name": "error", "required": false, "schema": { "type": "object", "properties": [ { "name": "code", "required": false, "schema": { "type": "integer" } }, { "name": "message", "required": false, "schema": { "type": "string" } }, { "name": "data", "required": false, "schema": { "type": "object" } } ] } } ], "refName": "JsonRpcResponse" } ``` --- ## NEAR Protocol RPC: Get block by hash - HTML path: https://docs.fastnear.com/rpcs/block/block_by_id - Markdown path: https://docs.fastnear.com/rpcs/block/block_by_id.md # NEAR Protocol RPC: Get block by hash Get block by hash Fetch a block's header and chunk summaries by its Base58-encoded SHA-256 hash. ## Source links - https://docs.fastnear.com/rpcs/block/block_by_id - https://docs.fastnear.com/rpcs/block/block_by_id/other/block_by_id - https://docs.fastnear.com/reference/operation/block_by_id ## Operation - Transport: json-rpc - Method: POST - Path: `/` - Source spec: `rpcs/block/block_by_id.yaml` ## Networks - Mainnet: https://rpc.mainnet.fastnear.com/ - Testnet: https://rpc.testnet.fastnear.com/ ## Auth - API key via query `apiKey`: The OpenAPI contract describes the FastNEAR API key as a query parameter named apiKey. - This export intentionally omits any locally saved credentials ## Current request - Network: Mainnet - Finality: final - Endpoint: https://rpc.mainnet.fastnear.com/ ### Request body ```json { "jsonrpc": "2.0", "id": "fastnear", "method": "block", "params": { "block_id": "EPnLgE7iEq9s7yTkos96M3cWymH5avBAPm3qx3NXqR8H" } } ``` ## Request reference ### Active example ```json { "body": { "jsonrpc": "2.0", "id": "fastnear", "method": "block", "params": { "block_id": "EPnLgE7iEq9s7yTkos96M3cWymH5avBAPm3qx3NXqR8H" } }, "headers": {}, "path": {}, "query": {} } ``` ### Inputs - `block_id` (body, required, string): Base58-encoded block hash ### Request schema ```json { "type": "object", "required": [ "jsonrpc", "id", "method", "params" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "type": "string", "example": "fastnear" } }, { "name": "method", "required": true, "schema": { "type": "string", "enum": [ "block" ] } }, { "name": "params", "required": true, "schema": { "type": "object", "required": [ "block_id" ], "properties": [ { "name": "block_id", "required": true, "schema": { "type": "string", "description": "Base58-encoded block hash" } } ] } } ] } ``` ## Response reference - Status: 200 - Media type: application/json - Summary: Successful response ### Response schema ```json { "type": "object", "required": [ "jsonrpc", "id" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "oneOf": [ { "type": "string" }, { "type": "number" } ] } }, { "name": "result", "required": false, "schema": { "type": "object" } }, { "name": "error", "required": false, "schema": { "type": "object", "properties": [ { "name": "code", "required": false, "schema": { "type": "integer" } }, { "name": "message", "required": false, "schema": { "type": "string" } }, { "name": "data", "required": false, "schema": { "type": "object" } } ] } } ], "refName": "JsonRpcResponse" } ``` --- ## NEAR Protocol RPC: Get block effects - HTML path: https://docs.fastnear.com/rpcs/block/block_effects - Markdown path: https://docs.fastnear.com/rpcs/block/block_effects.md # NEAR Protocol RPC: Get block effects Get block effects Summarize every state change in a block — which accounts, keys, and contract-state entries were touched. ## Source links - https://docs.fastnear.com/rpcs/block/block_effects - https://docs.fastnear.com/rpcs/block/block_effects/other/block_effects - https://docs.fastnear.com/reference/operation/block_effects ## Operation - Transport: json-rpc - Method: POST - Path: `/` - Source spec: `rpcs/block/block_effects.yaml` ## Networks - Mainnet: https://rpc.mainnet.fastnear.com/ - Testnet: https://rpc.testnet.fastnear.com/ ## Auth - API key via query `apiKey`: The OpenAPI contract describes the FastNEAR API key as a query parameter named apiKey. - This export intentionally omits any locally saved credentials ## Current request - Network: Mainnet - Finality: final - Endpoint: https://rpc.mainnet.fastnear.com/ ### Request body ```json { "jsonrpc": "2.0", "id": "fastnear", "method": "block_effects", "params": { "block_id": 9820210 } } ``` ## Request reference ### Active example ```json { "body": { "jsonrpc": "2.0", "id": "fastnear", "method": "block_effects", "params": { "block_id": 9820210 } }, "headers": {}, "path": {}, "query": {} } ``` ### Inputs - `block_id` (body, required, integer | string): Block height (integer) or block hash (string) ### Request schema ```json { "type": "object", "required": [ "jsonrpc", "id", "method", "params" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "type": "string", "example": "fastnear" } }, { "name": "method", "required": true, "schema": { "type": "string", "enum": [ "block_effects" ] } }, { "name": "params", "required": true, "schema": { "type": "object", "required": [ "block_id" ], "properties": [ { "name": "block_id", "required": true, "schema": { "description": "Block height (integer) or block hash (string)", "oneOf": [ { "type": "integer", "description": "Block height" }, { "type": "string", "description": "Base58-encoded block hash" } ] } } ] } } ] } ``` ## Response reference - Status: 200 - Media type: application/json - Summary: Successful response ### Response schema ```json { "type": "object", "required": [ "jsonrpc", "id" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "oneOf": [ { "type": "string" }, { "type": "number" } ] } }, { "name": "result", "required": false, "schema": { "type": "object", "required": [ "block_hash", "changes" ], "properties": [ { "name": "block_hash", "required": true, "schema": { "type": "string", "description": "Base58-encoded hash" } }, { "name": "changes", "required": true, "schema": { "type": "array", "items": { "type": "object", "description": "One of multiple possible types" } } } ] } }, { "name": "error", "required": false, "schema": { "type": "object", "properties": [ { "name": "code", "required": false, "schema": { "type": "integer" } }, { "name": "message", "required": false, "schema": { "type": "string" } }, { "name": "data", "required": false, "schema": { "type": "object" } } ] } } ], "refName": "JsonRpcResponse" } ``` --- ## NEAR Protocol RPC: Call contract function - HTML path: https://docs.fastnear.com/rpcs/contract/call - Markdown path: https://docs.fastnear.com/rpcs/contract/call.md # NEAR Protocol RPC: Call contract function Call contract function Invoke a contract view method without gas or state changes — reads computed values from contract logic. ## Source links - https://docs.fastnear.com/rpcs/contract/call - https://docs.fastnear.com/rpcs/contract/call/other/call_function - https://docs.fastnear.com/reference/operation/call_function ## Operation - Transport: json-rpc - Method: POST - Path: `/` - Source spec: `rpcs/contract/call.yaml` ## Networks - Mainnet: https://rpc.mainnet.fastnear.com/ - Testnet: https://rpc.testnet.fastnear.com/ ## Auth - API key via query `apiKey`: The OpenAPI contract describes the FastNEAR API key as a query parameter named apiKey. - This export intentionally omits any locally saved credentials ## Current request - Network: Mainnet - Finality: final - Endpoint: https://rpc.mainnet.fastnear.com/ ### Request body ```json { "jsonrpc": "2.0", "id": "fastnear", "method": "query", "params": { "request_type": "call_function", "finality": "final", "account_id": "contract.near", "method_name": "get_info", "args_base64": "e30=" } } ``` ## Request reference ### Active example ```json { "body": { "jsonrpc": "2.0", "id": "fastnear", "method": "query", "params": { "request_type": "call_function", "finality": "final", "account_id": "contract.near", "method_name": "get_info", "args_base64": "e30=" } }, "headers": {}, "path": {}, "query": {} } ``` ### Inputs - `account_id` (body, required, string): NEAR account ID - `args_base64` (body, required, string): Base64-encoded raw method arguments. JSON-based contracts typically expect UTF-8 bytes of the JSON payload; the example `e30=` is `{}`. - `method_name` (body, required, string): Name of the contract view method to invoke. ### Request schema ```json { "type": "object", "required": [ "jsonrpc", "id", "method", "params" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "type": "string", "example": "fastnear" } }, { "name": "method", "required": true, "schema": { "type": "string", "enum": [ "query" ] } }, { "name": "params", "required": true, "schema": { "type": "object", "required": [ "request_type", "account_id", "method_name", "args_base64", "finality" ], "properties": [ { "name": "account_id", "required": true, "schema": { "type": "string", "description": "NEAR account ID" } }, { "name": "args_base64", "required": true, "schema": { "type": "string", "description": "Base64-encoded raw method arguments. JSON-based contracts typically expect UTF-8 bytes of the JSON payload; the example `e30=` is `{}`." } }, { "name": "method_name", "required": true, "schema": { "type": "string", "description": "Name of the contract view method to invoke." } }, { "name": "request_type", "required": true, "schema": { "type": "string", "enum": [ "call_function" ] } }, { "name": "finality", "required": true, "schema": { "type": "string", "description": "Block finality", "enum": [ "final", "near-final", "optimistic" ] } } ] } } ] } ``` ## Response reference - Status: 200 - Media type: application/json - Summary: Successful response ### Response schema ```json { "type": "object", "required": [ "jsonrpc", "id" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "oneOf": [ { "type": "string" }, { "type": "number" } ] } }, { "name": "result", "required": false, "schema": { "type": "object", "description": "A result returned by contract method", "required": [ "result", "logs" ], "properties": [ { "name": "logs", "required": true, "schema": { "type": "array", "items": { "type": "string" } } }, { "name": "result", "required": true, "schema": { "type": "array", "items": { "type": "integer", "format": "uint8" } } } ] } }, { "name": "error", "required": false, "schema": { "type": "object", "properties": [ { "name": "code", "required": false, "schema": { "type": "integer" } }, { "name": "message", "required": false, "schema": { "type": "string" } }, { "name": "data", "required": false, "schema": { "type": "object" } } ] } } ], "refName": "JsonRpcResponse" } ``` --- ## NEAR Protocol RPC: View contract code - HTML path: https://docs.fastnear.com/rpcs/contract/view_code - Markdown path: https://docs.fastnear.com/rpcs/contract/view_code.md # NEAR Protocol RPC: View contract code View contract code Fetch the compiled WebAssembly bytes deployed directly to a single account. ## Source links - https://docs.fastnear.com/rpcs/contract/view_code - https://docs.fastnear.com/rpcs/contract/view_code/other/view_code - https://docs.fastnear.com/reference/operation/view_code ## Operation - Transport: json-rpc - Method: POST - Path: `/` - Source spec: `rpcs/contract/view_code.yaml` ## Networks - Mainnet: https://rpc.mainnet.fastnear.com/ - Testnet: https://rpc.testnet.fastnear.com/ ## Auth - API key via query `apiKey`: The OpenAPI contract describes the FastNEAR API key as a query parameter named apiKey. - This export intentionally omits any locally saved credentials ## Current request - Network: Mainnet - Finality: final - Endpoint: https://rpc.mainnet.fastnear.com/ ### Request body ```json { "jsonrpc": "2.0", "id": "fastnear", "method": "query", "params": { "account_id": "intents.near", "request_type": "view_code", "finality": "final" } } ``` ## Request reference ### Active example ```json { "body": { "jsonrpc": "2.0", "id": "fastnear", "method": "query", "params": { "account_id": "intents.near", "request_type": "view_code", "finality": "final" } }, "headers": {}, "path": {}, "query": {} } ``` ### Inputs - `account_id` (body, required, string): NEAR account ID ### Request schema ```json { "type": "object", "required": [ "jsonrpc", "id", "method", "params" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "type": "string", "example": "fastnear" } }, { "name": "method", "required": true, "schema": { "type": "string", "enum": [ "query" ] } }, { "name": "params", "required": true, "schema": { "type": "object", "required": [ "request_type", "account_id", "finality" ], "properties": [ { "name": "account_id", "required": true, "schema": { "type": "string", "description": "NEAR account ID" } }, { "name": "request_type", "required": true, "schema": { "type": "string", "enum": [ "view_code" ] } }, { "name": "finality", "required": true, "schema": { "type": "string", "description": "Block finality", "enum": [ "final", "near-final", "optimistic" ] } } ] } } ] } ``` ## Response reference - Status: 200 - Media type: application/json - Summary: Successful response ### Response schema ```json { "type": "object", "required": [ "jsonrpc", "id" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "oneOf": [ { "type": "string" }, { "type": "number" } ] } }, { "name": "result", "required": false, "schema": { "type": "object", "description": "A view of the contract code.", "required": [ "code_base64", "hash" ], "properties": [ { "name": "code_base64", "required": true, "schema": { "type": "string" } }, { "name": "hash", "required": true, "schema": { "type": "string", "description": "Base58-encoded hash" } } ] } }, { "name": "error", "required": false, "schema": { "type": "object", "properties": [ { "name": "code", "required": false, "schema": { "type": "integer" } }, { "name": "message", "required": false, "schema": { "type": "string" } }, { "name": "data", "required": false, "schema": { "type": "object" } } ] } } ], "refName": "JsonRpcResponse" } ``` --- ## NEAR Protocol RPC: View global contract code - HTML path: https://docs.fastnear.com/rpcs/contract/view_global_contract_code - Markdown path: https://docs.fastnear.com/rpcs/contract/view_global_contract_code.md # NEAR Protocol RPC: View global contract code View global contract code Look up a global contract's WebAssembly bytes by its Base58-encoded SHA-256 code hash. ## Source links - https://docs.fastnear.com/rpcs/contract/view_global_contract_code - https://docs.fastnear.com/rpcs/contract/view_global_contract_code/other/view_global_contract_code - https://docs.fastnear.com/reference/operation/view_global_contract_code ## Operation - Transport: json-rpc - Method: POST - Path: `/` - Source spec: `rpcs/contract/view_global_contract_code.yaml` ## Networks - Mainnet: https://rpc.mainnet.fastnear.com/ - Testnet: https://rpc.testnet.fastnear.com/ ## Auth - API key via query `apiKey`: The OpenAPI contract describes the FastNEAR API key as a query parameter named apiKey. - This export intentionally omits any locally saved credentials ## Current request - Network: Mainnet - Finality: final - Endpoint: https://rpc.mainnet.fastnear.com/ ### Request body ```json { "jsonrpc": "2.0", "id": "fastnear", "method": "query", "params": { "code_hash": "A2VxywASqbnarBAfTWobhDZjMXobjnYyJmkjhoXAiYBz", "request_type": "view_global_contract_code", "finality": "final" } } ``` ## Request reference ### Active example ```json { "body": { "jsonrpc": "2.0", "id": "fastnear", "method": "query", "params": { "code_hash": "A2VxywASqbnarBAfTWobhDZjMXobjnYyJmkjhoXAiYBz", "request_type": "view_global_contract_code", "finality": "final" } }, "headers": {}, "path": {}, "query": {} } ``` ### Inputs - `code_hash` (body, required, string): Base58-encoded hash ### Request schema ```json { "type": "object", "required": [ "jsonrpc", "id", "method", "params" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "type": "string", "example": "fastnear" } }, { "name": "method", "required": true, "schema": { "type": "string", "enum": [ "query" ] } }, { "name": "params", "required": true, "schema": { "type": "object", "required": [ "request_type", "code_hash", "finality" ], "properties": [ { "name": "code_hash", "required": true, "schema": { "type": "string", "description": "Base58-encoded hash" } }, { "name": "request_type", "required": true, "schema": { "type": "string", "enum": [ "view_global_contract_code" ] } }, { "name": "finality", "required": true, "schema": { "type": "string", "description": "Block finality", "enum": [ "final", "near-final", "optimistic" ] } } ] } } ] } ``` ## Response reference - Status: 200 - Media type: application/json - Summary: Successful response ### Response schema ```json { "type": "object", "required": [ "jsonrpc", "id" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "oneOf": [ { "type": "string" }, { "type": "number" } ] } }, { "name": "result", "required": false, "schema": { "type": "object", "description": "A view of the contract code.", "required": [ "code_base64", "hash" ], "properties": [ { "name": "code_base64", "required": true, "schema": { "type": "string" } }, { "name": "hash", "required": true, "schema": { "type": "string", "description": "Base58-encoded hash" } } ] } }, { "name": "error", "required": false, "schema": { "type": "object", "properties": [ { "name": "code", "required": false, "schema": { "type": "integer" } }, { "name": "message", "required": false, "schema": { "type": "string" } }, { "name": "data", "required": false, "schema": { "type": "object" } } ] } } ], "refName": "JsonRpcResponse" } ``` --- ## NEAR Protocol RPC: View global contract code by account - HTML path: https://docs.fastnear.com/rpcs/contract/view_global_contract_code_by_account_id - Markdown path: https://docs.fastnear.com/rpcs/contract/view_global_contract_code_by_account_id.md # NEAR Protocol RPC: View global contract code by account View global contract code by account Look up a global contract's WebAssembly bytes by the account that registered it. ## Source links - https://docs.fastnear.com/rpcs/contract/view_global_contract_code_by_account_id - https://docs.fastnear.com/rpcs/contract/view_global_contract_code_by_account_id/other/view_global_contract_code_by_account_id - https://docs.fastnear.com/reference/operation/view_global_contract_code_by_account_id ## Operation - Transport: json-rpc - Method: POST - Path: `/` - Source spec: `rpcs/contract/view_global_contract_code_by_account_id.yaml` ## Networks - Mainnet: https://rpc.mainnet.fastnear.com/ - Testnet: https://rpc.testnet.fastnear.com/ ## Auth - API key via query `apiKey`: The OpenAPI contract describes the FastNEAR API key as a query parameter named apiKey. - This export intentionally omits any locally saved credentials ## Current request - Network: Mainnet - Finality: final - Endpoint: https://rpc.mainnet.fastnear.com/ ### Request body ```json { "jsonrpc": "2.0", "id": "fastnear", "method": "query", "params": { "account_id": "global-contract.nfts.tg", "request_type": "view_global_contract_code_by_account_id", "finality": "final" } } ``` ## Request reference ### Active example ```json { "body": { "jsonrpc": "2.0", "id": "fastnear", "method": "query", "params": { "account_id": "global-contract.nfts.tg", "request_type": "view_global_contract_code_by_account_id", "finality": "final" } }, "headers": {}, "path": {}, "query": {} } ``` ### Inputs - `account_id` (body, required, string): NEAR account ID ### Request schema ```json { "type": "object", "required": [ "jsonrpc", "id", "method", "params" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "type": "string", "example": "fastnear" } }, { "name": "method", "required": true, "schema": { "type": "string", "enum": [ "query" ] } }, { "name": "params", "required": true, "schema": { "type": "object", "required": [ "request_type", "account_id", "finality" ], "properties": [ { "name": "account_id", "required": true, "schema": { "type": "string", "description": "NEAR account ID" } }, { "name": "request_type", "required": true, "schema": { "type": "string", "enum": [ "view_global_contract_code_by_account_id" ] } }, { "name": "finality", "required": true, "schema": { "type": "string", "description": "Block finality", "enum": [ "final", "near-final", "optimistic" ] } } ] } } ] } ``` ## Response reference - Status: 200 - Media type: application/json - Summary: Successful response ### Response schema ```json { "type": "object", "required": [ "jsonrpc", "id" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "oneOf": [ { "type": "string" }, { "type": "number" } ] } }, { "name": "result", "required": false, "schema": { "type": "object", "description": "A view of the contract code.", "required": [ "code_base64", "hash" ], "properties": [ { "name": "code_base64", "required": true, "schema": { "type": "string" } }, { "name": "hash", "required": true, "schema": { "type": "string", "description": "Base58-encoded hash" } } ] } }, { "name": "error", "required": false, "schema": { "type": "object", "properties": [ { "name": "code", "required": false, "schema": { "type": "integer" } }, { "name": "message", "required": false, "schema": { "type": "string" } }, { "name": "data", "required": false, "schema": { "type": "object" } } ] } } ], "refName": "JsonRpcResponse" } ``` --- ## NEAR Protocol RPC: View contract state - HTML path: https://docs.fastnear.com/rpcs/contract/view_state - Markdown path: https://docs.fastnear.com/rpcs/contract/view_state.md # NEAR Protocol RPC: View contract state View contract state Fetch the raw key-value state a contract has written, optionally filtered by key prefix. ## Source links - https://docs.fastnear.com/rpcs/contract/view_state - https://docs.fastnear.com/rpcs/contract/view_state/other/view_state - https://docs.fastnear.com/reference/operation/view_state ## Operation - Transport: json-rpc - Method: POST - Path: `/` - Source spec: `rpcs/contract/view_state.yaml` ## Networks - Mainnet: https://rpc.mainnet.fastnear.com/ - Testnet: https://rpc.testnet.fastnear.com/ ## Auth - API key via query `apiKey`: The OpenAPI contract describes the FastNEAR API key as a query parameter named apiKey. - This export intentionally omits any locally saved credentials ## Current request - Network: Mainnet - Finality: final - Endpoint: https://rpc.mainnet.fastnear.com/ ### Request body ```json { "jsonrpc": "2.0", "id": "fastnear", "method": "query", "params": { "request_type": "view_state", "finality": "final", "account_id": "lockup.near", "prefix_base64": "U1RBVEU=" } } ``` ## Request reference ### Active example ```json { "body": { "jsonrpc": "2.0", "id": "fastnear", "method": "query", "params": { "request_type": "view_state", "finality": "final", "account_id": "lockup.near", "prefix_base64": "U1RBVEU=" } }, "headers": {}, "path": {}, "query": {} } ``` ### Inputs - `account_id` (body, required, string): NEAR account ID - `include_proof` (body, boolean): Include a Merkle proof for the queried state alongside the values. - `prefix_base64` (body, required, string): Base64-encoded storage key prefix. Use an empty string (`""`) to remove the prefix filter and return all matching contract state values. Large contracts can produce very large responses when no prefix is set. ### Request schema ```json { "type": "object", "required": [ "jsonrpc", "id", "method", "params" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "type": "string", "example": "fastnear" } }, { "name": "method", "required": true, "schema": { "type": "string", "enum": [ "query" ] } }, { "name": "params", "required": true, "schema": { "type": "object", "required": [ "request_type", "account_id", "prefix_base64", "finality" ], "properties": [ { "name": "account_id", "required": true, "schema": { "type": "string", "description": "NEAR account ID" } }, { "name": "include_proof", "required": false, "schema": { "type": "boolean", "description": "Include a Merkle proof for the queried state alongside the values." } }, { "name": "prefix_base64", "required": true, "schema": { "type": "string", "description": "Base64-encoded storage key prefix. Use an empty string (`\"\"`) to remove the prefix filter and return all matching contract state values. Large contracts can produce very large responses when no prefix is set." } }, { "name": "request_type", "required": true, "schema": { "type": "string", "enum": [ "view_state" ] } }, { "name": "finality", "required": true, "schema": { "type": "string", "description": "Block finality", "enum": [ "final", "near-final", "optimistic" ] } } ] } } ] } ``` ## Response reference - Status: 200 - Media type: application/json - Summary: Successful response ### Response schema ```json { "type": "object", "required": [ "jsonrpc", "id" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "oneOf": [ { "type": "string" }, { "type": "number" } ] } }, { "name": "result", "required": false, "schema": { "type": "object", "description": "Resulting state values for a view state query request", "required": [ "values" ], "properties": [ { "name": "proof", "required": false, "schema": { "type": "array", "items": { "type": "string" } } }, { "name": "values", "required": true, "schema": { "type": "array", "items": { "type": "object", "description": "Item of the state, key and value are serialized in base64 and proof for inclusion of given state item." } } } ] } }, { "name": "error", "required": false, "schema": { "type": "object", "properties": [ { "name": "code", "required": false, "schema": { "type": "integer" } }, { "name": "message", "required": false, "schema": { "type": "string" } }, { "name": "data", "required": false, "schema": { "type": "object" } } ] } } ], "refName": "JsonRpcResponse" } ``` --- ## NEAR Protocol RPC: Get state changes - HTML path: https://docs.fastnear.com/rpcs/protocol/changes - Markdown path: https://docs.fastnear.com/rpcs/protocol/changes.md # NEAR Protocol RPC: Get state changes Get state changes Fetch detailed state changes in a block — filter by account, key prefix, or change type. ## Source links - https://docs.fastnear.com/rpcs/protocol/changes - https://docs.fastnear.com/rpcs/protocol/changes/other/changes - https://docs.fastnear.com/reference/operation/changes ## Operation - Transport: json-rpc - Method: POST - Path: `/` - Source spec: `rpcs/protocol/changes.yaml` ## Networks - Mainnet: https://rpc.mainnet.fastnear.com/ - Testnet: https://rpc.testnet.fastnear.com/ ## Auth - API key via query `apiKey`: The OpenAPI contract describes the FastNEAR API key as a query parameter named apiKey. - This export intentionally omits any locally saved credentials ## Current request - Network: Mainnet - Finality: final - Endpoint: https://rpc.mainnet.fastnear.com/ ### Request body ```json { "jsonrpc": "2.0", "id": "fastnear", "method": "changes", "params": { "finality": "final", "changes_type": "account_changes", "account_ids": [ "root.near" ] } } ``` ## Request reference ### Active example ```json { "body": { "jsonrpc": "2.0", "id": "fastnear", "method": "changes", "params": { "finality": "final", "changes_type": "account_changes", "account_ids": [ "root.near" ] } }, "headers": {}, "path": {}, "query": {} } ``` ### Request schema ```json { "type": "object", "required": [ "jsonrpc", "id", "method", "params" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "type": "string", "example": "fastnear" } }, { "name": "method", "required": true, "schema": { "type": "string", "enum": [ "changes" ] } }, { "name": "params", "required": true, "schema": { "type": "object", "description": "One of multiple possible types" } } ] } ``` ## Response reference - Status: 200 - Media type: application/json - Summary: Successful response ### Response schema ```json { "type": "object", "required": [ "jsonrpc", "id" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "oneOf": [ { "type": "string" }, { "type": "number" } ] } }, { "name": "result", "required": false, "schema": { "type": "object", "required": [ "block_hash", "changes" ], "properties": [ { "name": "block_hash", "required": true, "schema": { "type": "string", "description": "Base58-encoded hash" } }, { "name": "changes", "required": true, "schema": { "type": "array", "items": { "type": "object", "required": [ "cause" ], "properties": [ { "name": "cause", "required": true, "schema": { "type": "object", "description": "One of multiple possible types" } } ] } } } ] } }, { "name": "error", "required": false, "schema": { "type": "object", "properties": [ { "name": "code", "required": false, "schema": { "type": "integer" } }, { "name": "message", "required": false, "schema": { "type": "string" } }, { "name": "data", "required": false, "schema": { "type": "object" } } ] } } ], "refName": "JsonRpcResponse" } ``` --- ## NEAR Protocol RPC: Get chunk by block and shard - HTML path: https://docs.fastnear.com/rpcs/protocol/chunk_by_block_shard - Markdown path: https://docs.fastnear.com/rpcs/protocol/chunk_by_block_shard.md # NEAR Protocol RPC: Get chunk by block and shard Get chunk by block and shard Fetch a single chunk's transactions and receipts by its parent block plus shard index. ## Source links - https://docs.fastnear.com/rpcs/protocol/chunk_by_block_shard - https://docs.fastnear.com/rpcs/protocol/chunk_by_block_shard/other/chunk_by_block_shard - https://docs.fastnear.com/reference/operation/chunk_by_block_shard ## Operation - Transport: json-rpc - Method: POST - Path: `/` - Source spec: `rpcs/protocol/chunk_by_block_shard.yaml` ## Networks - Mainnet: https://rpc.mainnet.fastnear.com/ - Testnet: https://rpc.testnet.fastnear.com/ ## Auth - API key via query `apiKey`: The OpenAPI contract describes the FastNEAR API key as a query parameter named apiKey. - This export intentionally omits any locally saved credentials ## Current request - Network: Mainnet - Finality: final - Endpoint: https://rpc.mainnet.fastnear.com/ ### Request body ```json { "jsonrpc": "2.0", "id": "fastnear", "method": "chunk", "params": { "block_id": "9XN7MtDywZvfGx6TKy1MT2iCZkKuHikJXmNazxdZ4x6T", "shard_id": 10 } } ``` ## Request reference ### Active example ```json { "body": { "jsonrpc": "2.0", "id": "fastnear", "method": "chunk", "params": { "block_id": "9XN7MtDywZvfGx6TKy1MT2iCZkKuHikJXmNazxdZ4x6T", "shard_id": 10 } }, "headers": {}, "path": {}, "query": {} } ``` ### Inputs - `block_id` (body, required, integer | string): Block height (integer) or block hash (string) - `shard_id` (body, required, integer): Shard identifier ### Request schema ```json { "type": "object", "required": [ "jsonrpc", "id", "method", "params" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "type": "string", "example": "fastnear" } }, { "name": "method", "required": true, "schema": { "type": "string", "enum": [ "chunk" ] } }, { "name": "params", "required": true, "schema": { "type": "object", "required": [ "block_id", "shard_id" ], "properties": [ { "name": "block_id", "required": true, "schema": { "description": "Block height (integer) or block hash (string)", "oneOf": [ { "type": "integer", "description": "Block height" }, { "type": "string", "description": "Base58-encoded block hash" } ] } }, { "name": "shard_id", "required": true, "schema": { "type": "integer", "description": "Shard identifier" } } ] } } ] } ``` ## Response reference - Status: 200 - Media type: application/json - Summary: Successful response ### Response schema ```json { "type": "object", "required": [ "jsonrpc", "id" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "oneOf": [ { "type": "string" }, { "type": "number" } ] } }, { "name": "result", "required": false, "schema": { "type": "object", "required": [ "author", "header", "transactions", "receipts" ], "properties": [ { "name": "author", "required": true, "schema": { "type": "string", "description": "NEAR account ID" } }, { "name": "header", "required": true, "schema": { "type": "object", "description": "Contains main info about the chunk.", "required": [ "chunk_hash", "prev_block_hash", "outcome_root", "prev_state_root", "encoded_merkle_root", "encoded_length", "height_created", "height_included", "shard_id", "gas_used", "gas_limit", "balance_burnt", "outgoing_receipts_root", "tx_root", "validator_proposals", "signature" ], "properties": [ { "name": "balance_burnt", "required": true, "schema": { "type": "string", "description": "Amount in yoctoNEAR" } }, { "name": "bandwidth_requests", "required": false, "schema": { "type": "object", "nullable": true, "description": "One of multiple possible types" } }, { "name": "chunk_hash", "required": true, "schema": { "type": "string", "description": "Base58-encoded hash" } }, { "name": "congestion_info", "required": false, "schema": { "type": "object", "nullable": true, "description": "Stores the congestion level of a shard. More info about congestion [here](https://near.github.io/nearcore/architecture/how/receipt-congestion.html?highlight=congestion#receipt-congestion)" } }, { "name": "encoded_length", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "encoded_merkle_root", "required": true, "schema": { "type": "string", "description": "Base58-encoded hash" } }, { "name": "gas_limit", "required": true, "schema": { "type": "string", "description": "Gas amount" } }, { "name": "gas_used", "required": true, "schema": { "type": "string", "description": "Gas amount" } }, { "name": "height_created", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "height_included", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "outcome_root", "required": true, "schema": { "type": "string", "description": "Base58-encoded hash" } }, { "name": "outgoing_receipts_root", "required": true, "schema": { "type": "string", "description": "Base58-encoded hash" } }, { "name": "prev_block_hash", "required": true, "schema": { "type": "string", "description": "Base58-encoded hash" } }, { "name": "prev_state_root", "required": true, "schema": { "type": "string", "description": "Base58-encoded hash" } }, { "name": "rent_paid", "required": false, "schema": { "type": "string", "description": "Amount in yoctoNEAR", "default": "0" } }, { "name": "shard_id", "required": true, "schema": { "type": "integer", "description": "Shard identifier" } }, { "name": "signature", "required": true, "schema": { "type": "string", "description": "Base58-encoded cryptographic signature" } }, { "name": "tx_root", "required": true, "schema": { "type": "string", "description": "Base58-encoded hash" } }, { "name": "validator_proposals", "required": true, "schema": { "type": "array", "items": { "type": "object" } } }, { "name": "validator_reward", "required": false, "schema": { "type": "string", "description": "Amount in yoctoNEAR", "default": "0" } } ] } }, { "name": "receipts", "required": true, "schema": { "type": "array", "items": { "type": "object" } } }, { "name": "transactions", "required": true, "schema": { "type": "array", "items": { "type": "object" } } } ] } }, { "name": "error", "required": false, "schema": { "type": "object", "properties": [ { "name": "code", "required": false, "schema": { "type": "integer" } }, { "name": "message", "required": false, "schema": { "type": "string" } }, { "name": "data", "required": false, "schema": { "type": "object" } } ] } } ], "refName": "JsonRpcResponse" } ``` --- ## NEAR Protocol RPC: Get chunk by hash - HTML path: https://docs.fastnear.com/rpcs/protocol/chunk_by_hash - Markdown path: https://docs.fastnear.com/rpcs/protocol/chunk_by_hash.md # NEAR Protocol RPC: Get chunk by hash Get chunk by hash Fetch a single chunk's transactions and receipts by its Base58 content hash. ## Source links - https://docs.fastnear.com/rpcs/protocol/chunk_by_hash - https://docs.fastnear.com/rpcs/protocol/chunk_by_hash/other/chunk_by_hash - https://docs.fastnear.com/reference/operation/chunk_by_hash ## Operation - Transport: json-rpc - Method: POST - Path: `/` - Source spec: `rpcs/protocol/chunk_by_hash.yaml` ## Networks - Mainnet: https://rpc.mainnet.fastnear.com/ - Testnet: https://rpc.testnet.fastnear.com/ ## Auth - API key via query `apiKey`: The OpenAPI contract describes the FastNEAR API key as a query parameter named apiKey. - This export intentionally omits any locally saved credentials ## Current request - Network: Mainnet - Finality: final - Endpoint: https://rpc.mainnet.fastnear.com/ ### Request body ```json { "jsonrpc": "2.0", "id": "fastnear", "method": "chunk", "params": { "chunk_id": "349Wr5HMm2Bvyy8GuhExAZ4F353tXCChx1FfAsYnQTAn" } } ``` ## Request reference ### Active example ```json { "body": { "jsonrpc": "2.0", "id": "fastnear", "method": "chunk", "params": { "chunk_id": "349Wr5HMm2Bvyy8GuhExAZ4F353tXCChx1FfAsYnQTAn" } }, "headers": {}, "path": {}, "query": {} } ``` ### Inputs - `chunk_id` (body, required, string): Base58-encoded chunk hash ### Request schema ```json { "type": "object", "required": [ "jsonrpc", "id", "method", "params" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "type": "string", "example": "fastnear" } }, { "name": "method", "required": true, "schema": { "type": "string", "enum": [ "chunk" ] } }, { "name": "params", "required": true, "schema": { "type": "object", "required": [ "chunk_id" ], "properties": [ { "name": "chunk_id", "required": true, "schema": { "type": "string", "description": "Base58-encoded chunk hash" } } ] } } ] } ``` ## Response reference - Status: 200 - Media type: application/json - Summary: Successful response ### Response schema ```json { "type": "object", "required": [ "jsonrpc", "id" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "oneOf": [ { "type": "string" }, { "type": "number" } ] } }, { "name": "result", "required": false, "schema": { "type": "object", "required": [ "author", "header", "transactions", "receipts" ], "properties": [ { "name": "author", "required": true, "schema": { "type": "string", "description": "NEAR account ID" } }, { "name": "header", "required": true, "schema": { "type": "object", "description": "Contains main info about the chunk.", "required": [ "chunk_hash", "prev_block_hash", "outcome_root", "prev_state_root", "encoded_merkle_root", "encoded_length", "height_created", "height_included", "shard_id", "gas_used", "gas_limit", "balance_burnt", "outgoing_receipts_root", "tx_root", "validator_proposals", "signature" ], "properties": [ { "name": "balance_burnt", "required": true, "schema": { "type": "string", "description": "Amount in yoctoNEAR" } }, { "name": "bandwidth_requests", "required": false, "schema": { "type": "object", "nullable": true, "description": "One of multiple possible types" } }, { "name": "chunk_hash", "required": true, "schema": { "type": "string", "description": "Base58-encoded hash" } }, { "name": "congestion_info", "required": false, "schema": { "type": "object", "nullable": true, "description": "Stores the congestion level of a shard. More info about congestion [here](https://near.github.io/nearcore/architecture/how/receipt-congestion.html?highlight=congestion#receipt-congestion)" } }, { "name": "encoded_length", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "encoded_merkle_root", "required": true, "schema": { "type": "string", "description": "Base58-encoded hash" } }, { "name": "gas_limit", "required": true, "schema": { "type": "string", "description": "Gas amount" } }, { "name": "gas_used", "required": true, "schema": { "type": "string", "description": "Gas amount" } }, { "name": "height_created", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "height_included", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "outcome_root", "required": true, "schema": { "type": "string", "description": "Base58-encoded hash" } }, { "name": "outgoing_receipts_root", "required": true, "schema": { "type": "string", "description": "Base58-encoded hash" } }, { "name": "prev_block_hash", "required": true, "schema": { "type": "string", "description": "Base58-encoded hash" } }, { "name": "prev_state_root", "required": true, "schema": { "type": "string", "description": "Base58-encoded hash" } }, { "name": "rent_paid", "required": false, "schema": { "type": "string", "description": "Amount in yoctoNEAR", "default": "0" } }, { "name": "shard_id", "required": true, "schema": { "type": "integer", "description": "Shard identifier" } }, { "name": "signature", "required": true, "schema": { "type": "string", "description": "Base58-encoded cryptographic signature" } }, { "name": "tx_root", "required": true, "schema": { "type": "string", "description": "Base58-encoded hash" } }, { "name": "validator_proposals", "required": true, "schema": { "type": "array", "items": { "type": "object" } } }, { "name": "validator_reward", "required": false, "schema": { "type": "string", "description": "Amount in yoctoNEAR", "default": "0" } } ] } }, { "name": "receipts", "required": true, "schema": { "type": "array", "items": { "type": "object" } } }, { "name": "transactions", "required": true, "schema": { "type": "array", "items": { "type": "object" } } } ] } }, { "name": "error", "required": false, "schema": { "type": "object", "properties": [ { "name": "code", "required": false, "schema": { "type": "integer" } }, { "name": "message", "required": false, "schema": { "type": "string" } }, { "name": "data", "required": false, "schema": { "type": "object" } } ] } } ], "refName": "JsonRpcResponse" } ``` --- ## NEAR Protocol RPC: Get client config - HTML path: https://docs.fastnear.com/rpcs/protocol/client_config - Markdown path: https://docs.fastnear.com/rpcs/protocol/client_config.md # NEAR Protocol RPC: Get client config Get client config Fetch the node's own local client config — timeouts, retry settings, and operator-chosen parameters. ## Source links - https://docs.fastnear.com/rpcs/protocol/client_config - https://docs.fastnear.com/rpcs/protocol/client_config/other/client_config - https://docs.fastnear.com/reference/operation/client_config ## Operation - Transport: json-rpc - Method: POST - Path: `/` - Source spec: `rpcs/protocol/client_config.yaml` ## Networks - Mainnet: https://rpc.mainnet.fastnear.com/ - Testnet: https://rpc.testnet.fastnear.com/ ## Auth - API key via query `apiKey`: The OpenAPI contract describes the FastNEAR API key as a query parameter named apiKey. - This export intentionally omits any locally saved credentials ## Current request - Network: Mainnet - Finality: final - Endpoint: https://rpc.mainnet.fastnear.com/ ### Request body ```json { "jsonrpc": "2.0", "id": "fastnear", "method": "client_config", "params": [] } ``` ## Request reference ### Active example ```json { "body": { "jsonrpc": "2.0", "id": "fastnear", "method": "client_config", "params": [] }, "headers": {}, "path": {}, "query": {} } ``` ### Request schema ```json { "type": "object", "required": [ "jsonrpc", "id", "method", "params" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "type": "string", "example": "fastnear" } }, { "name": "method", "required": true, "schema": { "type": "string", "enum": [ "client_config" ] } }, { "name": "params", "required": true, "schema": { "type": "array", "description": "Empty array as this method takes no parameters", "example": [] } } ] } ``` ## Response reference - Status: 200 - Media type: application/json - Summary: Successful response ### Response schema ```json { "type": "object", "required": [ "jsonrpc", "id" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "oneOf": [ { "type": "string" }, { "type": "number" } ] } }, { "name": "result", "required": false, "schema": { "type": "object", "description": "ClientConfig where some fields can be updated at runtime.", "properties": [ { "name": "archive", "required": false, "schema": { "type": "boolean", "description": "Not clear old data, set `true` for archive nodes." } }, { "name": "block_fetch_horizon", "required": false, "schema": { "type": "integer", "description": "Horizon at which instead of fetching block, fetch full state.", "format": "uint64" } }, { "name": "block_header_fetch_horizon", "required": false, "schema": { "type": "integer", "description": "Behind this horizon header fetch kicks in.", "format": "uint64" } }, { "name": "block_production_tracking_delay", "required": false, "schema": { "type": "array", "description": "Duration to check for producing / skipping block.", "items": { "type": "integer", "format": "uint64" } } }, { "name": "catchup_step_period", "required": false, "schema": { "type": "array", "description": "Time between check to perform catchup.", "items": { "type": "integer", "format": "uint64" } } }, { "name": "chain_id", "required": false, "schema": { "type": "string", "description": "Chain id for status." } }, { "name": "chunk_distribution_network", "required": false, "schema": { "type": "object", "nullable": true, "description": "Config for the Chunk Distribution Network feature.\nThis allows nodes to push and pull chunks from a central stream.\nThe two benefits of this approach are: (1) less request/response traffic\non the peer-to-peer network and (2) lower latency for RPC nodes indexing the chain.", "properties": [ { "name": "enabled", "required": false, "schema": { "type": "boolean" } }, { "name": "uris", "required": false, "schema": { "type": "object", "description": "URIs for the Chunk Distribution Network feature." } } ] } }, { "name": "chunk_request_retry_period", "required": false, "schema": { "type": "array", "description": "Time between checking to re-request chunks.", "items": { "type": "integer", "format": "uint64" } } }, { "name": "chunk_validation_threads", "required": false, "schema": { "type": "integer", "description": "Number of threads for ChunkValidationActor pool.", "format": "uint" } }, { "name": "chunk_wait_mult", "required": false, "schema": { "type": "array", "description": "Multiplier for the wait time for all chunks to be received.", "items": { "type": "integer", "format": "int32" } } }, { "name": "chunks_cache_height_horizon", "required": false, "schema": { "type": "integer", "description": "Height horizon for the chunk cache. A chunk is removed from the cache\nif its height + chunks_cache_height_horizon < largest_seen_height.\nThe default value is DEFAULT_CHUNKS_CACHE_HEIGHT_HORIZON.", "format": "uint64" } }, { "name": "client_background_migration_threads", "required": false, "schema": { "type": "integer", "description": "Number of threads to execute background migration work in client.", "format": "uint" } }, { "name": "cloud_archival_writer", "required": false, "schema": { "type": "object", "nullable": true, "description": "Configuration for a cloud-based archival writer. If this config is present, the writer is enabled and\nwrites chunk-related data based on the tracked shards. This config also controls additional archival\nbehavior such as block data and polling interval.", "properties": [ { "name": "archive_block_data", "required": false, "schema": { "type": "boolean", "description": "Determines whether block-related data should be written to cloud storage.", "default": false } }, { "name": "polling_interval", "required": false, "schema": { "type": "object", "description": "Interval at which the system checks for new blocks or chunks to archive.", "default": { "nanos": 0, "secs": 1 } } } ] } }, { "name": "disable_tx_routing", "required": false, "schema": { "type": "boolean", "description": "If true, the node won't forward transactions to next the chunk producers." } }, { "name": "doomslug_step_period", "required": false, "schema": { "type": "array", "description": "Time between running doomslug timer.", "items": { "type": "integer", "format": "uint64" } } }, { "name": "enable_early_prepare_transactions", "required": false, "schema": { "type": "boolean", "description": "If true, transactions for the next chunk will be prepared early, right after the previous chunk's\npost-state is ready. This can help produce chunks faster, for high-throughput chains.\nThe current implementation increases latency on low-load chains, which will be fixed in the future.\nThe default is disabled." } }, { "name": "enable_multiline_logging", "required": false, "schema": { "type": "boolean" } }, { "name": "enable_statistics_export", "required": false, "schema": { "type": "boolean", "description": "Re-export storage layer statistics as prometheus metrics." } }, { "name": "epoch_length", "required": false, "schema": { "type": "integer", "description": "Epoch length.", "format": "uint64" } }, { "name": "epoch_sync", "required": false, "schema": { "type": "object", "description": "Options for epoch sync.", "properties": [ { "name": "epoch_sync_horizon_num_epochs", "required": false, "schema": { "type": "integer", "description": "Number of epochs behind the network head beyond which the node will use\nepoch sync instead of header sync. At the consumption site, this is\nmultiplied by epoch_length to get the horizon in blocks.", "format": "uint64", "default": 2 } }, { "name": "timeout_for_epoch_sync", "required": false, "schema": { "type": "object", "description": "Timeout for epoch sync requests. The node will continue retrying indefinitely even\nif this timeout is exceeded." } } ] } }, { "name": "expected_shutdown", "required": false, "schema": { "type": "string", "description": "Graceful shutdown at expected block height." } }, { "name": "gc", "required": false, "schema": { "type": "object", "description": "Configuration for garbage collection.", "properties": [ { "name": "gc_blocks_limit", "required": false, "schema": { "type": "integer", "description": "Maximum number of blocks to garbage collect at every garbage collection\ncall.", "format": "uint64", "default": 2 } }, { "name": "gc_fork_clean_step", "required": false, "schema": { "type": "integer", "description": "Maximum number of height to go through at each garbage collection step\nwhen cleaning forks during garbage collection.", "format": "uint64", "default": 100 } }, { "name": "gc_num_epochs_to_keep", "required": false, "schema": { "type": "integer", "description": "Number of epochs for which we keep store data.", "format": "uint64", "default": 5 } }, { "name": "gc_step_period", "required": false, "schema": { "type": "object", "description": "How often gc should be run", "default": { "nanos": 500000000, "secs": 0 } } } ] } }, { "name": "header_sync_expected_height_per_second", "required": false, "schema": { "type": "integer", "description": "Expected increase of header head height per second during header sync", "format": "uint64" } }, { "name": "header_sync_initial_timeout", "required": false, "schema": { "type": "array", "description": "How much time to wait after initial header sync", "items": { "type": "integer", "format": "uint64" } } }, { "name": "header_sync_progress_timeout", "required": false, "schema": { "type": "array", "description": "How much time to wait after some progress is made in header sync", "items": { "type": "integer", "format": "uint64" } } }, { "name": "header_sync_stall_ban_timeout", "required": false, "schema": { "type": "array", "description": "How much time to wait before banning a peer in header sync if sync is too slow", "items": { "type": "integer", "format": "uint64" } } }, { "name": "log_summary_period", "required": false, "schema": { "type": "array", "description": "Period between logging summary information.", "items": { "type": "integer", "format": "uint64" } } }, { "name": "log_summary_style", "required": false, "schema": { "type": "string", "description": "Enable coloring of the logs", "enum": [ "plain", "colored" ] } }, { "name": "max_block_production_delay", "required": false, "schema": { "type": "array", "description": "Maximum wait for approvals before producing block.", "items": { "type": "integer", "format": "uint64" } } }, { "name": "max_block_wait_delay", "required": false, "schema": { "type": "array", "description": "Maximum duration before skipping given height.", "items": { "type": "integer", "format": "uint64" } } }, { "name": "max_gas_burnt_view", "required": false, "schema": { "type": "string", "nullable": true, "description": "Gas amount" } }, { "name": "min_block_production_delay", "required": false, "schema": { "type": "array", "description": "Minimum duration before producing block.", "items": { "type": "integer", "format": "uint64" } } }, { "name": "min_num_peers", "required": false, "schema": { "type": "integer", "description": "Minimum number of peers to start syncing.", "format": "uint" } }, { "name": "num_block_producer_seats", "required": false, "schema": { "type": "integer", "description": "Number of block producer seats", "format": "uint64" } }, { "name": "orphan_state_witness_max_size", "required": false, "schema": { "type": "integer", "description": "Maximum size of state witnesses in the OrphanStateWitnessPool.\nWe keep only orphan witnesses which are smaller than this size.\nThis limits the maximum memory usage of OrphanStateWitnessPool.", "format": "uint64" } }, { "name": "orphan_state_witness_pool_size", "required": false, "schema": { "type": "integer", "description": "OrphanStateWitnessPool keeps instances of ChunkStateWitness which can't be processed\nbecause the previous block isn't available. The witnesses wait in the pool until the\nrequired block appears. This variable controls how many witnesses can be stored in the pool.", "format": "uint" } }, { "name": "produce_chunk_add_transactions_time_limit", "required": false, "schema": { "type": "string", "description": "Limit the time of adding transactions to a chunk.\nA node produces a chunk by adding transactions from the transaction pool until\nsome limit is reached. This time limit ensures that adding transactions won't take\nlonger than the specified duration, which helps to produce the chunk quickly." } }, { "name": "produce_empty_blocks", "required": false, "schema": { "type": "boolean", "description": "Produce empty blocks, use `false` for testing." } }, { "name": "protocol_version_check", "required": false, "schema": { "type": "string", "description": "Configures whether the node checks the next or the next next epoch for network version compatibility.", "enum": [ "Next", "NextNext" ] } }, { "name": "resharding_config", "required": false, "schema": { "type": "string" } }, { "name": "rpc_addr", "required": false, "schema": { "type": "string", "nullable": true, "description": "Listening rpc port for status." } }, { "name": "save_invalid_witnesses", "required": false, "schema": { "type": "boolean", "description": "Save observed instances of invalid ChunkStateWitness to the database in DBCol::InvalidChunkStateWitnesses.\nSaving invalid witnesses is useful for analysis and debugging.\nThis option can cause extra load on the database and is not recommended for production use." } }, { "name": "save_latest_witnesses", "required": false, "schema": { "type": "boolean", "description": "Save observed instances of ChunkStateWitness to the database in DBCol::LatestChunkStateWitnesses.\nSaving the latest witnesses is useful for analysis and debugging.\nThis option can cause extra load on the database and is not recommended for production use." } }, { "name": "save_state_changes", "required": false, "schema": { "type": "boolean", "description": "Whether to persist state changes on disk or not." } }, { "name": "save_trie_changes", "required": false, "schema": { "type": "boolean", "description": "save_trie_changes should be set to true iff\n- archive if false - non-archival nodes need trie changes to perform garbage collection\n- archive is true, cold_store is configured and migration to split_storage is finished - node\nworking in split storage mode needs trie changes in order to do garbage collection on hot." } }, { "name": "save_tx_outcomes", "required": false, "schema": { "type": "boolean", "description": "Whether to persist transaction outcomes to disk or not." } }, { "name": "save_untracked_partial_chunks_parts", "required": false, "schema": { "type": "boolean", "description": "Whether to persist partial chunk parts for untracked shards or not." } }, { "name": "skip_sync_wait", "required": false, "schema": { "type": "boolean", "description": "Skip waiting for sync (for testing or single node testnet)." } }, { "name": "state_request_server_threads", "required": false, "schema": { "type": "integer", "description": "Number of threads for StateRequestActor pool.", "format": "uint" } }, { "name": "state_request_throttle_period", "required": false, "schema": { "type": "array", "description": "Number of seconds between state requests for view client.\nThrottling window for state requests (headers and parts).", "items": { "type": "integer", "format": "uint64" } } }, { "name": "state_requests_per_throttle_period", "required": false, "schema": { "type": "integer", "description": "Maximum number of state requests served per throttle period", "format": "uint" } }, { "name": "state_sync", "required": false, "schema": { "type": "object", "description": "Options for syncing state.", "properties": [ { "name": "concurrency", "required": false, "schema": { "type": "object" } }, { "name": "dump", "required": false, "schema": { "type": "object", "nullable": true, "description": "Configures how to dump state to external storage." } }, { "name": "parts_compression_lvl", "required": false, "schema": { "type": "integer", "description": "Zstd compression level for state parts.", "format": "int32", "default": 1 } }, { "name": "sync", "required": false, "schema": { "type": "string", "nullable": true, "description": "Syncs state from the peers without reading anything from external storage.", "enum": [ "Peers" ] } } ] } }, { "name": "state_sync_enabled", "required": false, "schema": { "type": "boolean", "description": "Whether to use the State Sync mechanism.\nIf disabled, the node will do Block Sync instead of State Sync." } }, { "name": "state_sync_external_backoff", "required": false, "schema": { "type": "array", "description": "Additional waiting period after a failed request to external storage", "items": { "type": "integer", "format": "uint64" } } }, { "name": "state_sync_external_timeout", "required": false, "schema": { "type": "array", "description": "How long to wait for a response from centralized state sync", "items": { "type": "integer", "format": "uint64" } } }, { "name": "state_sync_p2p_timeout", "required": false, "schema": { "type": "array", "description": "How long to wait for a response from p2p state sync", "items": { "type": "integer", "format": "uint64" } } }, { "name": "state_sync_retry_backoff", "required": false, "schema": { "type": "array", "description": "How long to wait after a failed state sync request", "items": { "type": "integer", "format": "uint64" } } }, { "name": "sync_check_period", "required": false, "schema": { "type": "array", "description": "How often to check that we are not out of sync.", "items": { "type": "integer", "format": "uint64" } } }, { "name": "sync_height_threshold", "required": false, "schema": { "type": "integer", "description": "Sync height threshold: below this difference in height don't start syncing.", "format": "uint64" } }, { "name": "sync_max_block_requests", "required": false, "schema": { "type": "integer", "description": "Maximum number of block requests to send to peers to sync", "format": "uint" } }, { "name": "sync_step_period", "required": false, "schema": { "type": "array", "description": "While syncing, how long to check for each step.", "items": { "type": "integer", "format": "uint64" } } }, { "name": "tracked_shards_config", "required": false, "schema": { "type": "object", "description": "One of multiple possible types" } }, { "name": "transaction_pool_size_limit", "required": false, "schema": { "type": "integer", "nullable": true, "description": "Limit of the size of per-shard transaction pool measured in bytes. If not set, the size\nwill be unbounded.", "format": "uint64" } }, { "name": "transaction_request_handler_threads", "required": false, "schema": { "type": "integer", "format": "uint" } }, { "name": "trie_viewer_state_size_limit", "required": false, "schema": { "type": "integer", "nullable": true, "description": "Upper bound of the byte size of contract state that is still viewable. None is no limit", "format": "uint64" } }, { "name": "ttl_account_id_router", "required": false, "schema": { "type": "array", "description": "Time to persist Accounts Id in the router without removing them.", "items": { "type": "integer", "format": "uint64" } } }, { "name": "tx_routing_height_horizon", "required": false, "schema": { "type": "integer", "description": "If the node is not a chunk producer within that many blocks, then route\nto upcoming chunk producers.", "format": "uint64" } }, { "name": "version", "required": false, "schema": { "type": "object", "description": "Data structure for semver version and github tag or commit.", "required": [ "version", "build", "commit" ], "properties": [ { "name": "build", "required": true, "schema": { "type": "string" } }, { "name": "commit", "required": true, "schema": { "type": "string" } }, { "name": "rustc_version", "required": false, "schema": { "type": "string", "default": "" } }, { "name": "version", "required": true, "schema": { "type": "string" } } ] } }, { "name": "view_client_threads", "required": false, "schema": { "type": "integer", "description": "Number of threads for ViewClientActor pool.", "format": "uint" } }, { "name": "dynamic_resharding_dry_run", "required": false, "schema": { "type": "boolean", "description": "If true, the runtime will do a dynamic resharding 'dry run' at the last block of each epoch.\nThis means calculating tentative boundary accounts for splitting the tracked shards." } } ] } }, { "name": "error", "required": false, "schema": { "type": "object", "properties": [ { "name": "code", "required": false, "schema": { "type": "integer" } }, { "name": "message", "required": false, "schema": { "type": "string" } }, { "name": "data", "required": false, "schema": { "type": "object" } } ] } } ], "refName": "JsonRpcResponse" } ``` --- ## NEAR Protocol RPC: Get congestion level - HTML path: https://docs.fastnear.com/rpcs/protocol/EXPERIMENTAL_congestion_level - Markdown path: https://docs.fastnear.com/rpcs/protocol/EXPERIMENTAL_congestion_level.md # NEAR Protocol RPC: Get congestion level Get congestion level Measure a single shard's congestion pressure at a chosen block — a 0.0-to-1.0 saturation score. ## Source links - https://docs.fastnear.com/rpcs/protocol/EXPERIMENTAL_congestion_level - https://docs.fastnear.com/rpcs/protocol/EXPERIMENTAL_congestion_level/other/EXPERIMENTAL_congestion_level - https://docs.fastnear.com/reference/operation/EXPERIMENTAL_congestion_level ## Operation - Transport: json-rpc - Method: POST - Path: `/` - Source spec: `rpcs/protocol/EXPERIMENTAL_congestion_level.yaml` ## Networks - Mainnet: https://rpc.mainnet.fastnear.com/ - Testnet: https://rpc.testnet.fastnear.com/ ## Auth - API key via query `apiKey`: The OpenAPI contract describes the FastNEAR API key as a query parameter named apiKey. - This export intentionally omits any locally saved credentials ## Current request - Network: Mainnet - Finality: final - Endpoint: https://rpc.mainnet.fastnear.com/ ### Request body ```json { "jsonrpc": "2.0", "id": "fastnear", "method": "EXPERIMENTAL_congestion_level", "params": { "block_id": "9XN7MtDywZvfGx6TKy1MT2iCZkKuHikJXmNazxdZ4x6T", "shard_id": 10 } } ``` ## Request reference ### Active example ```json { "body": { "jsonrpc": "2.0", "id": "fastnear", "method": "EXPERIMENTAL_congestion_level", "params": { "block_id": "9XN7MtDywZvfGx6TKy1MT2iCZkKuHikJXmNazxdZ4x6T", "shard_id": 10 } }, "headers": {}, "path": {}, "query": {} } ``` ### Inputs - `block_id` (body, required, integer | string): Block height (integer) or block hash (string) - `shard_id` (body, required, integer): Shard identifier ### Request schema ```json { "type": "object", "required": [ "jsonrpc", "id", "method", "params" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "type": "string", "example": "fastnear" } }, { "name": "method", "required": true, "schema": { "type": "string", "enum": [ "EXPERIMENTAL_congestion_level" ] } }, { "name": "params", "required": true, "schema": { "type": "object", "nullable": true, "required": [ "block_id", "shard_id" ], "properties": [ { "name": "block_id", "required": true, "schema": { "description": "Block height (integer) or block hash (string)", "oneOf": [ { "type": "integer", "description": "Block height" }, { "type": "string", "description": "Base58-encoded block hash" } ] } }, { "name": "shard_id", "required": true, "schema": { "type": "integer", "description": "Shard identifier" } } ] } } ] } ``` ## Response reference - Status: 200 - Media type: application/json - Summary: Successful response ### Response schema ```json { "type": "object", "required": [ "jsonrpc", "id" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "oneOf": [ { "type": "string" }, { "type": "number" } ] } }, { "name": "result", "required": false, "schema": { "type": "object", "required": [ "congestion_level" ], "properties": [ { "name": "congestion_level", "required": true, "schema": { "type": "number", "format": "double" } } ] } }, { "name": "error", "required": false, "schema": { "type": "object", "properties": [ { "name": "code", "required": false, "schema": { "type": "integer" } }, { "name": "message", "required": false, "schema": { "type": "string" } }, { "name": "data", "required": false, "schema": { "type": "object" } } ] } } ], "refName": "JsonRpcResponse" } ``` --- ## NEAR Protocol RPC: Get light client block proof - HTML path: https://docs.fastnear.com/rpcs/protocol/EXPERIMENTAL_light_client_block_proof - Markdown path: https://docs.fastnear.com/rpcs/protocol/EXPERIMENTAL_light_client_block_proof.md # NEAR Protocol RPC: Get light client block proof Get light client block proof Fetch a Merkle proof — by Base58 block and light-client-head hashes — that the block is included in the light client's verified chain. ## Source links - https://docs.fastnear.com/rpcs/protocol/EXPERIMENTAL_light_client_block_proof - https://docs.fastnear.com/rpcs/protocol/EXPERIMENTAL_light_client_block_proof/other/EXPERIMENTAL_light_client_block_proof - https://docs.fastnear.com/reference/operation/EXPERIMENTAL_light_client_block_proof ## Operation - Transport: json-rpc - Method: POST - Path: `/` - Source spec: `rpcs/protocol/EXPERIMENTAL_light_client_block_proof.yaml` ## Networks - Mainnet: https://rpc.mainnet.fastnear.com/ - Testnet: https://rpc.testnet.fastnear.com/ ## Auth - API key via query `apiKey`: The OpenAPI contract describes the FastNEAR API key as a query parameter named apiKey. - This export intentionally omits any locally saved credentials ## Current request - Network: Mainnet - Finality: final - Endpoint: https://rpc.mainnet.fastnear.com/ ### Request body ```json { "jsonrpc": "2.0", "id": "fastnear", "method": "EXPERIMENTAL_light_client_block_proof", "params": { "block_hash": "64utzv4G8AwNSxVnj23KPwU46VL435jQbQokbaYFtZ6V", "light_client_head": "9XN7MtDywZvfGx6TKy1MT2iCZkKuHikJXmNazxdZ4x6T" } } ``` ## Request reference ### Active example ```json { "body": { "jsonrpc": "2.0", "id": "fastnear", "method": "EXPERIMENTAL_light_client_block_proof", "params": { "block_hash": "64utzv4G8AwNSxVnj23KPwU46VL435jQbQokbaYFtZ6V", "light_client_head": "9XN7MtDywZvfGx6TKy1MT2iCZkKuHikJXmNazxdZ4x6T" } }, "headers": {}, "path": {}, "query": {} } ``` ### Inputs - `block_hash` (body, required, string): Base58-encoded hash - `light_client_head` (body, required, string): Base58-encoded hash ### Request schema ```json { "type": "object", "required": [ "jsonrpc", "id", "method", "params" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "type": "string", "example": "fastnear" } }, { "name": "method", "required": true, "schema": { "type": "string", "enum": [ "EXPERIMENTAL_light_client_block_proof" ] } }, { "name": "params", "required": true, "schema": { "type": "object", "required": [ "block_hash", "light_client_head" ], "properties": [ { "name": "block_hash", "required": true, "schema": { "type": "string", "description": "Base58-encoded hash" } }, { "name": "light_client_head", "required": true, "schema": { "type": "string", "description": "Base58-encoded hash" } } ] } } ] } ``` ## Response reference - Status: 200 - Media type: application/json - Summary: Successful response ### Response schema ```json { "type": "object", "required": [ "jsonrpc", "id" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "oneOf": [ { "type": "string" }, { "type": "number" } ] } }, { "name": "result", "required": false, "schema": { "type": "object", "required": [ "block_header_lite", "block_proof" ], "properties": [ { "name": "block_header_lite", "required": true, "schema": { "type": "object", "required": [ "prev_block_hash", "inner_rest_hash", "inner_lite" ], "properties": [ { "name": "inner_lite", "required": true, "schema": { "type": "object", "description": "A part of a state for the current head of a light client. More info [here](https://nomicon.io/ChainSpec/LightClient)." } }, { "name": "inner_rest_hash", "required": true, "schema": { "type": "string", "description": "Base58-encoded hash" } }, { "name": "prev_block_hash", "required": true, "schema": { "type": "string", "description": "Base58-encoded hash" } } ] } }, { "name": "block_proof", "required": true, "schema": { "type": "array", "items": { "type": "object" } } } ] } }, { "name": "error", "required": false, "schema": { "type": "object", "properties": [ { "name": "code", "required": false, "schema": { "type": "integer" } }, { "name": "message", "required": false, "schema": { "type": "string" } }, { "name": "data", "required": false, "schema": { "type": "object" } } ] } } ], "refName": "JsonRpcResponse" } ``` --- ## NEAR Protocol RPC: Get light client execution proof - HTML path: https://docs.fastnear.com/rpcs/protocol/EXPERIMENTAL_light_client_proof - Markdown path: https://docs.fastnear.com/rpcs/protocol/EXPERIMENTAL_light_client_proof.md # NEAR Protocol RPC: Get light client execution proof Get light client execution proof Fetch a Merkle proof of transaction or receipt inclusion by Base58 ID — the EXPERIMENTAL alias of `light_client_proof`. ## Source links - https://docs.fastnear.com/rpcs/protocol/EXPERIMENTAL_light_client_proof - https://docs.fastnear.com/rpcs/protocol/EXPERIMENTAL_light_client_proof/other/EXPERIMENTAL_light_client_proof - https://docs.fastnear.com/reference/operation/EXPERIMENTAL_light_client_proof ## Operation - Transport: json-rpc - Method: POST - Path: `/` - Source spec: `rpcs/protocol/EXPERIMENTAL_light_client_proof.yaml` ## Networks - Mainnet: https://rpc.mainnet.fastnear.com/ - Testnet: https://rpc.testnet.fastnear.com/ ## Auth - API key via query `apiKey`: The OpenAPI contract describes the FastNEAR API key as a query parameter named apiKey. - This export intentionally omits any locally saved credentials ## Current request - Network: Mainnet - Finality: final - Endpoint: https://rpc.mainnet.fastnear.com/ ### Request body ```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": "receipt" } } ``` ## Request reference ### Active example ```json { "body": { "jsonrpc": "2.0", "id": "fastnear", "method": "EXPERIMENTAL_light_client_proof", "params": { "light_client_head": "9XN7MtDywZvfGx6TKy1MT2iCZkKuHikJXmNazxdZ4x6T", "sender_id": "escrow.ai.near", "transaction_hash": "34E7weKCDqXh3xPKdBgSWRqo44yTWjbka9deMK8JbAxx", "type": "receipt" } }, "headers": {}, "path": {}, "query": {} } ``` ### Inputs - `light_client_head` (body, required, string): Base58-encoded hash - `sender_id` (body, string): NEAR account ID - `transaction_hash` (body, string): Base58-encoded hash - `type` (body, string): Proof subject — `receipt` proves inclusion of a specific receipt produced during execution. - `receipt_id` (body, string): Base58-encoded hash - `receiver_id` (body, string): NEAR account ID ### Request schema ```json { "type": "object", "required": [ "jsonrpc", "id", "method", "params" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "type": "string", "example": "fastnear" } }, { "name": "method", "required": true, "schema": { "type": "string", "enum": [ "EXPERIMENTAL_light_client_proof" ] } }, { "name": "params", "required": true, "schema": { "type": "object", "required": [ "light_client_head" ], "properties": [ { "name": "light_client_head", "required": true, "schema": { "type": "string", "description": "Base58-encoded hash" } }, { "name": "sender_id", "required": false, "schema": { "type": "string", "description": "NEAR account ID" } }, { "name": "transaction_hash", "required": false, "schema": { "type": "string", "description": "Base58-encoded hash" } }, { "name": "type", "required": false, "schema": { "type": "string", "description": "Proof subject — `receipt` proves inclusion of a specific receipt produced during execution.", "enum": [ "receipt" ] } }, { "name": "receipt_id", "required": false, "schema": { "type": "string", "description": "Base58-encoded hash" } }, { "name": "receiver_id", "required": false, "schema": { "type": "string", "description": "NEAR account ID" } } ] } } ] } ``` ## Response reference - Status: 200 - Media type: application/json - Summary: Successful response ### Response schema ```json { "type": "object", "required": [ "jsonrpc", "id" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "oneOf": [ { "type": "string" }, { "type": "number" } ] } }, { "name": "result", "required": false, "schema": { "type": "object", "required": [ "outcome_proof", "outcome_root_proof", "block_header_lite", "block_proof" ], "properties": [ { "name": "block_header_lite", "required": true, "schema": { "type": "object", "required": [ "prev_block_hash", "inner_rest_hash", "inner_lite" ], "properties": [ { "name": "inner_lite", "required": true, "schema": { "type": "object", "description": "A part of a state for the current head of a light client. More info [here](https://nomicon.io/ChainSpec/LightClient)." } }, { "name": "inner_rest_hash", "required": true, "schema": { "type": "string", "description": "Base58-encoded hash" } }, { "name": "prev_block_hash", "required": true, "schema": { "type": "string", "description": "Base58-encoded hash" } } ] } }, { "name": "block_proof", "required": true, "schema": { "type": "array", "items": { "type": "object" } } }, { "name": "outcome_proof", "required": true, "schema": { "type": "object", "required": [ "proof", "block_hash", "id", "outcome" ], "properties": [ { "name": "block_hash", "required": true, "schema": { "type": "string", "description": "Base58-encoded hash" } }, { "name": "id", "required": true, "schema": { "type": "string", "description": "Base58-encoded hash" } }, { "name": "outcome", "required": true, "schema": { "type": "object" } }, { "name": "proof", "required": true, "schema": { "type": "array", "items": { "type": "object" } } } ] } }, { "name": "outcome_root_proof", "required": true, "schema": { "type": "array", "items": { "type": "object" } } } ] } }, { "name": "error", "required": false, "schema": { "type": "object", "properties": [ { "name": "code", "required": false, "schema": { "type": "integer" } }, { "name": "message", "required": false, "schema": { "type": "string" } }, { "name": "data", "required": false, "schema": { "type": "object" } } ] } } ], "refName": "JsonRpcResponse" } ``` --- ## NEAR Protocol RPC: Get protocol config - HTML path: https://docs.fastnear.com/rpcs/protocol/EXPERIMENTAL_protocol_config - Markdown path: https://docs.fastnear.com/rpcs/protocol/EXPERIMENTAL_protocol_config.md # NEAR Protocol RPC: Get protocol config Get protocol config Fetch the runtime protocol config at a chosen block — gas costs, storage prices, and limits currently in force. ## Source links - https://docs.fastnear.com/rpcs/protocol/EXPERIMENTAL_protocol_config - https://docs.fastnear.com/rpcs/protocol/EXPERIMENTAL_protocol_config/other/EXPERIMENTAL_protocol_config - https://docs.fastnear.com/reference/operation/EXPERIMENTAL_protocol_config ## Operation - Transport: json-rpc - Method: POST - Path: `/` - Source spec: `rpcs/protocol/EXPERIMENTAL_protocol_config.yaml` ## Networks - Mainnet: https://rpc.mainnet.fastnear.com/ - Testnet: https://rpc.testnet.fastnear.com/ ## Auth - API key via query `apiKey`: The OpenAPI contract describes the FastNEAR API key as a query parameter named apiKey. - This export intentionally omits any locally saved credentials ## Current request - Network: Mainnet - Finality: final - Endpoint: https://rpc.mainnet.fastnear.com/ ### Request body ```json { "jsonrpc": "2.0", "id": "fastnear", "method": "EXPERIMENTAL_protocol_config", "params": { "finality": "final" } } ``` ## Request reference ### Active example ```json { "body": { "jsonrpc": "2.0", "id": "fastnear", "method": "EXPERIMENTAL_protocol_config", "params": { "finality": "final" } }, "headers": {}, "path": {}, "query": {} } ``` ### Request schema ```json { "type": "object", "required": [ "jsonrpc", "id", "method", "params" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "type": "string", "example": "fastnear" } }, { "name": "method", "required": true, "schema": { "type": "string", "enum": [ "EXPERIMENTAL_protocol_config" ] } }, { "name": "params", "required": true, "schema": { "type": "object", "description": "One of multiple possible types" } } ] } ``` ## Response reference - Status: 200 - Media type: application/json - Summary: Successful response ### Response schema ```json { "type": "object", "required": [ "jsonrpc", "id" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "oneOf": [ { "type": "string" }, { "type": "number" } ] } }, { "name": "result", "required": false, "schema": { "type": "object", "properties": [ { "name": "avg_hidden_validator_seats_per_shard", "required": false, "schema": { "type": "array", "description": "Expected number of hidden validators per shard.", "items": { "type": "integer", "format": "uint64" } } }, { "name": "block_producer_kickout_threshold", "required": false, "schema": { "type": "integer", "description": "Threshold for kicking out block producers, between 0 and 100.", "format": "uint8" } }, { "name": "chain_id", "required": false, "schema": { "type": "string", "description": "ID of the blockchain. This must be unique for every blockchain.\nIf your testnet blockchains do not have unique chain IDs, you will have a bad time." } }, { "name": "chunk_producer_kickout_threshold", "required": false, "schema": { "type": "integer", "description": "Threshold for kicking out chunk producers, between 0 and 100.", "format": "uint8" } }, { "name": "chunk_validator_only_kickout_threshold", "required": false, "schema": { "type": "integer", "description": "Threshold for kicking out nodes which are only chunk validators, between 0 and 100.", "format": "uint8" } }, { "name": "dynamic_resharding", "required": false, "schema": { "type": "boolean", "description": "Enable dynamic re-sharding." } }, { "name": "epoch_length", "required": false, "schema": { "type": "integer", "description": "Epoch length counted in block heights.", "format": "uint64" } }, { "name": "fishermen_threshold", "required": false, "schema": { "type": "string", "description": "Amount in yoctoNEAR" } }, { "name": "gas_limit", "required": false, "schema": { "type": "string", "description": "Gas amount" } }, { "name": "gas_price_adjustment_rate", "required": false, "schema": { "type": "array", "description": "Gas price adjustment rate", "items": { "type": "integer", "format": "int32" } } }, { "name": "genesis_height", "required": false, "schema": { "type": "integer", "description": "Height of genesis block.", "format": "uint64" } }, { "name": "genesis_time", "required": false, "schema": { "type": "string", "description": "Official time of blockchain start.", "format": "date-time" } }, { "name": "max_gas_price", "required": false, "schema": { "type": "string", "description": "Amount in yoctoNEAR" } }, { "name": "max_inflation_rate", "required": false, "schema": { "type": "array", "description": "Maximum inflation on the total supply every epoch.", "items": { "type": "integer", "format": "int32" } } }, { "name": "max_kickout_stake_perc", "required": false, "schema": { "type": "integer", "description": "Max stake percentage of the validators we will kick out.", "format": "uint8" } }, { "name": "min_gas_price", "required": false, "schema": { "type": "string", "description": "Amount in yoctoNEAR" } }, { "name": "minimum_stake_divisor", "required": false, "schema": { "type": "integer", "description": "The minimum stake required for staking is last seat price divided by this number.", "format": "uint64" } }, { "name": "minimum_stake_ratio", "required": false, "schema": { "type": "array", "description": "The lowest ratio s/s_total any block producer can have.\nSee for details", "items": { "type": "integer", "format": "int32" } } }, { "name": "minimum_validators_per_shard", "required": false, "schema": { "type": "integer", "description": "The minimum number of validators each shard must have", "format": "uint64" } }, { "name": "num_block_producer_seats", "required": false, "schema": { "type": "integer", "description": "Number of block producer seats at genesis.", "format": "uint64" } }, { "name": "num_block_producer_seats_per_shard", "required": false, "schema": { "type": "array", "description": "Defines number of shards and number of block producer seats per each shard at genesis.", "items": { "type": "integer", "format": "uint64" } } }, { "name": "num_blocks_per_year", "required": false, "schema": { "type": "integer", "description": "Expected number of blocks per year", "format": "uint64" } }, { "name": "online_max_threshold", "required": false, "schema": { "type": "array", "description": "Online maximum threshold above which validator gets full reward.", "items": { "type": "integer", "format": "int32" } } }, { "name": "online_min_threshold", "required": false, "schema": { "type": "array", "description": "Online minimum threshold below which validator doesn't receive reward.", "items": { "type": "integer", "format": "int32" } } }, { "name": "protocol_reward_rate", "required": false, "schema": { "type": "array", "description": "Protocol treasury rate", "items": { "type": "integer", "format": "int32" } } }, { "name": "protocol_treasury_account", "required": false, "schema": { "type": "string", "description": "NEAR account ID" } }, { "name": "protocol_upgrade_stake_threshold", "required": false, "schema": { "type": "array", "description": "Threshold of stake that needs to indicate that they ready for upgrade.", "items": { "type": "integer", "format": "int32" } } }, { "name": "protocol_version", "required": false, "schema": { "type": "integer", "description": "Current Protocol Version", "format": "uint32" } }, { "name": "runtime_config", "required": false, "schema": { "type": "object", "description": "View that preserves JSON format of the runtime config.", "properties": [ { "name": "account_creation_config", "required": false, "schema": { "type": "object", "description": "The structure describes configuration for creation of new accounts." } }, { "name": "congestion_control_config", "required": false, "schema": { "type": "object", "description": "The configuration for congestion control. More info about congestion [here](https://near.github.io/nearcore/architecture/how/receipt-congestion.html?highlight=congestion#receipt-congestion)" } }, { "name": "storage_amount_per_byte", "required": false, "schema": { "type": "string", "description": "Amount in yoctoNEAR" } }, { "name": "transaction_costs", "required": false, "schema": { "type": "object", "description": "Describes different fees for the runtime" } }, { "name": "wasm_config", "required": false, "schema": { "type": "object", "description": "Config of wasm operations." } }, { "name": "witness_config", "required": false, "schema": { "type": "object", "description": "Configuration specific to ChunkStateWitness." } } ] } }, { "name": "shard_layout", "required": false, "schema": { "type": "object", "description": "One of multiple possible types" } }, { "name": "shuffle_shard_assignment_for_chunk_producers", "required": false, "schema": { "type": "boolean", "description": "If true, shuffle the chunk producers across shards. In other words, if\nthe shard assignments were `[S_0, S_1, S_2, S_3]` where `S_i` represents\nthe set of chunk producers for shard `i`, if this flag were true, the\nshard assignments might become, for example, `[S_2, S_0, S_3, S_1]`." } }, { "name": "target_validator_mandates_per_shard", "required": false, "schema": { "type": "integer", "description": "Number of target chunk validator mandates for each shard.", "format": "uint64" } }, { "name": "transaction_validity_period", "required": false, "schema": { "type": "integer", "description": "Number of blocks for which a given transaction is valid", "format": "uint64" } } ] } }, { "name": "error", "required": false, "schema": { "type": "object", "properties": [ { "name": "code", "required": false, "schema": { "type": "integer" } }, { "name": "message", "required": false, "schema": { "type": "string" } }, { "name": "data", "required": false, "schema": { "type": "object" } } ] } } ], "refName": "JsonRpcResponse" } ``` --- ## NEAR Protocol RPC: Get split storage info - HTML path: https://docs.fastnear.com/rpcs/protocol/EXPERIMENTAL_split_storage_info - Markdown path: https://docs.fastnear.com/rpcs/protocol/EXPERIMENTAL_split_storage_info.md # NEAR Protocol RPC: Get split storage info Get split storage info Inspect a node's split-storage layout — the boundary between hot recent data and cold archival data. ## Source links - https://docs.fastnear.com/rpcs/protocol/EXPERIMENTAL_split_storage_info - https://docs.fastnear.com/rpcs/protocol/EXPERIMENTAL_split_storage_info/other/EXPERIMENTAL_split_storage_info - https://docs.fastnear.com/reference/operation/EXPERIMENTAL_split_storage_info ## Operation - Transport: json-rpc - Method: POST - Path: `/` - Source spec: `rpcs/protocol/EXPERIMENTAL_split_storage_info.yaml` ## Networks - Mainnet: https://rpc.mainnet.fastnear.com/ - Testnet: https://rpc.testnet.fastnear.com/ ## Auth - API key via query `apiKey`: The OpenAPI contract describes the FastNEAR API key as a query parameter named apiKey. - This export intentionally omits any locally saved credentials ## Current request - Network: Mainnet - Finality: final - Endpoint: https://rpc.mainnet.fastnear.com/ ### Request body ```json { "jsonrpc": "2.0", "id": "fastnear", "method": "EXPERIMENTAL_split_storage_info", "params": [] } ``` ## Request reference ### Active example ```json { "body": { "jsonrpc": "2.0", "id": "fastnear", "method": "EXPERIMENTAL_split_storage_info", "params": [] }, "headers": {}, "path": {}, "query": {} } ``` ### Request schema ```json { "type": "object", "required": [ "jsonrpc", "id", "method", "params" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "type": "string", "example": "fastnear" } }, { "name": "method", "required": true, "schema": { "type": "string", "enum": [ "EXPERIMENTAL_split_storage_info" ] } }, { "name": "params", "required": true, "schema": { "type": "array", "description": "Empty array as this method takes no parameters", "example": [] } } ] } ``` ## Response reference - Status: 200 - Media type: application/json - Summary: Successful response ### Response schema ```json { "type": "object", "required": [ "jsonrpc", "id" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "oneOf": [ { "type": "string" }, { "type": "number" } ] } }, { "name": "result", "required": false, "schema": { "type": "object", "description": "Contains the split storage information.", "properties": [ { "name": "cold_head_height", "required": false, "schema": { "type": "integer", "nullable": true, "format": "uint64" } }, { "name": "final_head_height", "required": false, "schema": { "type": "integer", "nullable": true, "format": "uint64" } }, { "name": "head_height", "required": false, "schema": { "type": "integer", "nullable": true, "format": "uint64" } }, { "name": "hot_db_kind", "required": false, "schema": { "type": "string", "nullable": true } } ] } }, { "name": "error", "required": false, "schema": { "type": "object", "properties": [ { "name": "code", "required": false, "schema": { "type": "integer" } }, { "name": "message", "required": false, "schema": { "type": "string" } }, { "name": "data", "required": false, "schema": { "type": "object" } } ] } } ], "refName": "JsonRpcResponse" } ``` --- ## NEAR Protocol RPC: Get gas price - HTML path: https://docs.fastnear.com/rpcs/protocol/gas_price - Markdown path: https://docs.fastnear.com/rpcs/protocol/gas_price.md # NEAR Protocol RPC: Get gas price Get gas price Fetch the current chain-wide gas price for the most recent block. ## Source links - https://docs.fastnear.com/rpcs/protocol/gas_price - https://docs.fastnear.com/rpcs/protocol/gas_price/other/gas_price - https://docs.fastnear.com/reference/operation/gas_price ## Operation - Transport: json-rpc - Method: POST - Path: `/` - Source spec: `rpcs/protocol/gas_price.yaml` ## Networks - Mainnet: https://rpc.mainnet.fastnear.com/ - Testnet: https://rpc.testnet.fastnear.com/ ## Auth - API key via query `apiKey`: The OpenAPI contract describes the FastNEAR API key as a query parameter named apiKey. - This export intentionally omits any locally saved credentials ## Current request - Network: Mainnet - Finality: final - Endpoint: https://rpc.mainnet.fastnear.com/ ### Request body ```json { "jsonrpc": "2.0", "id": "fastnear", "method": "gas_price", "params": [ null ] } ``` ## Request reference ### Active example ```json { "body": { "jsonrpc": "2.0", "id": "fastnear", "method": "gas_price", "params": [ null ] }, "headers": {}, "path": {}, "query": {} } ``` ### Request schema ```json { "type": "object", "required": [ "jsonrpc", "id", "method", "params" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "type": "string", "example": "fastnear" } }, { "name": "method", "required": true, "schema": { "type": "string", "enum": [ "gas_price" ] } }, { "name": "params", "required": true, "schema": { "type": "array", "example": [ null ], "items": { "nullable": true } } } ] } ``` ## Response reference - Status: 200 - Media type: application/json - Summary: Successful response ### Response schema ```json { "type": "object", "required": [ "jsonrpc", "id" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "oneOf": [ { "type": "string" }, { "type": "number" } ] } }, { "name": "result", "required": false, "schema": { "type": "object", "required": [ "gas_price" ], "properties": [ { "name": "gas_price", "required": true, "schema": { "type": "string", "description": "Amount in yoctoNEAR" } } ] } }, { "name": "error", "required": false, "schema": { "type": "object", "properties": [ { "name": "code", "required": false, "schema": { "type": "integer" } }, { "name": "message", "required": false, "schema": { "type": "string" } }, { "name": "data", "required": false, "schema": { "type": "object" } } ] } } ], "refName": "JsonRpcResponse" } ``` --- ## NEAR Protocol RPC: Get gas price by block - HTML path: https://docs.fastnear.com/rpcs/protocol/gas_price_by_block - Markdown path: https://docs.fastnear.com/rpcs/protocol/gas_price_by_block.md # NEAR Protocol RPC: Get gas price by block Get gas price by block Fetch the chain-wide gas price at a chosen historical block, by height or hash. ## Source links - https://docs.fastnear.com/rpcs/protocol/gas_price_by_block - https://docs.fastnear.com/rpcs/protocol/gas_price_by_block/other/gas_price_by_block - https://docs.fastnear.com/reference/operation/gas_price_by_block ## Operation - Transport: json-rpc - Method: POST - Path: `/` - Source spec: `rpcs/protocol/gas_price_by_block.yaml` ## Networks - Mainnet: https://rpc.mainnet.fastnear.com/ - Testnet: https://rpc.testnet.fastnear.com/ ## Auth - API key via query `apiKey`: The OpenAPI contract describes the FastNEAR API key as a query parameter named apiKey. - This export intentionally omits any locally saved credentials ## Current request - Network: Mainnet - Finality: final - Endpoint: https://rpc.mainnet.fastnear.com/ ### Request body ```json { "jsonrpc": "2.0", "id": "fastnear", "method": "gas_price", "params": { "block_id": "9XN7MtDywZvfGx6TKy1MT2iCZkKuHikJXmNazxdZ4x6T" } } ``` ## Request reference ### Active example ```json { "body": { "jsonrpc": "2.0", "id": "fastnear", "method": "gas_price", "params": { "block_id": "9XN7MtDywZvfGx6TKy1MT2iCZkKuHikJXmNazxdZ4x6T" } }, "headers": {}, "path": {}, "query": {} } ``` ### Inputs - `block_id` (body, required, integer | string): Block height (integer) or block hash (string) ### Request schema ```json { "type": "object", "required": [ "jsonrpc", "id", "method", "params" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "type": "string", "example": "fastnear" } }, { "name": "method", "required": true, "schema": { "type": "string", "enum": [ "gas_price" ] } }, { "name": "params", "required": true, "schema": { "type": "object", "required": [ "block_id" ], "properties": [ { "name": "block_id", "required": true, "schema": { "description": "Block height (integer) or block hash (string)", "oneOf": [ { "type": "integer", "description": "Block height" }, { "type": "string", "description": "Base58-encoded block hash" } ] } } ] } } ] } ``` ## Response reference - Status: 200 - Media type: application/json - Summary: Successful response ### Response schema ```json { "type": "object", "required": [ "jsonrpc", "id" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "oneOf": [ { "type": "string" }, { "type": "number" } ] } }, { "name": "result", "required": false, "schema": { "type": "object", "required": [ "gas_price" ], "properties": [ { "name": "gas_price", "required": true, "schema": { "type": "string", "description": "Amount in yoctoNEAR" } } ] } }, { "name": "error", "required": false, "schema": { "type": "object", "properties": [ { "name": "code", "required": false, "schema": { "type": "integer" } }, { "name": "message", "required": false, "schema": { "type": "string" } }, { "name": "data", "required": false, "schema": { "type": "object" } } ] } } ], "refName": "JsonRpcResponse" } ``` --- ## NEAR Protocol RPC: Get genesis config - HTML path: https://docs.fastnear.com/rpcs/protocol/genesis_config - Markdown path: https://docs.fastnear.com/rpcs/protocol/genesis_config.md # NEAR Protocol RPC: Get genesis config Get genesis config Fetch the chain's immutable genesis config — initial records, protocol settings, and epoch length at block 0. ## Source links - https://docs.fastnear.com/rpcs/protocol/genesis_config - https://docs.fastnear.com/rpcs/protocol/genesis_config/other/genesis_config - https://docs.fastnear.com/reference/operation/genesis_config ## Operation - Transport: json-rpc - Method: POST - Path: `/` - Source spec: `rpcs/protocol/genesis_config.yaml` ## Networks - Mainnet: https://rpc.mainnet.fastnear.com/ - Testnet: https://rpc.testnet.fastnear.com/ ## Auth - API key via query `apiKey`: The OpenAPI contract describes the FastNEAR API key as a query parameter named apiKey. - This export intentionally omits any locally saved credentials ## Current request - Network: Mainnet - Finality: final - Endpoint: https://rpc.mainnet.fastnear.com/ ### Request body ```json { "jsonrpc": "2.0", "id": "fastnear", "method": "genesis_config", "params": [] } ``` ## Request reference ### Active example ```json { "body": { "jsonrpc": "2.0", "id": "fastnear", "method": "genesis_config", "params": [] }, "headers": {}, "path": {}, "query": {} } ``` ### Request schema ```json { "type": "object", "required": [ "jsonrpc", "id", "method", "params" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "type": "string", "example": "fastnear" } }, { "name": "method", "required": true, "schema": { "type": "string", "enum": [ "genesis_config" ] } }, { "name": "params", "required": true, "schema": { "type": "array", "description": "Empty array as this method takes no parameters", "example": [] } } ] } ``` ## Response reference - Status: 200 - Media type: application/json - Summary: Successful response ### Response schema ```json { "type": "object", "required": [ "jsonrpc", "id" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "oneOf": [ { "type": "string" }, { "type": "number" } ] } }, { "name": "result", "required": false, "schema": { "type": "object", "required": [ "protocol_version", "genesis_time", "chain_id", "genesis_height", "num_block_producer_seats", "num_block_producer_seats_per_shard", "avg_hidden_validator_seats_per_shard", "dynamic_resharding", "epoch_length", "gas_limit", "min_gas_price", "max_gas_price", "block_producer_kickout_threshold", "chunk_producer_kickout_threshold", "gas_price_adjustment_rate", "validators", "transaction_validity_period", "protocol_reward_rate", "max_inflation_rate", "total_supply", "num_blocks_per_year", "protocol_treasury_account", "fishermen_threshold" ], "properties": [ { "name": "avg_hidden_validator_seats_per_shard", "required": true, "schema": { "type": "array", "description": "Expected number of hidden validators per shard.", "items": { "type": "integer", "format": "uint64" } } }, { "name": "block_producer_kickout_threshold", "required": true, "schema": { "type": "integer", "description": "Threshold for kicking out block producers, between 0 and 100.", "format": "uint8" } }, { "name": "chain_id", "required": true, "schema": { "type": "string", "description": "ID of the blockchain. This must be unique for every blockchain.\nIf your testnet blockchains do not have unique chain IDs, you will have a bad time." } }, { "name": "chunk_producer_assignment_changes_limit", "required": false, "schema": { "type": "integer", "description": "Limits the number of shard changes in chunk producer assignments,\nif algorithm is able to choose assignment with better balance of\nnumber of chunk producers for shards.", "format": "uint64", "default": 5 } }, { "name": "chunk_producer_kickout_threshold", "required": true, "schema": { "type": "integer", "description": "Threshold for kicking out chunk producers, between 0 and 100.", "format": "uint8" } }, { "name": "chunk_validator_only_kickout_threshold", "required": false, "schema": { "type": "integer", "description": "Threshold for kicking out nodes which are only chunk validators, between 0 and 100.", "format": "uint8", "default": 80 } }, { "name": "dynamic_resharding", "required": true, "schema": { "type": "boolean", "description": "Enable dynamic re-sharding." } }, { "name": "epoch_length", "required": true, "schema": { "type": "integer", "description": "Epoch length counted in block heights.", "format": "uint64" } }, { "name": "fishermen_threshold", "required": true, "schema": { "type": "string", "description": "Amount in yoctoNEAR" } }, { "name": "gas_limit", "required": true, "schema": { "type": "string", "description": "Gas amount" } }, { "name": "gas_price_adjustment_rate", "required": true, "schema": { "type": "array", "description": "Gas price adjustment rate", "items": { "type": "integer", "format": "int32" } } }, { "name": "genesis_height", "required": true, "schema": { "type": "integer", "description": "Height of genesis block.", "format": "uint64" } }, { "name": "genesis_time", "required": true, "schema": { "type": "string", "description": "Official time of blockchain start.", "format": "date-time" } }, { "name": "max_gas_price", "required": true, "schema": { "type": "string", "description": "Amount in yoctoNEAR" } }, { "name": "max_inflation_rate", "required": true, "schema": { "type": "array", "description": "Maximum inflation on the total supply every epoch.", "items": { "type": "integer", "format": "int32" } } }, { "name": "max_kickout_stake_perc", "required": false, "schema": { "type": "integer", "description": "Max stake percentage of the validators we will kick out.", "format": "uint8", "default": 100 } }, { "name": "min_gas_price", "required": true, "schema": { "type": "string", "description": "Amount in yoctoNEAR" } }, { "name": "minimum_stake_divisor", "required": false, "schema": { "type": "integer", "description": "The minimum stake required for staking is last seat price divided by this number.", "format": "uint64", "default": 10 } }, { "name": "minimum_stake_ratio", "required": false, "schema": { "type": "array", "description": "The lowest ratio s/s_total any block producer can have.\nSee for details", "items": { "type": "integer", "format": "int32" } } }, { "name": "minimum_validators_per_shard", "required": false, "schema": { "type": "integer", "description": "The minimum number of validators each shard must have", "format": "uint64", "default": 1 } }, { "name": "num_block_producer_seats", "required": true, "schema": { "type": "integer", "description": "Number of block producer seats at genesis.", "format": "uint64" } }, { "name": "num_block_producer_seats_per_shard", "required": true, "schema": { "type": "array", "description": "Defines number of shards and number of block producer seats per each shard at genesis.\nNote: not used with protocol_feature_chunk_only_producers -- replaced by minimum_validators_per_shard\nNote: not used before as all block producers produce chunks for all shards", "items": { "type": "integer", "format": "uint64" } } }, { "name": "num_blocks_per_year", "required": true, "schema": { "type": "integer", "description": "Expected number of blocks per year", "format": "uint64" } }, { "name": "num_chunk_only_producer_seats", "required": false, "schema": { "type": "integer", "description": "Deprecated.", "format": "uint64", "default": 300 } }, { "name": "num_chunk_producer_seats", "required": false, "schema": { "type": "integer", "description": "Number of chunk producers.\nDon't mess it up with chunk-only producers feature which is deprecated.", "format": "uint64", "default": 100 } }, { "name": "num_chunk_validator_seats", "required": false, "schema": { "type": "integer", "format": "uint64", "default": 300 } }, { "name": "online_max_threshold", "required": false, "schema": { "type": "array", "description": "Online maximum threshold above which validator gets full reward.", "items": { "type": "integer", "format": "int32" } } }, { "name": "online_min_threshold", "required": false, "schema": { "type": "array", "description": "Online minimum threshold below which validator doesn't receive reward.", "items": { "type": "integer", "format": "int32" } } }, { "name": "protocol_reward_rate", "required": true, "schema": { "type": "array", "description": "Protocol treasury rate", "items": { "type": "integer", "format": "int32" } } }, { "name": "protocol_treasury_account", "required": true, "schema": { "type": "string", "description": "NEAR account ID" } }, { "name": "protocol_upgrade_stake_threshold", "required": false, "schema": { "type": "array", "description": "Threshold of stake that needs to indicate that they ready for upgrade.", "items": { "type": "integer", "format": "int32" } } }, { "name": "protocol_version", "required": true, "schema": { "type": "integer", "description": "Protocol version that this genesis works with.", "format": "uint32" } }, { "name": "shard_layout", "required": false, "schema": { "type": "object", "description": "One of multiple possible types", "default": { "V2": { "boundary_accounts": [], "id_to_index_map": { "0": 0 }, "index_to_id_map": { "0": 0 }, "shard_ids": [ 0 ], "version": 0 } } } }, { "name": "shuffle_shard_assignment_for_chunk_producers", "required": false, "schema": { "type": "boolean", "description": "If true, shuffle the chunk producers across shards. In other words, if\nthe shard assignments were `[S_0, S_1, S_2, S_3]` where `S_i` represents\nthe set of chunk producers for shard `i`, if this flag were true, the\nshard assignments might become, for example, `[S_2, S_0, S_3, S_1]`.", "default": false } }, { "name": "target_validator_mandates_per_shard", "required": false, "schema": { "type": "integer", "description": "Number of target chunk validator mandates for each shard.", "format": "uint64", "default": 68 } }, { "name": "total_supply", "required": true, "schema": { "type": "string", "description": "Amount in yoctoNEAR" } }, { "name": "transaction_validity_period", "required": true, "schema": { "type": "integer", "description": "Number of blocks for which a given transaction is valid", "format": "uint64" } }, { "name": "use_production_config", "required": false, "schema": { "type": "boolean", "description": "This is only for test purposes. We hard code some configs for mainnet and testnet\nin AllEpochConfig, and we want to have a way to test that code path. This flag is for that.\nIf set to true, the node will use the same config override path as mainnet and testnet.", "default": false } }, { "name": "validators", "required": true, "schema": { "type": "array", "description": "List of initial validators.", "items": { "type": "object", "description": "Account info for validators" } } } ] } }, { "name": "error", "required": false, "schema": { "type": "object", "properties": [ { "name": "code", "required": false, "schema": { "type": "integer" } }, { "name": "message", "required": false, "schema": { "type": "string" } }, { "name": "data", "required": false, "schema": { "type": "object" } } ] } } ], "refName": "JsonRpcResponse" } ``` --- ## NEAR Protocol RPC: Check node health - HTML path: https://docs.fastnear.com/rpcs/protocol/health - Markdown path: https://docs.fastnear.com/rpcs/protocol/health.md # NEAR Protocol RPC: Check node health Check node health Ping a node for liveness — returns `null` on success, an error on unhealthy state. ## Source links - https://docs.fastnear.com/rpcs/protocol/health - https://docs.fastnear.com/rpcs/protocol/health/other/health - https://docs.fastnear.com/reference/operation/health ## Operation - Transport: json-rpc - Method: POST - Path: `/` - Source spec: `rpcs/protocol/health.yaml` ## Networks - Mainnet: https://rpc.mainnet.fastnear.com/ - Testnet: https://rpc.testnet.fastnear.com/ ## Auth - API key via query `apiKey`: The OpenAPI contract describes the FastNEAR API key as a query parameter named apiKey. - This export intentionally omits any locally saved credentials ## Current request - Network: Mainnet - Finality: final - Endpoint: https://rpc.mainnet.fastnear.com/ ### Request body ```json { "jsonrpc": "2.0", "id": "fastnear", "method": "health", "params": [] } ``` ## Request reference ### Active example ```json { "body": { "jsonrpc": "2.0", "id": "fastnear", "method": "health", "params": [] }, "headers": {}, "path": {}, "query": {} } ``` ### Request schema ```json { "type": "object", "required": [ "jsonrpc", "id", "method", "params" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "type": "string", "example": "fastnear" } }, { "name": "method", "required": true, "schema": { "type": "string", "enum": [ "health" ] } }, { "name": "params", "required": true, "schema": { "type": "array", "description": "Empty array as this method takes no parameters", "example": [] } } ] } ``` ## Response reference - Status: 200 - Media type: application/json - Summary: Successful response ### Response schema ```json { "type": "object", "required": [ "jsonrpc", "id" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "oneOf": [ { "type": "string" }, { "type": "number" } ] } }, { "name": "result", "required": false, "schema": { "type": "object", "description": "Health status of the node" } }, { "name": "error", "required": false, "schema": { "type": "object", "properties": [ { "name": "code", "required": false, "schema": { "type": "integer" } }, { "name": "message", "required": false, "schema": { "type": "string" } }, { "name": "data", "required": false, "schema": { "type": "object" } } ] } } ], "refName": "JsonRpcResponse" } ``` --- ## NEAR Protocol RPC: Latest Block - HTML path: https://docs.fastnear.com/rpcs/protocol/latest_block - Markdown path: https://docs.fastnear.com/rpcs/protocol/latest_block.md # NEAR Protocol RPC: Latest Block Get latest block Fetch the latest final block — finality set automatically, no block ID needed. ## Source links - https://docs.fastnear.com/rpcs/protocol/latest_block - https://docs.fastnear.com/rpcs/protocol/latest_block/other/latest_block - https://docs.fastnear.com/reference/operation/latest_block ## Operation - Transport: json-rpc - Method: POST - Path: `/` - Source spec: `rpcs/protocol/latest_block.yaml` ## Networks - Mainnet RPC: https://rpc.mainnet.fastnear.com/ - Testnet RPC: https://rpc.testnet.fastnear.com/ - Mainnet Archival RPC: https://archival-rpc.mainnet.fastnear.com/ - Testnet Archival RPC: https://archival-rpc.testnet.fastnear.com/ ## Auth - API key via query `apiKey`: The OpenAPI contract describes the FastNEAR API key as a query parameter named apiKey. - This export intentionally omits any locally saved credentials ## Current request - Network: Mainnet RPC - Finality: final - Endpoint: https://rpc.mainnet.fastnear.com/ ### Request body ```json { "jsonrpc": "2.0", "id": "fastnear", "method": "block", "params": { "finality": "final" } } ``` ## Request reference ### Active example ```json { "body": { "jsonrpc": "2.0", "id": "fastnear", "method": "block", "params": { "finality": "optimistic" } }, "headers": {}, "path": {}, "query": {} } ``` ### Request schema ```json { "type": "object", "required": [ "jsonrpc", "id", "method", "params" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "type": "string", "example": "fastnear" } }, { "name": "method", "required": true, "schema": { "type": "string", "enum": [ "block" ] } }, { "name": "params", "required": true, "schema": { "type": "object", "required": [ "finality" ], "properties": [ { "name": "finality", "required": true, "schema": { "type": "string", "description": "Finality selector for the latest visible block", "enum": [ "final", "near-final", "optimistic" ] } } ] } } ] } ``` ## Response reference - Status: 200 - Media type: application/json - Summary: Successful response ### Response schema ```json { "type": "object", "required": [ "jsonrpc", "id" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "oneOf": [ { "type": "string" }, { "type": "number" } ] } }, { "name": "result", "required": false, "schema": { "type": "object" } }, { "name": "error", "required": false, "schema": { "type": "object", "properties": [ { "name": "code", "required": false, "schema": { "type": "integer" } }, { "name": "message", "required": false, "schema": { "type": "string" } }, { "name": "data", "required": false, "schema": { "type": "object" } } ] } } ], "refName": "JsonRpcResponse" } ``` --- ## NEAR Protocol RPC: Get light client proof - HTML path: https://docs.fastnear.com/rpcs/protocol/light_client_proof - Markdown path: https://docs.fastnear.com/rpcs/protocol/light_client_proof.md # NEAR Protocol RPC: Get light client proof Get light client proof Fetch a Merkle proof — by Base58 transaction or receipt ID — that the item was included and executed, suitable for light-client verification. ## Source links - https://docs.fastnear.com/rpcs/protocol/light_client_proof - https://docs.fastnear.com/rpcs/protocol/light_client_proof/other/light_client_proof - https://docs.fastnear.com/reference/operation/light_client_proof ## Operation - Transport: json-rpc - Method: POST - Path: `/` - Source spec: `rpcs/protocol/light_client_proof.yaml` ## Networks - Mainnet: https://rpc.mainnet.fastnear.com/ - Testnet: https://rpc.testnet.fastnear.com/ ## Auth - API key via query `apiKey`: The OpenAPI contract describes the FastNEAR API key as a query parameter named apiKey. - This export intentionally omits any locally saved credentials ## Current request - Network: Mainnet - Finality: final - Endpoint: https://rpc.mainnet.fastnear.com/ ### Request body ```json { "jsonrpc": "2.0", "id": "fastnear", "method": "light_client_proof", "params": { "type": "receipt", "transaction_hash": "34E7weKCDqXh3xPKdBgSWRqo44yTWjbka9deMK8JbAxx", "sender_id": "escrow.ai.near", "light_client_head": "9XN7MtDywZvfGx6TKy1MT2iCZkKuHikJXmNazxdZ4x6T" } } ``` ## Request reference ### Active example ```json { "body": { "jsonrpc": "2.0", "id": "fastnear", "method": "light_client_proof", "params": { "type": "receipt", "transaction_hash": "34E7weKCDqXh3xPKdBgSWRqo44yTWjbka9deMK8JbAxx", "sender_id": "escrow.ai.near", "light_client_head": "9XN7MtDywZvfGx6TKy1MT2iCZkKuHikJXmNazxdZ4x6T" } }, "headers": {}, "path": {}, "query": {} } ``` ### Inputs - `light_client_head` (body, required, string): Base58-encoded hash - `sender_id` (body, string): NEAR account ID - `transaction_hash` (body, string): Base58-encoded hash - `type` (body, string): Proof subject — `receipt` proves inclusion of a specific receipt produced during execution. - `receipt_id` (body, string): Base58-encoded hash - `receiver_id` (body, string): NEAR account ID ### Request schema ```json { "type": "object", "required": [ "jsonrpc", "id", "method", "params" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "type": "string", "example": "fastnear" } }, { "name": "method", "required": true, "schema": { "type": "string", "enum": [ "light_client_proof" ] } }, { "name": "params", "required": true, "schema": { "type": "object", "required": [ "light_client_head" ], "properties": [ { "name": "light_client_head", "required": true, "schema": { "type": "string", "description": "Base58-encoded hash" } }, { "name": "sender_id", "required": false, "schema": { "type": "string", "description": "NEAR account ID" } }, { "name": "transaction_hash", "required": false, "schema": { "type": "string", "description": "Base58-encoded hash" } }, { "name": "type", "required": false, "schema": { "type": "string", "description": "Proof subject — `receipt` proves inclusion of a specific receipt produced during execution.", "enum": [ "receipt" ] } }, { "name": "receipt_id", "required": false, "schema": { "type": "string", "description": "Base58-encoded hash" } }, { "name": "receiver_id", "required": false, "schema": { "type": "string", "description": "NEAR account ID" } } ] } } ] } ``` ## Response reference - Status: 200 - Media type: application/json - Summary: Successful response ### Response schema ```json { "type": "object", "required": [ "jsonrpc", "id" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "oneOf": [ { "type": "string" }, { "type": "number" } ] } }, { "name": "result", "required": false, "schema": { "type": "object", "required": [ "outcome_proof", "outcome_root_proof", "block_header_lite", "block_proof" ], "properties": [ { "name": "block_header_lite", "required": true, "schema": { "type": "object", "required": [ "prev_block_hash", "inner_rest_hash", "inner_lite" ], "properties": [ { "name": "inner_lite", "required": true, "schema": { "type": "object", "description": "A part of a state for the current head of a light client. More info [here](https://nomicon.io/ChainSpec/LightClient)." } }, { "name": "inner_rest_hash", "required": true, "schema": { "type": "string", "description": "Base58-encoded hash" } }, { "name": "prev_block_hash", "required": true, "schema": { "type": "string", "description": "Base58-encoded hash" } } ] } }, { "name": "block_proof", "required": true, "schema": { "type": "array", "items": { "type": "object" } } }, { "name": "outcome_proof", "required": true, "schema": { "type": "object", "required": [ "proof", "block_hash", "id", "outcome" ], "properties": [ { "name": "block_hash", "required": true, "schema": { "type": "string", "description": "Base58-encoded hash" } }, { "name": "id", "required": true, "schema": { "type": "string", "description": "Base58-encoded hash" } }, { "name": "outcome", "required": true, "schema": { "type": "object" } }, { "name": "proof", "required": true, "schema": { "type": "array", "items": { "type": "object" } } } ] } }, { "name": "outcome_root_proof", "required": true, "schema": { "type": "array", "items": { "type": "object" } } } ] } }, { "name": "error", "required": false, "schema": { "type": "object", "properties": [ { "name": "code", "required": false, "schema": { "type": "integer" } }, { "name": "message", "required": false, "schema": { "type": "string" } }, { "name": "data", "required": false, "schema": { "type": "object" } } ] } } ], "refName": "JsonRpcResponse" } ``` --- ## NEAR Protocol RPC: Get maintenance windows - HTML path: https://docs.fastnear.com/rpcs/protocol/maintenance_windows - Markdown path: https://docs.fastnear.com/rpcs/protocol/maintenance_windows.md # NEAR Protocol RPC: Get maintenance windows Get maintenance windows Find upcoming block ranges where a validator can safely restart without missing block production. ## Source links - https://docs.fastnear.com/rpcs/protocol/maintenance_windows - https://docs.fastnear.com/rpcs/protocol/maintenance_windows/other/maintenance_windows - https://docs.fastnear.com/reference/operation/maintenance_windows ## Operation - Transport: json-rpc - Method: POST - Path: `/` - Source spec: `rpcs/protocol/maintenance_windows.yaml` ## Networks - Mainnet: https://rpc.mainnet.fastnear.com/ - Testnet: https://rpc.testnet.fastnear.com/ ## Auth - API key via query `apiKey`: The OpenAPI contract describes the FastNEAR API key as a query parameter named apiKey. - This export intentionally omits any locally saved credentials ## Current request - Network: Mainnet - Finality: final - Endpoint: https://rpc.mainnet.fastnear.com/ ### Request body ```json { "jsonrpc": "2.0", "id": "fastnear", "method": "maintenance_windows", "params": { "account_id": "root.near" } } ``` ## Request reference ### Active example ```json { "body": { "jsonrpc": "2.0", "id": "fastnear", "method": "maintenance_windows", "params": { "account_id": "root.near" } }, "headers": {}, "path": {}, "query": {} } ``` ### Inputs - `account_id` (body, required, string): NEAR account ID ### Request schema ```json { "type": "object", "required": [ "jsonrpc", "id", "method", "params" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "type": "string", "example": "fastnear" } }, { "name": "method", "required": true, "schema": { "type": "string", "enum": [ "maintenance_windows" ] } }, { "name": "params", "required": true, "schema": { "type": "object", "required": [ "account_id" ], "properties": [ { "name": "account_id", "required": true, "schema": { "type": "string", "description": "NEAR account ID" } } ] } } ] } ``` ## Response reference - Status: 200 - Media type: application/json - Summary: Successful response ### Response schema ```json { "type": "object", "required": [ "jsonrpc", "id" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "oneOf": [ { "type": "string" }, { "type": "number" } ] } }, { "name": "result", "required": false, "schema": { "type": "array", "items": { "type": "object", "required": [ "start", "end" ], "properties": [ { "name": "end", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "start", "required": true, "schema": { "type": "integer", "format": "uint64" } } ] } } }, { "name": "error", "required": false, "schema": { "type": "object", "properties": [ { "name": "code", "required": false, "schema": { "type": "integer" } }, { "name": "message", "required": false, "schema": { "type": "string" } }, { "name": "data", "required": false, "schema": { "type": "object" } } ] } } ], "refName": "JsonRpcResponse" } ``` --- ## NEAR Protocol RPC: Node Metrics - HTML path: https://docs.fastnear.com/rpcs/protocol/metrics - Markdown path: https://docs.fastnear.com/rpcs/protocol/metrics.md # NEAR Protocol RPC: Node Metrics Get node metrics Retrieves Prometheus-format node metrics from the HTTP `/metrics` endpoint. Requires an API key. ## Source links - https://docs.fastnear.com/rpcs/protocol/metrics - https://docs.fastnear.com/rpcs/protocol/metrics/other/metrics - https://docs.fastnear.com/reference/operation/metrics ## Operation - Transport: json-rpc - Method: GET - Path: `/metrics` - Source spec: `rpcs/protocol/metrics.yaml` ## Networks - Mainnet: https://rpc.mainnet.fastnear.com/ - Testnet: https://rpc.testnet.fastnear.com/ ## Auth - API key via query `apiKey`: The OpenAPI contract describes the FastNEAR API key as a query parameter named apiKey. - This export intentionally omits any locally saved credentials ## Current request - Network: Mainnet - Finality: final - Endpoint: https://rpc.mainnet.fastnear.com/ ### Request body ```json { "jsonrpc": "2.0", "id": "fastnear", "method": "metrics", "params": {} } ``` ## Request reference ## Response reference - Status: 200 - Media type: text/plain - Summary: Successful response ### Response schema ```json { "type": "string", "description": "Prometheus exposition text", "example": "# HELP process_cpu_seconds_total Total user and system CPU time spent in seconds.\n# TYPE process_cpu_seconds_total counter\nprocess_cpu_seconds_total 12.34" } ``` --- ## NEAR Protocol RPC: Get network info - HTML path: https://docs.fastnear.com/rpcs/protocol/network_info - Markdown path: https://docs.fastnear.com/rpcs/protocol/network_info.md # NEAR Protocol RPC: Get network info Get network info List the node's active peer connections and the block producers it currently tracks. ## Source links - https://docs.fastnear.com/rpcs/protocol/network_info - https://docs.fastnear.com/rpcs/protocol/network_info/other/network_info - https://docs.fastnear.com/reference/operation/network_info ## Operation - Transport: json-rpc - Method: POST - Path: `/` - Source spec: `rpcs/protocol/network_info.yaml` ## Networks - Mainnet: https://rpc.mainnet.fastnear.com/ - Testnet: https://rpc.testnet.fastnear.com/ ## Auth - API key via query `apiKey`: The OpenAPI contract describes the FastNEAR API key as a query parameter named apiKey. - This export intentionally omits any locally saved credentials ## Current request - Network: Mainnet - Finality: final - Endpoint: https://rpc.mainnet.fastnear.com/ ### Request body ```json { "jsonrpc": "2.0", "id": "fastnear", "method": "network_info", "params": [] } ``` ## Request reference ### Active example ```json { "body": { "jsonrpc": "2.0", "id": "fastnear", "method": "network_info", "params": [] }, "headers": {}, "path": {}, "query": {} } ``` ### Request schema ```json { "type": "object", "required": [ "jsonrpc", "id", "method", "params" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "type": "string", "example": "fastnear" } }, { "name": "method", "required": true, "schema": { "type": "string", "enum": [ "network_info" ] } }, { "name": "params", "required": true, "schema": { "type": "array", "description": "Empty array as this method takes no parameters", "example": [] } } ] } ``` ## Response reference - Status: 200 - Media type: application/json - Summary: Successful response ### Response schema ```json { "type": "object", "required": [ "jsonrpc", "id" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "oneOf": [ { "type": "string" }, { "type": "number" } ] } }, { "name": "result", "required": false, "schema": { "type": "object", "required": [ "active_peers", "num_active_peers", "peer_max_count", "sent_bytes_per_sec", "received_bytes_per_sec", "known_producers" ], "properties": [ { "name": "active_peers", "required": true, "schema": { "type": "array", "items": { "type": "object" } } }, { "name": "known_producers", "required": true, "schema": { "type": "array", "description": "Accounts of known block and chunk producers from routing table.", "items": { "type": "object" } } }, { "name": "num_active_peers", "required": true, "schema": { "type": "integer", "format": "uint" } }, { "name": "peer_max_count", "required": true, "schema": { "type": "integer", "format": "uint32" } }, { "name": "received_bytes_per_sec", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "sent_bytes_per_sec", "required": true, "schema": { "type": "integer", "format": "uint64" } } ] } }, { "name": "error", "required": false, "schema": { "type": "object", "properties": [ { "name": "code", "required": false, "schema": { "type": "integer" } }, { "name": "message", "required": false, "schema": { "type": "string" } }, { "name": "data", "required": false, "schema": { "type": "object" } } ] } } ], "refName": "JsonRpcResponse" } ``` --- ## NEAR Protocol RPC: Get next light client block - HTML path: https://docs.fastnear.com/rpcs/protocol/next_light_client_block - Markdown path: https://docs.fastnear.com/rpcs/protocol/next_light_client_block.md # NEAR Protocol RPC: Get next light client block Get next light client block Advance a light client's verified chain by fetching the next block header after a known Base58 head hash. ## Source links - https://docs.fastnear.com/rpcs/protocol/next_light_client_block - https://docs.fastnear.com/rpcs/protocol/next_light_client_block/other/next_light_client_block - https://docs.fastnear.com/reference/operation/next_light_client_block ## Operation - Transport: json-rpc - Method: POST - Path: `/` - Source spec: `rpcs/protocol/next_light_client_block.yaml` ## Networks - Mainnet: https://rpc.mainnet.fastnear.com/ - Testnet: https://rpc.testnet.fastnear.com/ ## Auth - API key via query `apiKey`: The OpenAPI contract describes the FastNEAR API key as a query parameter named apiKey. - This export intentionally omits any locally saved credentials ## Current request - Network: Mainnet - Finality: final - Endpoint: https://rpc.mainnet.fastnear.com/ ### Request body ```json { "jsonrpc": "2.0", "id": "fastnear", "method": "next_light_client_block", "params": { "last_block_hash": "9XN7MtDywZvfGx6TKy1MT2iCZkKuHikJXmNazxdZ4x6T" } } ``` ## Request reference ### Active example ```json { "body": { "jsonrpc": "2.0", "id": "fastnear", "method": "next_light_client_block", "params": { "last_block_hash": "9XN7MtDywZvfGx6TKy1MT2iCZkKuHikJXmNazxdZ4x6T" } }, "headers": {}, "path": {}, "query": {} } ``` ### Inputs - `last_block_hash` (body, required, string): Base58-encoded hash ### Request schema ```json { "type": "object", "required": [ "jsonrpc", "id", "method", "params" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "type": "string", "example": "fastnear" } }, { "name": "method", "required": true, "schema": { "type": "string", "enum": [ "next_light_client_block" ] } }, { "name": "params", "required": true, "schema": { "type": "object", "required": [ "last_block_hash" ], "properties": [ { "name": "last_block_hash", "required": true, "schema": { "type": "string", "description": "Base58-encoded hash" } } ] } } ] } ``` ## Response reference - Status: 200 - Media type: application/json - Summary: Successful response ### Response schema ```json { "type": "object", "required": [ "jsonrpc", "id" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "oneOf": [ { "type": "string" }, { "type": "number" } ] } }, { "name": "result", "required": false, "schema": { "type": "object", "description": "A state for the current head of a light client. More info [here](https://nomicon.io/ChainSpec/LightClient).", "properties": [ { "name": "approvals_after_next", "required": false, "schema": { "type": "array", "items": { "type": "string", "nullable": true, "description": "Base58-encoded cryptographic signature" } } }, { "name": "inner_lite", "required": false, "schema": { "type": "object", "description": "A part of a state for the current head of a light client. More info [here](https://nomicon.io/ChainSpec/LightClient).", "required": [ "height", "epoch_id", "next_epoch_id", "prev_state_root", "outcome_root", "timestamp", "timestamp_nanosec", "next_bp_hash", "block_merkle_root" ], "properties": [ { "name": "block_merkle_root", "required": true, "schema": { "type": "string", "description": "Base58-encoded hash" } }, { "name": "epoch_id", "required": true, "schema": { "type": "string", "description": "Base58-encoded hash" } }, { "name": "height", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "next_bp_hash", "required": true, "schema": { "type": "string", "description": "Base58-encoded hash" } }, { "name": "next_epoch_id", "required": true, "schema": { "type": "string", "description": "Base58-encoded hash" } }, { "name": "outcome_root", "required": true, "schema": { "type": "string", "description": "Base58-encoded hash" } }, { "name": "prev_state_root", "required": true, "schema": { "type": "string", "description": "Base58-encoded hash" } }, { "name": "timestamp", "required": true, "schema": { "type": "integer", "description": "Legacy json number. Should not be used.", "format": "uint64" } }, { "name": "timestamp_nanosec", "required": true, "schema": { "type": "string" } } ] } }, { "name": "inner_rest_hash", "required": false, "schema": { "type": "string", "description": "Base58-encoded hash" } }, { "name": "next_block_inner_hash", "required": false, "schema": { "type": "string", "description": "Base58-encoded hash" } }, { "name": "next_bps", "required": false, "schema": { "type": "array", "items": { "type": "object", "description": "One of multiple possible types" } } }, { "name": "prev_block_hash", "required": false, "schema": { "type": "string", "description": "Base58-encoded hash" } } ] } }, { "name": "error", "required": false, "schema": { "type": "object", "properties": [ { "name": "code", "required": false, "schema": { "type": "integer" } }, { "name": "message", "required": false, "schema": { "type": "string" } }, { "name": "data", "required": false, "schema": { "type": "object" } } ] } } ], "refName": "JsonRpcResponse" } ``` --- ## NEAR Protocol RPC: Get node status - HTML path: https://docs.fastnear.com/rpcs/protocol/status - Markdown path: https://docs.fastnear.com/rpcs/protocol/status.md # NEAR Protocol RPC: Get node status Get node status Fetch a node's binary version, sync progress, and head block in one snapshot. ## Source links - https://docs.fastnear.com/rpcs/protocol/status - https://docs.fastnear.com/rpcs/protocol/status/other/status - https://docs.fastnear.com/reference/operation/status ## Operation - Transport: json-rpc - Method: POST - Path: `/` - Source spec: `rpcs/protocol/status.yaml` ## Networks - Mainnet: https://rpc.mainnet.fastnear.com/ - Testnet: https://rpc.testnet.fastnear.com/ ## Auth - API key via query `apiKey`: The OpenAPI contract describes the FastNEAR API key as a query parameter named apiKey. - This export intentionally omits any locally saved credentials ## Current request - Network: Mainnet - Finality: final - Endpoint: https://rpc.mainnet.fastnear.com/ ### Request body ```json { "jsonrpc": "2.0", "id": "fastnear", "method": "status", "params": [] } ``` ## Request reference ### Active example ```json { "body": { "jsonrpc": "2.0", "id": "fastnear", "method": "status", "params": [] }, "headers": {}, "path": {}, "query": {} } ``` ### Request schema ```json { "type": "object", "required": [ "jsonrpc", "id", "method", "params" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "type": "string", "example": "fastnear" } }, { "name": "method", "required": true, "schema": { "type": "string", "enum": [ "status" ] } }, { "name": "params", "required": true, "schema": { "type": "array", "description": "Empty array as this method takes no parameters", "example": [] } } ] } ``` ## Response reference - Status: 200 - Media type: application/json - Summary: Successful response ### Response schema ```json { "type": "object", "required": [ "jsonrpc", "id" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "oneOf": [ { "type": "string" }, { "type": "number" } ] } }, { "name": "result", "required": false, "schema": { "type": "object", "required": [ "version", "chain_id", "protocol_version", "latest_protocol_version", "validators", "sync_info", "node_public_key", "uptime_sec", "genesis_hash" ], "properties": [ { "name": "chain_id", "required": true, "schema": { "type": "string", "description": "Unique chain id." } }, { "name": "detailed_debug_status", "required": false, "schema": { "type": "object", "nullable": true, "required": [ "network_info", "sync_status", "catchup_status", "current_head_status", "current_header_head_status", "block_production_delay_millis" ], "properties": [ { "name": "block_production_delay_millis", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "catchup_status", "required": true, "schema": { "type": "array", "items": { "type": "object" } } }, { "name": "current_head_status", "required": true, "schema": { "type": "object", "description": "Height and hash of a block" } }, { "name": "current_header_head_status", "required": true, "schema": { "type": "object", "description": "Height and hash of a block" } }, { "name": "network_info", "required": true, "schema": { "type": "object" } }, { "name": "sync_status", "required": true, "schema": { "type": "string" } } ] } }, { "name": "genesis_hash", "required": true, "schema": { "type": "string", "description": "Base58-encoded hash" } }, { "name": "latest_protocol_version", "required": true, "schema": { "type": "integer", "description": "Latest protocol version that this client supports.", "format": "uint32" } }, { "name": "node_key", "required": false, "schema": { "type": "string", "nullable": true, "description": "ed25519: or secp256k1: prefixed public key" } }, { "name": "node_public_key", "required": true, "schema": { "type": "string", "description": "ed25519: or secp256k1: prefixed public key" } }, { "name": "protocol_version", "required": true, "schema": { "type": "integer", "description": "Currently active protocol version.", "format": "uint32" } }, { "name": "rpc_addr", "required": false, "schema": { "type": "string", "nullable": true, "description": "Address for RPC server. None if node doesn't have RPC endpoint enabled." } }, { "name": "sync_info", "required": true, "schema": { "type": "object", "description": "Sync status of the node.", "required": [ "latest_block_hash", "latest_block_height", "latest_state_root", "latest_block_time", "syncing" ], "properties": [ { "name": "earliest_block_hash", "required": false, "schema": { "type": "string", "nullable": true, "description": "Base58-encoded hash" } }, { "name": "earliest_block_height", "required": false, "schema": { "type": "integer", "nullable": true, "format": "uint64" } }, { "name": "earliest_block_time", "required": false, "schema": { "type": "string", "nullable": true } }, { "name": "epoch_id", "required": false, "schema": { "type": "string", "nullable": true, "description": "Base58-encoded epoch identifier hash" } }, { "name": "epoch_start_height", "required": false, "schema": { "type": "integer", "nullable": true, "format": "uint64" } }, { "name": "latest_block_hash", "required": true, "schema": { "type": "string", "description": "Base58-encoded hash" } }, { "name": "latest_block_height", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "latest_block_time", "required": true, "schema": { "type": "string" } }, { "name": "latest_state_root", "required": true, "schema": { "type": "string", "description": "Base58-encoded hash" } }, { "name": "syncing", "required": true, "schema": { "type": "boolean" } } ] } }, { "name": "uptime_sec", "required": true, "schema": { "type": "integer", "description": "Uptime of the node.", "format": "int64" } }, { "name": "validator_account_id", "required": false, "schema": { "type": "string", "nullable": true, "description": "NEAR account ID" } }, { "name": "validator_public_key", "required": false, "schema": { "type": "string", "nullable": true, "description": "ed25519: or secp256k1: prefixed public key" } }, { "name": "validators", "required": true, "schema": { "type": "array", "description": "Current epoch validators.", "items": { "type": "object" } } }, { "name": "version", "required": true, "schema": { "type": "object", "description": "Data structure for semver version and github tag or commit.", "required": [ "version", "build", "commit" ], "properties": [ { "name": "build", "required": true, "schema": { "type": "string" } }, { "name": "commit", "required": true, "schema": { "type": "string" } }, { "name": "rustc_version", "required": false, "schema": { "type": "string", "default": "" } }, { "name": "version", "required": true, "schema": { "type": "string" } } ] } } ] } }, { "name": "error", "required": false, "schema": { "type": "object", "properties": [ { "name": "code", "required": false, "schema": { "type": "integer" } }, { "name": "message", "required": false, "schema": { "type": "string" } }, { "name": "data", "required": false, "schema": { "type": "object" } } ] } } ], "refName": "JsonRpcResponse" } ``` --- ## NEAR Protocol RPC: Send transaction asynchronously - HTML path: https://docs.fastnear.com/rpcs/transaction/broadcast_tx_async - Markdown path: https://docs.fastnear.com/rpcs/transaction/broadcast_tx_async.md # NEAR Protocol RPC: Send transaction asynchronously Send transaction asynchronously Submit a freshly signed transaction and immediately get its hash — no wait for execution. Default examples are illustrative only and are not reusable signed payloads. ## Source links - https://docs.fastnear.com/rpcs/transaction/broadcast_tx_async - https://docs.fastnear.com/rpcs/transaction/broadcast_tx_async/other/broadcast_tx_async - https://docs.fastnear.com/reference/operation/broadcast_tx_async ## Operation - Transport: json-rpc - Method: POST - Path: `/` - Source spec: `rpcs/transaction/broadcast_tx_async.yaml` ## Networks - Mainnet: https://rpc.mainnet.fastnear.com/ - Testnet: https://rpc.testnet.fastnear.com/ ## Auth - API key via query `apiKey`: The OpenAPI contract describes the FastNEAR API key as a query parameter named apiKey. - This export intentionally omits any locally saved credentials ## Current request - Network: Mainnet - Finality: final - Endpoint: https://rpc.mainnet.fastnear.com/ ### Request body ```json { "jsonrpc": "2.0", "id": "fastnear", "method": "broadcast_tx_async", "params": { "signed_tx_base64": "DgAAAG1pa2UubmVhcgCpPJgEEFUwQjFQvL8V3CnZ0h688WG5sVsKE8JYM37ax2cUjgEAAAAAAAAADQAAAG1pa2V0ZXN0Lm5lYXIPfFBmYNAIe2/MicVhDXbvT3w06LxS2OCF0UHIYgjNDQAAAHRlc3RpbmcgbWVtbwEAAAADAQAAAAAAAAAAAAAAAAAAAA==" } } ``` ## Request reference ### Active example ```json { "body": { "jsonrpc": "2.0", "id": "fastnear", "method": "broadcast_tx_async", "params": { "signed_tx_base64": "DgAAAG1pa2UubmVhcgCpPJgEEFUwQjFQvL8V3CnZ0h688WG5sVsKE8JYM37ax2cUjgEAAAAAAAAADQAAAG1pa2V0ZXN0Lm5lYXIPfFBmYNAIe2/MicVhDXbvT3w06LxS2OCF0UHIYgjNDQAAAHRlc3RpbmcgbWVtbwEAAAADAQAAAAAAAAAAAAAAAAAAAA==" } }, "headers": {}, "path": {}, "query": {} } ``` ### Inputs - `signed_tx_base64` (body, required, string): Base64-encoded signed transaction. Generate a fresh signed payload for the signing account immediately before submission or status lookup. - `wait_until` (body, string): Desired level of execution status guarantee ### Request schema ```json { "type": "object", "required": [ "jsonrpc", "id", "method", "params" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "type": "string", "example": "fastnear" } }, { "name": "method", "required": true, "schema": { "type": "string", "enum": [ "broadcast_tx_async" ] } }, { "name": "params", "required": true, "schema": { "type": "object", "required": [ "signed_tx_base64" ], "properties": [ { "name": "signed_tx_base64", "required": true, "schema": { "type": "string", "description": "Base64-encoded signed transaction. Generate a fresh signed payload for the signing account immediately before submission or status lookup." } }, { "name": "wait_until", "required": false, "schema": { "type": "string", "description": "Desired level of execution status guarantee", "default": "EXECUTED_OPTIMISTIC", "enum": [ "NONE", "INCLUDED", "INCLUDED_FINAL", "EXECUTED", "EXECUTED_OPTIMISTIC", "FINAL" ] } } ] } } ] } ``` ## Response reference - Status: 200 - Media type: application/json - Summary: Successful response ### Response schema ```json { "type": "object", "required": [ "jsonrpc", "id" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "oneOf": [ { "type": "string" }, { "type": "number" } ] } }, { "name": "result", "required": false, "schema": { "type": "string", "description": "Base58-encoded hash" } }, { "name": "error", "required": false, "schema": { "type": "object", "properties": [ { "name": "code", "required": false, "schema": { "type": "integer" } }, { "name": "message", "required": false, "schema": { "type": "string" } }, { "name": "data", "required": false, "schema": { "type": "object" } } ] } } ], "refName": "JsonRpcResponse" } ``` --- ## NEAR Protocol RPC: Send transaction and wait - HTML path: https://docs.fastnear.com/rpcs/transaction/broadcast_tx_commit - Markdown path: https://docs.fastnear.com/rpcs/transaction/broadcast_tx_commit.md # NEAR Protocol RPC: Send transaction and wait Send transaction and wait Submit a freshly signed transaction and wait for its commit — the legacy synchronous send, superseded by `send_tx`. Default examples are illustrative only and are not reusable signed payloads. ## Source links - https://docs.fastnear.com/rpcs/transaction/broadcast_tx_commit - https://docs.fastnear.com/rpcs/transaction/broadcast_tx_commit/other/broadcast_tx_commit - https://docs.fastnear.com/reference/operation/broadcast_tx_commit ## Operation - Transport: json-rpc - Method: POST - Path: `/` - Source spec: `rpcs/transaction/broadcast_tx_commit.yaml` ## Networks - Mainnet: https://rpc.mainnet.fastnear.com/ - Testnet: https://rpc.testnet.fastnear.com/ ## Auth - API key via query `apiKey`: The OpenAPI contract describes the FastNEAR API key as a query parameter named apiKey. - This export intentionally omits any locally saved credentials ## Current request - Network: Mainnet - Finality: final - Endpoint: https://rpc.mainnet.fastnear.com/ ### Request body ```json { "jsonrpc": "2.0", "id": "fastnear", "method": "broadcast_tx_commit", "params": { "signed_tx_base64": "DgAAAG1pa2UubmVhcgCpPJgEEFUwQjFQvL8V3CnZ0h688WG5sVsKE8JYM37ax2cUjgEAAAAAAAAADQAAAG1pa2V0ZXN0Lm5lYXIPfFBmYNAIe2/MicVhDXbvT3w06LxS2OCF0UHIYgjNDQAAAHRlc3RpbmcgbWVtbwEAAAADAQAAAAAAAAAAAAAAAAAAAA==" } } ``` ## Request reference ### Active example ```json { "body": { "jsonrpc": "2.0", "id": "fastnear", "method": "broadcast_tx_commit", "params": { "signed_tx_base64": "DgAAAG1pa2UubmVhcgCpPJgEEFUwQjFQvL8V3CnZ0h688WG5sVsKE8JYM37ax2cUjgEAAAAAAAAADQAAAG1pa2V0ZXN0Lm5lYXIPfFBmYNAIe2/MicVhDXbvT3w06LxS2OCF0UHIYgjNDQAAAHRlc3RpbmcgbWVtbwEAAAADAQAAAAAAAAAAAAAAAAAAAA==" } }, "headers": {}, "path": {}, "query": {} } ``` ### Inputs - `signed_tx_base64` (body, required, string): Base64-encoded signed transaction. Generate a fresh signed payload for the signing account immediately before submission or status lookup. - `wait_until` (body, string): Desired level of execution status guarantee ### Request schema ```json { "type": "object", "required": [ "jsonrpc", "id", "method", "params" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "type": "string", "example": "fastnear" } }, { "name": "method", "required": true, "schema": { "type": "string", "enum": [ "broadcast_tx_commit" ] } }, { "name": "params", "required": true, "schema": { "type": "object", "required": [ "signed_tx_base64" ], "properties": [ { "name": "signed_tx_base64", "required": true, "schema": { "type": "string", "description": "Base64-encoded signed transaction. Generate a fresh signed payload for the signing account immediately before submission or status lookup." } }, { "name": "wait_until", "required": false, "schema": { "type": "string", "description": "Desired level of execution status guarantee", "default": "EXECUTED_OPTIMISTIC", "enum": [ "NONE", "INCLUDED", "INCLUDED_FINAL", "EXECUTED", "EXECUTED_OPTIMISTIC", "FINAL" ] } } ] } } ] } ``` ## Response reference - Status: 200 - Media type: application/json - Summary: Successful response ### Response schema ```json { "type": "object", "required": [ "jsonrpc", "id" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "oneOf": [ { "type": "string" }, { "type": "number" } ] } }, { "name": "result", "required": false, "schema": { "type": "object", "required": [ "final_execution_status" ], "properties": [ { "name": "final_execution_status", "required": true, "schema": { "type": "string", "description": "Desired level of execution status guarantee", "enum": [ "NONE", "INCLUDED", "INCLUDED_FINAL", "EXECUTED", "EXECUTED_OPTIMISTIC", "FINAL" ] } }, { "name": "receipts", "required": false, "schema": { "type": "array", "description": "Receipts generated from the transaction", "items": { "type": "object" } } }, { "name": "receipts_outcome", "required": false, "schema": { "type": "array", "description": "The execution outcome of receipts.", "items": { "type": "object" } } }, { "name": "status", "required": false, "schema": { "type": "object", "description": "One of multiple possible types" } }, { "name": "transaction", "required": false, "schema": { "type": "object", "description": "Signed Transaction" } }, { "name": "transaction_outcome", "required": false, "schema": { "type": "object", "description": "The execution outcome of the signed transaction." } } ] } }, { "name": "error", "required": false, "schema": { "type": "object", "properties": [ { "name": "code", "required": false, "schema": { "type": "integer" } }, { "name": "message", "required": false, "schema": { "type": "string" } }, { "name": "data", "required": false, "schema": { "type": "object" } } ] } } ], "refName": "JsonRpcResponse" } ``` --- ## NEAR Protocol RPC: Get receipt by ID - HTML path: https://docs.fastnear.com/rpcs/transaction/EXPERIMENTAL_receipt - Markdown path: https://docs.fastnear.com/rpcs/transaction/EXPERIMENTAL_receipt.md # NEAR Protocol RPC: Get receipt by ID Get receipt by ID Fetch a single receipt by Base58 ID — the cross-shard execution unit a transaction produces. ## Source links - https://docs.fastnear.com/rpcs/transaction/EXPERIMENTAL_receipt - https://docs.fastnear.com/rpcs/transaction/EXPERIMENTAL_receipt/other/EXPERIMENTAL_receipt - https://docs.fastnear.com/reference/operation/EXPERIMENTAL_receipt ## Operation - Transport: json-rpc - Method: POST - Path: `/` - Source spec: `rpcs/transaction/EXPERIMENTAL_receipt.yaml` ## Networks - Mainnet: https://rpc.mainnet.fastnear.com/ - Testnet: https://rpc.testnet.fastnear.com/ ## Auth - API key via query `apiKey`: The OpenAPI contract describes the FastNEAR API key as a query parameter named apiKey. - This export intentionally omits any locally saved credentials ## Current request - Network: Mainnet - Finality: final - Endpoint: https://rpc.mainnet.fastnear.com/ ### Request body ```json { "jsonrpc": "2.0", "id": "fastnear", "method": "EXPERIMENTAL_receipt", "params": { "receipt_id": "ETMK9HmPsAYcNxfSXBejMWQs57W4Ph5HDYoYhDMpotQn" } } ``` ## Request reference ### Active example ```json { "body": { "jsonrpc": "2.0", "id": "fastnear", "method": "EXPERIMENTAL_receipt", "params": { "receipt_id": "ETMK9HmPsAYcNxfSXBejMWQs57W4Ph5HDYoYhDMpotQn" } }, "headers": {}, "path": {}, "query": {} } ``` ### Inputs - `receipt_id` (body, required, string): Base58-encoded hash ### Request schema ```json { "type": "object", "required": [ "jsonrpc", "id", "method", "params" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "type": "string", "example": "fastnear" } }, { "name": "method", "required": true, "schema": { "type": "string", "enum": [ "EXPERIMENTAL_receipt" ] } }, { "name": "params", "required": true, "schema": { "type": "object", "required": [ "receipt_id" ], "properties": [ { "name": "receipt_id", "required": true, "schema": { "type": "string", "description": "Base58-encoded hash" } } ] } } ] } ``` ## Response reference - Status: 200 - Media type: application/json - Summary: Successful response ### Response schema ```json { "type": "object", "required": [ "jsonrpc", "id" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "oneOf": [ { "type": "string" }, { "type": "number" } ] } }, { "name": "result", "required": false, "schema": { "type": "object", "required": [ "predecessor_id", "receiver_id", "receipt_id", "receipt" ], "properties": [ { "name": "predecessor_id", "required": true, "schema": { "type": "string", "description": "NEAR account ID" } }, { "name": "priority", "required": false, "schema": { "type": "integer", "description": "Deprecated, retained for backward compatibility.", "format": "uint64", "default": 0 } }, { "name": "receipt", "required": true, "schema": { "type": "object", "description": "One of multiple possible types" } }, { "name": "receipt_id", "required": true, "schema": { "type": "string", "description": "Base58-encoded hash" } }, { "name": "receiver_id", "required": true, "schema": { "type": "string", "description": "NEAR account ID" } } ] } }, { "name": "error", "required": false, "schema": { "type": "object", "properties": [ { "name": "code", "required": false, "schema": { "type": "integer" } }, { "name": "message", "required": false, "schema": { "type": "string" } }, { "name": "data", "required": false, "schema": { "type": "object" } } ] } } ], "refName": "JsonRpcResponse" } ``` --- ## NEAR Protocol RPC: Get detailed transaction status - HTML path: https://docs.fastnear.com/rpcs/transaction/EXPERIMENTAL_tx_status - Markdown path: https://docs.fastnear.com/rpcs/transaction/EXPERIMENTAL_tx_status.md # NEAR Protocol RPC: Get detailed transaction status Get detailed transaction status Fetch a transaction's full receipt tree and per-receipt outcomes by Base58 hash — richer than `tx_status`. ## Source links - https://docs.fastnear.com/rpcs/transaction/EXPERIMENTAL_tx_status - https://docs.fastnear.com/rpcs/transaction/EXPERIMENTAL_tx_status/other/EXPERIMENTAL_tx_status - https://docs.fastnear.com/reference/operation/EXPERIMENTAL_tx_status ## Operation - Transport: json-rpc - Method: POST - Path: `/` - Source spec: `rpcs/transaction/EXPERIMENTAL_tx_status.yaml` ## Networks - Mainnet: https://rpc.mainnet.fastnear.com/ - Testnet: https://rpc.testnet.fastnear.com/ ## Auth - API key via query `apiKey`: The OpenAPI contract describes the FastNEAR API key as a query parameter named apiKey. - This export intentionally omits any locally saved credentials ## Current request - Network: Mainnet - Finality: final - Endpoint: https://rpc.mainnet.fastnear.com/ ### Request body ```json { "jsonrpc": "2.0", "id": "fastnear", "method": "EXPERIMENTAL_tx_status", "params": { "wait_until": "EXECUTED_OPTIMISTIC", "sender_account_id": "escrow.ai.near", "tx_hash": "34E7weKCDqXh3xPKdBgSWRqo44yTWjbka9deMK8JbAxx" } } ``` ## Request reference ### Active example ```json { "body": { "jsonrpc": "2.0", "id": "fastnear", "method": "EXPERIMENTAL_tx_status", "params": { "wait_until": "EXECUTED_OPTIMISTIC", "sender_account_id": "escrow.ai.near", "tx_hash": "34E7weKCDqXh3xPKdBgSWRqo44yTWjbka9deMK8JbAxx" } }, "headers": {}, "path": {}, "query": {} } ``` ### Inputs - `wait_until` (body, string): Desired level of execution status guarantee - `signed_tx_base64` (body, string): Base64-encoded signed transaction. Generate a fresh signed payload for the signing account immediately before submission or status lookup. - `sender_account_id` (body, string): NEAR account ID - `tx_hash` (body, string): Base58-encoded hash ### Request schema ```json { "type": "object", "required": [ "jsonrpc", "id", "method", "params" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "type": "string", "example": "fastnear" } }, { "name": "method", "required": true, "schema": { "type": "string", "enum": [ "EXPERIMENTAL_tx_status" ] } }, { "name": "params", "required": true, "schema": { "type": "object", "properties": [ { "name": "wait_until", "required": false, "schema": { "type": "string", "description": "Desired level of execution status guarantee", "default": "EXECUTED_OPTIMISTIC", "enum": [ "NONE", "INCLUDED", "INCLUDED_FINAL", "EXECUTED", "EXECUTED_OPTIMISTIC", "FINAL" ] } }, { "name": "signed_tx_base64", "required": false, "schema": { "type": "string", "description": "Base64-encoded signed transaction. Generate a fresh signed payload for the signing account immediately before submission or status lookup." } }, { "name": "sender_account_id", "required": false, "schema": { "type": "string", "description": "NEAR account ID" } }, { "name": "tx_hash", "required": false, "schema": { "type": "string", "description": "Base58-encoded hash" } } ] } } ] } ``` ## Response reference - Status: 200 - Media type: application/json - Summary: Successful response ### Response schema ```json { "type": "object", "required": [ "jsonrpc", "id" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "oneOf": [ { "type": "string" }, { "type": "number" } ] } }, { "name": "result", "required": false, "schema": { "type": "object", "required": [ "final_execution_status" ], "properties": [ { "name": "final_execution_status", "required": true, "schema": { "type": "string", "description": "Desired level of execution status guarantee", "enum": [ "NONE", "INCLUDED", "INCLUDED_FINAL", "EXECUTED", "EXECUTED_OPTIMISTIC", "FINAL" ] } }, { "name": "receipts", "required": false, "schema": { "type": "array", "description": "Receipts generated from the transaction", "items": { "type": "object" } } }, { "name": "receipts_outcome", "required": false, "schema": { "type": "array", "description": "The execution outcome of receipts.", "items": { "type": "object" } } }, { "name": "status", "required": false, "schema": { "type": "object", "description": "One of multiple possible types" } }, { "name": "transaction", "required": false, "schema": { "type": "object", "description": "Signed Transaction" } }, { "name": "transaction_outcome", "required": false, "schema": { "type": "object", "description": "The execution outcome of the signed transaction." } } ] } }, { "name": "error", "required": false, "schema": { "type": "object", "properties": [ { "name": "code", "required": false, "schema": { "type": "integer" } }, { "name": "message", "required": false, "schema": { "type": "string" } }, { "name": "data", "required": false, "schema": { "type": "object" } } ] } } ], "refName": "JsonRpcResponse" } ``` --- ## NEAR Protocol RPC: Send transaction - HTML path: https://docs.fastnear.com/rpcs/transaction/send_tx - Markdown path: https://docs.fastnear.com/rpcs/transaction/send_tx.md # NEAR Protocol RPC: Send transaction Send transaction Submit a freshly signed transaction and wait for its final execution outcome — the current synchronous send. Default examples are illustrative only and are not reusable signed payloads. ## Source links - https://docs.fastnear.com/rpcs/transaction/send_tx - https://docs.fastnear.com/rpcs/transaction/send_tx/other/send_tx - https://docs.fastnear.com/reference/operation/send_tx ## Operation - Transport: json-rpc - Method: POST - Path: `/` - Source spec: `rpcs/transaction/send_tx.yaml` ## Networks - Mainnet: https://rpc.mainnet.fastnear.com/ - Testnet: https://rpc.testnet.fastnear.com/ ## Auth - API key via query `apiKey`: The OpenAPI contract describes the FastNEAR API key as a query parameter named apiKey. - This export intentionally omits any locally saved credentials ## Current request - Network: Mainnet - Finality: final - Endpoint: https://rpc.mainnet.fastnear.com/ ### Request body ```json { "jsonrpc": "2.0", "id": "fastnear", "method": "send_tx", "params": { "signed_tx_base64": "ExampleBase64EncodedTransaction", "wait_until": "EXECUTED_OPTIMISTIC" } } ``` ## Request reference ### Active example ```json { "body": { "jsonrpc": "2.0", "id": "fastnear", "method": "send_tx", "params": { "signed_tx_base64": "ExampleBase64EncodedTransaction", "wait_until": "EXECUTED_OPTIMISTIC" } }, "headers": {}, "path": {}, "query": {} } ``` ### Inputs - `signed_tx_base64` (body, required, string): Base64-encoded signed transaction. Generate a fresh signed payload for the signing account immediately before submission or status lookup. - `wait_until` (body, string): Desired level of execution status guarantee ### Request schema ```json { "type": "object", "required": [ "jsonrpc", "id", "method", "params" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "type": "string", "example": "fastnear" } }, { "name": "method", "required": true, "schema": { "type": "string", "enum": [ "send_tx" ] } }, { "name": "params", "required": true, "schema": { "type": "object", "required": [ "signed_tx_base64" ], "properties": [ { "name": "signed_tx_base64", "required": true, "schema": { "type": "string", "description": "Base64-encoded signed transaction. Generate a fresh signed payload for the signing account immediately before submission or status lookup." } }, { "name": "wait_until", "required": false, "schema": { "type": "string", "description": "Desired level of execution status guarantee", "default": "EXECUTED_OPTIMISTIC", "enum": [ "NONE", "INCLUDED", "INCLUDED_FINAL", "EXECUTED", "EXECUTED_OPTIMISTIC", "FINAL" ] } } ] } } ] } ``` ## Response reference - Status: 200 - Media type: application/json - Summary: Successful response ### Response schema ```json { "type": "object", "required": [ "jsonrpc", "id" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "oneOf": [ { "type": "string" }, { "type": "number" } ] } }, { "name": "result", "required": false, "schema": { "type": "object", "required": [ "final_execution_status" ], "properties": [ { "name": "final_execution_status", "required": true, "schema": { "type": "string", "description": "Desired level of execution status guarantee", "enum": [ "NONE", "INCLUDED", "INCLUDED_FINAL", "EXECUTED", "EXECUTED_OPTIMISTIC", "FINAL" ] } }, { "name": "receipts", "required": false, "schema": { "type": "array", "description": "Receipts generated from the transaction", "items": { "type": "object" } } }, { "name": "receipts_outcome", "required": false, "schema": { "type": "array", "description": "The execution outcome of receipts.", "items": { "type": "object" } } }, { "name": "status", "required": false, "schema": { "type": "object", "description": "One of multiple possible types" } }, { "name": "transaction", "required": false, "schema": { "type": "object", "description": "Signed Transaction" } }, { "name": "transaction_outcome", "required": false, "schema": { "type": "object", "description": "The execution outcome of the signed transaction." } } ] } }, { "name": "error", "required": false, "schema": { "type": "object", "properties": [ { "name": "code", "required": false, "schema": { "type": "integer" } }, { "name": "message", "required": false, "schema": { "type": "string" } }, { "name": "data", "required": false, "schema": { "type": "object" } } ] } } ], "refName": "JsonRpcResponse" } ``` --- ## NEAR Protocol RPC: Get transaction status - HTML path: https://docs.fastnear.com/rpcs/transaction/tx_status - Markdown path: https://docs.fastnear.com/rpcs/transaction/tx_status.md # NEAR Protocol RPC: Get transaction status Get transaction status Check a transaction's final outcome by Base58 hash — succeeded, failed, or still unresolved. ## Source links - https://docs.fastnear.com/rpcs/transaction/tx_status - https://docs.fastnear.com/rpcs/transaction/tx_status/other/tx_status - https://docs.fastnear.com/reference/operation/tx_status ## Operation - Transport: json-rpc - Method: POST - Path: `/` - Source spec: `rpcs/transaction/tx_status.yaml` ## Networks - Mainnet: https://rpc.mainnet.fastnear.com/ - Testnet: https://rpc.testnet.fastnear.com/ ## Auth - API key via query `apiKey`: The OpenAPI contract describes the FastNEAR API key as a query parameter named apiKey. - This export intentionally omits any locally saved credentials ## Current request - Network: Mainnet - Finality: final - Endpoint: https://rpc.mainnet.fastnear.com/ ### Request body ```json { "jsonrpc": "2.0", "id": "fastnear", "method": "tx", "params": { "tx_hash": "34E7weKCDqXh3xPKdBgSWRqo44yTWjbka9deMK8JbAxx", "sender_account_id": "escrow.ai.near" } } ``` ## Request reference ### Active example ```json { "body": { "jsonrpc": "2.0", "id": "fastnear", "method": "tx", "params": { "tx_hash": "34E7weKCDqXh3xPKdBgSWRqo44yTWjbka9deMK8JbAxx", "sender_account_id": "escrow.ai.near" } }, "headers": {}, "path": {}, "query": {} } ``` ### Inputs - `wait_until` (body, string): Desired level of execution status guarantee - `signed_tx_base64` (body, string): Base64-encoded signed transaction. Generate a fresh signed payload for the signing account immediately before submission or status lookup. - `sender_account_id` (body, string): NEAR account ID - `tx_hash` (body, string): Base58-encoded hash ### Request schema ```json { "type": "object", "required": [ "jsonrpc", "id", "method", "params" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "type": "string", "example": "fastnear" } }, { "name": "method", "required": true, "schema": { "type": "string", "enum": [ "tx" ] } }, { "name": "params", "required": true, "schema": { "type": "object", "properties": [ { "name": "wait_until", "required": false, "schema": { "type": "string", "description": "Desired level of execution status guarantee", "default": "EXECUTED_OPTIMISTIC", "enum": [ "NONE", "INCLUDED", "INCLUDED_FINAL", "EXECUTED", "EXECUTED_OPTIMISTIC", "FINAL" ] } }, { "name": "signed_tx_base64", "required": false, "schema": { "type": "string", "description": "Base64-encoded signed transaction. Generate a fresh signed payload for the signing account immediately before submission or status lookup." } }, { "name": "sender_account_id", "required": false, "schema": { "type": "string", "description": "NEAR account ID" } }, { "name": "tx_hash", "required": false, "schema": { "type": "string", "description": "Base58-encoded hash" } } ] } } ] } ``` ## Response reference - Status: 200 - Media type: application/json - Summary: Successful response ### Response schema ```json { "type": "object", "required": [ "jsonrpc", "id" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "oneOf": [ { "type": "string" }, { "type": "number" } ] } }, { "name": "result", "required": false, "schema": { "type": "object", "required": [ "final_execution_status" ], "properties": [ { "name": "final_execution_status", "required": true, "schema": { "type": "string", "description": "Desired level of execution status guarantee", "enum": [ "NONE", "INCLUDED", "INCLUDED_FINAL", "EXECUTED", "EXECUTED_OPTIMISTIC", "FINAL" ] } }, { "name": "receipts", "required": false, "schema": { "type": "array", "description": "Receipts generated from the transaction", "items": { "type": "object" } } }, { "name": "receipts_outcome", "required": false, "schema": { "type": "array", "description": "The execution outcome of receipts.", "items": { "type": "object" } } }, { "name": "status", "required": false, "schema": { "type": "object", "description": "One of multiple possible types" } }, { "name": "transaction", "required": false, "schema": { "type": "object", "description": "Signed Transaction" } }, { "name": "transaction_outcome", "required": false, "schema": { "type": "object", "description": "The execution outcome of the signed transaction." } } ] } }, { "name": "error", "required": false, "schema": { "type": "object", "properties": [ { "name": "code", "required": false, "schema": { "type": "integer" } }, { "name": "message", "required": false, "schema": { "type": "string" } }, { "name": "data", "required": false, "schema": { "type": "object" } } ] } } ], "refName": "JsonRpcResponse" } ``` --- ## NEAR Protocol RPC: Get validators ordered - HTML path: https://docs.fastnear.com/rpcs/validators/EXPERIMENTAL_validators_ordered - Markdown path: https://docs.fastnear.com/rpcs/validators/EXPERIMENTAL_validators_ordered.md # NEAR Protocol RPC: Get validators ordered Get validators ordered List validators ordered by stake size at a chosen block — broader than just the current active set. ## Source links - https://docs.fastnear.com/rpcs/validators/EXPERIMENTAL_validators_ordered - https://docs.fastnear.com/rpcs/validators/EXPERIMENTAL_validators_ordered/other/EXPERIMENTAL_validators_ordered - https://docs.fastnear.com/reference/operation/EXPERIMENTAL_validators_ordered ## Operation - Transport: json-rpc - Method: POST - Path: `/` - Source spec: `rpcs/validators/EXPERIMENTAL_validators_ordered.yaml` ## Networks - Mainnet: https://rpc.mainnet.fastnear.com/ - Testnet: https://rpc.testnet.fastnear.com/ ## Auth - API key via query `apiKey`: The OpenAPI contract describes the FastNEAR API key as a query parameter named apiKey. - This export intentionally omits any locally saved credentials ## Current request - Network: Mainnet - Finality: final - Endpoint: https://rpc.mainnet.fastnear.com/ ### Request body ```json { "jsonrpc": "2.0", "id": "fastnear", "method": "EXPERIMENTAL_validators_ordered", "params": { "block_id": 194263739 } } ``` ## Request reference ### Active example ```json { "body": { "jsonrpc": "2.0", "id": "fastnear", "method": "EXPERIMENTAL_validators_ordered", "params": { "block_id": 194263739 } }, "headers": {}, "path": {}, "query": {} } ``` ### Inputs - `block_id` (body, integer | string): Block height (integer) or block hash (string) ### Request schema ```json { "type": "object", "required": [ "jsonrpc", "id", "method", "params" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "type": "string", "example": "fastnear" } }, { "name": "method", "required": true, "schema": { "type": "string", "enum": [ "EXPERIMENTAL_validators_ordered" ] } }, { "name": "params", "required": true, "schema": { "type": "object", "properties": [ { "name": "block_id", "required": false, "schema": { "description": "Block height (integer) or block hash (string)", "oneOf": [ { "type": "integer", "description": "Block height" }, { "type": "string", "description": "Base58-encoded block hash" }, { "nullable": true } ] } } ] } } ] } ``` ## Response reference - Status: 200 - Media type: application/json - Summary: Successful response ### Response schema ```json { "type": "object", "required": [ "jsonrpc", "id" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "oneOf": [ { "type": "string" }, { "type": "number" } ] } }, { "name": "result", "required": false, "schema": { "type": "array", "items": { "type": "object", "description": "One of multiple possible types" } } }, { "name": "error", "required": false, "schema": { "type": "object", "properties": [ { "name": "code", "required": false, "schema": { "type": "integer" } }, { "name": "message", "required": false, "schema": { "type": "string" } }, { "name": "data", "required": false, "schema": { "type": "object" } } ] } } ], "refName": "JsonRpcResponse" } ``` --- ## NEAR Protocol RPC: Get validators by epoch - HTML path: https://docs.fastnear.com/rpcs/validators/validators_by_epoch - Markdown path: https://docs.fastnear.com/rpcs/validators/validators_by_epoch.md # NEAR Protocol RPC: Get validators by epoch Get validators by epoch Fetch the validator set for a chosen past epoch, selected by epoch-start block height or Base58 epoch-id hash. ## Source links - https://docs.fastnear.com/rpcs/validators/validators_by_epoch - https://docs.fastnear.com/rpcs/validators/validators_by_epoch/other/validators_by_epoch - https://docs.fastnear.com/reference/operation/validators_by_epoch ## Operation - Transport: json-rpc - Method: POST - Path: `/` - Source spec: `rpcs/validators/validators_by_epoch.yaml` ## Networks - Mainnet: https://rpc.mainnet.fastnear.com/ - Testnet: https://rpc.testnet.fastnear.com/ ## Auth - API key via query `apiKey`: The OpenAPI contract describes the FastNEAR API key as a query parameter named apiKey. - This export intentionally omits any locally saved credentials ## Current request - Network: Mainnet - Finality: final - Endpoint: https://rpc.mainnet.fastnear.com/ ### Request body ```json { "jsonrpc": "2.0", "id": "fastnear", "method": "validators", "params": { "epoch_id": "4cPDvNDzf3zbKvAxPNWnNGGz8x2tty6xhowmsugAm3fo" } } ``` ## Request reference ### Active example ```json { "body": { "jsonrpc": "2.0", "id": "fastnear", "method": "validators", "params": { "epoch_id": "4cPDvNDzf3zbKvAxPNWnNGGz8x2tty6xhowmsugAm3fo" } }, "headers": {}, "path": {}, "query": {} } ``` ### Inputs - `epoch_id` (body, required, string): Base58-encoded epoch identifier hash ### Request schema ```json { "type": "object", "required": [ "jsonrpc", "id", "method", "params" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "type": "string", "example": "fastnear" } }, { "name": "method", "required": true, "schema": { "type": "string", "enum": [ "validators" ] } }, { "name": "params", "required": true, "schema": { "type": "object", "required": [ "epoch_id" ], "properties": [ { "name": "epoch_id", "required": true, "schema": { "type": "string", "description": "Base58-encoded epoch identifier hash" } } ] } } ] } ``` ## Response reference - Status: 200 - Media type: application/json - Summary: Successful response ### Response schema ```json { "type": "object", "required": [ "jsonrpc", "id" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "oneOf": [ { "type": "string" }, { "type": "number" } ] } }, { "name": "result", "required": false, "schema": { "type": "object", "description": "Information about this epoch validators and next epoch validators", "required": [ "current_validators", "next_validators", "current_fishermen", "next_fishermen", "current_proposals", "prev_epoch_kickout", "epoch_start_height", "epoch_height" ], "properties": [ { "name": "current_fishermen", "required": true, "schema": { "type": "array", "description": "Fishermen for the current epoch", "items": { "type": "object", "description": "One of multiple possible types" } } }, { "name": "current_proposals", "required": true, "schema": { "type": "array", "description": "Proposals in the current epoch", "items": { "type": "object", "description": "One of multiple possible types" } } }, { "name": "current_validators", "required": true, "schema": { "type": "array", "description": "Validators for the current epoch", "items": { "type": "object", "description": "Describes information about the current epoch validator" } } }, { "name": "epoch_height", "required": true, "schema": { "type": "integer", "description": "Epoch height", "format": "uint64" } }, { "name": "epoch_start_height", "required": true, "schema": { "type": "integer", "description": "Epoch start block height", "format": "uint64" } }, { "name": "next_fishermen", "required": true, "schema": { "type": "array", "description": "Fishermen for the next epoch", "items": { "type": "object", "description": "One of multiple possible types" } } }, { "name": "next_validators", "required": true, "schema": { "type": "array", "description": "Validators for the next epoch", "items": { "type": "object" } } }, { "name": "prev_epoch_kickout", "required": true, "schema": { "type": "array", "description": "Kickout in the previous epoch", "items": { "type": "object" } } } ] } }, { "name": "error", "required": false, "schema": { "type": "object", "properties": [ { "name": "code", "required": false, "schema": { "type": "integer" } }, { "name": "message", "required": false, "schema": { "type": "string" } }, { "name": "data", "required": false, "schema": { "type": "object" } } ] } } ], "refName": "JsonRpcResponse" } ``` --- ## NEAR Protocol RPC: Get current validators - HTML path: https://docs.fastnear.com/rpcs/validators/validators_current - Markdown path: https://docs.fastnear.com/rpcs/validators/validators_current.md # NEAR Protocol RPC: Get current validators Get current validators Fetch the active validator set for the current epoch, with stakes and performance stats. ## Source links - https://docs.fastnear.com/rpcs/validators/validators_current - https://docs.fastnear.com/rpcs/validators/validators_current/other/validators_current - https://docs.fastnear.com/reference/operation/validators_current ## Operation - Transport: json-rpc - Method: POST - Path: `/` - Source spec: `rpcs/validators/validators_current.yaml` ## Networks - Mainnet: https://rpc.mainnet.fastnear.com/ - Testnet: https://rpc.testnet.fastnear.com/ ## Auth - API key via query `apiKey`: The OpenAPI contract describes the FastNEAR API key as a query parameter named apiKey. - This export intentionally omits any locally saved credentials ## Current request - Network: Mainnet - Finality: final - Endpoint: https://rpc.mainnet.fastnear.com/ ### Request body ```json { "jsonrpc": "2.0", "id": "fastnear", "method": "validators", "params": [ null ] } ``` ## Request reference ### Active example ```json { "body": { "jsonrpc": "2.0", "id": "fastnear", "method": "validators", "params": [ null ] }, "headers": {}, "path": {}, "query": {} } ``` ### Request schema ```json { "type": "object", "required": [ "jsonrpc", "id", "method", "params" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "type": "string", "example": "fastnear" } }, { "name": "method", "required": true, "schema": { "type": "string", "enum": [ "validators" ] } }, { "name": "params", "required": true, "schema": { "type": "array", "example": [ null ], "items": { "nullable": true } } } ] } ``` ## Response reference - Status: 200 - Media type: application/json - Summary: Successful response ### Response schema ```json { "type": "object", "required": [ "jsonrpc", "id" ], "properties": [ { "name": "jsonrpc", "required": true, "schema": { "type": "string", "enum": [ "2.0" ] } }, { "name": "id", "required": true, "schema": { "oneOf": [ { "type": "string" }, { "type": "number" } ] } }, { "name": "result", "required": false, "schema": { "type": "object", "description": "Information about this epoch validators and next epoch validators", "required": [ "current_validators", "next_validators", "current_fishermen", "next_fishermen", "current_proposals", "prev_epoch_kickout", "epoch_start_height", "epoch_height" ], "properties": [ { "name": "current_fishermen", "required": true, "schema": { "type": "array", "description": "Fishermen for the current epoch", "items": { "type": "object", "description": "One of multiple possible types" } } }, { "name": "current_proposals", "required": true, "schema": { "type": "array", "description": "Proposals in the current epoch", "items": { "type": "object", "description": "One of multiple possible types" } } }, { "name": "current_validators", "required": true, "schema": { "type": "array", "description": "Validators for the current epoch", "items": { "type": "object", "description": "Describes information about the current epoch validator" } } }, { "name": "epoch_height", "required": true, "schema": { "type": "integer", "description": "Epoch height", "format": "uint64" } }, { "name": "epoch_start_height", "required": true, "schema": { "type": "integer", "description": "Epoch start block height", "format": "uint64" } }, { "name": "next_fishermen", "required": true, "schema": { "type": "array", "description": "Fishermen for the next epoch", "items": { "type": "object", "description": "One of multiple possible types" } } }, { "name": "next_validators", "required": true, "schema": { "type": "array", "description": "Validators for the next epoch", "items": { "type": "object" } } }, { "name": "prev_epoch_kickout", "required": true, "schema": { "type": "array", "description": "Kickout in the previous epoch", "items": { "type": "object" } } } ] } }, { "name": "error", "required": false, "schema": { "type": "object", "properties": [ { "name": "code", "required": false, "schema": { "type": "integer" } }, { "name": "message", "required": false, "schema": { "type": "string" } }, { "name": "data", "required": false, "schema": { "type": "object" } } ] } } ], "refName": "JsonRpcResponse" } ``` --- ## FastNEAR API - Health - HTML path: https://docs.fastnear.com/apis/fastnear/system/health - Markdown path: https://docs.fastnear.com/apis/fastnear/system/health.md # FastNEAR API - Health Get service health Ping the FastNEAR API for liveness — returns `{status: ok}` when healthy. ## Source links - https://docs.fastnear.com/apis/fastnear/system/health - https://docs.fastnear.com/apis/fastnear/openapi/system/get_health ## Operation - Transport: http - Method: GET - Path: `/health` - Source spec: `apis/fastnear/system/health.yaml` ## Networks - Mainnet: https://api.fastnear.com/ - Testnet: https://test.api.fastnear.com/ ## Auth - API key via query `apiKey`: Optional API key forwarded by embedded portal clients. The public FastNEAR API does not require it. - This export intentionally omits any locally saved credentials ## Current request - Network: Mainnet - Method: GET - URL: https://api.fastnear.com/health - Active example: Mainnet ## Request reference ### Active example ```json { "body": null, "headers": {}, "path": {}, "query": {} } ``` ### Query parameters - `apiKey` (query, string): Optional API key forwarded by embedded portal clients. The public FastNEAR API does not require it. ## Response reference - Status: 200 - Media type: application/json - Summary: Health status string ### Response schema ```json { "type": "object", "required": [ "status" ], "additionalProperties": false, "properties": [ { "name": "status", "required": true, "schema": { "type": "string" } } ], "refName": "HealthResponse" } ``` --- ## FastNEAR API - Status - HTML path: https://docs.fastnear.com/apis/fastnear/system/status - Markdown path: https://docs.fastnear.com/apis/fastnear/system/status.md # FastNEAR API - Status Get service sync status Check the current indexed block height, latency, and deployed service version. ## Source links - https://docs.fastnear.com/apis/fastnear/system/status - https://docs.fastnear.com/apis/fastnear/openapi/system/get_status ## Operation - Transport: http - Method: GET - Path: `/status` - Source spec: `apis/fastnear/system/status.yaml` ## Networks - Mainnet: https://api.fastnear.com/ - Testnet: https://test.api.fastnear.com/ ## Auth - API key via query `apiKey`: Optional API key forwarded by embedded portal clients. The public FastNEAR API does not require it. - This export intentionally omits any locally saved credentials ## Current request - Network: Mainnet - Method: GET - URL: https://api.fastnear.com/status - Active example: Mainnet ## Request reference ### Active example ```json { "body": null, "headers": {}, "path": {}, "query": {} } ``` ### Query parameters - `apiKey` (query, string): Optional API key forwarded by embedded portal clients. The public FastNEAR API does not require it. ## Response reference - Status: 200 - Media type: application/json - Summary: Current FastNEAR API sync status ### Response schema ```json { "type": "object", "required": [ "version", "sync_block_height", "sync_latency_sec", "sync_block_timestamp_nanosec", "sync_balance_block_height" ], "additionalProperties": false, "properties": [ { "name": "sync_balance_block_height", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "sync_block_height", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "sync_block_timestamp_nanosec", "required": true, "schema": { "type": "string" } }, { "name": "sync_latency_sec", "required": true, "schema": { "type": "number", "format": "double" } }, { "name": "version", "required": true, "schema": { "type": "string" } } ], "refName": "StatusResponse" } ``` --- ## FastNEAR API - V0 Account FT - HTML path: https://docs.fastnear.com/apis/fastnear/v0/account_ft - Markdown path: https://docs.fastnear.com/apis/fastnear/v0/account_ft.md # FastNEAR API - V0 Account FT Lookup fungible token contract IDs for an account Fetch the fungible token contract IDs an account has held — contract IDs only, no balances. ## Source links - https://docs.fastnear.com/apis/fastnear/v0/account_ft - https://docs.fastnear.com/apis/fastnear/openapi/fungible-tokens/account_ft_v0 ## Operation - Transport: http - Method: GET - Path: `/v0/account/{account_id}/ft` - Source spec: `apis/fastnear/v0/account_ft.yaml` ## Networks - Mainnet: https://api.fastnear.com/ - Testnet: https://test.api.fastnear.com/ ## Auth - API key via query `apiKey`: Optional API key forwarded by embedded portal clients. The public FastNEAR API does not require it. - This export intentionally omits any locally saved credentials ## Current request - Network: Mainnet - Method: GET - URL: https://api.fastnear.com/v0/account/root.near/ft - Active example: Mainnet ## Request reference ### Active example ```json { "body": null, "headers": {}, "path": { "account_id": "root.near" }, "query": {} } ``` ### Inputs - `account_id` (path, required, string): NEAR account ID to inspect. ### Path parameters - `account_id` (path, required, string): NEAR account ID to inspect. ### Query parameters - `apiKey` (query, string): Optional API key forwarded by embedded portal clients. The public FastNEAR API does not require it. ## Response reference - Status: 200 - Media type: application/json - Summary: Fungible token contract IDs for the requested account ### Response schema ```json { "type": "object", "required": [ "account_id", "contract_ids" ], "additionalProperties": false, "properties": [ { "name": "account_id", "required": true, "schema": { "type": "string" } }, { "name": "contract_ids", "required": true, "schema": { "type": "array", "items": { "type": "string" } } } ], "refName": "V0ContractsResponse" } ``` --- ## FastNEAR API - V0 Account NFT - HTML path: https://docs.fastnear.com/apis/fastnear/v0/account_nft - Markdown path: https://docs.fastnear.com/apis/fastnear/v0/account_nft.md # FastNEAR API - V0 Account NFT Lookup NFT contract IDs for an account Fetch the NFT contract IDs an account has held — contract IDs only, no block-height metadata. ## Source links - https://docs.fastnear.com/apis/fastnear/v0/account_nft - https://docs.fastnear.com/apis/fastnear/openapi/non-fungible-tokens/account_nft_v0 ## Operation - Transport: http - Method: GET - Path: `/v0/account/{account_id}/nft` - Source spec: `apis/fastnear/v0/account_nft.yaml` ## Networks - Mainnet: https://api.fastnear.com/ - Testnet: https://test.api.fastnear.com/ ## Auth - API key via query `apiKey`: Optional API key forwarded by embedded portal clients. The public FastNEAR API does not require it. - This export intentionally omits any locally saved credentials ## Current request - Network: Mainnet - Method: GET - URL: https://api.fastnear.com/v0/account/root.near/nft - Active example: Mainnet ## Request reference ### Active example ```json { "body": null, "headers": {}, "path": { "account_id": "root.near" }, "query": {} } ``` ### Inputs - `account_id` (path, required, string): NEAR account ID to inspect. ### Path parameters - `account_id` (path, required, string): NEAR account ID to inspect. ### Query parameters - `apiKey` (query, string): Optional API key forwarded by embedded portal clients. The public FastNEAR API does not require it. ## Response reference - Status: 200 - Media type: application/json - Summary: NFT contract IDs for the requested account ### Response schema ```json { "type": "object", "required": [ "account_id", "contract_ids" ], "additionalProperties": false, "properties": [ { "name": "account_id", "required": true, "schema": { "type": "string" } }, { "name": "contract_ids", "required": true, "schema": { "type": "array", "items": { "type": "string" } } } ], "refName": "V0ContractsResponse" } ``` --- ## FastNEAR API - V0 Account Staking - HTML path: https://docs.fastnear.com/apis/fastnear/v0/account_staking - Markdown path: https://docs.fastnear.com/apis/fastnear/v0/account_staking.md # FastNEAR API - V0 Account Staking Lookup staking pool account IDs for an account Fetch staking pool account IDs for one account — pool IDs only, no block-height metadata. ## Source links - https://docs.fastnear.com/apis/fastnear/v0/account_staking - https://docs.fastnear.com/apis/fastnear/openapi/staking/account_staking_v0 ## Operation - Transport: http - Method: GET - Path: `/v0/account/{account_id}/staking` - Source spec: `apis/fastnear/v0/account_staking.yaml` ## Networks - Mainnet: https://api.fastnear.com/ - Testnet: https://test.api.fastnear.com/ ## Auth - API key via query `apiKey`: Optional API key forwarded by embedded portal clients. The public FastNEAR API does not require it. - This export intentionally omits any locally saved credentials ## Current request - Network: Mainnet - Method: GET - URL: https://api.fastnear.com/v0/account/root.near/staking - Active example: Mainnet ## Request reference ### Active example ```json { "body": null, "headers": {}, "path": { "account_id": "root.near" }, "query": {} } ``` ### Inputs - `account_id` (path, required, string): NEAR account ID to inspect. ### Path parameters - `account_id` (path, required, string): NEAR account ID to inspect. ### Query parameters - `apiKey` (query, string): Optional API key forwarded by embedded portal clients. The public FastNEAR API does not require it. ## Response reference - Status: 200 - Media type: application/json - Summary: Staking pool account IDs for the requested account ### Response schema ```json { "type": "object", "required": [ "account_id", "pools" ], "additionalProperties": false, "properties": [ { "name": "account_id", "required": true, "schema": { "type": "string" } }, { "name": "pools", "required": true, "schema": { "type": "array", "items": { "type": "string" } } } ], "refName": "V0StakingResponse" } ``` --- ## FastNEAR API - V0 Public Key Lookup - HTML path: https://docs.fastnear.com/apis/fastnear/v0/public_key_lookup - Markdown path: https://docs.fastnear.com/apis/fastnear/v0/public_key_lookup.md # FastNEAR API - V0 Public Key Lookup Lookup full-access accounts by public key Fetch the account IDs that have registered a full-access public key, via the legacy V0 lookup path. ## Source links - https://docs.fastnear.com/apis/fastnear/v0/public_key_lookup - https://docs.fastnear.com/apis/fastnear/openapi/public-key/lookup_by_public_key_v0 ## Operation - Transport: http - Method: GET - Path: `/v0/public_key/{public_key}` - Source spec: `apis/fastnear/v0/public_key_lookup.yaml` ## Networks - Mainnet: https://api.fastnear.com/ - Testnet: https://test.api.fastnear.com/ ## Auth - API key via query `apiKey`: Optional API key forwarded by embedded portal clients. The public FastNEAR API does not require it. - This export intentionally omits any locally saved credentials ## Current request - Network: Mainnet - Method: GET - URL: https://api.fastnear.com/v0/public_key/ed25519%3ACCaThr3uokqnUs6Z5vVnaDcJdrfuTpYJHJWcAGubDjT - Active example: Mainnet ## Request reference ### Active example ```json { "body": null, "headers": {}, "path": { "public_key": "ed25519:CCaThr3uokqnUs6Z5vVnaDcJdrfuTpYJHJWcAGubDjT" }, "query": {} } ``` ### Inputs - `public_key` (path, required, string): NEAR public key in `ed25519:...` or `secp256k1:...` form. ### Path parameters - `public_key` (path, required, string): NEAR public key in `ed25519:...` or `secp256k1:...` form. ### Query parameters - `apiKey` (query, string): Optional API key forwarded by embedded portal clients. The public FastNEAR API does not require it. ## Response reference - Status: 200 - Media type: application/json - Summary: Matching account IDs for the supplied full-access public key ### Response schema ```json { "type": "object", "required": [ "public_key", "account_ids" ], "additionalProperties": false, "properties": [ { "name": "account_ids", "required": true, "schema": { "type": "array", "items": { "type": "string" } } }, { "name": "public_key", "required": true, "schema": { "type": "string" } } ], "refName": "PublicKeyLookupResponse" } ``` --- ## FastNEAR API - V0 Public Key Lookup (All) - HTML path: https://docs.fastnear.com/apis/fastnear/v0/public_key_lookup_all - Markdown path: https://docs.fastnear.com/apis/fastnear/v0/public_key_lookup_all.md # FastNEAR API - V0 Public Key Lookup (All) Lookup all indexed accounts by public key List every account tied to a public key — full-access and limited-access keys together — via the legacy V0 lookup-all path. ## Source links - https://docs.fastnear.com/apis/fastnear/v0/public_key_lookup_all - https://docs.fastnear.com/apis/fastnear/openapi/public-key/lookup_by_public_key_all_v0 ## Operation - Transport: http - Method: GET - Path: `/v0/public_key/{public_key}/all` - Source spec: `apis/fastnear/v0/public_key_lookup_all.yaml` ## Networks - Mainnet: https://api.fastnear.com/ - Testnet: https://test.api.fastnear.com/ ## Auth - API key via query `apiKey`: Optional API key forwarded by embedded portal clients. The public FastNEAR API does not require it. - This export intentionally omits any locally saved credentials ## Current request - Network: Mainnet - Method: GET - URL: https://api.fastnear.com/v0/public_key/ed25519%3ACCaThr3uokqnUs6Z5vVnaDcJdrfuTpYJHJWcAGubDjT/all - Active example: Mainnet ## Request reference ### Active example ```json { "body": null, "headers": {}, "path": { "public_key": "ed25519:CCaThr3uokqnUs6Z5vVnaDcJdrfuTpYJHJWcAGubDjT" }, "query": {} } ``` ### Inputs - `public_key` (path, required, string): NEAR public key in `ed25519:...` or `secp256k1:...` form. ### Path parameters - `public_key` (path, required, string): NEAR public key in `ed25519:...` or `secp256k1:...` form. ### Query parameters - `apiKey` (query, string): Optional API key forwarded by embedded portal clients. The public FastNEAR API does not require it. ## Response reference - Status: 200 - Media type: application/json - Summary: Matching account IDs for the supplied public key, including limited-access keys ### Response schema ```json { "type": "object", "required": [ "public_key", "account_ids" ], "additionalProperties": false, "properties": [ { "name": "account_ids", "required": true, "schema": { "type": "array", "items": { "type": "string" } } }, { "name": "public_key", "required": true, "schema": { "type": "string" } } ], "refName": "PublicKeyLookupResponse" } ``` --- ## FastNEAR API - V1 Account FT - HTML path: https://docs.fastnear.com/apis/fastnear/v1/account_ft - Markdown path: https://docs.fastnear.com/apis/fastnear/v1/account_ft.md # FastNEAR API - V1 Account FT Lookup indexed fungible token rows for an account Fetch an account's fungible token balance rows, each with contract ID, balance, and last-update block height. ## Source links - https://docs.fastnear.com/apis/fastnear/v1/account_ft - https://docs.fastnear.com/apis/fastnear/openapi/fungible-tokens/account_ft_v1 ## Operation - Transport: http - Method: GET - Path: `/v1/account/{account_id}/ft` - Source spec: `apis/fastnear/v1/account_ft.yaml` ## Networks - Mainnet: https://api.fastnear.com/ - Testnet: https://test.api.fastnear.com/ ## Auth - API key via query `apiKey`: Optional API key forwarded by embedded portal clients. The public FastNEAR API does not require it. - This export intentionally omits any locally saved credentials ## Current request - Network: Mainnet - Method: GET - URL: https://api.fastnear.com/v1/account/root.near/ft - Active example: Mainnet ## Request reference ### Active example ```json { "body": null, "headers": {}, "path": { "account_id": "root.near" }, "query": {} } ``` ### Inputs - `account_id` (path, required, string): NEAR account ID to inspect. ### Path parameters - `account_id` (path, required, string): NEAR account ID to inspect. ### Query parameters - `apiKey` (query, string): Optional API key forwarded by embedded portal clients. The public FastNEAR API does not require it. ## Response reference - Status: 200 - Media type: application/json - Summary: Indexed fungible token rows for the requested account ### Response schema ```json { "type": "object", "required": [ "account_id", "tokens" ], "additionalProperties": false, "properties": [ { "name": "account_id", "required": true, "schema": { "type": "string" } }, { "name": "tokens", "required": true, "schema": { "type": "array", "items": { "type": "object", "required": [ "contract_id", "last_update_block_height", "balance" ], "additionalProperties": false, "properties": [ { "name": "balance", "required": true, "schema": { "type": "string" } }, { "name": "contract_id", "required": true, "schema": { "type": "string" } }, { "name": "last_update_block_height", "required": true, "schema": { "type": "integer", "format": "uint64" } } ], "refName": "TokenRow" } } } ], "refName": "V1FtResponse" } ``` --- ## FastNEAR API - V1 Account Full - HTML path: https://docs.fastnear.com/apis/fastnear/v1/account_full - Markdown path: https://docs.fastnear.com/apis/fastnear/v1/account_full.md # FastNEAR API - V1 Account Full Lookup full indexed account information Fetch the combined indexed account view, including staking pools, FT balances, NFTs, and account state. ## Source links - https://docs.fastnear.com/apis/fastnear/v1/account_full - https://docs.fastnear.com/apis/fastnear/openapi/accounts/account_full_v1 ## Operation - Transport: http - Method: GET - Path: `/v1/account/{account_id}/full` - Source spec: `apis/fastnear/v1/account_full.yaml` ## Networks - Mainnet: https://api.fastnear.com/ - Testnet: https://test.api.fastnear.com/ ## Auth - API key via query `apiKey`: Optional API key forwarded by embedded portal clients. The public FastNEAR API does not require it. - This export intentionally omits any locally saved credentials ## Current request - Network: Mainnet - Method: GET - URL: https://api.fastnear.com/v1/account/root.near/full - Active example: Mainnet ## Request reference ### Active example ```json { "body": null, "headers": {}, "path": { "account_id": "root.near" }, "query": {} } ``` ### Inputs - `account_id` (path, required, string): NEAR account ID to inspect. ### Path parameters - `account_id` (path, required, string): NEAR account ID to inspect. ### Query parameters - `apiKey` (query, string): Optional API key forwarded by embedded portal clients. The public FastNEAR API does not require it. ## Response reference - Status: 200 - Media type: application/json - Summary: Full indexed account information for the requested account ### Response schema ```json { "type": "object", "required": [ "account_id", "pools", "tokens", "nfts", "state" ], "additionalProperties": false, "properties": [ { "name": "account_id", "required": true, "schema": { "type": "string" } }, { "name": "nfts", "required": true, "schema": { "type": "array", "items": { "type": "object", "required": [ "contract_id", "last_update_block_height" ], "additionalProperties": false, "properties": [ { "name": "contract_id", "required": true, "schema": { "type": "string" } }, { "name": "last_update_block_height", "required": true, "schema": { "type": "integer", "format": "uint64" } } ], "refName": "NftRow" } } }, { "name": "pools", "required": true, "schema": { "type": "array", "items": { "type": "object", "required": [ "pool_id", "last_update_block_height" ], "additionalProperties": false, "properties": [ { "name": "last_update_block_height", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "pool_id", "required": true, "schema": { "type": "string" } } ], "refName": "PoolRow" } } }, { "name": "state", "required": true, "schema": { "type": "object" } }, { "name": "tokens", "required": true, "schema": { "type": "array", "items": { "type": "object", "required": [ "contract_id", "last_update_block_height", "balance" ], "additionalProperties": false, "properties": [ { "name": "balance", "required": true, "schema": { "type": "string" } }, { "name": "contract_id", "required": true, "schema": { "type": "string" } }, { "name": "last_update_block_height", "required": true, "schema": { "type": "integer", "format": "uint64" } } ], "refName": "TokenRow" } } } ], "refName": "AccountFullResponse" } ``` --- ## FastNEAR API - V1 Account NFT - HTML path: https://docs.fastnear.com/apis/fastnear/v1/account_nft - Markdown path: https://docs.fastnear.com/apis/fastnear/v1/account_nft.md # FastNEAR API - V1 Account NFT Lookup indexed NFT contract rows for an account Fetch NFT contract rows for an account, including block-height metadata for each contract. ## Source links - https://docs.fastnear.com/apis/fastnear/v1/account_nft - https://docs.fastnear.com/apis/fastnear/openapi/non-fungible-tokens/account_nft_v1 ## Operation - Transport: http - Method: GET - Path: `/v1/account/{account_id}/nft` - Source spec: `apis/fastnear/v1/account_nft.yaml` ## Networks - Mainnet: https://api.fastnear.com/ - Testnet: https://test.api.fastnear.com/ ## Auth - API key via query `apiKey`: Optional API key forwarded by embedded portal clients. The public FastNEAR API does not require it. - This export intentionally omits any locally saved credentials ## Current request - Network: Mainnet - Method: GET - URL: https://api.fastnear.com/v1/account/root.near/nft - Active example: Mainnet ## Request reference ### Active example ```json { "body": null, "headers": {}, "path": { "account_id": "root.near" }, "query": {} } ``` ### Inputs - `account_id` (path, required, string): NEAR account ID to inspect. ### Path parameters - `account_id` (path, required, string): NEAR account ID to inspect. ### Query parameters - `apiKey` (query, string): Optional API key forwarded by embedded portal clients. The public FastNEAR API does not require it. ## Response reference - Status: 200 - Media type: application/json - Summary: Indexed NFT contract rows for the requested account ### Response schema ```json { "type": "object", "required": [ "account_id", "tokens" ], "additionalProperties": false, "properties": [ { "name": "account_id", "required": true, "schema": { "type": "string" } }, { "name": "tokens", "required": true, "schema": { "type": "array", "items": { "type": "object", "required": [ "contract_id", "last_update_block_height" ], "additionalProperties": false, "properties": [ { "name": "contract_id", "required": true, "schema": { "type": "string" } }, { "name": "last_update_block_height", "required": true, "schema": { "type": "integer", "format": "uint64" } } ], "refName": "NftRow" } } } ], "refName": "V1NftResponse" } ``` --- ## FastNEAR API - V1 Account Staking - HTML path: https://docs.fastnear.com/apis/fastnear/v1/account_staking - Markdown path: https://docs.fastnear.com/apis/fastnear/v1/account_staking.md # FastNEAR API - V1 Account Staking Lookup indexed staking pools for an account Retrieve staking pool rows for an account, including block-height metadata for each pool relationship. ## Source links - https://docs.fastnear.com/apis/fastnear/v1/account_staking - https://docs.fastnear.com/apis/fastnear/openapi/staking/account_staking_v1 ## Operation - Transport: http - Method: GET - Path: `/v1/account/{account_id}/staking` - Source spec: `apis/fastnear/v1/account_staking.yaml` ## Networks - Mainnet: https://api.fastnear.com/ - Testnet: https://test.api.fastnear.com/ ## Auth - API key via query `apiKey`: Optional API key forwarded by embedded portal clients. The public FastNEAR API does not require it. - This export intentionally omits any locally saved credentials ## Current request - Network: Mainnet - Method: GET - URL: https://api.fastnear.com/v1/account/root.near/staking - Active example: Mainnet ## Request reference ### Active example ```json { "body": null, "headers": {}, "path": { "account_id": "root.near" }, "query": {} } ``` ### Inputs - `account_id` (path, required, string): NEAR account ID to inspect. ### Path parameters - `account_id` (path, required, string): NEAR account ID to inspect. ### Query parameters - `apiKey` (query, string): Optional API key forwarded by embedded portal clients. The public FastNEAR API does not require it. ## Response reference - Status: 200 - Media type: application/json - Summary: Indexed staking pool rows for the requested account ### Response schema ```json { "type": "object", "required": [ "account_id", "pools" ], "additionalProperties": false, "properties": [ { "name": "account_id", "required": true, "schema": { "type": "string" } }, { "name": "pools", "required": true, "schema": { "type": "array", "items": { "type": "object", "required": [ "pool_id", "last_update_block_height" ], "additionalProperties": false, "properties": [ { "name": "last_update_block_height", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "pool_id", "required": true, "schema": { "type": "string" } } ], "refName": "PoolRow" } } } ], "refName": "V1StakingResponse" } ``` --- ## FastNEAR API - V1 FT Top Holders - HTML path: https://docs.fastnear.com/apis/fastnear/v1/ft_top - Markdown path: https://docs.fastnear.com/apis/fastnear/v1/ft_top.md # FastNEAR API - V1 FT Top Holders Lookup top indexed holders for a fungible token Fetch the top-balance holder list for a fungible token contract, ranked highest balance first. ## Source links - https://docs.fastnear.com/apis/fastnear/v1/ft_top - https://docs.fastnear.com/apis/fastnear/openapi/fungible-tokens/ft_top_v1 ## Operation - Transport: http - Method: GET - Path: `/v1/ft/{token_id}/top` - Source spec: `apis/fastnear/v1/ft_top.yaml` ## Networks - Mainnet: https://api.fastnear.com/ - Testnet: https://test.api.fastnear.com/ ## Auth - API key via query `apiKey`: Optional API key forwarded by embedded portal clients. The public FastNEAR API does not require it. - This export intentionally omits any locally saved credentials ## Current request - Network: Mainnet - Method: GET - URL: https://api.fastnear.com/v1/ft/wrap.near/top - Active example: Mainnet ## Request reference ### Active example ```json { "body": null, "headers": {}, "path": { "token_id": "wrap.near" }, "query": {} } ``` ### Inputs - `token_id` (path, required, string): Fungible token contract account ID. ### Path parameters - `token_id` (path, required, string): Fungible token contract account ID. ### Query parameters - `apiKey` (query, string): Optional API key forwarded by embedded portal clients. The public FastNEAR API does not require it. ## Response reference - Status: 200 - Media type: application/json - Summary: Indexed top holders for the requested fungible token ### Response schema ```json { "type": "object", "required": [ "token_id", "accounts" ], "additionalProperties": false, "properties": [ { "name": "accounts", "required": true, "schema": { "type": "array", "items": { "type": "object", "required": [ "account_id", "balance" ], "additionalProperties": false, "properties": [ { "name": "account_id", "required": true, "schema": { "type": "string" } }, { "name": "balance", "required": true, "schema": { "type": "string" } } ], "refName": "AccountBalanceRow" } } }, { "name": "token_id", "required": true, "schema": { "type": "string" } } ], "refName": "TokenAccountsResponse" } ``` --- ## FastNEAR API - V1 Public Key Lookup - HTML path: https://docs.fastnear.com/apis/fastnear/v1/public_key_lookup - Markdown path: https://docs.fastnear.com/apis/fastnear/v1/public_key_lookup.md # FastNEAR API - V1 Public Key Lookup Lookup full-access accounts by public key Resolve a full-access public key to the indexed NEAR accounts that have registered it — V1 canonical lookup path. ## Source links - https://docs.fastnear.com/apis/fastnear/v1/public_key_lookup - https://docs.fastnear.com/apis/fastnear/openapi/public-key/lookup_by_public_key_v1 ## Operation - Transport: http - Method: GET - Path: `/v1/public_key/{public_key}` - Source spec: `apis/fastnear/v1/public_key_lookup.yaml` ## Networks - Mainnet: https://api.fastnear.com/ - Testnet: https://test.api.fastnear.com/ ## Auth - API key via query `apiKey`: Optional API key forwarded by embedded portal clients. The public FastNEAR API does not require it. - This export intentionally omits any locally saved credentials ## Current request - Network: Mainnet - Method: GET - URL: https://api.fastnear.com/v1/public_key/ed25519%3ACCaThr3uokqnUs6Z5vVnaDcJdrfuTpYJHJWcAGubDjT - Active example: Mainnet ## Request reference ### Active example ```json { "body": null, "headers": {}, "path": { "public_key": "ed25519:CCaThr3uokqnUs6Z5vVnaDcJdrfuTpYJHJWcAGubDjT" }, "query": {} } ``` ### Inputs - `public_key` (path, required, string): NEAR public key in `ed25519:...` or `secp256k1:...` form. ### Path parameters - `public_key` (path, required, string): NEAR public key in `ed25519:...` or `secp256k1:...` form. ### Query parameters - `apiKey` (query, string): Optional API key forwarded by embedded portal clients. The public FastNEAR API does not require it. ## Response reference - Status: 200 - Media type: application/json - Summary: Matching account IDs for the supplied full-access public key ### Response schema ```json { "type": "object", "required": [ "public_key", "account_ids" ], "additionalProperties": false, "properties": [ { "name": "account_ids", "required": true, "schema": { "type": "array", "items": { "type": "string" } } }, { "name": "public_key", "required": true, "schema": { "type": "string" } } ], "refName": "PublicKeyLookupResponse" } ``` --- ## FastNEAR API - V1 Public Key Lookup (All) - HTML path: https://docs.fastnear.com/apis/fastnear/v1/public_key_lookup_all - Markdown path: https://docs.fastnear.com/apis/fastnear/v1/public_key_lookup_all.md # FastNEAR API - V1 Public Key Lookup (All) Lookup all indexed accounts by public key Resolve a public key to every account that holds it — full-access and limited-access keys alike — via the V1 lookup-all path. ## Source links - https://docs.fastnear.com/apis/fastnear/v1/public_key_lookup_all - https://docs.fastnear.com/apis/fastnear/openapi/public-key/lookup_by_public_key_all_v1 ## Operation - Transport: http - Method: GET - Path: `/v1/public_key/{public_key}/all` - Source spec: `apis/fastnear/v1/public_key_lookup_all.yaml` ## Networks - Mainnet: https://api.fastnear.com/ - Testnet: https://test.api.fastnear.com/ ## Auth - API key via query `apiKey`: Optional API key forwarded by embedded portal clients. The public FastNEAR API does not require it. - This export intentionally omits any locally saved credentials ## Current request - Network: Mainnet - Method: GET - URL: https://api.fastnear.com/v1/public_key/ed25519%3ACCaThr3uokqnUs6Z5vVnaDcJdrfuTpYJHJWcAGubDjT/all - Active example: Mainnet ## Request reference ### Active example ```json { "body": null, "headers": {}, "path": { "public_key": "ed25519:CCaThr3uokqnUs6Z5vVnaDcJdrfuTpYJHJWcAGubDjT" }, "query": {} } ``` ### Inputs - `public_key` (path, required, string): NEAR public key in `ed25519:...` or `secp256k1:...` form. ### Path parameters - `public_key` (path, required, string): NEAR public key in `ed25519:...` or `secp256k1:...` form. ### Query parameters - `apiKey` (query, string): Optional API key forwarded by embedded portal clients. The public FastNEAR API does not require it. ## Response reference - Status: 200 - Media type: application/json - Summary: Matching account IDs for the supplied public key, including limited-access keys ### Response schema ```json { "type": "object", "required": [ "public_key", "account_ids" ], "additionalProperties": false, "properties": [ { "name": "account_ids", "required": true, "schema": { "type": "array", "items": { "type": "string" } } }, { "name": "public_key", "required": true, "schema": { "type": "string" } } ], "refName": "PublicKeyLookupResponse" } ``` --- ## KV FastData API - All Latest Keys by Predecessor - HTML path: https://docs.fastnear.com/apis/kv-fastdata/v0/all_by_predecessor - Markdown path: https://docs.fastnear.com/apis/kv-fastdata/v0/all_by_predecessor.md # KV FastData API - All Latest Keys by Predecessor Fetch latest key-value rows for one predecessor across all contracts Fetch the latest values for all contracts touched by one predecessor account. ## Source links - https://docs.fastnear.com/apis/kv-fastdata/v0/all_by_predecessor - https://docs.fastnear.com/apis/kv-fastdata/openapi/latest/all_by_predecessor ## Operation - Transport: http - Method: POST - Path: `/v0/all/{predecessor_id}` - Source spec: `apis/kv-fastdata/v0/all_by_predecessor.yaml` ## Networks - Mainnet: https://kv.main.fastnear.com/ - Testnet: https://kv.test.fastnear.com/ ## Auth - No auth required ## Current request - Network: Mainnet - Method: POST - URL: https://kv.main.fastnear.com/v0/all/james.near - Active example: Mainnet ### Request body ```json { "include_metadata": true, "limit": 50 } ``` ## Request reference ### Active example ```json { "body": { "include_metadata": true, "limit": 50 }, "headers": {}, "path": { "predecessor_id": "james.near" }, "query": {} } ``` ### Inputs - `predecessor_id` (path, required, string): Calling account that wrote the FastData keys. - `include_metadata` (body, boolean): Include receipt and signer metadata in each entry. - `limit` (body, integer): Maximum number of entries to return in one page (1–200, default 50). - `page_token` (body, string): Opaque pagination cursor from a previous `/v0/all/{predecessor_id}` response. ### Request schema ```json { "type": "object", "additionalProperties": false, "properties": [ { "name": "include_metadata", "required": false, "schema": { "type": "boolean", "description": "Include receipt and signer metadata in each entry.", "default": false } }, { "name": "limit", "required": false, "schema": { "type": "integer", "description": "Maximum number of entries to return in one page (1–200, default 50).", "format": "int32" } }, { "name": "page_token", "required": false, "schema": { "type": "string", "description": "Opaque pagination cursor from a previous `/v0/all/{predecessor_id}` response." } } ], "refName": "AllRequest" } ``` ### Path parameters - `predecessor_id` (path, required, string): Calling account that wrote the FastData keys. ## Response reference - Status: 200 - Media type: application/json - Summary: Latest rows for the selected predecessor ### Response schema ```json { "type": "object", "required": [ "entries" ], "additionalProperties": false, "properties": [ { "name": "entries", "required": true, "schema": { "type": "array", "items": { "type": "object", "required": [ "predecessor_id", "current_account_id", "block_height", "block_timestamp", "key", "value" ], "additionalProperties": false, "properties": [ { "name": "action_index", "required": false, "schema": { "type": "integer", "format": "uint32" } }, { "name": "block_height", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "block_timestamp", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "current_account_id", "required": true, "schema": { "type": "string" } }, { "name": "key", "required": true, "schema": { "type": "string" } }, { "name": "predecessor_id", "required": true, "schema": { "type": "string" } }, { "name": "receipt_id", "required": false, "schema": { "type": "string" } }, { "name": "signer_id", "required": false, "schema": { "type": "string" } }, { "name": "tx_hash", "required": false, "schema": { "type": "string" } }, { "name": "value", "required": true, "schema": { "description": "Raw JSON value as stored in FastData." } } ], "refName": "KvEntry" } } }, { "name": "page_token", "required": false, "schema": { "type": "string", "description": "Opaque pagination cursor for the next page. Absent when there are no more results." } } ], "refName": "ListResponse" } ``` --- ## KV FastData API - History by Exact Key - HTML path: https://docs.fastnear.com/apis/kv-fastdata/v0/get_history_key - Markdown path: https://docs.fastnear.com/apis/kv-fastdata/v0/get_history_key.md # KV FastData API - History by Exact Key Fetch historical rows for one exact key under one predecessor and contract Fetch every historical write for one exact key under one predecessor and contract. ## Source links - https://docs.fastnear.com/apis/kv-fastdata/v0/get_history_key - https://docs.fastnear.com/apis/kv-fastdata/openapi/history/get_history_key ## Operation - Transport: http - Method: GET - Path: `/v0/history/{current_account_id}/{predecessor_id}/{key}` - Source spec: `apis/kv-fastdata/v0/get_history_key.yaml` ## Networks - Mainnet: https://kv.main.fastnear.com/ - Testnet: https://kv.test.fastnear.com/ ## Auth - No auth required ## Current request - Network: Mainnet - Method: GET - URL: https://kv.main.fastnear.com/v0/history/social.near/james.near/graph%2Ffollow%2Fsleet.near - Active example: Mainnet ## Request reference ### Active example ```json { "body": null, "headers": {}, "path": { "current_account_id": "social.near", "predecessor_id": "james.near", "key": "graph/follow/sleet.near" }, "query": {} } ``` ### Inputs - `current_account_id` (path, required, string): Contract account whose FastData keys were written. - `predecessor_id` (path, required, string): Calling account that wrote the FastData keys. - `key` (path, required, string): Exact FastData key to return. ### Path parameters - `current_account_id` (path, required, string): Contract account whose FastData keys were written. - `predecessor_id` (path, required, string): Calling account that wrote the FastData keys. - `key` (path, required, string): Exact FastData key to return. ## Response reference - Status: 200 - Media type: application/json - Summary: Historical rows for the selected predecessor, account, and key ### Response schema ```json { "type": "object", "required": [ "entries" ], "additionalProperties": false, "properties": [ { "name": "entries", "required": true, "schema": { "type": "array", "items": { "type": "object", "required": [ "predecessor_id", "current_account_id", "block_height", "block_timestamp", "key", "value" ], "additionalProperties": false, "properties": [ { "name": "action_index", "required": false, "schema": { "type": "integer", "format": "uint32" } }, { "name": "block_height", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "block_timestamp", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "current_account_id", "required": true, "schema": { "type": "string" } }, { "name": "key", "required": true, "schema": { "type": "string" } }, { "name": "predecessor_id", "required": true, "schema": { "type": "string" } }, { "name": "receipt_id", "required": false, "schema": { "type": "string" } }, { "name": "signer_id", "required": false, "schema": { "type": "string" } }, { "name": "tx_hash", "required": false, "schema": { "type": "string" } }, { "name": "value", "required": true, "schema": { "description": "Raw JSON value as stored in FastData." } } ], "refName": "KvEntry" } } }, { "name": "page_token", "required": false, "schema": { "type": "string", "description": "Opaque pagination cursor for the next page. Absent when there are no more results." } } ], "refName": "ListResponse" } ``` --- ## KV FastData API - Latest by Exact Key - HTML path: https://docs.fastnear.com/apis/kv-fastdata/v0/get_latest_key - Markdown path: https://docs.fastnear.com/apis/kv-fastdata/v0/get_latest_key.md # KV FastData API - Latest by Exact Key Fetch the latest row for one exact key under one predecessor and contract Fetch the latest value for one exact key under one predecessor and contract. ## Source links - https://docs.fastnear.com/apis/kv-fastdata/v0/get_latest_key - https://docs.fastnear.com/apis/kv-fastdata/openapi/latest/get_latest_key ## Operation - Transport: http - Method: GET - Path: `/v0/latest/{current_account_id}/{predecessor_id}/{key}` - Source spec: `apis/kv-fastdata/v0/get_latest_key.yaml` ## Networks - Mainnet: https://kv.main.fastnear.com/ - Testnet: https://kv.test.fastnear.com/ ## Auth - No auth required ## Current request - Network: Mainnet - Method: GET - URL: https://kv.main.fastnear.com/v0/latest/social.near/james.near/graph%2Ffollow%2Fsleet.near - Active example: Mainnet ## Request reference ### Active example ```json { "body": null, "headers": {}, "path": { "current_account_id": "social.near", "predecessor_id": "james.near", "key": "graph/follow/sleet.near" }, "query": {} } ``` ### Inputs - `current_account_id` (path, required, string): Contract account whose FastData keys were written. - `predecessor_id` (path, required, string): Calling account that wrote the FastData keys. - `key` (path, required, string): Exact FastData key to return. ### Path parameters - `current_account_id` (path, required, string): Contract account whose FastData keys were written. - `predecessor_id` (path, required, string): Calling account that wrote the FastData keys. - `key` (path, required, string): Exact FastData key to return. ## Response reference - Status: 200 - Media type: application/json - Summary: Latest rows for the selected predecessor, account, and key ### Response schema ```json { "type": "object", "required": [ "entries" ], "additionalProperties": false, "properties": [ { "name": "entries", "required": true, "schema": { "type": "array", "items": { "type": "object", "required": [ "predecessor_id", "current_account_id", "block_height", "block_timestamp", "key", "value" ], "additionalProperties": false, "properties": [ { "name": "action_index", "required": false, "schema": { "type": "integer", "format": "uint32" } }, { "name": "block_height", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "block_timestamp", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "current_account_id", "required": true, "schema": { "type": "string" } }, { "name": "key", "required": true, "schema": { "type": "string" } }, { "name": "predecessor_id", "required": true, "schema": { "type": "string" } }, { "name": "receipt_id", "required": false, "schema": { "type": "string" } }, { "name": "signer_id", "required": false, "schema": { "type": "string" } }, { "name": "tx_hash", "required": false, "schema": { "type": "string" } }, { "name": "value", "required": true, "schema": { "description": "Raw JSON value as stored in FastData." } } ], "refName": "KvEntry" } } }, { "name": "page_token", "required": false, "schema": { "type": "string", "description": "Opaque pagination cursor for the next page. Absent when there are no more results." } } ], "refName": "ListResponse" } ``` --- ## KV FastData API - History by Account - HTML path: https://docs.fastnear.com/apis/kv-fastdata/v0/history_by_account - Markdown path: https://docs.fastnear.com/apis/kv-fastdata/v0/history_by_account.md # KV FastData API - History by Account Fetch historical key-value writes for one contract across all predecessors Fetch historical FastData rows for one target account across all predecessor accounts. ## Source links - https://docs.fastnear.com/apis/kv-fastdata/v0/history_by_account - https://docs.fastnear.com/apis/kv-fastdata/openapi/history/history_by_account ## Operation - Transport: http - Method: POST - Path: `/v0/history/{current_account_id}` - Source spec: `apis/kv-fastdata/v0/history_by_account.yaml` ## Networks - Mainnet: https://kv.main.fastnear.com/ - Testnet: https://kv.test.fastnear.com/ ## Auth - No auth required ## Current request - Network: Mainnet - Method: POST - URL: https://kv.main.fastnear.com/v0/history/social.near - Active example: Mainnet ### Request body ```json { "asc": true, "include_metadata": true, "key_prefix": "graph/follow/sleet.near", "limit": 10 } ``` ## Request reference ### Active example ```json { "body": { "asc": true, "include_metadata": true, "key_prefix": "graph/follow/sleet.near", "limit": 10 }, "headers": {}, "path": { "current_account_id": "social.near" }, "query": {} } ``` ### Inputs - `current_account_id` (path, required, string): Contract account whose FastData keys were written. - `asc` (body, boolean): Sort ascending for history endpoints. Defaults to newest-first. - `include_metadata` (body, boolean): Include receipt and signer metadata in each entry. - `key` (body, string): Exact key filter. Mutually exclusive with `key_prefix`. - `key_prefix` (body, string): Prefix filter for matching key namespaces. - `limit` (body, integer): Maximum number of entries to return in one page (1–200, default 50). - `page_token` (body, string): Opaque pagination cursor from a previous response for the same endpoint and filter set. ### Request schema ```json { "type": "object", "additionalProperties": false, "properties": [ { "name": "asc", "required": false, "schema": { "type": "boolean", "description": "Sort ascending for history endpoints. Defaults to newest-first.", "default": false } }, { "name": "include_metadata", "required": false, "schema": { "type": "boolean", "description": "Include receipt and signer metadata in each entry.", "default": false } }, { "name": "key", "required": false, "schema": { "type": "string", "description": "Exact key filter. Mutually exclusive with `key_prefix`." } }, { "name": "key_prefix", "required": false, "schema": { "type": "string", "description": "Prefix filter for matching key namespaces." } }, { "name": "limit", "required": false, "schema": { "type": "integer", "description": "Maximum number of entries to return in one page (1–200, default 50).", "format": "int32" } }, { "name": "page_token", "required": false, "schema": { "type": "string", "description": "Opaque pagination cursor from a previous response for the same endpoint and filter set." } } ], "refName": "QueryRequest" } ``` ### Path parameters - `current_account_id` (path, required, string): Contract account whose FastData keys were written. ## Response reference - Status: 200 - Media type: application/json - Summary: Historical rows for the selected contract ### Response schema ```json { "type": "object", "required": [ "entries" ], "additionalProperties": false, "properties": [ { "name": "entries", "required": true, "schema": { "type": "array", "items": { "type": "object", "required": [ "predecessor_id", "current_account_id", "block_height", "block_timestamp", "key", "value" ], "additionalProperties": false, "properties": [ { "name": "action_index", "required": false, "schema": { "type": "integer", "format": "uint32" } }, { "name": "block_height", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "block_timestamp", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "current_account_id", "required": true, "schema": { "type": "string" } }, { "name": "key", "required": true, "schema": { "type": "string" } }, { "name": "predecessor_id", "required": true, "schema": { "type": "string" } }, { "name": "receipt_id", "required": false, "schema": { "type": "string" } }, { "name": "signer_id", "required": false, "schema": { "type": "string" } }, { "name": "tx_hash", "required": false, "schema": { "type": "string" } }, { "name": "value", "required": true, "schema": { "description": "Raw JSON value as stored in FastData." } } ], "refName": "KvEntry" } } }, { "name": "page_token", "required": false, "schema": { "type": "string", "description": "Opaque pagination cursor for the next page. Absent when there are no more results." } } ], "refName": "ListResponse" } ``` --- ## KV FastData API - History by Global Key - HTML path: https://docs.fastnear.com/apis/kv-fastdata/v0/history_by_key - Markdown path: https://docs.fastnear.com/apis/kv-fastdata/v0/history_by_key.md # KV FastData API - History by Global Key Fetch historical rows by exact key across all indexed contracts Fetch the historical values for a selected key across accounts and predecessors. ## Source links - https://docs.fastnear.com/apis/kv-fastdata/v0/history_by_key - https://docs.fastnear.com/apis/kv-fastdata/openapi/history/history_by_key ## Operation - Transport: http - Method: POST - Path: `/v0/history` - Source spec: `apis/kv-fastdata/v0/history_by_key.yaml` ## Networks - Mainnet: https://kv.main.fastnear.com/ - Testnet: https://kv.test.fastnear.com/ ## Auth - No auth required ## Current request - Network: Mainnet - Method: POST - URL: https://kv.main.fastnear.com/v0/history - Active example: Mainnet ### Request body ```json { "asc": true, "include_metadata": false, "key": "graph/follow/sleet.near", "limit": 50 } ``` ## Request reference ### Active example ```json { "body": { "asc": true, "include_metadata": false, "key": "graph/follow/sleet.near", "limit": 50 }, "headers": {}, "path": {}, "query": {} } ``` ### Inputs - `asc` (body, boolean): Sort ascending for history results. Defaults to newest-first. - `include_metadata` (body, boolean): Include receipt and signer metadata in each entry. - `key` (body, required, string): Exact key name to match across all accounts and predecessors. - `limit` (body, integer): Maximum number of entries to return in one page (1–200, default 50). - `page_token` (body, string): Opaque pagination cursor from a previous response for the same endpoint and filter set. ### Request schema ```json { "type": "object", "required": [ "key" ], "additionalProperties": false, "properties": [ { "name": "asc", "required": false, "schema": { "type": "boolean", "description": "Sort ascending for history results. Defaults to newest-first.", "default": false } }, { "name": "include_metadata", "required": false, "schema": { "type": "boolean", "description": "Include receipt and signer metadata in each entry.", "default": false } }, { "name": "key", "required": true, "schema": { "type": "string", "description": "Exact key name to match across all accounts and predecessors." } }, { "name": "limit", "required": false, "schema": { "type": "integer", "description": "Maximum number of entries to return in one page (1–200, default 50).", "format": "int32" } }, { "name": "page_token", "required": false, "schema": { "type": "string", "description": "Opaque pagination cursor from a previous response for the same endpoint and filter set." } } ], "refName": "ByKeyRequest" } ``` ## Response reference - Status: 200 - Media type: application/json - Summary: Historical rows for the selected key ### Response schema ```json { "type": "object", "required": [ "entries" ], "additionalProperties": false, "properties": [ { "name": "entries", "required": true, "schema": { "type": "array", "items": { "type": "object", "required": [ "predecessor_id", "current_account_id", "block_height", "block_timestamp", "key", "value" ], "additionalProperties": false, "properties": [ { "name": "action_index", "required": false, "schema": { "type": "integer", "format": "uint32" } }, { "name": "block_height", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "block_timestamp", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "current_account_id", "required": true, "schema": { "type": "string" } }, { "name": "key", "required": true, "schema": { "type": "string" } }, { "name": "predecessor_id", "required": true, "schema": { "type": "string" } }, { "name": "receipt_id", "required": false, "schema": { "type": "string" } }, { "name": "signer_id", "required": false, "schema": { "type": "string" } }, { "name": "tx_hash", "required": false, "schema": { "type": "string" } }, { "name": "value", "required": true, "schema": { "description": "Raw JSON value as stored in FastData." } } ], "refName": "KvEntry" } } }, { "name": "page_token", "required": false, "schema": { "type": "string", "description": "Opaque pagination cursor for the next page. Absent when there are no more results." } } ], "refName": "ListResponse" } ``` --- ## KV FastData API - History by Predecessor - HTML path: https://docs.fastnear.com/apis/kv-fastdata/v0/history_by_predecessor - Markdown path: https://docs.fastnear.com/apis/kv-fastdata/v0/history_by_predecessor.md # KV FastData API - History by Predecessor Fetch historical key-value writes for one predecessor and contract Fetch historical FastData rows for a single predecessor and target account. ## Source links - https://docs.fastnear.com/apis/kv-fastdata/v0/history_by_predecessor - https://docs.fastnear.com/apis/kv-fastdata/openapi/history/history_by_predecessor ## Operation - Transport: http - Method: POST - Path: `/v0/history/{current_account_id}/{predecessor_id}` - Source spec: `apis/kv-fastdata/v0/history_by_predecessor.yaml` ## Networks - Mainnet: https://kv.main.fastnear.com/ - Testnet: https://kv.test.fastnear.com/ ## Auth - No auth required ## Current request - Network: Mainnet - Method: POST - URL: https://kv.main.fastnear.com/v0/history/social.near/james.near - Active example: Mainnet ### Request body ```json { "asc": false, "include_metadata": true, "key_prefix": "graph/follow/", "limit": 50 } ``` ## Request reference ### Active example ```json { "body": { "asc": false, "include_metadata": true, "key_prefix": "graph/follow/", "limit": 50 }, "headers": {}, "path": { "current_account_id": "social.near", "predecessor_id": "james.near" }, "query": {} } ``` ### Inputs - `current_account_id` (path, required, string): Contract account whose FastData keys were written. - `predecessor_id` (path, required, string): Calling account that wrote the FastData keys. - `asc` (body, boolean): Sort ascending for history endpoints. Defaults to newest-first. - `include_metadata` (body, boolean): Include receipt and signer metadata in each entry. - `key` (body, string): Exact key filter. Mutually exclusive with `key_prefix`. - `key_prefix` (body, string): Prefix filter for matching key namespaces. - `limit` (body, integer): Maximum number of entries to return in one page (1–200, default 50). - `page_token` (body, string): Opaque pagination cursor from a previous response for the same endpoint and filter set. ### Request schema ```json { "type": "object", "additionalProperties": false, "properties": [ { "name": "asc", "required": false, "schema": { "type": "boolean", "description": "Sort ascending for history endpoints. Defaults to newest-first.", "default": false } }, { "name": "include_metadata", "required": false, "schema": { "type": "boolean", "description": "Include receipt and signer metadata in each entry.", "default": false } }, { "name": "key", "required": false, "schema": { "type": "string", "description": "Exact key filter. Mutually exclusive with `key_prefix`." } }, { "name": "key_prefix", "required": false, "schema": { "type": "string", "description": "Prefix filter for matching key namespaces." } }, { "name": "limit", "required": false, "schema": { "type": "integer", "description": "Maximum number of entries to return in one page (1–200, default 50).", "format": "int32" } }, { "name": "page_token", "required": false, "schema": { "type": "string", "description": "Opaque pagination cursor from a previous response for the same endpoint and filter set." } } ], "refName": "QueryRequest" } ``` ### Path parameters - `current_account_id` (path, required, string): Contract account whose FastData keys were written. - `predecessor_id` (path, required, string): Calling account that wrote the FastData keys. ## Response reference - Status: 200 - Media type: application/json - Summary: Historical rows for the selected predecessor and account ### Response schema ```json { "type": "object", "required": [ "entries" ], "additionalProperties": false, "properties": [ { "name": "entries", "required": true, "schema": { "type": "array", "items": { "type": "object", "required": [ "predecessor_id", "current_account_id", "block_height", "block_timestamp", "key", "value" ], "additionalProperties": false, "properties": [ { "name": "action_index", "required": false, "schema": { "type": "integer", "format": "uint32" } }, { "name": "block_height", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "block_timestamp", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "current_account_id", "required": true, "schema": { "type": "string" } }, { "name": "key", "required": true, "schema": { "type": "string" } }, { "name": "predecessor_id", "required": true, "schema": { "type": "string" } }, { "name": "receipt_id", "required": false, "schema": { "type": "string" } }, { "name": "signer_id", "required": false, "schema": { "type": "string" } }, { "name": "tx_hash", "required": false, "schema": { "type": "string" } }, { "name": "value", "required": true, "schema": { "description": "Raw JSON value as stored in FastData." } } ], "refName": "KvEntry" } } }, { "name": "page_token", "required": false, "schema": { "type": "string", "description": "Opaque pagination cursor for the next page. Absent when there are no more results." } } ], "refName": "ListResponse" } ``` --- ## KV FastData API - Latest by Account - HTML path: https://docs.fastnear.com/apis/kv-fastdata/v0/latest_by_account - Markdown path: https://docs.fastnear.com/apis/kv-fastdata/v0/latest_by_account.md # KV FastData API - Latest by Account Fetch latest key-value rows for one contract across all predecessors Fetch the latest FastData rows for one target account across all predecessor accounts. ## Source links - https://docs.fastnear.com/apis/kv-fastdata/v0/latest_by_account - https://docs.fastnear.com/apis/kv-fastdata/openapi/latest/latest_by_account ## Operation - Transport: http - Method: POST - Path: `/v0/latest/{current_account_id}` - Source spec: `apis/kv-fastdata/v0/latest_by_account.yaml` ## Networks - Mainnet: https://kv.main.fastnear.com/ - Testnet: https://kv.test.fastnear.com/ ## Auth - No auth required ## Current request - Network: Mainnet - Method: POST - URL: https://kv.main.fastnear.com/v0/latest/social.near - Active example: Mainnet ### Request body ```json { "include_metadata": true, "key_prefix": "graph/follow/", "limit": 50 } ``` ## Request reference ### Active example ```json { "body": { "include_metadata": true, "key_prefix": "graph/follow/", "limit": 50 }, "headers": {}, "path": { "current_account_id": "social.near" }, "query": {} } ``` ### Inputs - `current_account_id` (path, required, string): Contract account whose FastData keys were written. - `include_metadata` (body, boolean): Include receipt and signer metadata in each entry. - `key` (body, string): Exact key filter. Mutually exclusive with `key_prefix`. - `key_prefix` (body, string): Prefix filter for matching key namespaces. - `limit` (body, integer): Maximum number of entries to return in one page (1–200, default 50). - `page_token` (body, string): Opaque pagination cursor from a previous response for the same endpoint and filter set. ### Request schema ```json { "type": "object", "additionalProperties": false, "properties": [ { "name": "include_metadata", "required": false, "schema": { "type": "boolean", "description": "Include receipt and signer metadata in each entry.", "default": false } }, { "name": "key", "required": false, "schema": { "type": "string", "description": "Exact key filter. Mutually exclusive with `key_prefix`." } }, { "name": "key_prefix", "required": false, "schema": { "type": "string", "description": "Prefix filter for matching key namespaces." } }, { "name": "limit", "required": false, "schema": { "type": "integer", "description": "Maximum number of entries to return in one page (1–200, default 50).", "format": "int32" } }, { "name": "page_token", "required": false, "schema": { "type": "string", "description": "Opaque pagination cursor from a previous response for the same endpoint and filter set." } } ], "refName": "LatestRequest" } ``` ### Path parameters - `current_account_id` (path, required, string): Contract account whose FastData keys were written. ## Response reference - Status: 200 - Media type: application/json - Summary: Latest rows for the selected contract ### Response schema ```json { "type": "object", "required": [ "entries" ], "additionalProperties": false, "properties": [ { "name": "entries", "required": true, "schema": { "type": "array", "items": { "type": "object", "required": [ "predecessor_id", "current_account_id", "block_height", "block_timestamp", "key", "value" ], "additionalProperties": false, "properties": [ { "name": "action_index", "required": false, "schema": { "type": "integer", "format": "uint32" } }, { "name": "block_height", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "block_timestamp", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "current_account_id", "required": true, "schema": { "type": "string" } }, { "name": "key", "required": true, "schema": { "type": "string" } }, { "name": "predecessor_id", "required": true, "schema": { "type": "string" } }, { "name": "receipt_id", "required": false, "schema": { "type": "string" } }, { "name": "signer_id", "required": false, "schema": { "type": "string" } }, { "name": "tx_hash", "required": false, "schema": { "type": "string" } }, { "name": "value", "required": true, "schema": { "description": "Raw JSON value as stored in FastData." } } ], "refName": "KvEntry" } } }, { "name": "page_token", "required": false, "schema": { "type": "string", "description": "Opaque pagination cursor for the next page. Absent when there are no more results." } } ], "refName": "ListResponse" } ``` --- ## KV FastData API - Latest by Predecessor - HTML path: https://docs.fastnear.com/apis/kv-fastdata/v0/latest_by_predecessor - Markdown path: https://docs.fastnear.com/apis/kv-fastdata/v0/latest_by_predecessor.md # KV FastData API - Latest by Predecessor Fetch latest key-value rows for one predecessor and contract Fetch the latest FastData rows for a single predecessor and target account. ## Source links - https://docs.fastnear.com/apis/kv-fastdata/v0/latest_by_predecessor - https://docs.fastnear.com/apis/kv-fastdata/openapi/latest/latest_by_predecessor ## Operation - Transport: http - Method: POST - Path: `/v0/latest/{current_account_id}/{predecessor_id}` - Source spec: `apis/kv-fastdata/v0/latest_by_predecessor.yaml` ## Networks - Mainnet: https://kv.main.fastnear.com/ - Testnet: https://kv.test.fastnear.com/ ## Auth - No auth required ## Current request - Network: Mainnet - Method: POST - URL: https://kv.main.fastnear.com/v0/latest/social.near/james.near - Active example: Mainnet ### Request body ```json { "include_metadata": true, "key_prefix": "graph/follow/", "limit": 50 } ``` ## Request reference ### Active example ```json { "body": { "include_metadata": true, "key_prefix": "graph/follow/", "limit": 50 }, "headers": {}, "path": { "current_account_id": "social.near", "predecessor_id": "james.near" }, "query": {} } ``` ### Inputs - `current_account_id` (path, required, string): Contract account whose FastData keys were written. - `predecessor_id` (path, required, string): Calling account that wrote the FastData keys. - `include_metadata` (body, boolean): Include receipt and signer metadata in each entry. - `key` (body, string): Exact key filter. Mutually exclusive with `key_prefix`. - `key_prefix` (body, string): Prefix filter for matching key namespaces. - `limit` (body, integer): Maximum number of entries to return in one page (1–200, default 50). - `page_token` (body, string): Opaque pagination cursor from a previous response for the same endpoint and filter set. ### Request schema ```json { "type": "object", "additionalProperties": false, "properties": [ { "name": "include_metadata", "required": false, "schema": { "type": "boolean", "description": "Include receipt and signer metadata in each entry.", "default": false } }, { "name": "key", "required": false, "schema": { "type": "string", "description": "Exact key filter. Mutually exclusive with `key_prefix`." } }, { "name": "key_prefix", "required": false, "schema": { "type": "string", "description": "Prefix filter for matching key namespaces." } }, { "name": "limit", "required": false, "schema": { "type": "integer", "description": "Maximum number of entries to return in one page (1–200, default 50).", "format": "int32" } }, { "name": "page_token", "required": false, "schema": { "type": "string", "description": "Opaque pagination cursor from a previous response for the same endpoint and filter set." } } ], "refName": "LatestRequest" } ``` ### Path parameters - `current_account_id` (path, required, string): Contract account whose FastData keys were written. - `predecessor_id` (path, required, string): Calling account that wrote the FastData keys. ## Response reference - Status: 200 - Media type: application/json - Summary: Latest rows for the selected predecessor and account ### Response schema ```json { "type": "object", "required": [ "entries" ], "additionalProperties": false, "properties": [ { "name": "entries", "required": true, "schema": { "type": "array", "items": { "type": "object", "required": [ "predecessor_id", "current_account_id", "block_height", "block_timestamp", "key", "value" ], "additionalProperties": false, "properties": [ { "name": "action_index", "required": false, "schema": { "type": "integer", "format": "uint32" } }, { "name": "block_height", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "block_timestamp", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "current_account_id", "required": true, "schema": { "type": "string" } }, { "name": "key", "required": true, "schema": { "type": "string" } }, { "name": "predecessor_id", "required": true, "schema": { "type": "string" } }, { "name": "receipt_id", "required": false, "schema": { "type": "string" } }, { "name": "signer_id", "required": false, "schema": { "type": "string" } }, { "name": "tx_hash", "required": false, "schema": { "type": "string" } }, { "name": "value", "required": true, "schema": { "description": "Raw JSON value as stored in FastData." } } ], "refName": "KvEntry" } } }, { "name": "page_token", "required": false, "schema": { "type": "string", "description": "Opaque pagination cursor for the next page. Absent when there are no more results." } } ], "refName": "ListResponse" } ``` --- ## KV FastData API - Multi-Key Lookup - HTML path: https://docs.fastnear.com/apis/kv-fastdata/v0/multi - Markdown path: https://docs.fastnear.com/apis/kv-fastdata/v0/multi.md # KV FastData API - Multi-Key Lookup Fetch the latest rows for multiple fully qualified keys Fetch the latest FastData row for up to 100 keys in a single request. ## Source links - https://docs.fastnear.com/apis/kv-fastdata/v0/multi - https://docs.fastnear.com/apis/kv-fastdata/openapi/latest/multi ## Operation - Transport: http - Method: POST - Path: `/v0/multi` - Source spec: `apis/kv-fastdata/v0/multi.yaml` ## Networks - Mainnet: https://kv.main.fastnear.com/ - Testnet: https://kv.test.fastnear.com/ ## Auth - No auth required ## Current request - Network: Mainnet - Method: POST - URL: https://kv.main.fastnear.com/v0/multi - Active example: Mainnet ### Request body ```json { "include_metadata": true, "keys": [ "social.near/james.near/graph/follow/sleet.near", "social.near/james.near/graph/follow/missing" ] } ``` ## Request reference ### Active example ```json { "body": { "include_metadata": true, "keys": [ "social.near/james.near/graph/follow/sleet.near", "social.near/james.near/graph/follow/missing" ] }, "headers": {}, "path": {}, "query": {} } ``` ### Inputs - `include_metadata` (body, boolean): Include receipt and signer metadata in each entry. - `keys` (body, required, array): Fully qualified keys in current_account_id/predecessor_id/key form. ### Request schema ```json { "type": "object", "required": [ "keys" ], "additionalProperties": false, "properties": [ { "name": "include_metadata", "required": false, "schema": { "type": "boolean", "description": "Include receipt and signer metadata in each entry.", "default": false } }, { "name": "keys", "required": true, "schema": { "type": "array", "description": "Fully qualified keys in current_account_id/predecessor_id/key form.", "items": { "type": "string" } } } ], "refName": "MultiRequest" } ``` ## Response reference - Status: 200 - Media type: application/json - Summary: Latest rows for the requested keys ### Response schema ```json { "type": "object", "required": [ "entries" ], "additionalProperties": false, "properties": [ { "name": "entries", "required": true, "schema": { "type": "array", "items": { "oneOf": [ { "type": "object", "required": [ "predecessor_id", "current_account_id", "block_height", "block_timestamp", "key", "value" ], "additionalProperties": false, "properties": [ { "name": "action_index", "required": false, "schema": { "type": "integer", "format": "uint32" } }, { "name": "block_height", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "block_timestamp", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "current_account_id", "required": true, "schema": { "type": "string" } }, { "name": "key", "required": true, "schema": { "type": "string" } }, { "name": "predecessor_id", "required": true, "schema": { "type": "string" } }, { "name": "receipt_id", "required": false, "schema": { "type": "string" } }, { "name": "signer_id", "required": false, "schema": { "type": "string" } }, { "name": "tx_hash", "required": false, "schema": { "type": "string" } }, { "name": "value", "required": true, "schema": { "description": "Raw JSON value as stored in FastData." } } ] }, { "enum": [ null ] } ] } } } ], "refName": "MultiResponse" } ``` --- ## NEAR Data API - Health - HTML path: https://docs.fastnear.com/apis/neardata/system/health - Markdown path: https://docs.fastnear.com/apis/neardata/system/health.md # NEAR Data API - Health Get service health Ping the neardata service for liveness — returns `{status: ok}` when healthy, errors otherwise. ## Source links - https://docs.fastnear.com/apis/neardata/system/health - https://docs.fastnear.com/apis/neardata/openapi/system/get_health ## Operation - Transport: http - Method: GET - Path: `/health` - Source spec: `apis/neardata/system/health.yaml` ## Networks - Mainnet: https://mainnet.neardata.xyz/ - Testnet: https://testnet.neardata.xyz/ ## Auth - API key via query `apiKey`: Optional FastNEAR subscription API key. Invalid values may return `401` before redirect handling. - This export intentionally omits any locally saved credentials ## Current request - Network: Mainnet - Method: GET - URL: https://mainnet.neardata.xyz/health - Active example: Mainnet ## Request reference ### Active example ```json { "body": null, "headers": {}, "path": {}, "query": {} } ``` ### Query parameters - `apiKey` (query, string): Optional FastNEAR subscription API key. Invalid values may return `401` before redirect handling. ## Response reference - Status: 200 - Media type: application/json - Summary: Health payload ### Response schema ```json { "type": "object", "required": [ "status" ], "additionalProperties": false, "properties": [ { "name": "status", "required": true, "schema": { "type": "string" } } ], "refName": "HealthResponse" } ``` --- ## NEAR Data API - Block - HTML path: https://docs.fastnear.com/apis/neardata/v0/block - Markdown path: https://docs.fastnear.com/apis/neardata/v0/block.md # NEAR Data API - Block Fetch a finalized block by height Fetch a finalized block's full document at a chosen height — header plus every chunk and shard payload. ## Source links - https://docs.fastnear.com/apis/neardata/v0/block - https://docs.fastnear.com/apis/neardata/openapi/blocks/get_block ## Operation - Transport: http - Method: GET - Path: `/v0/block/{block_height}` - Source spec: `apis/neardata/v0/block.yaml` ## Networks - Mainnet: https://mainnet.neardata.xyz/ - Testnet: https://testnet.neardata.xyz/ ## Auth - API key via query `apiKey`: Optional FastNEAR subscription API key. Invalid values may return `401` before redirect handling. - This export intentionally omits any locally saved credentials ## Current request - Network: Mainnet - Method: GET - URL: https://mainnet.neardata.xyz/v0/block/9820210 - Active example: Mainnet ## Request reference ### Active example ```json { "body": null, "headers": {}, "path": { "block_height": "9820210" }, "query": {} } ``` ### Inputs - `block_height` (path, required, string): NEAR block height to retrieve. ### Path parameters - `block_height` (path, required, string): NEAR block height to retrieve. ### Query parameters - `apiKey` (query, string): Optional FastNEAR subscription API key. Invalid values may return `401` before redirect handling. ## Response reference - Status: 200 - Media type: application/json - Summary: Requested document, or `null` when the selected slice is absent ### Response schema ```json { "type": "object", "description": "Full block document as served by neardata, including the block envelope and per-shard payloads.", "required": [ "block", "shards" ], "additionalProperties": false, "properties": [ { "name": "block", "required": true, "schema": { "type": "object", "description": "Block-level payload returned by neardata.", "required": [ "author", "chunks", "header" ], "additionalProperties": false, "properties": [ { "name": "author", "required": true, "schema": { "type": "string", "description": "Block producer account ID." } }, { "name": "chunks", "required": true, "schema": { "type": "array", "items": { "type": "object", "description": "Chunk header object as served by neardata.", "additionalProperties": true, "properties": [ { "name": "chunk_hash", "required": false, "schema": { "type": "string" } }, { "name": "gas_limit", "required": false, "schema": { "type": "integer" } }, { "name": "gas_used", "required": false, "schema": { "type": "integer" } }, { "name": "height_created", "required": false, "schema": { "type": "integer", "format": "uint64" } }, { "name": "height_included", "required": false, "schema": { "type": "integer", "format": "uint64" } }, { "name": "outcome_root", "required": false, "schema": { "type": "string" } }, { "name": "outgoing_receipts_root", "required": false, "schema": { "type": "string" } }, { "name": "prev_block_hash", "required": false, "schema": { "type": "string" } }, { "name": "shard_id", "required": false, "schema": { "type": "integer", "format": "uint64" } }, { "name": "tx_root", "required": false, "schema": { "type": "string" } } ], "refName": "ChunkHeader" } } }, { "name": "header", "required": true, "schema": { "type": "object", "description": "Block header object as served by neardata.", "additionalProperties": true, "properties": [ { "name": "chunks_included", "required": false, "schema": { "type": "integer", "format": "uint64" } }, { "name": "epoch_id", "required": false, "schema": { "type": "string" } }, { "name": "gas_price", "required": false, "schema": { "type": "string" } }, { "name": "hash", "required": false, "schema": { "type": "string" } }, { "name": "height", "required": false, "schema": { "type": "integer", "format": "uint64" } }, { "name": "next_epoch_id", "required": false, "schema": { "type": "string" } }, { "name": "prev_hash", "required": false, "schema": { "type": "string" } }, { "name": "prev_height", "required": false, "schema": { "type": "integer", "format": "uint64" } }, { "name": "timestamp", "required": false, "schema": { "type": "integer" } }, { "name": "timestamp_nanosec", "required": false, "schema": { "type": "string" } }, { "name": "total_supply", "required": false, "schema": { "type": "string" } } ], "refName": "BlockHeader" } } ], "refName": "BlockEnvelope" } }, { "name": "shards", "required": true, "schema": { "type": "array", "items": { "type": "object", "description": "Per-shard payload returned by neardata for a block.", "required": [ "chunk", "receipt_execution_outcomes", "shard_id", "state_changes" ], "additionalProperties": false, "properties": [ { "name": "chunk", "required": true, "schema": { "type": "object", "description": "Chunk payload returned by neardata for a single shard in a selected block.", "required": [ "author", "header", "receipts", "transactions" ], "additionalProperties": false, "properties": [ { "name": "author", "required": true, "schema": { "type": "string", "description": "Chunk producer account ID." } }, { "name": "header", "required": true, "schema": { "type": "object", "description": "Chunk header object as served by neardata.", "additionalProperties": true, "properties": [ { "name": "chunk_hash", "required": false, "schema": { "type": "string" } }, { "name": "gas_limit", "required": false, "schema": { "type": "integer" } }, { "name": "gas_used", "required": false, "schema": { "type": "integer" } }, { "name": "height_created", "required": false, "schema": { "type": "integer", "format": "uint64" } }, { "name": "height_included", "required": false, "schema": { "type": "integer", "format": "uint64" } }, { "name": "outcome_root", "required": false, "schema": { "type": "string" } }, { "name": "outgoing_receipts_root", "required": false, "schema": { "type": "string" } }, { "name": "prev_block_hash", "required": false, "schema": { "type": "string" } }, { "name": "shard_id", "required": false, "schema": { "type": "integer", "format": "uint64" } }, { "name": "tx_root", "required": false, "schema": { "type": "string" } } ], "refName": "ChunkHeader" } }, { "name": "receipts", "required": true, "schema": { "type": "array", "items": { "type": "object", "description": "Receipt object as served by neardata inside a chunk payload.", "required": [ "predecessor_id", "priority", "receipt", "receipt_id", "receiver_id" ], "additionalProperties": false, "properties": [ { "name": "predecessor_id", "required": true, "schema": { "type": "string" } }, { "name": "priority", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "receipt", "required": true, "schema": { "oneOf": [ { "type": "object", "required": [ "Action" ], "additionalProperties": false, "properties": [ { "name": "Action", "required": true, "schema": { "type": "object", "required": [ "actions", "gas_price", "input_data_ids", "is_promise_yield", "output_data_receivers", "signer_id", "signer_public_key" ], "additionalProperties": false, "properties": [ { "name": "actions", "required": true, "schema": { "type": "array", "items": { "type": "object", "additionalProperties": true, "refName": "ActionDocument" } } }, { "name": "gas_price", "required": true, "schema": { "type": "string" } }, { "name": "input_data_ids", "required": true, "schema": { "type": "array", "items": { "type": "string" } } }, { "name": "is_promise_yield", "required": true, "schema": { "type": "boolean" } }, { "name": "output_data_receivers", "required": true, "schema": { "type": "array", "items": { "type": "object", "required": [ "data_id", "receiver_id" ], "additionalProperties": false, "properties": [ { "name": "data_id", "required": true, "schema": { "type": "string" } }, { "name": "receiver_id", "required": true, "schema": { "type": "string" } } ], "refName": "OutputDataReceiverDocument" } } }, { "name": "signer_id", "required": true, "schema": { "type": "string" } }, { "name": "signer_public_key", "required": true, "schema": { "type": "string" } } ], "refName": "ActionReceiptDocument" } } ], "refName": "ActionReceiptBody" }, { "type": "object", "required": [ "Data" ], "additionalProperties": false, "properties": [ { "name": "Data", "required": true, "schema": { "type": "object", "required": [ "data", "data_id", "is_promise_resume" ], "additionalProperties": false, "properties": [ { "name": "data", "required": true, "schema": { "type": "string" } }, { "name": "data_id", "required": true, "schema": { "type": "string" } }, { "name": "is_promise_resume", "required": true, "schema": { "type": "boolean" } } ], "refName": "DataReceiptDocument" } } ], "refName": "DataReceiptBody" } ], "refName": "ReceiptBody" } }, { "name": "receipt_id", "required": true, "schema": { "type": "string" } }, { "name": "receiver_id", "required": true, "schema": { "type": "string" } } ], "refName": "ReceiptDocument" } } }, { "name": "transactions", "required": true, "schema": { "type": "array", "items": { "type": "object", "description": "Transaction entry returned inside a neardata chunk.", "required": [ "outcome", "transaction" ], "additionalProperties": false, "properties": [ { "name": "outcome", "required": true, "schema": { "type": "object", "description": "Execution result paired with an optional receipt object.", "required": [ "execution_outcome", "receipt" ], "additionalProperties": false, "properties": [ { "name": "execution_outcome", "required": true, "schema": { "type": "object", "required": [ "block_hash", "id", "outcome", "proof" ], "additionalProperties": false, "properties": [ { "name": "block_hash", "required": true, "schema": { "type": "string" } }, { "name": "id", "required": true, "schema": { "type": "string" } }, { "name": "outcome", "required": true, "schema": { "type": "object", "required": [ "executor_id", "gas_burnt", "logs", "metadata", "receipt_ids", "status", "tokens_burnt" ], "additionalProperties": false, "properties": [ { "name": "executor_id", "required": true, "schema": { "type": "string" } }, { "name": "gas_burnt", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "logs", "required": true, "schema": { "type": "array", "items": { "type": "string" } } }, { "name": "metadata", "required": true, "schema": { "type": "object", "additionalProperties": true } }, { "name": "receipt_ids", "required": true, "schema": { "type": "array", "items": { "type": "string" } } }, { "name": "status", "required": true, "schema": { "oneOf": [ { "type": "object", "required": [ "SuccessReceiptId" ], "additionalProperties": false, "properties": [ { "name": "SuccessReceiptId", "required": true, "schema": { "type": "string" } } ], "refName": "ExecutionOutcomeStatusSuccessReceiptId" }, { "type": "object", "required": [ "SuccessValue" ], "additionalProperties": false, "properties": [ { "name": "SuccessValue", "required": true, "schema": { "type": "string" } } ], "refName": "ExecutionOutcomeStatusSuccessValue" }, { "type": "object", "required": [ "Failure" ], "additionalProperties": false, "properties": [ { "name": "Failure", "required": true, "schema": { "type": "object", "additionalProperties": true } } ], "refName": "ExecutionOutcomeStatusFailure" } ], "refName": "ExecutionOutcomeStatus" } }, { "name": "tokens_burnt", "required": true, "schema": { "type": "string" } } ], "refName": "ExecutionOutcomeSummary" } }, { "name": "proof", "required": true, "schema": { "type": "array", "items": { "type": "object", "additionalProperties": true, "refName": "ExecutionProofItem" } } } ], "refName": "ExecutionOutcomeDocument" } }, { "name": "receipt", "required": true, "schema": { "type": "object", "description": "Receipt payload when neardata includes it for this entry.", "oneOf": [ { "type": "object", "description": "Receipt object as served by neardata inside a chunk payload.", "required": [ "predecessor_id", "priority", "receipt", "receipt_id", "receiver_id" ], "additionalProperties": false, "properties": [ { "name": "predecessor_id", "required": true, "schema": { "type": "string" } }, { "name": "priority", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "receipt", "required": true, "schema": { "oneOf": [ { "type": "object", "required": [ "Action" ], "additionalProperties": false, "properties": [ { "name": "Action", "required": true, "schema": { "type": "object", "required": [ "actions", "gas_price", "input_data_ids", "is_promise_yield", "output_data_receivers", "signer_id", "signer_public_key" ], "additionalProperties": false, "properties": [ { "name": "actions", "required": true, "schema": { "type": "array", "items": { "type": "object", "additionalProperties": true, "refName": "ActionDocument" } } }, { "name": "gas_price", "required": true, "schema": { "type": "string" } }, { "name": "input_data_ids", "required": true, "schema": { "type": "array", "items": { "type": "string" } } }, { "name": "is_promise_yield", "required": true, "schema": { "type": "boolean" } }, { "name": "output_data_receivers", "required": true, "schema": { "type": "array", "items": { "type": "object", "required": [ "data_id", "receiver_id" ], "additionalProperties": false, "properties": [ { "name": "data_id", "required": true, "schema": { "type": "string" } }, { "name": "receiver_id", "required": true, "schema": { "type": "string" } } ], "refName": "OutputDataReceiverDocument" } } }, { "name": "signer_id", "required": true, "schema": { "type": "string" } }, { "name": "signer_public_key", "required": true, "schema": { "type": "string" } } ], "refName": "ActionReceiptDocument" } } ], "refName": "ActionReceiptBody" }, { "type": "object", "required": [ "Data" ], "additionalProperties": false, "properties": [ { "name": "Data", "required": true, "schema": { "type": "object", "required": [ "data", "data_id", "is_promise_resume" ], "additionalProperties": false, "properties": [ { "name": "data", "required": true, "schema": { "type": "string" } }, { "name": "data_id", "required": true, "schema": { "type": "string" } }, { "name": "is_promise_resume", "required": true, "schema": { "type": "boolean" } } ], "refName": "DataReceiptDocument" } } ], "refName": "DataReceiptBody" } ], "refName": "ReceiptBody" } }, { "name": "receipt_id", "required": true, "schema": { "type": "string" } }, { "name": "receiver_id", "required": true, "schema": { "type": "string" } } ], "refName": "ReceiptDocument" }, { "type": "object", "additionalProperties": false, "refName": "OmittedReceiptDocument" } ] } }, { "name": "tx_hash", "required": false, "schema": { "type": "string" } } ], "refName": "ExecutionWithReceipt" } }, { "name": "transaction", "required": true, "schema": { "type": "object", "required": [ "actions", "hash", "nonce", "priority_fee", "public_key", "receiver_id", "signature", "signer_id" ], "additionalProperties": false, "properties": [ { "name": "actions", "required": true, "schema": { "type": "array", "items": { "type": "object", "additionalProperties": true, "refName": "ActionDocument" } } }, { "name": "hash", "required": true, "schema": { "type": "string" } }, { "name": "nonce", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "priority_fee", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "public_key", "required": true, "schema": { "type": "string" } }, { "name": "receiver_id", "required": true, "schema": { "type": "string" } }, { "name": "signature", "required": true, "schema": { "type": "string" } }, { "name": "signer_id", "required": true, "schema": { "type": "string" } } ], "refName": "SignedTransactionDocument" } } ], "refName": "ChunkTransactionWrapper" } } } ], "refName": "ChunkDocument" } }, { "name": "receipt_execution_outcomes", "required": true, "schema": { "type": "array", "items": { "type": "object", "description": "Execution result paired with an optional receipt object.", "required": [ "execution_outcome", "receipt" ], "additionalProperties": false, "properties": [ { "name": "execution_outcome", "required": true, "schema": { "type": "object", "required": [ "block_hash", "id", "outcome", "proof" ], "additionalProperties": false, "properties": [ { "name": "block_hash", "required": true, "schema": { "type": "string" } }, { "name": "id", "required": true, "schema": { "type": "string" } }, { "name": "outcome", "required": true, "schema": { "type": "object", "required": [ "executor_id", "gas_burnt", "logs", "metadata", "receipt_ids", "status", "tokens_burnt" ], "additionalProperties": false, "properties": [ { "name": "executor_id", "required": true, "schema": { "type": "string" } }, { "name": "gas_burnt", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "logs", "required": true, "schema": { "type": "array", "items": { "type": "string" } } }, { "name": "metadata", "required": true, "schema": { "type": "object", "additionalProperties": true } }, { "name": "receipt_ids", "required": true, "schema": { "type": "array", "items": { "type": "string" } } }, { "name": "status", "required": true, "schema": { "oneOf": [ { "type": "object", "required": [ "SuccessReceiptId" ], "additionalProperties": false, "properties": [ { "name": "SuccessReceiptId", "required": true, "schema": { "type": "string" } } ], "refName": "ExecutionOutcomeStatusSuccessReceiptId" }, { "type": "object", "required": [ "SuccessValue" ], "additionalProperties": false, "properties": [ { "name": "SuccessValue", "required": true, "schema": { "type": "string" } } ], "refName": "ExecutionOutcomeStatusSuccessValue" }, { "type": "object", "required": [ "Failure" ], "additionalProperties": false, "properties": [ { "name": "Failure", "required": true, "schema": { "type": "object", "additionalProperties": true } } ], "refName": "ExecutionOutcomeStatusFailure" } ], "refName": "ExecutionOutcomeStatus" } }, { "name": "tokens_burnt", "required": true, "schema": { "type": "string" } } ], "refName": "ExecutionOutcomeSummary" } }, { "name": "proof", "required": true, "schema": { "type": "array", "items": { "type": "object", "additionalProperties": true, "refName": "ExecutionProofItem" } } } ], "refName": "ExecutionOutcomeDocument" } }, { "name": "receipt", "required": true, "schema": { "type": "object", "description": "Receipt payload when neardata includes it for this entry.", "oneOf": [ { "type": "object", "description": "Receipt object as served by neardata inside a chunk payload.", "required": [ "predecessor_id", "priority", "receipt", "receipt_id", "receiver_id" ], "additionalProperties": false, "properties": [ { "name": "predecessor_id", "required": true, "schema": { "type": "string" } }, { "name": "priority", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "receipt", "required": true, "schema": { "oneOf": [ { "type": "object", "required": [ "Action" ], "additionalProperties": false, "properties": [ { "name": "Action", "required": true, "schema": { "type": "object", "required": [ "actions", "gas_price", "input_data_ids", "is_promise_yield", "output_data_receivers", "signer_id", "signer_public_key" ], "additionalProperties": false, "properties": [ { "name": "actions", "required": true, "schema": { "type": "array", "items": { "type": "object", "additionalProperties": true, "refName": "ActionDocument" } } }, { "name": "gas_price", "required": true, "schema": { "type": "string" } }, { "name": "input_data_ids", "required": true, "schema": { "type": "array", "items": { "type": "string" } } }, { "name": "is_promise_yield", "required": true, "schema": { "type": "boolean" } }, { "name": "output_data_receivers", "required": true, "schema": { "type": "array", "items": { "type": "object", "required": [ "data_id", "receiver_id" ], "additionalProperties": false, "properties": [ { "name": "data_id", "required": true, "schema": { "type": "string" } }, { "name": "receiver_id", "required": true, "schema": { "type": "string" } } ], "refName": "OutputDataReceiverDocument" } } }, { "name": "signer_id", "required": true, "schema": { "type": "string" } }, { "name": "signer_public_key", "required": true, "schema": { "type": "string" } } ], "refName": "ActionReceiptDocument" } } ], "refName": "ActionReceiptBody" }, { "type": "object", "required": [ "Data" ], "additionalProperties": false, "properties": [ { "name": "Data", "required": true, "schema": { "type": "object", "required": [ "data", "data_id", "is_promise_resume" ], "additionalProperties": false, "properties": [ { "name": "data", "required": true, "schema": { "type": "string" } }, { "name": "data_id", "required": true, "schema": { "type": "string" } }, { "name": "is_promise_resume", "required": true, "schema": { "type": "boolean" } } ], "refName": "DataReceiptDocument" } } ], "refName": "DataReceiptBody" } ], "refName": "ReceiptBody" } }, { "name": "receipt_id", "required": true, "schema": { "type": "string" } }, { "name": "receiver_id", "required": true, "schema": { "type": "string" } } ], "refName": "ReceiptDocument" }, { "type": "object", "additionalProperties": false, "refName": "OmittedReceiptDocument" } ] } }, { "name": "tx_hash", "required": false, "schema": { "type": "string" } } ], "refName": "ExecutionWithReceipt" } } }, { "name": "shard_id", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "state_changes", "required": true, "schema": { "type": "array", "items": { "type": "object", "description": "State change entry returned by neardata for a shard.", "required": [ "cause", "change", "type" ], "additionalProperties": false, "properties": [ { "name": "cause", "required": true, "schema": { "oneOf": [ { "type": "object", "required": [ "tx_hash", "type" ], "additionalProperties": false, "properties": [ { "name": "tx_hash", "required": true, "schema": { "type": "string" } }, { "name": "type", "required": true, "schema": { "type": "string" } } ], "refName": "StateChangeCauseTransactionProcessing" }, { "type": "object", "required": [ "receipt_hash", "type" ], "additionalProperties": false, "properties": [ { "name": "receipt_hash", "required": true, "schema": { "type": "string" } }, { "name": "type", "required": true, "schema": { "type": "string" } } ], "refName": "StateChangeCauseReceiptProcessing" }, { "type": "object", "required": [ "receipt_hash", "type" ], "additionalProperties": false, "properties": [ { "name": "receipt_hash", "required": true, "schema": { "type": "string" } }, { "name": "type", "required": true, "schema": { "type": "string" } } ], "refName": "StateChangeCauseActionReceiptGasReward" } ], "refName": "StateChangeCause" } }, { "name": "change", "required": true, "schema": { "oneOf": [ { "type": "object", "required": [ "account_id", "amount", "code_hash", "locked", "storage_paid_at", "storage_usage" ], "additionalProperties": false, "properties": [ { "name": "account_id", "required": true, "schema": { "type": "string" } }, { "name": "amount", "required": true, "schema": { "type": "string" } }, { "name": "code_hash", "required": true, "schema": { "type": "string" } }, { "name": "locked", "required": true, "schema": { "type": "string" } }, { "name": "storage_paid_at", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "storage_usage", "required": true, "schema": { "type": "integer", "format": "uint64" } } ], "refName": "StateChangeValueAccountUpdate" }, { "type": "object", "required": [ "access_key", "account_id", "public_key" ], "additionalProperties": false, "properties": [ { "name": "access_key", "required": true, "schema": { "type": "object", "additionalProperties": true } }, { "name": "account_id", "required": true, "schema": { "type": "string" } }, { "name": "public_key", "required": true, "schema": { "type": "string" } } ], "refName": "StateChangeValueAccessKeyUpdate" }, { "type": "object", "required": [ "account_id", "key_base64", "value_base64" ], "additionalProperties": false, "properties": [ { "name": "account_id", "required": true, "schema": { "type": "string" } }, { "name": "key_base64", "required": true, "schema": { "type": "string" } }, { "name": "value_base64", "required": true, "schema": { "type": "string" } } ], "refName": "StateChangeValueDataUpdate" }, { "type": "object", "required": [ "account_id", "key_base64" ], "additionalProperties": false, "properties": [ { "name": "account_id", "required": true, "schema": { "type": "string" } }, { "name": "key_base64", "required": true, "schema": { "type": "string" } } ], "refName": "StateChangeValueDataDeletion" } ], "refName": "StateChangeValue" } }, { "name": "type", "required": true, "schema": { "type": "string" } } ], "refName": "StateChangeItem" } } } ], "refName": "ShardDocument" } } } ], "refName": "BlockDocument" } ``` --- ## NEAR Data API - Block Chunk - HTML path: https://docs.fastnear.com/apis/neardata/v0/block_chunk - Markdown path: https://docs.fastnear.com/apis/neardata/v0/block_chunk.md # NEAR Data API - Block Chunk Fetch one chunk from a finalized block Fetch one chunk — a single shard's transactions and incoming receipts — at a chosen block height. ## Source links - https://docs.fastnear.com/apis/neardata/v0/block_chunk - https://docs.fastnear.com/apis/neardata/openapi/blocks/get_chunk ## Operation - Transport: http - Method: GET - Path: `/v0/block/{block_height}/chunk/{shard_id}` - Source spec: `apis/neardata/v0/block_chunk.yaml` ## Networks - Mainnet: https://mainnet.neardata.xyz/ - Testnet: https://testnet.neardata.xyz/ ## Auth - API key via query `apiKey`: Optional FastNEAR subscription API key. Invalid values may return `401` before redirect handling. - This export intentionally omits any locally saved credentials ## Current request - Network: Mainnet - Method: GET - URL: https://mainnet.neardata.xyz/v0/block/50000000/chunk/0 - Active example: Mainnet ## Request reference ### Active example ```json { "body": null, "headers": {}, "path": { "block_height": "50000000", "shard_id": "0" }, "query": {} } ``` ### Inputs - `block_height` (path, required, string): NEAR block height to retrieve. - `shard_id` (path, required, string): Shard ID whose chunk should be returned. ### Path parameters - `block_height` (path, required, string): NEAR block height to retrieve. - `shard_id` (path, required, string): Shard ID whose chunk should be returned. ### Query parameters - `apiKey` (query, string): Optional FastNEAR subscription API key. Invalid values may return `401` before redirect handling. ## Response reference - Status: 200 - Media type: application/json - Summary: Requested document, or `null` when the selected slice is absent ### Response schema ```json { "type": "object", "description": "Chunk payload returned by neardata for a single shard in a selected block.", "required": [ "author", "header", "receipts", "transactions" ], "additionalProperties": false, "properties": [ { "name": "author", "required": true, "schema": { "type": "string", "description": "Chunk producer account ID." } }, { "name": "header", "required": true, "schema": { "type": "object", "description": "Chunk header object as served by neardata.", "additionalProperties": true, "properties": [ { "name": "chunk_hash", "required": false, "schema": { "type": "string" } }, { "name": "gas_limit", "required": false, "schema": { "type": "integer" } }, { "name": "gas_used", "required": false, "schema": { "type": "integer" } }, { "name": "height_created", "required": false, "schema": { "type": "integer", "format": "uint64" } }, { "name": "height_included", "required": false, "schema": { "type": "integer", "format": "uint64" } }, { "name": "outcome_root", "required": false, "schema": { "type": "string" } }, { "name": "outgoing_receipts_root", "required": false, "schema": { "type": "string" } }, { "name": "prev_block_hash", "required": false, "schema": { "type": "string" } }, { "name": "shard_id", "required": false, "schema": { "type": "integer", "format": "uint64" } }, { "name": "tx_root", "required": false, "schema": { "type": "string" } } ], "refName": "ChunkHeader" } }, { "name": "receipts", "required": true, "schema": { "type": "array", "items": { "type": "object", "description": "Receipt object as served by neardata inside a chunk payload.", "required": [ "predecessor_id", "priority", "receipt", "receipt_id", "receiver_id" ], "additionalProperties": false, "properties": [ { "name": "predecessor_id", "required": true, "schema": { "type": "string" } }, { "name": "priority", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "receipt", "required": true, "schema": { "oneOf": [ { "type": "object", "required": [ "Action" ], "additionalProperties": false, "properties": [ { "name": "Action", "required": true, "schema": { "type": "object", "required": [ "actions", "gas_price", "input_data_ids", "is_promise_yield", "output_data_receivers", "signer_id", "signer_public_key" ], "additionalProperties": false, "properties": [ { "name": "actions", "required": true, "schema": { "type": "array", "items": { "type": "object", "additionalProperties": true, "refName": "ActionDocument" } } }, { "name": "gas_price", "required": true, "schema": { "type": "string" } }, { "name": "input_data_ids", "required": true, "schema": { "type": "array", "items": { "type": "string" } } }, { "name": "is_promise_yield", "required": true, "schema": { "type": "boolean" } }, { "name": "output_data_receivers", "required": true, "schema": { "type": "array", "items": { "type": "object", "required": [ "data_id", "receiver_id" ], "additionalProperties": false, "properties": [ { "name": "data_id", "required": true, "schema": { "type": "string" } }, { "name": "receiver_id", "required": true, "schema": { "type": "string" } } ], "refName": "OutputDataReceiverDocument" } } }, { "name": "signer_id", "required": true, "schema": { "type": "string" } }, { "name": "signer_public_key", "required": true, "schema": { "type": "string" } } ], "refName": "ActionReceiptDocument" } } ], "refName": "ActionReceiptBody" }, { "type": "object", "required": [ "Data" ], "additionalProperties": false, "properties": [ { "name": "Data", "required": true, "schema": { "type": "object", "required": [ "data", "data_id", "is_promise_resume" ], "additionalProperties": false, "properties": [ { "name": "data", "required": true, "schema": { "type": "string" } }, { "name": "data_id", "required": true, "schema": { "type": "string" } }, { "name": "is_promise_resume", "required": true, "schema": { "type": "boolean" } } ], "refName": "DataReceiptDocument" } } ], "refName": "DataReceiptBody" } ], "refName": "ReceiptBody" } }, { "name": "receipt_id", "required": true, "schema": { "type": "string" } }, { "name": "receiver_id", "required": true, "schema": { "type": "string" } } ], "refName": "ReceiptDocument" } } }, { "name": "transactions", "required": true, "schema": { "type": "array", "items": { "type": "object", "description": "Transaction entry returned inside a neardata chunk.", "required": [ "outcome", "transaction" ], "additionalProperties": false, "properties": [ { "name": "outcome", "required": true, "schema": { "type": "object", "description": "Execution result paired with an optional receipt object.", "required": [ "execution_outcome", "receipt" ], "additionalProperties": false, "properties": [ { "name": "execution_outcome", "required": true, "schema": { "type": "object", "required": [ "block_hash", "id", "outcome", "proof" ], "additionalProperties": false, "properties": [ { "name": "block_hash", "required": true, "schema": { "type": "string" } }, { "name": "id", "required": true, "schema": { "type": "string" } }, { "name": "outcome", "required": true, "schema": { "type": "object", "required": [ "executor_id", "gas_burnt", "logs", "metadata", "receipt_ids", "status", "tokens_burnt" ], "additionalProperties": false, "properties": [ { "name": "executor_id", "required": true, "schema": { "type": "string" } }, { "name": "gas_burnt", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "logs", "required": true, "schema": { "type": "array", "items": { "type": "string" } } }, { "name": "metadata", "required": true, "schema": { "type": "object", "additionalProperties": true } }, { "name": "receipt_ids", "required": true, "schema": { "type": "array", "items": { "type": "string" } } }, { "name": "status", "required": true, "schema": { "oneOf": [ { "type": "object", "required": [ "SuccessReceiptId" ], "additionalProperties": false, "properties": [ { "name": "SuccessReceiptId", "required": true, "schema": { "type": "string" } } ], "refName": "ExecutionOutcomeStatusSuccessReceiptId" }, { "type": "object", "required": [ "SuccessValue" ], "additionalProperties": false, "properties": [ { "name": "SuccessValue", "required": true, "schema": { "type": "string" } } ], "refName": "ExecutionOutcomeStatusSuccessValue" }, { "type": "object", "required": [ "Failure" ], "additionalProperties": false, "properties": [ { "name": "Failure", "required": true, "schema": { "type": "object", "additionalProperties": true } } ], "refName": "ExecutionOutcomeStatusFailure" } ], "refName": "ExecutionOutcomeStatus" } }, { "name": "tokens_burnt", "required": true, "schema": { "type": "string" } } ], "refName": "ExecutionOutcomeSummary" } }, { "name": "proof", "required": true, "schema": { "type": "array", "items": { "type": "object", "additionalProperties": true, "refName": "ExecutionProofItem" } } } ], "refName": "ExecutionOutcomeDocument" } }, { "name": "receipt", "required": true, "schema": { "type": "object", "description": "Receipt payload when neardata includes it for this entry.", "oneOf": [ { "type": "object", "description": "Receipt object as served by neardata inside a chunk payload.", "required": [ "predecessor_id", "priority", "receipt", "receipt_id", "receiver_id" ], "additionalProperties": false, "properties": [ { "name": "predecessor_id", "required": true, "schema": { "type": "string" } }, { "name": "priority", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "receipt", "required": true, "schema": { "oneOf": [ { "type": "object", "required": [ "Action" ], "additionalProperties": false, "properties": [ { "name": "Action", "required": true, "schema": { "type": "object", "required": [ "actions", "gas_price", "input_data_ids", "is_promise_yield", "output_data_receivers", "signer_id", "signer_public_key" ], "additionalProperties": false, "properties": [ { "name": "actions", "required": true, "schema": { "type": "array", "items": { "type": "object", "additionalProperties": true, "refName": "ActionDocument" } } }, { "name": "gas_price", "required": true, "schema": { "type": "string" } }, { "name": "input_data_ids", "required": true, "schema": { "type": "array", "items": { "type": "string" } } }, { "name": "is_promise_yield", "required": true, "schema": { "type": "boolean" } }, { "name": "output_data_receivers", "required": true, "schema": { "type": "array", "items": { "type": "object", "required": [ "data_id", "receiver_id" ], "additionalProperties": false, "properties": [ { "name": "data_id", "required": true, "schema": { "type": "string" } }, { "name": "receiver_id", "required": true, "schema": { "type": "string" } } ], "refName": "OutputDataReceiverDocument" } } }, { "name": "signer_id", "required": true, "schema": { "type": "string" } }, { "name": "signer_public_key", "required": true, "schema": { "type": "string" } } ], "refName": "ActionReceiptDocument" } } ], "refName": "ActionReceiptBody" }, { "type": "object", "required": [ "Data" ], "additionalProperties": false, "properties": [ { "name": "Data", "required": true, "schema": { "type": "object", "required": [ "data", "data_id", "is_promise_resume" ], "additionalProperties": false, "properties": [ { "name": "data", "required": true, "schema": { "type": "string" } }, { "name": "data_id", "required": true, "schema": { "type": "string" } }, { "name": "is_promise_resume", "required": true, "schema": { "type": "boolean" } } ], "refName": "DataReceiptDocument" } } ], "refName": "DataReceiptBody" } ], "refName": "ReceiptBody" } }, { "name": "receipt_id", "required": true, "schema": { "type": "string" } }, { "name": "receiver_id", "required": true, "schema": { "type": "string" } } ], "refName": "ReceiptDocument" }, { "type": "object", "additionalProperties": false, "refName": "OmittedReceiptDocument" } ] } }, { "name": "tx_hash", "required": false, "schema": { "type": "string" } } ], "refName": "ExecutionWithReceipt" } }, { "name": "transaction", "required": true, "schema": { "type": "object", "required": [ "actions", "hash", "nonce", "priority_fee", "public_key", "receiver_id", "signature", "signer_id" ], "additionalProperties": false, "properties": [ { "name": "actions", "required": true, "schema": { "type": "array", "items": { "type": "object", "additionalProperties": true, "refName": "ActionDocument" } } }, { "name": "hash", "required": true, "schema": { "type": "string" } }, { "name": "nonce", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "priority_fee", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "public_key", "required": true, "schema": { "type": "string" } }, { "name": "receiver_id", "required": true, "schema": { "type": "string" } }, { "name": "signature", "required": true, "schema": { "type": "string" } }, { "name": "signer_id", "required": true, "schema": { "type": "string" } } ], "refName": "SignedTransactionDocument" } } ], "refName": "ChunkTransactionWrapper" } } } ], "refName": "ChunkDocument" } ``` --- ## NEAR Data API - Block Headers - HTML path: https://docs.fastnear.com/apis/neardata/v0/block_headers - Markdown path: https://docs.fastnear.com/apis/neardata/v0/block_headers.md # NEAR Data API - Block Headers Fetch the block-level object for a finalized block Fetch only a finalized block's header and chunk summaries — no per-shard payload. ## Source links - https://docs.fastnear.com/apis/neardata/v0/block_headers - https://docs.fastnear.com/apis/neardata/openapi/blocks/get_block_headers ## Operation - Transport: http - Method: GET - Path: `/v0/block/{block_height}/headers` - Source spec: `apis/neardata/v0/block_headers.yaml` ## Networks - Mainnet: https://mainnet.neardata.xyz/ - Testnet: https://testnet.neardata.xyz/ ## Auth - API key via query `apiKey`: Optional FastNEAR subscription API key. Invalid values may return `401` before redirect handling. - This export intentionally omits any locally saved credentials ## Current request - Network: Mainnet - Method: GET - URL: https://mainnet.neardata.xyz/v0/block/9820210/headers - Active example: Mainnet ## Request reference ### Active example ```json { "body": null, "headers": {}, "path": { "block_height": "9820210" }, "query": {} } ``` ### Inputs - `block_height` (path, required, string): NEAR block height to retrieve. ### Path parameters - `block_height` (path, required, string): NEAR block height to retrieve. ### Query parameters - `apiKey` (query, string): Optional FastNEAR subscription API key. Invalid values may return `401` before redirect handling. ## Response reference - Status: 200 - Media type: application/json - Summary: Requested document, or `null` when the selected slice is absent ### Response schema ```json { "type": "object", "description": "Block-level payload returned by neardata.", "required": [ "author", "chunks", "header" ], "additionalProperties": false, "properties": [ { "name": "author", "required": true, "schema": { "type": "string", "description": "Block producer account ID." } }, { "name": "chunks", "required": true, "schema": { "type": "array", "items": { "type": "object", "description": "Chunk header object as served by neardata.", "additionalProperties": true, "properties": [ { "name": "chunk_hash", "required": false, "schema": { "type": "string" } }, { "name": "gas_limit", "required": false, "schema": { "type": "integer" } }, { "name": "gas_used", "required": false, "schema": { "type": "integer" } }, { "name": "height_created", "required": false, "schema": { "type": "integer", "format": "uint64" } }, { "name": "height_included", "required": false, "schema": { "type": "integer", "format": "uint64" } }, { "name": "outcome_root", "required": false, "schema": { "type": "string" } }, { "name": "outgoing_receipts_root", "required": false, "schema": { "type": "string" } }, { "name": "prev_block_hash", "required": false, "schema": { "type": "string" } }, { "name": "shard_id", "required": false, "schema": { "type": "integer", "format": "uint64" } }, { "name": "tx_root", "required": false, "schema": { "type": "string" } } ], "refName": "ChunkHeader" } } }, { "name": "header", "required": true, "schema": { "type": "object", "description": "Block header object as served by neardata.", "additionalProperties": true, "properties": [ { "name": "chunks_included", "required": false, "schema": { "type": "integer", "format": "uint64" } }, { "name": "epoch_id", "required": false, "schema": { "type": "string" } }, { "name": "gas_price", "required": false, "schema": { "type": "string" } }, { "name": "hash", "required": false, "schema": { "type": "string" } }, { "name": "height", "required": false, "schema": { "type": "integer", "format": "uint64" } }, { "name": "next_epoch_id", "required": false, "schema": { "type": "string" } }, { "name": "prev_hash", "required": false, "schema": { "type": "string" } }, { "name": "prev_height", "required": false, "schema": { "type": "integer", "format": "uint64" } }, { "name": "timestamp", "required": false, "schema": { "type": "integer" } }, { "name": "timestamp_nanosec", "required": false, "schema": { "type": "string" } }, { "name": "total_supply", "required": false, "schema": { "type": "string" } } ], "refName": "BlockHeader" } } ], "refName": "BlockEnvelope" } ``` --- ## NEAR Data API - Optimistic Block - HTML path: https://docs.fastnear.com/apis/neardata/v0/block_optimistic - Markdown path: https://docs.fastnear.com/apis/neardata/v0/block_optimistic.md # NEAR Data API - Optimistic Block Fetch an optimistic block by height Fetch an optimistic (not-yet-final) block at a chosen height — may redirect once the optimistic window has finalized. ## Source links - https://docs.fastnear.com/apis/neardata/v0/block_optimistic - https://docs.fastnear.com/apis/neardata/openapi/blocks/get_block_optimistic ## Operation - Transport: http - Method: GET - Path: `/v0/block_opt/{block_height}` - Source spec: `apis/neardata/v0/block_optimistic.yaml` ## Networks - Mainnet: https://mainnet.neardata.xyz/ - Testnet: https://testnet.neardata.xyz/ ## Auth - API key via query `apiKey`: Optional FastNEAR subscription API key. Invalid values may return `401` before redirect handling. - This export intentionally omits any locally saved credentials ## Current request - Network: Mainnet - Method: GET - URL: https://mainnet.neardata.xyz/v0/block_opt/9820210 - Active example: Mainnet ## Request reference ### Active example ```json { "body": null, "headers": {}, "path": { "block_height": "9820210" }, "query": {} } ``` ### Inputs - `block_height` (path, required, string): NEAR block height to retrieve. ### Path parameters - `block_height` (path, required, string): NEAR block height to retrieve. ### Query parameters - `apiKey` (query, string): Optional FastNEAR subscription API key. Invalid values may return `401` before redirect handling. ## Response reference - Status: 200 - Media type: application/json - Summary: Requested document, or `null` when the selected slice is absent ### Response schema ```json { "type": "object", "description": "Full block document as served by neardata, including the block envelope and per-shard payloads.", "required": [ "block", "shards" ], "additionalProperties": false, "properties": [ { "name": "block", "required": true, "schema": { "type": "object", "description": "Block-level payload returned by neardata.", "required": [ "author", "chunks", "header" ], "additionalProperties": false, "properties": [ { "name": "author", "required": true, "schema": { "type": "string", "description": "Block producer account ID." } }, { "name": "chunks", "required": true, "schema": { "type": "array", "items": { "type": "object", "description": "Chunk header object as served by neardata.", "additionalProperties": true, "properties": [ { "name": "chunk_hash", "required": false, "schema": { "type": "string" } }, { "name": "gas_limit", "required": false, "schema": { "type": "integer" } }, { "name": "gas_used", "required": false, "schema": { "type": "integer" } }, { "name": "height_created", "required": false, "schema": { "type": "integer", "format": "uint64" } }, { "name": "height_included", "required": false, "schema": { "type": "integer", "format": "uint64" } }, { "name": "outcome_root", "required": false, "schema": { "type": "string" } }, { "name": "outgoing_receipts_root", "required": false, "schema": { "type": "string" } }, { "name": "prev_block_hash", "required": false, "schema": { "type": "string" } }, { "name": "shard_id", "required": false, "schema": { "type": "integer", "format": "uint64" } }, { "name": "tx_root", "required": false, "schema": { "type": "string" } } ], "refName": "ChunkHeader" } } }, { "name": "header", "required": true, "schema": { "type": "object", "description": "Block header object as served by neardata.", "additionalProperties": true, "properties": [ { "name": "chunks_included", "required": false, "schema": { "type": "integer", "format": "uint64" } }, { "name": "epoch_id", "required": false, "schema": { "type": "string" } }, { "name": "gas_price", "required": false, "schema": { "type": "string" } }, { "name": "hash", "required": false, "schema": { "type": "string" } }, { "name": "height", "required": false, "schema": { "type": "integer", "format": "uint64" } }, { "name": "next_epoch_id", "required": false, "schema": { "type": "string" } }, { "name": "prev_hash", "required": false, "schema": { "type": "string" } }, { "name": "prev_height", "required": false, "schema": { "type": "integer", "format": "uint64" } }, { "name": "timestamp", "required": false, "schema": { "type": "integer" } }, { "name": "timestamp_nanosec", "required": false, "schema": { "type": "string" } }, { "name": "total_supply", "required": false, "schema": { "type": "string" } } ], "refName": "BlockHeader" } } ], "refName": "BlockEnvelope" } }, { "name": "shards", "required": true, "schema": { "type": "array", "items": { "type": "object", "description": "Per-shard payload returned by neardata for a block.", "required": [ "chunk", "receipt_execution_outcomes", "shard_id", "state_changes" ], "additionalProperties": false, "properties": [ { "name": "chunk", "required": true, "schema": { "type": "object", "description": "Chunk payload returned by neardata for a single shard in a selected block.", "required": [ "author", "header", "receipts", "transactions" ], "additionalProperties": false, "properties": [ { "name": "author", "required": true, "schema": { "type": "string", "description": "Chunk producer account ID." } }, { "name": "header", "required": true, "schema": { "type": "object", "description": "Chunk header object as served by neardata.", "additionalProperties": true, "properties": [ { "name": "chunk_hash", "required": false, "schema": { "type": "string" } }, { "name": "gas_limit", "required": false, "schema": { "type": "integer" } }, { "name": "gas_used", "required": false, "schema": { "type": "integer" } }, { "name": "height_created", "required": false, "schema": { "type": "integer", "format": "uint64" } }, { "name": "height_included", "required": false, "schema": { "type": "integer", "format": "uint64" } }, { "name": "outcome_root", "required": false, "schema": { "type": "string" } }, { "name": "outgoing_receipts_root", "required": false, "schema": { "type": "string" } }, { "name": "prev_block_hash", "required": false, "schema": { "type": "string" } }, { "name": "shard_id", "required": false, "schema": { "type": "integer", "format": "uint64" } }, { "name": "tx_root", "required": false, "schema": { "type": "string" } } ], "refName": "ChunkHeader" } }, { "name": "receipts", "required": true, "schema": { "type": "array", "items": { "type": "object", "description": "Receipt object as served by neardata inside a chunk payload.", "required": [ "predecessor_id", "priority", "receipt", "receipt_id", "receiver_id" ], "additionalProperties": false, "properties": [ { "name": "predecessor_id", "required": true, "schema": { "type": "string" } }, { "name": "priority", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "receipt", "required": true, "schema": { "oneOf": [ { "type": "object", "required": [ "Action" ], "additionalProperties": false, "properties": [ { "name": "Action", "required": true, "schema": { "type": "object", "required": [ "actions", "gas_price", "input_data_ids", "is_promise_yield", "output_data_receivers", "signer_id", "signer_public_key" ], "additionalProperties": false, "properties": [ { "name": "actions", "required": true, "schema": { "type": "array", "items": { "type": "object", "additionalProperties": true, "refName": "ActionDocument" } } }, { "name": "gas_price", "required": true, "schema": { "type": "string" } }, { "name": "input_data_ids", "required": true, "schema": { "type": "array", "items": { "type": "string" } } }, { "name": "is_promise_yield", "required": true, "schema": { "type": "boolean" } }, { "name": "output_data_receivers", "required": true, "schema": { "type": "array", "items": { "type": "object", "required": [ "data_id", "receiver_id" ], "additionalProperties": false, "properties": [ { "name": "data_id", "required": true, "schema": { "type": "string" } }, { "name": "receiver_id", "required": true, "schema": { "type": "string" } } ], "refName": "OutputDataReceiverDocument" } } }, { "name": "signer_id", "required": true, "schema": { "type": "string" } }, { "name": "signer_public_key", "required": true, "schema": { "type": "string" } } ], "refName": "ActionReceiptDocument" } } ], "refName": "ActionReceiptBody" }, { "type": "object", "required": [ "Data" ], "additionalProperties": false, "properties": [ { "name": "Data", "required": true, "schema": { "type": "object", "required": [ "data", "data_id", "is_promise_resume" ], "additionalProperties": false, "properties": [ { "name": "data", "required": true, "schema": { "type": "string" } }, { "name": "data_id", "required": true, "schema": { "type": "string" } }, { "name": "is_promise_resume", "required": true, "schema": { "type": "boolean" } } ], "refName": "DataReceiptDocument" } } ], "refName": "DataReceiptBody" } ], "refName": "ReceiptBody" } }, { "name": "receipt_id", "required": true, "schema": { "type": "string" } }, { "name": "receiver_id", "required": true, "schema": { "type": "string" } } ], "refName": "ReceiptDocument" } } }, { "name": "transactions", "required": true, "schema": { "type": "array", "items": { "type": "object", "description": "Transaction entry returned inside a neardata chunk.", "required": [ "outcome", "transaction" ], "additionalProperties": false, "properties": [ { "name": "outcome", "required": true, "schema": { "type": "object", "description": "Execution result paired with an optional receipt object.", "required": [ "execution_outcome", "receipt" ], "additionalProperties": false, "properties": [ { "name": "execution_outcome", "required": true, "schema": { "type": "object", "required": [ "block_hash", "id", "outcome", "proof" ], "additionalProperties": false, "properties": [ { "name": "block_hash", "required": true, "schema": { "type": "string" } }, { "name": "id", "required": true, "schema": { "type": "string" } }, { "name": "outcome", "required": true, "schema": { "type": "object", "required": [ "executor_id", "gas_burnt", "logs", "metadata", "receipt_ids", "status", "tokens_burnt" ], "additionalProperties": false, "properties": [ { "name": "executor_id", "required": true, "schema": { "type": "string" } }, { "name": "gas_burnt", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "logs", "required": true, "schema": { "type": "array", "items": { "type": "string" } } }, { "name": "metadata", "required": true, "schema": { "type": "object", "additionalProperties": true } }, { "name": "receipt_ids", "required": true, "schema": { "type": "array", "items": { "type": "string" } } }, { "name": "status", "required": true, "schema": { "oneOf": [ { "type": "object", "required": [ "SuccessReceiptId" ], "additionalProperties": false, "properties": [ { "name": "SuccessReceiptId", "required": true, "schema": { "type": "string" } } ], "refName": "ExecutionOutcomeStatusSuccessReceiptId" }, { "type": "object", "required": [ "SuccessValue" ], "additionalProperties": false, "properties": [ { "name": "SuccessValue", "required": true, "schema": { "type": "string" } } ], "refName": "ExecutionOutcomeStatusSuccessValue" }, { "type": "object", "required": [ "Failure" ], "additionalProperties": false, "properties": [ { "name": "Failure", "required": true, "schema": { "type": "object", "additionalProperties": true } } ], "refName": "ExecutionOutcomeStatusFailure" } ], "refName": "ExecutionOutcomeStatus" } }, { "name": "tokens_burnt", "required": true, "schema": { "type": "string" } } ], "refName": "ExecutionOutcomeSummary" } }, { "name": "proof", "required": true, "schema": { "type": "array", "items": { "type": "object", "additionalProperties": true, "refName": "ExecutionProofItem" } } } ], "refName": "ExecutionOutcomeDocument" } }, { "name": "receipt", "required": true, "schema": { "type": "object", "description": "Receipt payload when neardata includes it for this entry.", "oneOf": [ { "type": "object", "description": "Receipt object as served by neardata inside a chunk payload.", "required": [ "predecessor_id", "priority", "receipt", "receipt_id", "receiver_id" ], "additionalProperties": false, "properties": [ { "name": "predecessor_id", "required": true, "schema": { "type": "string" } }, { "name": "priority", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "receipt", "required": true, "schema": { "oneOf": [ { "type": "object", "required": [ "Action" ], "additionalProperties": false, "properties": [ { "name": "Action", "required": true, "schema": { "type": "object", "required": [ "actions", "gas_price", "input_data_ids", "is_promise_yield", "output_data_receivers", "signer_id", "signer_public_key" ], "additionalProperties": false, "properties": [ { "name": "actions", "required": true, "schema": { "type": "array", "items": { "type": "object", "additionalProperties": true, "refName": "ActionDocument" } } }, { "name": "gas_price", "required": true, "schema": { "type": "string" } }, { "name": "input_data_ids", "required": true, "schema": { "type": "array", "items": { "type": "string" } } }, { "name": "is_promise_yield", "required": true, "schema": { "type": "boolean" } }, { "name": "output_data_receivers", "required": true, "schema": { "type": "array", "items": { "type": "object", "required": [ "data_id", "receiver_id" ], "additionalProperties": false, "properties": [ { "name": "data_id", "required": true, "schema": { "type": "string" } }, { "name": "receiver_id", "required": true, "schema": { "type": "string" } } ], "refName": "OutputDataReceiverDocument" } } }, { "name": "signer_id", "required": true, "schema": { "type": "string" } }, { "name": "signer_public_key", "required": true, "schema": { "type": "string" } } ], "refName": "ActionReceiptDocument" } } ], "refName": "ActionReceiptBody" }, { "type": "object", "required": [ "Data" ], "additionalProperties": false, "properties": [ { "name": "Data", "required": true, "schema": { "type": "object", "required": [ "data", "data_id", "is_promise_resume" ], "additionalProperties": false, "properties": [ { "name": "data", "required": true, "schema": { "type": "string" } }, { "name": "data_id", "required": true, "schema": { "type": "string" } }, { "name": "is_promise_resume", "required": true, "schema": { "type": "boolean" } } ], "refName": "DataReceiptDocument" } } ], "refName": "DataReceiptBody" } ], "refName": "ReceiptBody" } }, { "name": "receipt_id", "required": true, "schema": { "type": "string" } }, { "name": "receiver_id", "required": true, "schema": { "type": "string" } } ], "refName": "ReceiptDocument" }, { "type": "object", "additionalProperties": false, "refName": "OmittedReceiptDocument" } ] } }, { "name": "tx_hash", "required": false, "schema": { "type": "string" } } ], "refName": "ExecutionWithReceipt" } }, { "name": "transaction", "required": true, "schema": { "type": "object", "required": [ "actions", "hash", "nonce", "priority_fee", "public_key", "receiver_id", "signature", "signer_id" ], "additionalProperties": false, "properties": [ { "name": "actions", "required": true, "schema": { "type": "array", "items": { "type": "object", "additionalProperties": true, "refName": "ActionDocument" } } }, { "name": "hash", "required": true, "schema": { "type": "string" } }, { "name": "nonce", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "priority_fee", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "public_key", "required": true, "schema": { "type": "string" } }, { "name": "receiver_id", "required": true, "schema": { "type": "string" } }, { "name": "signature", "required": true, "schema": { "type": "string" } }, { "name": "signer_id", "required": true, "schema": { "type": "string" } } ], "refName": "SignedTransactionDocument" } } ], "refName": "ChunkTransactionWrapper" } } } ], "refName": "ChunkDocument" } }, { "name": "receipt_execution_outcomes", "required": true, "schema": { "type": "array", "items": { "type": "object", "description": "Execution result paired with an optional receipt object.", "required": [ "execution_outcome", "receipt" ], "additionalProperties": false, "properties": [ { "name": "execution_outcome", "required": true, "schema": { "type": "object", "required": [ "block_hash", "id", "outcome", "proof" ], "additionalProperties": false, "properties": [ { "name": "block_hash", "required": true, "schema": { "type": "string" } }, { "name": "id", "required": true, "schema": { "type": "string" } }, { "name": "outcome", "required": true, "schema": { "type": "object", "required": [ "executor_id", "gas_burnt", "logs", "metadata", "receipt_ids", "status", "tokens_burnt" ], "additionalProperties": false, "properties": [ { "name": "executor_id", "required": true, "schema": { "type": "string" } }, { "name": "gas_burnt", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "logs", "required": true, "schema": { "type": "array", "items": { "type": "string" } } }, { "name": "metadata", "required": true, "schema": { "type": "object", "additionalProperties": true } }, { "name": "receipt_ids", "required": true, "schema": { "type": "array", "items": { "type": "string" } } }, { "name": "status", "required": true, "schema": { "oneOf": [ { "type": "object", "required": [ "SuccessReceiptId" ], "additionalProperties": false, "properties": [ { "name": "SuccessReceiptId", "required": true, "schema": { "type": "string" } } ], "refName": "ExecutionOutcomeStatusSuccessReceiptId" }, { "type": "object", "required": [ "SuccessValue" ], "additionalProperties": false, "properties": [ { "name": "SuccessValue", "required": true, "schema": { "type": "string" } } ], "refName": "ExecutionOutcomeStatusSuccessValue" }, { "type": "object", "required": [ "Failure" ], "additionalProperties": false, "properties": [ { "name": "Failure", "required": true, "schema": { "type": "object", "additionalProperties": true } } ], "refName": "ExecutionOutcomeStatusFailure" } ], "refName": "ExecutionOutcomeStatus" } }, { "name": "tokens_burnt", "required": true, "schema": { "type": "string" } } ], "refName": "ExecutionOutcomeSummary" } }, { "name": "proof", "required": true, "schema": { "type": "array", "items": { "type": "object", "additionalProperties": true, "refName": "ExecutionProofItem" } } } ], "refName": "ExecutionOutcomeDocument" } }, { "name": "receipt", "required": true, "schema": { "type": "object", "description": "Receipt payload when neardata includes it for this entry.", "oneOf": [ { "type": "object", "description": "Receipt object as served by neardata inside a chunk payload.", "required": [ "predecessor_id", "priority", "receipt", "receipt_id", "receiver_id" ], "additionalProperties": false, "properties": [ { "name": "predecessor_id", "required": true, "schema": { "type": "string" } }, { "name": "priority", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "receipt", "required": true, "schema": { "oneOf": [ { "type": "object", "required": [ "Action" ], "additionalProperties": false, "properties": [ { "name": "Action", "required": true, "schema": { "type": "object", "required": [ "actions", "gas_price", "input_data_ids", "is_promise_yield", "output_data_receivers", "signer_id", "signer_public_key" ], "additionalProperties": false, "properties": [ { "name": "actions", "required": true, "schema": { "type": "array", "items": { "type": "object", "additionalProperties": true, "refName": "ActionDocument" } } }, { "name": "gas_price", "required": true, "schema": { "type": "string" } }, { "name": "input_data_ids", "required": true, "schema": { "type": "array", "items": { "type": "string" } } }, { "name": "is_promise_yield", "required": true, "schema": { "type": "boolean" } }, { "name": "output_data_receivers", "required": true, "schema": { "type": "array", "items": { "type": "object", "required": [ "data_id", "receiver_id" ], "additionalProperties": false, "properties": [ { "name": "data_id", "required": true, "schema": { "type": "string" } }, { "name": "receiver_id", "required": true, "schema": { "type": "string" } } ], "refName": "OutputDataReceiverDocument" } } }, { "name": "signer_id", "required": true, "schema": { "type": "string" } }, { "name": "signer_public_key", "required": true, "schema": { "type": "string" } } ], "refName": "ActionReceiptDocument" } } ], "refName": "ActionReceiptBody" }, { "type": "object", "required": [ "Data" ], "additionalProperties": false, "properties": [ { "name": "Data", "required": true, "schema": { "type": "object", "required": [ "data", "data_id", "is_promise_resume" ], "additionalProperties": false, "properties": [ { "name": "data", "required": true, "schema": { "type": "string" } }, { "name": "data_id", "required": true, "schema": { "type": "string" } }, { "name": "is_promise_resume", "required": true, "schema": { "type": "boolean" } } ], "refName": "DataReceiptDocument" } } ], "refName": "DataReceiptBody" } ], "refName": "ReceiptBody" } }, { "name": "receipt_id", "required": true, "schema": { "type": "string" } }, { "name": "receiver_id", "required": true, "schema": { "type": "string" } } ], "refName": "ReceiptDocument" }, { "type": "object", "additionalProperties": false, "refName": "OmittedReceiptDocument" } ] } }, { "name": "tx_hash", "required": false, "schema": { "type": "string" } } ], "refName": "ExecutionWithReceipt" } } }, { "name": "shard_id", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "state_changes", "required": true, "schema": { "type": "array", "items": { "type": "object", "description": "State change entry returned by neardata for a shard.", "required": [ "cause", "change", "type" ], "additionalProperties": false, "properties": [ { "name": "cause", "required": true, "schema": { "oneOf": [ { "type": "object", "required": [ "tx_hash", "type" ], "additionalProperties": false, "properties": [ { "name": "tx_hash", "required": true, "schema": { "type": "string" } }, { "name": "type", "required": true, "schema": { "type": "string" } } ], "refName": "StateChangeCauseTransactionProcessing" }, { "type": "object", "required": [ "receipt_hash", "type" ], "additionalProperties": false, "properties": [ { "name": "receipt_hash", "required": true, "schema": { "type": "string" } }, { "name": "type", "required": true, "schema": { "type": "string" } } ], "refName": "StateChangeCauseReceiptProcessing" }, { "type": "object", "required": [ "receipt_hash", "type" ], "additionalProperties": false, "properties": [ { "name": "receipt_hash", "required": true, "schema": { "type": "string" } }, { "name": "type", "required": true, "schema": { "type": "string" } } ], "refName": "StateChangeCauseActionReceiptGasReward" } ], "refName": "StateChangeCause" } }, { "name": "change", "required": true, "schema": { "oneOf": [ { "type": "object", "required": [ "account_id", "amount", "code_hash", "locked", "storage_paid_at", "storage_usage" ], "additionalProperties": false, "properties": [ { "name": "account_id", "required": true, "schema": { "type": "string" } }, { "name": "amount", "required": true, "schema": { "type": "string" } }, { "name": "code_hash", "required": true, "schema": { "type": "string" } }, { "name": "locked", "required": true, "schema": { "type": "string" } }, { "name": "storage_paid_at", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "storage_usage", "required": true, "schema": { "type": "integer", "format": "uint64" } } ], "refName": "StateChangeValueAccountUpdate" }, { "type": "object", "required": [ "access_key", "account_id", "public_key" ], "additionalProperties": false, "properties": [ { "name": "access_key", "required": true, "schema": { "type": "object", "additionalProperties": true } }, { "name": "account_id", "required": true, "schema": { "type": "string" } }, { "name": "public_key", "required": true, "schema": { "type": "string" } } ], "refName": "StateChangeValueAccessKeyUpdate" }, { "type": "object", "required": [ "account_id", "key_base64", "value_base64" ], "additionalProperties": false, "properties": [ { "name": "account_id", "required": true, "schema": { "type": "string" } }, { "name": "key_base64", "required": true, "schema": { "type": "string" } }, { "name": "value_base64", "required": true, "schema": { "type": "string" } } ], "refName": "StateChangeValueDataUpdate" }, { "type": "object", "required": [ "account_id", "key_base64" ], "additionalProperties": false, "properties": [ { "name": "account_id", "required": true, "schema": { "type": "string" } }, { "name": "key_base64", "required": true, "schema": { "type": "string" } } ], "refName": "StateChangeValueDataDeletion" } ], "refName": "StateChangeValue" } }, { "name": "type", "required": true, "schema": { "type": "string" } } ], "refName": "StateChangeItem" } } } ], "refName": "ShardDocument" } } } ], "refName": "BlockDocument" } ``` --- ## NEAR Data API - Block Shard - HTML path: https://docs.fastnear.com/apis/neardata/v0/block_shard - Markdown path: https://docs.fastnear.com/apis/neardata/v0/block_shard.md # NEAR Data API - Block Shard Fetch one shard from a finalized block Fetch one shard's full payload at a chosen block — chunk plus state changes and produced receipts. ## Source links - https://docs.fastnear.com/apis/neardata/v0/block_shard - https://docs.fastnear.com/apis/neardata/openapi/blocks/get_shard ## Operation - Transport: http - Method: GET - Path: `/v0/block/{block_height}/shard/{shard_id}` - Source spec: `apis/neardata/v0/block_shard.yaml` ## Networks - Mainnet: https://mainnet.neardata.xyz/ - Testnet: https://testnet.neardata.xyz/ ## Auth - API key via query `apiKey`: Optional FastNEAR subscription API key. Invalid values may return `401` before redirect handling. - This export intentionally omits any locally saved credentials ## Current request - Network: Mainnet - Method: GET - URL: https://mainnet.neardata.xyz/v0/block/50000000/shard/0 - Active example: Mainnet ## Request reference ### Active example ```json { "body": null, "headers": {}, "path": { "block_height": "50000000", "shard_id": "0" }, "query": {} } ``` ### Inputs - `block_height` (path, required, string): NEAR block height to retrieve. - `shard_id` (path, required, string): Shard ID to return. ### Path parameters - `block_height` (path, required, string): NEAR block height to retrieve. - `shard_id` (path, required, string): Shard ID to return. ### Query parameters - `apiKey` (query, string): Optional FastNEAR subscription API key. Invalid values may return `401` before redirect handling. ## Response reference - Status: 200 - Media type: application/json - Summary: Requested document, or `null` when the selected slice is absent ### Response schema ```json { "type": "object", "description": "Per-shard payload returned by neardata for a block.", "required": [ "chunk", "receipt_execution_outcomes", "shard_id", "state_changes" ], "additionalProperties": false, "properties": [ { "name": "chunk", "required": true, "schema": { "type": "object", "description": "Chunk payload returned by neardata for a single shard in a selected block.", "required": [ "author", "header", "receipts", "transactions" ], "additionalProperties": false, "properties": [ { "name": "author", "required": true, "schema": { "type": "string", "description": "Chunk producer account ID." } }, { "name": "header", "required": true, "schema": { "type": "object", "description": "Chunk header object as served by neardata.", "additionalProperties": true, "properties": [ { "name": "chunk_hash", "required": false, "schema": { "type": "string" } }, { "name": "gas_limit", "required": false, "schema": { "type": "integer" } }, { "name": "gas_used", "required": false, "schema": { "type": "integer" } }, { "name": "height_created", "required": false, "schema": { "type": "integer", "format": "uint64" } }, { "name": "height_included", "required": false, "schema": { "type": "integer", "format": "uint64" } }, { "name": "outcome_root", "required": false, "schema": { "type": "string" } }, { "name": "outgoing_receipts_root", "required": false, "schema": { "type": "string" } }, { "name": "prev_block_hash", "required": false, "schema": { "type": "string" } }, { "name": "shard_id", "required": false, "schema": { "type": "integer", "format": "uint64" } }, { "name": "tx_root", "required": false, "schema": { "type": "string" } } ], "refName": "ChunkHeader" } }, { "name": "receipts", "required": true, "schema": { "type": "array", "items": { "type": "object", "description": "Receipt object as served by neardata inside a chunk payload.", "required": [ "predecessor_id", "priority", "receipt", "receipt_id", "receiver_id" ], "additionalProperties": false, "properties": [ { "name": "predecessor_id", "required": true, "schema": { "type": "string" } }, { "name": "priority", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "receipt", "required": true, "schema": { "oneOf": [ { "type": "object", "required": [ "Action" ], "additionalProperties": false, "properties": [ { "name": "Action", "required": true, "schema": { "type": "object", "required": [ "actions", "gas_price", "input_data_ids", "is_promise_yield", "output_data_receivers", "signer_id", "signer_public_key" ], "additionalProperties": false, "properties": [ { "name": "actions", "required": true, "schema": { "type": "array", "items": { "type": "object", "additionalProperties": true, "refName": "ActionDocument" } } }, { "name": "gas_price", "required": true, "schema": { "type": "string" } }, { "name": "input_data_ids", "required": true, "schema": { "type": "array", "items": { "type": "string" } } }, { "name": "is_promise_yield", "required": true, "schema": { "type": "boolean" } }, { "name": "output_data_receivers", "required": true, "schema": { "type": "array", "items": { "type": "object", "required": [ "data_id", "receiver_id" ], "additionalProperties": false, "properties": [ { "name": "data_id", "required": true, "schema": { "type": "string" } }, { "name": "receiver_id", "required": true, "schema": { "type": "string" } } ], "refName": "OutputDataReceiverDocument" } } }, { "name": "signer_id", "required": true, "schema": { "type": "string" } }, { "name": "signer_public_key", "required": true, "schema": { "type": "string" } } ], "refName": "ActionReceiptDocument" } } ], "refName": "ActionReceiptBody" }, { "type": "object", "required": [ "Data" ], "additionalProperties": false, "properties": [ { "name": "Data", "required": true, "schema": { "type": "object", "required": [ "data", "data_id", "is_promise_resume" ], "additionalProperties": false, "properties": [ { "name": "data", "required": true, "schema": { "type": "string" } }, { "name": "data_id", "required": true, "schema": { "type": "string" } }, { "name": "is_promise_resume", "required": true, "schema": { "type": "boolean" } } ], "refName": "DataReceiptDocument" } } ], "refName": "DataReceiptBody" } ], "refName": "ReceiptBody" } }, { "name": "receipt_id", "required": true, "schema": { "type": "string" } }, { "name": "receiver_id", "required": true, "schema": { "type": "string" } } ], "refName": "ReceiptDocument" } } }, { "name": "transactions", "required": true, "schema": { "type": "array", "items": { "type": "object", "description": "Transaction entry returned inside a neardata chunk.", "required": [ "outcome", "transaction" ], "additionalProperties": false, "properties": [ { "name": "outcome", "required": true, "schema": { "type": "object", "description": "Execution result paired with an optional receipt object.", "required": [ "execution_outcome", "receipt" ], "additionalProperties": false, "properties": [ { "name": "execution_outcome", "required": true, "schema": { "type": "object", "required": [ "block_hash", "id", "outcome", "proof" ], "additionalProperties": false, "properties": [ { "name": "block_hash", "required": true, "schema": { "type": "string" } }, { "name": "id", "required": true, "schema": { "type": "string" } }, { "name": "outcome", "required": true, "schema": { "type": "object", "required": [ "executor_id", "gas_burnt", "logs", "metadata", "receipt_ids", "status", "tokens_burnt" ], "additionalProperties": false, "properties": [ { "name": "executor_id", "required": true, "schema": { "type": "string" } }, { "name": "gas_burnt", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "logs", "required": true, "schema": { "type": "array", "items": { "type": "string" } } }, { "name": "metadata", "required": true, "schema": { "type": "object", "additionalProperties": true } }, { "name": "receipt_ids", "required": true, "schema": { "type": "array", "items": { "type": "string" } } }, { "name": "status", "required": true, "schema": { "oneOf": [ { "type": "object", "required": [ "SuccessReceiptId" ], "additionalProperties": false, "properties": [ { "name": "SuccessReceiptId", "required": true, "schema": { "type": "string" } } ], "refName": "ExecutionOutcomeStatusSuccessReceiptId" }, { "type": "object", "required": [ "SuccessValue" ], "additionalProperties": false, "properties": [ { "name": "SuccessValue", "required": true, "schema": { "type": "string" } } ], "refName": "ExecutionOutcomeStatusSuccessValue" }, { "type": "object", "required": [ "Failure" ], "additionalProperties": false, "properties": [ { "name": "Failure", "required": true, "schema": { "type": "object", "additionalProperties": true } } ], "refName": "ExecutionOutcomeStatusFailure" } ], "refName": "ExecutionOutcomeStatus" } }, { "name": "tokens_burnt", "required": true, "schema": { "type": "string" } } ], "refName": "ExecutionOutcomeSummary" } }, { "name": "proof", "required": true, "schema": { "type": "array", "items": { "type": "object", "additionalProperties": true, "refName": "ExecutionProofItem" } } } ], "refName": "ExecutionOutcomeDocument" } }, { "name": "receipt", "required": true, "schema": { "type": "object", "description": "Receipt payload when neardata includes it for this entry.", "oneOf": [ { "type": "object", "description": "Receipt object as served by neardata inside a chunk payload.", "required": [ "predecessor_id", "priority", "receipt", "receipt_id", "receiver_id" ], "additionalProperties": false, "properties": [ { "name": "predecessor_id", "required": true, "schema": { "type": "string" } }, { "name": "priority", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "receipt", "required": true, "schema": { "oneOf": [ { "type": "object", "required": [ "Action" ], "additionalProperties": false, "properties": [ { "name": "Action", "required": true, "schema": { "type": "object", "required": [ "actions", "gas_price", "input_data_ids", "is_promise_yield", "output_data_receivers", "signer_id", "signer_public_key" ], "additionalProperties": false, "properties": [ { "name": "actions", "required": true, "schema": { "type": "array", "items": { "type": "object", "additionalProperties": true, "refName": "ActionDocument" } } }, { "name": "gas_price", "required": true, "schema": { "type": "string" } }, { "name": "input_data_ids", "required": true, "schema": { "type": "array", "items": { "type": "string" } } }, { "name": "is_promise_yield", "required": true, "schema": { "type": "boolean" } }, { "name": "output_data_receivers", "required": true, "schema": { "type": "array", "items": { "type": "object", "required": [ "data_id", "receiver_id" ], "additionalProperties": false, "properties": [ { "name": "data_id", "required": true, "schema": { "type": "string" } }, { "name": "receiver_id", "required": true, "schema": { "type": "string" } } ], "refName": "OutputDataReceiverDocument" } } }, { "name": "signer_id", "required": true, "schema": { "type": "string" } }, { "name": "signer_public_key", "required": true, "schema": { "type": "string" } } ], "refName": "ActionReceiptDocument" } } ], "refName": "ActionReceiptBody" }, { "type": "object", "required": [ "Data" ], "additionalProperties": false, "properties": [ { "name": "Data", "required": true, "schema": { "type": "object", "required": [ "data", "data_id", "is_promise_resume" ], "additionalProperties": false, "properties": [ { "name": "data", "required": true, "schema": { "type": "string" } }, { "name": "data_id", "required": true, "schema": { "type": "string" } }, { "name": "is_promise_resume", "required": true, "schema": { "type": "boolean" } } ], "refName": "DataReceiptDocument" } } ], "refName": "DataReceiptBody" } ], "refName": "ReceiptBody" } }, { "name": "receipt_id", "required": true, "schema": { "type": "string" } }, { "name": "receiver_id", "required": true, "schema": { "type": "string" } } ], "refName": "ReceiptDocument" }, { "type": "object", "additionalProperties": false, "refName": "OmittedReceiptDocument" } ] } }, { "name": "tx_hash", "required": false, "schema": { "type": "string" } } ], "refName": "ExecutionWithReceipt" } }, { "name": "transaction", "required": true, "schema": { "type": "object", "required": [ "actions", "hash", "nonce", "priority_fee", "public_key", "receiver_id", "signature", "signer_id" ], "additionalProperties": false, "properties": [ { "name": "actions", "required": true, "schema": { "type": "array", "items": { "type": "object", "additionalProperties": true, "refName": "ActionDocument" } } }, { "name": "hash", "required": true, "schema": { "type": "string" } }, { "name": "nonce", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "priority_fee", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "public_key", "required": true, "schema": { "type": "string" } }, { "name": "receiver_id", "required": true, "schema": { "type": "string" } }, { "name": "signature", "required": true, "schema": { "type": "string" } }, { "name": "signer_id", "required": true, "schema": { "type": "string" } } ], "refName": "SignedTransactionDocument" } } ], "refName": "ChunkTransactionWrapper" } } } ], "refName": "ChunkDocument" } }, { "name": "receipt_execution_outcomes", "required": true, "schema": { "type": "array", "items": { "type": "object", "description": "Execution result paired with an optional receipt object.", "required": [ "execution_outcome", "receipt" ], "additionalProperties": false, "properties": [ { "name": "execution_outcome", "required": true, "schema": { "type": "object", "required": [ "block_hash", "id", "outcome", "proof" ], "additionalProperties": false, "properties": [ { "name": "block_hash", "required": true, "schema": { "type": "string" } }, { "name": "id", "required": true, "schema": { "type": "string" } }, { "name": "outcome", "required": true, "schema": { "type": "object", "required": [ "executor_id", "gas_burnt", "logs", "metadata", "receipt_ids", "status", "tokens_burnt" ], "additionalProperties": false, "properties": [ { "name": "executor_id", "required": true, "schema": { "type": "string" } }, { "name": "gas_burnt", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "logs", "required": true, "schema": { "type": "array", "items": { "type": "string" } } }, { "name": "metadata", "required": true, "schema": { "type": "object", "additionalProperties": true } }, { "name": "receipt_ids", "required": true, "schema": { "type": "array", "items": { "type": "string" } } }, { "name": "status", "required": true, "schema": { "oneOf": [ { "type": "object", "required": [ "SuccessReceiptId" ], "additionalProperties": false, "properties": [ { "name": "SuccessReceiptId", "required": true, "schema": { "type": "string" } } ], "refName": "ExecutionOutcomeStatusSuccessReceiptId" }, { "type": "object", "required": [ "SuccessValue" ], "additionalProperties": false, "properties": [ { "name": "SuccessValue", "required": true, "schema": { "type": "string" } } ], "refName": "ExecutionOutcomeStatusSuccessValue" }, { "type": "object", "required": [ "Failure" ], "additionalProperties": false, "properties": [ { "name": "Failure", "required": true, "schema": { "type": "object", "additionalProperties": true } } ], "refName": "ExecutionOutcomeStatusFailure" } ], "refName": "ExecutionOutcomeStatus" } }, { "name": "tokens_burnt", "required": true, "schema": { "type": "string" } } ], "refName": "ExecutionOutcomeSummary" } }, { "name": "proof", "required": true, "schema": { "type": "array", "items": { "type": "object", "additionalProperties": true, "refName": "ExecutionProofItem" } } } ], "refName": "ExecutionOutcomeDocument" } }, { "name": "receipt", "required": true, "schema": { "type": "object", "description": "Receipt payload when neardata includes it for this entry.", "oneOf": [ { "type": "object", "description": "Receipt object as served by neardata inside a chunk payload.", "required": [ "predecessor_id", "priority", "receipt", "receipt_id", "receiver_id" ], "additionalProperties": false, "properties": [ { "name": "predecessor_id", "required": true, "schema": { "type": "string" } }, { "name": "priority", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "receipt", "required": true, "schema": { "oneOf": [ { "type": "object", "required": [ "Action" ], "additionalProperties": false, "properties": [ { "name": "Action", "required": true, "schema": { "type": "object", "required": [ "actions", "gas_price", "input_data_ids", "is_promise_yield", "output_data_receivers", "signer_id", "signer_public_key" ], "additionalProperties": false, "properties": [ { "name": "actions", "required": true, "schema": { "type": "array", "items": { "type": "object", "additionalProperties": true, "refName": "ActionDocument" } } }, { "name": "gas_price", "required": true, "schema": { "type": "string" } }, { "name": "input_data_ids", "required": true, "schema": { "type": "array", "items": { "type": "string" } } }, { "name": "is_promise_yield", "required": true, "schema": { "type": "boolean" } }, { "name": "output_data_receivers", "required": true, "schema": { "type": "array", "items": { "type": "object", "required": [ "data_id", "receiver_id" ], "additionalProperties": false, "properties": [ { "name": "data_id", "required": true, "schema": { "type": "string" } }, { "name": "receiver_id", "required": true, "schema": { "type": "string" } } ], "refName": "OutputDataReceiverDocument" } } }, { "name": "signer_id", "required": true, "schema": { "type": "string" } }, { "name": "signer_public_key", "required": true, "schema": { "type": "string" } } ], "refName": "ActionReceiptDocument" } } ], "refName": "ActionReceiptBody" }, { "type": "object", "required": [ "Data" ], "additionalProperties": false, "properties": [ { "name": "Data", "required": true, "schema": { "type": "object", "required": [ "data", "data_id", "is_promise_resume" ], "additionalProperties": false, "properties": [ { "name": "data", "required": true, "schema": { "type": "string" } }, { "name": "data_id", "required": true, "schema": { "type": "string" } }, { "name": "is_promise_resume", "required": true, "schema": { "type": "boolean" } } ], "refName": "DataReceiptDocument" } } ], "refName": "DataReceiptBody" } ], "refName": "ReceiptBody" } }, { "name": "receipt_id", "required": true, "schema": { "type": "string" } }, { "name": "receiver_id", "required": true, "schema": { "type": "string" } } ], "refName": "ReceiptDocument" }, { "type": "object", "additionalProperties": false, "refName": "OmittedReceiptDocument" } ] } }, { "name": "tx_hash", "required": false, "schema": { "type": "string" } } ], "refName": "ExecutionWithReceipt" } } }, { "name": "shard_id", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "state_changes", "required": true, "schema": { "type": "array", "items": { "type": "object", "description": "State change entry returned by neardata for a shard.", "required": [ "cause", "change", "type" ], "additionalProperties": false, "properties": [ { "name": "cause", "required": true, "schema": { "oneOf": [ { "type": "object", "required": [ "tx_hash", "type" ], "additionalProperties": false, "properties": [ { "name": "tx_hash", "required": true, "schema": { "type": "string" } }, { "name": "type", "required": true, "schema": { "type": "string" } } ], "refName": "StateChangeCauseTransactionProcessing" }, { "type": "object", "required": [ "receipt_hash", "type" ], "additionalProperties": false, "properties": [ { "name": "receipt_hash", "required": true, "schema": { "type": "string" } }, { "name": "type", "required": true, "schema": { "type": "string" } } ], "refName": "StateChangeCauseReceiptProcessing" }, { "type": "object", "required": [ "receipt_hash", "type" ], "additionalProperties": false, "properties": [ { "name": "receipt_hash", "required": true, "schema": { "type": "string" } }, { "name": "type", "required": true, "schema": { "type": "string" } } ], "refName": "StateChangeCauseActionReceiptGasReward" } ], "refName": "StateChangeCause" } }, { "name": "change", "required": true, "schema": { "oneOf": [ { "type": "object", "required": [ "account_id", "amount", "code_hash", "locked", "storage_paid_at", "storage_usage" ], "additionalProperties": false, "properties": [ { "name": "account_id", "required": true, "schema": { "type": "string" } }, { "name": "amount", "required": true, "schema": { "type": "string" } }, { "name": "code_hash", "required": true, "schema": { "type": "string" } }, { "name": "locked", "required": true, "schema": { "type": "string" } }, { "name": "storage_paid_at", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "storage_usage", "required": true, "schema": { "type": "integer", "format": "uint64" } } ], "refName": "StateChangeValueAccountUpdate" }, { "type": "object", "required": [ "access_key", "account_id", "public_key" ], "additionalProperties": false, "properties": [ { "name": "access_key", "required": true, "schema": { "type": "object", "additionalProperties": true } }, { "name": "account_id", "required": true, "schema": { "type": "string" } }, { "name": "public_key", "required": true, "schema": { "type": "string" } } ], "refName": "StateChangeValueAccessKeyUpdate" }, { "type": "object", "required": [ "account_id", "key_base64", "value_base64" ], "additionalProperties": false, "properties": [ { "name": "account_id", "required": true, "schema": { "type": "string" } }, { "name": "key_base64", "required": true, "schema": { "type": "string" } }, { "name": "value_base64", "required": true, "schema": { "type": "string" } } ], "refName": "StateChangeValueDataUpdate" }, { "type": "object", "required": [ "account_id", "key_base64" ], "additionalProperties": false, "properties": [ { "name": "account_id", "required": true, "schema": { "type": "string" } }, { "name": "key_base64", "required": true, "schema": { "type": "string" } } ], "refName": "StateChangeValueDataDeletion" } ], "refName": "StateChangeValue" } }, { "name": "type", "required": true, "schema": { "type": "string" } } ], "refName": "StateChangeItem" } } } ], "refName": "ShardDocument" } ``` --- ## NEAR Data API - First Block - HTML path: https://docs.fastnear.com/apis/neardata/v0/first_block - Markdown path: https://docs.fastnear.com/apis/neardata/v0/first_block.md # NEAR Data API - First Block Redirect to the first block after genesis Redirect to the chain's first post-genesis block — a starting cursor for indexers backfilling from the beginning. ## Source links - https://docs.fastnear.com/apis/neardata/v0/first_block - https://docs.fastnear.com/apis/neardata/openapi/blocks/get_first_block ## Operation - Transport: http - Method: GET - Path: `/v0/first_block` - Source spec: `apis/neardata/v0/first_block.yaml` ## Networks - Mainnet: https://mainnet.neardata.xyz/ - Testnet: https://testnet.neardata.xyz/ ## Auth - API key via query `apiKey`: Optional FastNEAR subscription API key. Invalid values may return `401` before redirect handling. - This export intentionally omits any locally saved credentials ## Current request - Network: Mainnet - Method: GET - URL: https://mainnet.neardata.xyz/v0/first_block - Active example: Mainnet ## Request reference ### Active example ```json { "body": null, "headers": {}, "path": {}, "query": {} } ``` ### Query parameters - `apiKey` (query, string): Optional FastNEAR subscription API key. Invalid values may return `401` before redirect handling. ## Response reference - Status: 200 - Media type: application/json - Summary: Full block document returned after automatic redirect following ### Response schema ```json { "type": "object", "description": "Full block document as served by neardata, including the block envelope and per-shard payloads.", "required": [ "block", "shards" ], "additionalProperties": false, "properties": [ { "name": "block", "required": true, "schema": { "type": "object", "description": "Block-level payload returned by neardata.", "required": [ "author", "chunks", "header" ], "additionalProperties": false, "properties": [ { "name": "author", "required": true, "schema": { "type": "string", "description": "Block producer account ID." } }, { "name": "chunks", "required": true, "schema": { "type": "array", "items": { "type": "object", "description": "Chunk header object as served by neardata.", "additionalProperties": true, "properties": [ { "name": "chunk_hash", "required": false, "schema": { "type": "string" } }, { "name": "gas_limit", "required": false, "schema": { "type": "integer" } }, { "name": "gas_used", "required": false, "schema": { "type": "integer" } }, { "name": "height_created", "required": false, "schema": { "type": "integer", "format": "uint64" } }, { "name": "height_included", "required": false, "schema": { "type": "integer", "format": "uint64" } }, { "name": "outcome_root", "required": false, "schema": { "type": "string" } }, { "name": "outgoing_receipts_root", "required": false, "schema": { "type": "string" } }, { "name": "prev_block_hash", "required": false, "schema": { "type": "string" } }, { "name": "shard_id", "required": false, "schema": { "type": "integer", "format": "uint64" } }, { "name": "tx_root", "required": false, "schema": { "type": "string" } } ], "refName": "ChunkHeader" } } }, { "name": "header", "required": true, "schema": { "type": "object", "description": "Block header object as served by neardata.", "additionalProperties": true, "properties": [ { "name": "chunks_included", "required": false, "schema": { "type": "integer", "format": "uint64" } }, { "name": "epoch_id", "required": false, "schema": { "type": "string" } }, { "name": "gas_price", "required": false, "schema": { "type": "string" } }, { "name": "hash", "required": false, "schema": { "type": "string" } }, { "name": "height", "required": false, "schema": { "type": "integer", "format": "uint64" } }, { "name": "next_epoch_id", "required": false, "schema": { "type": "string" } }, { "name": "prev_hash", "required": false, "schema": { "type": "string" } }, { "name": "prev_height", "required": false, "schema": { "type": "integer", "format": "uint64" } }, { "name": "timestamp", "required": false, "schema": { "type": "integer" } }, { "name": "timestamp_nanosec", "required": false, "schema": { "type": "string" } }, { "name": "total_supply", "required": false, "schema": { "type": "string" } } ], "refName": "BlockHeader" } } ], "refName": "BlockEnvelope" } }, { "name": "shards", "required": true, "schema": { "type": "array", "items": { "type": "object", "description": "Per-shard payload returned by neardata for a block.", "required": [ "chunk", "receipt_execution_outcomes", "shard_id", "state_changes" ], "additionalProperties": false, "properties": [ { "name": "chunk", "required": true, "schema": { "type": "object", "description": "Chunk payload returned by neardata for a single shard in a selected block.", "required": [ "author", "header", "receipts", "transactions" ], "additionalProperties": false, "properties": [ { "name": "author", "required": true, "schema": { "type": "string", "description": "Chunk producer account ID." } }, { "name": "header", "required": true, "schema": { "type": "object", "description": "Chunk header object as served by neardata.", "additionalProperties": true, "properties": [ { "name": "chunk_hash", "required": false, "schema": { "type": "string" } }, { "name": "gas_limit", "required": false, "schema": { "type": "integer" } }, { "name": "gas_used", "required": false, "schema": { "type": "integer" } }, { "name": "height_created", "required": false, "schema": { "type": "integer", "format": "uint64" } }, { "name": "height_included", "required": false, "schema": { "type": "integer", "format": "uint64" } }, { "name": "outcome_root", "required": false, "schema": { "type": "string" } }, { "name": "outgoing_receipts_root", "required": false, "schema": { "type": "string" } }, { "name": "prev_block_hash", "required": false, "schema": { "type": "string" } }, { "name": "shard_id", "required": false, "schema": { "type": "integer", "format": "uint64" } }, { "name": "tx_root", "required": false, "schema": { "type": "string" } } ], "refName": "ChunkHeader" } }, { "name": "receipts", "required": true, "schema": { "type": "array", "items": { "type": "object", "description": "Receipt object as served by neardata inside a chunk payload.", "required": [ "predecessor_id", "priority", "receipt", "receipt_id", "receiver_id" ], "additionalProperties": false, "properties": [ { "name": "predecessor_id", "required": true, "schema": { "type": "string" } }, { "name": "priority", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "receipt", "required": true, "schema": { "oneOf": [ { "type": "object", "required": [ "Action" ], "additionalProperties": false, "properties": [ { "name": "Action", "required": true, "schema": { "type": "object", "required": [ "actions", "gas_price", "input_data_ids", "is_promise_yield", "output_data_receivers", "signer_id", "signer_public_key" ], "additionalProperties": false, "properties": [ { "name": "actions", "required": true, "schema": { "type": "array", "items": { "type": "object", "additionalProperties": true, "refName": "ActionDocument" } } }, { "name": "gas_price", "required": true, "schema": { "type": "string" } }, { "name": "input_data_ids", "required": true, "schema": { "type": "array", "items": { "type": "string" } } }, { "name": "is_promise_yield", "required": true, "schema": { "type": "boolean" } }, { "name": "output_data_receivers", "required": true, "schema": { "type": "array", "items": { "type": "object", "required": [ "data_id", "receiver_id" ], "additionalProperties": false, "properties": [ { "name": "data_id", "required": true, "schema": { "type": "string" } }, { "name": "receiver_id", "required": true, "schema": { "type": "string" } } ], "refName": "OutputDataReceiverDocument" } } }, { "name": "signer_id", "required": true, "schema": { "type": "string" } }, { "name": "signer_public_key", "required": true, "schema": { "type": "string" } } ], "refName": "ActionReceiptDocument" } } ], "refName": "ActionReceiptBody" }, { "type": "object", "required": [ "Data" ], "additionalProperties": false, "properties": [ { "name": "Data", "required": true, "schema": { "type": "object", "required": [ "data", "data_id", "is_promise_resume" ], "additionalProperties": false, "properties": [ { "name": "data", "required": true, "schema": { "type": "string" } }, { "name": "data_id", "required": true, "schema": { "type": "string" } }, { "name": "is_promise_resume", "required": true, "schema": { "type": "boolean" } } ], "refName": "DataReceiptDocument" } } ], "refName": "DataReceiptBody" } ], "refName": "ReceiptBody" } }, { "name": "receipt_id", "required": true, "schema": { "type": "string" } }, { "name": "receiver_id", "required": true, "schema": { "type": "string" } } ], "refName": "ReceiptDocument" } } }, { "name": "transactions", "required": true, "schema": { "type": "array", "items": { "type": "object", "description": "Transaction entry returned inside a neardata chunk.", "required": [ "outcome", "transaction" ], "additionalProperties": false, "properties": [ { "name": "outcome", "required": true, "schema": { "type": "object", "description": "Execution result paired with an optional receipt object.", "required": [ "execution_outcome", "receipt" ], "additionalProperties": false, "properties": [ { "name": "execution_outcome", "required": true, "schema": { "type": "object", "required": [ "block_hash", "id", "outcome", "proof" ], "additionalProperties": false, "properties": [ { "name": "block_hash", "required": true, "schema": { "type": "string" } }, { "name": "id", "required": true, "schema": { "type": "string" } }, { "name": "outcome", "required": true, "schema": { "type": "object", "required": [ "executor_id", "gas_burnt", "logs", "metadata", "receipt_ids", "status", "tokens_burnt" ], "additionalProperties": false, "properties": [ { "name": "executor_id", "required": true, "schema": { "type": "string" } }, { "name": "gas_burnt", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "logs", "required": true, "schema": { "type": "array", "items": { "type": "string" } } }, { "name": "metadata", "required": true, "schema": { "type": "object", "additionalProperties": true } }, { "name": "receipt_ids", "required": true, "schema": { "type": "array", "items": { "type": "string" } } }, { "name": "status", "required": true, "schema": { "oneOf": [ { "type": "object", "required": [ "SuccessReceiptId" ], "additionalProperties": false, "properties": [ { "name": "SuccessReceiptId", "required": true, "schema": { "type": "string" } } ], "refName": "ExecutionOutcomeStatusSuccessReceiptId" }, { "type": "object", "required": [ "SuccessValue" ], "additionalProperties": false, "properties": [ { "name": "SuccessValue", "required": true, "schema": { "type": "string" } } ], "refName": "ExecutionOutcomeStatusSuccessValue" }, { "type": "object", "required": [ "Failure" ], "additionalProperties": false, "properties": [ { "name": "Failure", "required": true, "schema": { "type": "object", "additionalProperties": true } } ], "refName": "ExecutionOutcomeStatusFailure" } ], "refName": "ExecutionOutcomeStatus" } }, { "name": "tokens_burnt", "required": true, "schema": { "type": "string" } } ], "refName": "ExecutionOutcomeSummary" } }, { "name": "proof", "required": true, "schema": { "type": "array", "items": { "type": "object", "additionalProperties": true, "refName": "ExecutionProofItem" } } } ], "refName": "ExecutionOutcomeDocument" } }, { "name": "receipt", "required": true, "schema": { "type": "object", "description": "Receipt payload when neardata includes it for this entry.", "oneOf": [ { "type": "object", "description": "Receipt object as served by neardata inside a chunk payload.", "required": [ "predecessor_id", "priority", "receipt", "receipt_id", "receiver_id" ], "additionalProperties": false, "properties": [ { "name": "predecessor_id", "required": true, "schema": { "type": "string" } }, { "name": "priority", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "receipt", "required": true, "schema": { "oneOf": [ { "type": "object", "required": [ "Action" ], "additionalProperties": false, "properties": [ { "name": "Action", "required": true, "schema": { "type": "object", "required": [ "actions", "gas_price", "input_data_ids", "is_promise_yield", "output_data_receivers", "signer_id", "signer_public_key" ], "additionalProperties": false, "properties": [ { "name": "actions", "required": true, "schema": { "type": "array", "items": { "type": "object", "additionalProperties": true, "refName": "ActionDocument" } } }, { "name": "gas_price", "required": true, "schema": { "type": "string" } }, { "name": "input_data_ids", "required": true, "schema": { "type": "array", "items": { "type": "string" } } }, { "name": "is_promise_yield", "required": true, "schema": { "type": "boolean" } }, { "name": "output_data_receivers", "required": true, "schema": { "type": "array", "items": { "type": "object", "required": [ "data_id", "receiver_id" ], "additionalProperties": false, "properties": [ { "name": "data_id", "required": true, "schema": { "type": "string" } }, { "name": "receiver_id", "required": true, "schema": { "type": "string" } } ], "refName": "OutputDataReceiverDocument" } } }, { "name": "signer_id", "required": true, "schema": { "type": "string" } }, { "name": "signer_public_key", "required": true, "schema": { "type": "string" } } ], "refName": "ActionReceiptDocument" } } ], "refName": "ActionReceiptBody" }, { "type": "object", "required": [ "Data" ], "additionalProperties": false, "properties": [ { "name": "Data", "required": true, "schema": { "type": "object", "required": [ "data", "data_id", "is_promise_resume" ], "additionalProperties": false, "properties": [ { "name": "data", "required": true, "schema": { "type": "string" } }, { "name": "data_id", "required": true, "schema": { "type": "string" } }, { "name": "is_promise_resume", "required": true, "schema": { "type": "boolean" } } ], "refName": "DataReceiptDocument" } } ], "refName": "DataReceiptBody" } ], "refName": "ReceiptBody" } }, { "name": "receipt_id", "required": true, "schema": { "type": "string" } }, { "name": "receiver_id", "required": true, "schema": { "type": "string" } } ], "refName": "ReceiptDocument" }, { "type": "object", "additionalProperties": false, "refName": "OmittedReceiptDocument" } ] } }, { "name": "tx_hash", "required": false, "schema": { "type": "string" } } ], "refName": "ExecutionWithReceipt" } }, { "name": "transaction", "required": true, "schema": { "type": "object", "required": [ "actions", "hash", "nonce", "priority_fee", "public_key", "receiver_id", "signature", "signer_id" ], "additionalProperties": false, "properties": [ { "name": "actions", "required": true, "schema": { "type": "array", "items": { "type": "object", "additionalProperties": true, "refName": "ActionDocument" } } }, { "name": "hash", "required": true, "schema": { "type": "string" } }, { "name": "nonce", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "priority_fee", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "public_key", "required": true, "schema": { "type": "string" } }, { "name": "receiver_id", "required": true, "schema": { "type": "string" } }, { "name": "signature", "required": true, "schema": { "type": "string" } }, { "name": "signer_id", "required": true, "schema": { "type": "string" } } ], "refName": "SignedTransactionDocument" } } ], "refName": "ChunkTransactionWrapper" } } } ], "refName": "ChunkDocument" } }, { "name": "receipt_execution_outcomes", "required": true, "schema": { "type": "array", "items": { "type": "object", "description": "Execution result paired with an optional receipt object.", "required": [ "execution_outcome", "receipt" ], "additionalProperties": false, "properties": [ { "name": "execution_outcome", "required": true, "schema": { "type": "object", "required": [ "block_hash", "id", "outcome", "proof" ], "additionalProperties": false, "properties": [ { "name": "block_hash", "required": true, "schema": { "type": "string" } }, { "name": "id", "required": true, "schema": { "type": "string" } }, { "name": "outcome", "required": true, "schema": { "type": "object", "required": [ "executor_id", "gas_burnt", "logs", "metadata", "receipt_ids", "status", "tokens_burnt" ], "additionalProperties": false, "properties": [ { "name": "executor_id", "required": true, "schema": { "type": "string" } }, { "name": "gas_burnt", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "logs", "required": true, "schema": { "type": "array", "items": { "type": "string" } } }, { "name": "metadata", "required": true, "schema": { "type": "object", "additionalProperties": true } }, { "name": "receipt_ids", "required": true, "schema": { "type": "array", "items": { "type": "string" } } }, { "name": "status", "required": true, "schema": { "oneOf": [ { "type": "object", "required": [ "SuccessReceiptId" ], "additionalProperties": false, "properties": [ { "name": "SuccessReceiptId", "required": true, "schema": { "type": "string" } } ], "refName": "ExecutionOutcomeStatusSuccessReceiptId" }, { "type": "object", "required": [ "SuccessValue" ], "additionalProperties": false, "properties": [ { "name": "SuccessValue", "required": true, "schema": { "type": "string" } } ], "refName": "ExecutionOutcomeStatusSuccessValue" }, { "type": "object", "required": [ "Failure" ], "additionalProperties": false, "properties": [ { "name": "Failure", "required": true, "schema": { "type": "object", "additionalProperties": true } } ], "refName": "ExecutionOutcomeStatusFailure" } ], "refName": "ExecutionOutcomeStatus" } }, { "name": "tokens_burnt", "required": true, "schema": { "type": "string" } } ], "refName": "ExecutionOutcomeSummary" } }, { "name": "proof", "required": true, "schema": { "type": "array", "items": { "type": "object", "additionalProperties": true, "refName": "ExecutionProofItem" } } } ], "refName": "ExecutionOutcomeDocument" } }, { "name": "receipt", "required": true, "schema": { "type": "object", "description": "Receipt payload when neardata includes it for this entry.", "oneOf": [ { "type": "object", "description": "Receipt object as served by neardata inside a chunk payload.", "required": [ "predecessor_id", "priority", "receipt", "receipt_id", "receiver_id" ], "additionalProperties": false, "properties": [ { "name": "predecessor_id", "required": true, "schema": { "type": "string" } }, { "name": "priority", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "receipt", "required": true, "schema": { "oneOf": [ { "type": "object", "required": [ "Action" ], "additionalProperties": false, "properties": [ { "name": "Action", "required": true, "schema": { "type": "object", "required": [ "actions", "gas_price", "input_data_ids", "is_promise_yield", "output_data_receivers", "signer_id", "signer_public_key" ], "additionalProperties": false, "properties": [ { "name": "actions", "required": true, "schema": { "type": "array", "items": { "type": "object", "additionalProperties": true, "refName": "ActionDocument" } } }, { "name": "gas_price", "required": true, "schema": { "type": "string" } }, { "name": "input_data_ids", "required": true, "schema": { "type": "array", "items": { "type": "string" } } }, { "name": "is_promise_yield", "required": true, "schema": { "type": "boolean" } }, { "name": "output_data_receivers", "required": true, "schema": { "type": "array", "items": { "type": "object", "required": [ "data_id", "receiver_id" ], "additionalProperties": false, "properties": [ { "name": "data_id", "required": true, "schema": { "type": "string" } }, { "name": "receiver_id", "required": true, "schema": { "type": "string" } } ], "refName": "OutputDataReceiverDocument" } } }, { "name": "signer_id", "required": true, "schema": { "type": "string" } }, { "name": "signer_public_key", "required": true, "schema": { "type": "string" } } ], "refName": "ActionReceiptDocument" } } ], "refName": "ActionReceiptBody" }, { "type": "object", "required": [ "Data" ], "additionalProperties": false, "properties": [ { "name": "Data", "required": true, "schema": { "type": "object", "required": [ "data", "data_id", "is_promise_resume" ], "additionalProperties": false, "properties": [ { "name": "data", "required": true, "schema": { "type": "string" } }, { "name": "data_id", "required": true, "schema": { "type": "string" } }, { "name": "is_promise_resume", "required": true, "schema": { "type": "boolean" } } ], "refName": "DataReceiptDocument" } } ], "refName": "DataReceiptBody" } ], "refName": "ReceiptBody" } }, { "name": "receipt_id", "required": true, "schema": { "type": "string" } }, { "name": "receiver_id", "required": true, "schema": { "type": "string" } } ], "refName": "ReceiptDocument" }, { "type": "object", "additionalProperties": false, "refName": "OmittedReceiptDocument" } ] } }, { "name": "tx_hash", "required": false, "schema": { "type": "string" } } ], "refName": "ExecutionWithReceipt" } } }, { "name": "shard_id", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "state_changes", "required": true, "schema": { "type": "array", "items": { "type": "object", "description": "State change entry returned by neardata for a shard.", "required": [ "cause", "change", "type" ], "additionalProperties": false, "properties": [ { "name": "cause", "required": true, "schema": { "oneOf": [ { "type": "object", "required": [ "tx_hash", "type" ], "additionalProperties": false, "properties": [ { "name": "tx_hash", "required": true, "schema": { "type": "string" } }, { "name": "type", "required": true, "schema": { "type": "string" } } ], "refName": "StateChangeCauseTransactionProcessing" }, { "type": "object", "required": [ "receipt_hash", "type" ], "additionalProperties": false, "properties": [ { "name": "receipt_hash", "required": true, "schema": { "type": "string" } }, { "name": "type", "required": true, "schema": { "type": "string" } } ], "refName": "StateChangeCauseReceiptProcessing" }, { "type": "object", "required": [ "receipt_hash", "type" ], "additionalProperties": false, "properties": [ { "name": "receipt_hash", "required": true, "schema": { "type": "string" } }, { "name": "type", "required": true, "schema": { "type": "string" } } ], "refName": "StateChangeCauseActionReceiptGasReward" } ], "refName": "StateChangeCause" } }, { "name": "change", "required": true, "schema": { "oneOf": [ { "type": "object", "required": [ "account_id", "amount", "code_hash", "locked", "storage_paid_at", "storage_usage" ], "additionalProperties": false, "properties": [ { "name": "account_id", "required": true, "schema": { "type": "string" } }, { "name": "amount", "required": true, "schema": { "type": "string" } }, { "name": "code_hash", "required": true, "schema": { "type": "string" } }, { "name": "locked", "required": true, "schema": { "type": "string" } }, { "name": "storage_paid_at", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "storage_usage", "required": true, "schema": { "type": "integer", "format": "uint64" } } ], "refName": "StateChangeValueAccountUpdate" }, { "type": "object", "required": [ "access_key", "account_id", "public_key" ], "additionalProperties": false, "properties": [ { "name": "access_key", "required": true, "schema": { "type": "object", "additionalProperties": true } }, { "name": "account_id", "required": true, "schema": { "type": "string" } }, { "name": "public_key", "required": true, "schema": { "type": "string" } } ], "refName": "StateChangeValueAccessKeyUpdate" }, { "type": "object", "required": [ "account_id", "key_base64", "value_base64" ], "additionalProperties": false, "properties": [ { "name": "account_id", "required": true, "schema": { "type": "string" } }, { "name": "key_base64", "required": true, "schema": { "type": "string" } }, { "name": "value_base64", "required": true, "schema": { "type": "string" } } ], "refName": "StateChangeValueDataUpdate" }, { "type": "object", "required": [ "account_id", "key_base64" ], "additionalProperties": false, "properties": [ { "name": "account_id", "required": true, "schema": { "type": "string" } }, { "name": "key_base64", "required": true, "schema": { "type": "string" } } ], "refName": "StateChangeValueDataDeletion" } ], "refName": "StateChangeValue" } }, { "name": "type", "required": true, "schema": { "type": "string" } } ], "refName": "StateChangeItem" } } } ], "refName": "ShardDocument" } } } ], "refName": "BlockDocument" } ``` --- ## NEAR Data API - Last Final Block - HTML path: https://docs.fastnear.com/apis/neardata/v0/last_block_final - Markdown path: https://docs.fastnear.com/apis/neardata/v0/last_block_final.md # NEAR Data API - Last Final Block Redirect to the latest finalized block Redirect to the most recent finalized block — the chain-tip cursor once consensus has settled. ## Source links - https://docs.fastnear.com/apis/neardata/v0/last_block_final - https://docs.fastnear.com/apis/neardata/openapi/blocks/get_last_block_final ## Operation - Transport: http - Method: GET - Path: `/v0/last_block/final` - Source spec: `apis/neardata/v0/last_block_final.yaml` ## Networks - Mainnet: https://mainnet.neardata.xyz/ - Testnet: https://testnet.neardata.xyz/ ## Auth - API key via query `apiKey`: Optional FastNEAR subscription API key. Invalid values may return `401` before redirect handling. - This export intentionally omits any locally saved credentials ## Current request - Network: Mainnet - Method: GET - URL: https://mainnet.neardata.xyz/v0/last_block/final - Active example: Mainnet ## Request reference ### Active example ```json { "body": null, "headers": {}, "path": {}, "query": {} } ``` ### Query parameters - `apiKey` (query, string): Optional FastNEAR subscription API key. Invalid values may return `401` before redirect handling. ## Response reference - Status: 200 - Media type: application/json - Summary: Full block document returned after automatic redirect following ### Response schema ```json { "type": "object", "description": "Full block document as served by neardata, including the block envelope and per-shard payloads.", "required": [ "block", "shards" ], "additionalProperties": false, "properties": [ { "name": "block", "required": true, "schema": { "type": "object", "description": "Block-level payload returned by neardata.", "required": [ "author", "chunks", "header" ], "additionalProperties": false, "properties": [ { "name": "author", "required": true, "schema": { "type": "string", "description": "Block producer account ID." } }, { "name": "chunks", "required": true, "schema": { "type": "array", "items": { "type": "object", "description": "Chunk header object as served by neardata.", "additionalProperties": true, "properties": [ { "name": "chunk_hash", "required": false, "schema": { "type": "string" } }, { "name": "gas_limit", "required": false, "schema": { "type": "integer" } }, { "name": "gas_used", "required": false, "schema": { "type": "integer" } }, { "name": "height_created", "required": false, "schema": { "type": "integer", "format": "uint64" } }, { "name": "height_included", "required": false, "schema": { "type": "integer", "format": "uint64" } }, { "name": "outcome_root", "required": false, "schema": { "type": "string" } }, { "name": "outgoing_receipts_root", "required": false, "schema": { "type": "string" } }, { "name": "prev_block_hash", "required": false, "schema": { "type": "string" } }, { "name": "shard_id", "required": false, "schema": { "type": "integer", "format": "uint64" } }, { "name": "tx_root", "required": false, "schema": { "type": "string" } } ], "refName": "ChunkHeader" } } }, { "name": "header", "required": true, "schema": { "type": "object", "description": "Block header object as served by neardata.", "additionalProperties": true, "properties": [ { "name": "chunks_included", "required": false, "schema": { "type": "integer", "format": "uint64" } }, { "name": "epoch_id", "required": false, "schema": { "type": "string" } }, { "name": "gas_price", "required": false, "schema": { "type": "string" } }, { "name": "hash", "required": false, "schema": { "type": "string" } }, { "name": "height", "required": false, "schema": { "type": "integer", "format": "uint64" } }, { "name": "next_epoch_id", "required": false, "schema": { "type": "string" } }, { "name": "prev_hash", "required": false, "schema": { "type": "string" } }, { "name": "prev_height", "required": false, "schema": { "type": "integer", "format": "uint64" } }, { "name": "timestamp", "required": false, "schema": { "type": "integer" } }, { "name": "timestamp_nanosec", "required": false, "schema": { "type": "string" } }, { "name": "total_supply", "required": false, "schema": { "type": "string" } } ], "refName": "BlockHeader" } } ], "refName": "BlockEnvelope" } }, { "name": "shards", "required": true, "schema": { "type": "array", "items": { "type": "object", "description": "Per-shard payload returned by neardata for a block.", "required": [ "chunk", "receipt_execution_outcomes", "shard_id", "state_changes" ], "additionalProperties": false, "properties": [ { "name": "chunk", "required": true, "schema": { "type": "object", "description": "Chunk payload returned by neardata for a single shard in a selected block.", "required": [ "author", "header", "receipts", "transactions" ], "additionalProperties": false, "properties": [ { "name": "author", "required": true, "schema": { "type": "string", "description": "Chunk producer account ID." } }, { "name": "header", "required": true, "schema": { "type": "object", "description": "Chunk header object as served by neardata.", "additionalProperties": true, "properties": [ { "name": "chunk_hash", "required": false, "schema": { "type": "string" } }, { "name": "gas_limit", "required": false, "schema": { "type": "integer" } }, { "name": "gas_used", "required": false, "schema": { "type": "integer" } }, { "name": "height_created", "required": false, "schema": { "type": "integer", "format": "uint64" } }, { "name": "height_included", "required": false, "schema": { "type": "integer", "format": "uint64" } }, { "name": "outcome_root", "required": false, "schema": { "type": "string" } }, { "name": "outgoing_receipts_root", "required": false, "schema": { "type": "string" } }, { "name": "prev_block_hash", "required": false, "schema": { "type": "string" } }, { "name": "shard_id", "required": false, "schema": { "type": "integer", "format": "uint64" } }, { "name": "tx_root", "required": false, "schema": { "type": "string" } } ], "refName": "ChunkHeader" } }, { "name": "receipts", "required": true, "schema": { "type": "array", "items": { "type": "object", "description": "Receipt object as served by neardata inside a chunk payload.", "required": [ "predecessor_id", "priority", "receipt", "receipt_id", "receiver_id" ], "additionalProperties": false, "properties": [ { "name": "predecessor_id", "required": true, "schema": { "type": "string" } }, { "name": "priority", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "receipt", "required": true, "schema": { "oneOf": [ { "type": "object", "required": [ "Action" ], "additionalProperties": false, "properties": [ { "name": "Action", "required": true, "schema": { "type": "object", "required": [ "actions", "gas_price", "input_data_ids", "is_promise_yield", "output_data_receivers", "signer_id", "signer_public_key" ], "additionalProperties": false, "properties": [ { "name": "actions", "required": true, "schema": { "type": "array", "items": { "type": "object", "additionalProperties": true, "refName": "ActionDocument" } } }, { "name": "gas_price", "required": true, "schema": { "type": "string" } }, { "name": "input_data_ids", "required": true, "schema": { "type": "array", "items": { "type": "string" } } }, { "name": "is_promise_yield", "required": true, "schema": { "type": "boolean" } }, { "name": "output_data_receivers", "required": true, "schema": { "type": "array", "items": { "type": "object", "required": [ "data_id", "receiver_id" ], "additionalProperties": false, "properties": [ { "name": "data_id", "required": true, "schema": { "type": "string" } }, { "name": "receiver_id", "required": true, "schema": { "type": "string" } } ], "refName": "OutputDataReceiverDocument" } } }, { "name": "signer_id", "required": true, "schema": { "type": "string" } }, { "name": "signer_public_key", "required": true, "schema": { "type": "string" } } ], "refName": "ActionReceiptDocument" } } ], "refName": "ActionReceiptBody" }, { "type": "object", "required": [ "Data" ], "additionalProperties": false, "properties": [ { "name": "Data", "required": true, "schema": { "type": "object", "required": [ "data", "data_id", "is_promise_resume" ], "additionalProperties": false, "properties": [ { "name": "data", "required": true, "schema": { "type": "string" } }, { "name": "data_id", "required": true, "schema": { "type": "string" } }, { "name": "is_promise_resume", "required": true, "schema": { "type": "boolean" } } ], "refName": "DataReceiptDocument" } } ], "refName": "DataReceiptBody" } ], "refName": "ReceiptBody" } }, { "name": "receipt_id", "required": true, "schema": { "type": "string" } }, { "name": "receiver_id", "required": true, "schema": { "type": "string" } } ], "refName": "ReceiptDocument" } } }, { "name": "transactions", "required": true, "schema": { "type": "array", "items": { "type": "object", "description": "Transaction entry returned inside a neardata chunk.", "required": [ "outcome", "transaction" ], "additionalProperties": false, "properties": [ { "name": "outcome", "required": true, "schema": { "type": "object", "description": "Execution result paired with an optional receipt object.", "required": [ "execution_outcome", "receipt" ], "additionalProperties": false, "properties": [ { "name": "execution_outcome", "required": true, "schema": { "type": "object", "required": [ "block_hash", "id", "outcome", "proof" ], "additionalProperties": false, "properties": [ { "name": "block_hash", "required": true, "schema": { "type": "string" } }, { "name": "id", "required": true, "schema": { "type": "string" } }, { "name": "outcome", "required": true, "schema": { "type": "object", "required": [ "executor_id", "gas_burnt", "logs", "metadata", "receipt_ids", "status", "tokens_burnt" ], "additionalProperties": false, "properties": [ { "name": "executor_id", "required": true, "schema": { "type": "string" } }, { "name": "gas_burnt", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "logs", "required": true, "schema": { "type": "array", "items": { "type": "string" } } }, { "name": "metadata", "required": true, "schema": { "type": "object", "additionalProperties": true } }, { "name": "receipt_ids", "required": true, "schema": { "type": "array", "items": { "type": "string" } } }, { "name": "status", "required": true, "schema": { "oneOf": [ { "type": "object", "required": [ "SuccessReceiptId" ], "additionalProperties": false, "properties": [ { "name": "SuccessReceiptId", "required": true, "schema": { "type": "string" } } ], "refName": "ExecutionOutcomeStatusSuccessReceiptId" }, { "type": "object", "required": [ "SuccessValue" ], "additionalProperties": false, "properties": [ { "name": "SuccessValue", "required": true, "schema": { "type": "string" } } ], "refName": "ExecutionOutcomeStatusSuccessValue" }, { "type": "object", "required": [ "Failure" ], "additionalProperties": false, "properties": [ { "name": "Failure", "required": true, "schema": { "type": "object", "additionalProperties": true } } ], "refName": "ExecutionOutcomeStatusFailure" } ], "refName": "ExecutionOutcomeStatus" } }, { "name": "tokens_burnt", "required": true, "schema": { "type": "string" } } ], "refName": "ExecutionOutcomeSummary" } }, { "name": "proof", "required": true, "schema": { "type": "array", "items": { "type": "object", "additionalProperties": true, "refName": "ExecutionProofItem" } } } ], "refName": "ExecutionOutcomeDocument" } }, { "name": "receipt", "required": true, "schema": { "type": "object", "description": "Receipt payload when neardata includes it for this entry.", "oneOf": [ { "type": "object", "description": "Receipt object as served by neardata inside a chunk payload.", "required": [ "predecessor_id", "priority", "receipt", "receipt_id", "receiver_id" ], "additionalProperties": false, "properties": [ { "name": "predecessor_id", "required": true, "schema": { "type": "string" } }, { "name": "priority", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "receipt", "required": true, "schema": { "oneOf": [ { "type": "object", "required": [ "Action" ], "additionalProperties": false, "properties": [ { "name": "Action", "required": true, "schema": { "type": "object", "required": [ "actions", "gas_price", "input_data_ids", "is_promise_yield", "output_data_receivers", "signer_id", "signer_public_key" ], "additionalProperties": false, "properties": [ { "name": "actions", "required": true, "schema": { "type": "array", "items": { "type": "object", "additionalProperties": true, "refName": "ActionDocument" } } }, { "name": "gas_price", "required": true, "schema": { "type": "string" } }, { "name": "input_data_ids", "required": true, "schema": { "type": "array", "items": { "type": "string" } } }, { "name": "is_promise_yield", "required": true, "schema": { "type": "boolean" } }, { "name": "output_data_receivers", "required": true, "schema": { "type": "array", "items": { "type": "object", "required": [ "data_id", "receiver_id" ], "additionalProperties": false, "properties": [ { "name": "data_id", "required": true, "schema": { "type": "string" } }, { "name": "receiver_id", "required": true, "schema": { "type": "string" } } ], "refName": "OutputDataReceiverDocument" } } }, { "name": "signer_id", "required": true, "schema": { "type": "string" } }, { "name": "signer_public_key", "required": true, "schema": { "type": "string" } } ], "refName": "ActionReceiptDocument" } } ], "refName": "ActionReceiptBody" }, { "type": "object", "required": [ "Data" ], "additionalProperties": false, "properties": [ { "name": "Data", "required": true, "schema": { "type": "object", "required": [ "data", "data_id", "is_promise_resume" ], "additionalProperties": false, "properties": [ { "name": "data", "required": true, "schema": { "type": "string" } }, { "name": "data_id", "required": true, "schema": { "type": "string" } }, { "name": "is_promise_resume", "required": true, "schema": { "type": "boolean" } } ], "refName": "DataReceiptDocument" } } ], "refName": "DataReceiptBody" } ], "refName": "ReceiptBody" } }, { "name": "receipt_id", "required": true, "schema": { "type": "string" } }, { "name": "receiver_id", "required": true, "schema": { "type": "string" } } ], "refName": "ReceiptDocument" }, { "type": "object", "additionalProperties": false, "refName": "OmittedReceiptDocument" } ] } }, { "name": "tx_hash", "required": false, "schema": { "type": "string" } } ], "refName": "ExecutionWithReceipt" } }, { "name": "transaction", "required": true, "schema": { "type": "object", "required": [ "actions", "hash", "nonce", "priority_fee", "public_key", "receiver_id", "signature", "signer_id" ], "additionalProperties": false, "properties": [ { "name": "actions", "required": true, "schema": { "type": "array", "items": { "type": "object", "additionalProperties": true, "refName": "ActionDocument" } } }, { "name": "hash", "required": true, "schema": { "type": "string" } }, { "name": "nonce", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "priority_fee", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "public_key", "required": true, "schema": { "type": "string" } }, { "name": "receiver_id", "required": true, "schema": { "type": "string" } }, { "name": "signature", "required": true, "schema": { "type": "string" } }, { "name": "signer_id", "required": true, "schema": { "type": "string" } } ], "refName": "SignedTransactionDocument" } } ], "refName": "ChunkTransactionWrapper" } } } ], "refName": "ChunkDocument" } }, { "name": "receipt_execution_outcomes", "required": true, "schema": { "type": "array", "items": { "type": "object", "description": "Execution result paired with an optional receipt object.", "required": [ "execution_outcome", "receipt" ], "additionalProperties": false, "properties": [ { "name": "execution_outcome", "required": true, "schema": { "type": "object", "required": [ "block_hash", "id", "outcome", "proof" ], "additionalProperties": false, "properties": [ { "name": "block_hash", "required": true, "schema": { "type": "string" } }, { "name": "id", "required": true, "schema": { "type": "string" } }, { "name": "outcome", "required": true, "schema": { "type": "object", "required": [ "executor_id", "gas_burnt", "logs", "metadata", "receipt_ids", "status", "tokens_burnt" ], "additionalProperties": false, "properties": [ { "name": "executor_id", "required": true, "schema": { "type": "string" } }, { "name": "gas_burnt", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "logs", "required": true, "schema": { "type": "array", "items": { "type": "string" } } }, { "name": "metadata", "required": true, "schema": { "type": "object", "additionalProperties": true } }, { "name": "receipt_ids", "required": true, "schema": { "type": "array", "items": { "type": "string" } } }, { "name": "status", "required": true, "schema": { "oneOf": [ { "type": "object", "required": [ "SuccessReceiptId" ], "additionalProperties": false, "properties": [ { "name": "SuccessReceiptId", "required": true, "schema": { "type": "string" } } ], "refName": "ExecutionOutcomeStatusSuccessReceiptId" }, { "type": "object", "required": [ "SuccessValue" ], "additionalProperties": false, "properties": [ { "name": "SuccessValue", "required": true, "schema": { "type": "string" } } ], "refName": "ExecutionOutcomeStatusSuccessValue" }, { "type": "object", "required": [ "Failure" ], "additionalProperties": false, "properties": [ { "name": "Failure", "required": true, "schema": { "type": "object", "additionalProperties": true } } ], "refName": "ExecutionOutcomeStatusFailure" } ], "refName": "ExecutionOutcomeStatus" } }, { "name": "tokens_burnt", "required": true, "schema": { "type": "string" } } ], "refName": "ExecutionOutcomeSummary" } }, { "name": "proof", "required": true, "schema": { "type": "array", "items": { "type": "object", "additionalProperties": true, "refName": "ExecutionProofItem" } } } ], "refName": "ExecutionOutcomeDocument" } }, { "name": "receipt", "required": true, "schema": { "type": "object", "description": "Receipt payload when neardata includes it for this entry.", "oneOf": [ { "type": "object", "description": "Receipt object as served by neardata inside a chunk payload.", "required": [ "predecessor_id", "priority", "receipt", "receipt_id", "receiver_id" ], "additionalProperties": false, "properties": [ { "name": "predecessor_id", "required": true, "schema": { "type": "string" } }, { "name": "priority", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "receipt", "required": true, "schema": { "oneOf": [ { "type": "object", "required": [ "Action" ], "additionalProperties": false, "properties": [ { "name": "Action", "required": true, "schema": { "type": "object", "required": [ "actions", "gas_price", "input_data_ids", "is_promise_yield", "output_data_receivers", "signer_id", "signer_public_key" ], "additionalProperties": false, "properties": [ { "name": "actions", "required": true, "schema": { "type": "array", "items": { "type": "object", "additionalProperties": true, "refName": "ActionDocument" } } }, { "name": "gas_price", "required": true, "schema": { "type": "string" } }, { "name": "input_data_ids", "required": true, "schema": { "type": "array", "items": { "type": "string" } } }, { "name": "is_promise_yield", "required": true, "schema": { "type": "boolean" } }, { "name": "output_data_receivers", "required": true, "schema": { "type": "array", "items": { "type": "object", "required": [ "data_id", "receiver_id" ], "additionalProperties": false, "properties": [ { "name": "data_id", "required": true, "schema": { "type": "string" } }, { "name": "receiver_id", "required": true, "schema": { "type": "string" } } ], "refName": "OutputDataReceiverDocument" } } }, { "name": "signer_id", "required": true, "schema": { "type": "string" } }, { "name": "signer_public_key", "required": true, "schema": { "type": "string" } } ], "refName": "ActionReceiptDocument" } } ], "refName": "ActionReceiptBody" }, { "type": "object", "required": [ "Data" ], "additionalProperties": false, "properties": [ { "name": "Data", "required": true, "schema": { "type": "object", "required": [ "data", "data_id", "is_promise_resume" ], "additionalProperties": false, "properties": [ { "name": "data", "required": true, "schema": { "type": "string" } }, { "name": "data_id", "required": true, "schema": { "type": "string" } }, { "name": "is_promise_resume", "required": true, "schema": { "type": "boolean" } } ], "refName": "DataReceiptDocument" } } ], "refName": "DataReceiptBody" } ], "refName": "ReceiptBody" } }, { "name": "receipt_id", "required": true, "schema": { "type": "string" } }, { "name": "receiver_id", "required": true, "schema": { "type": "string" } } ], "refName": "ReceiptDocument" }, { "type": "object", "additionalProperties": false, "refName": "OmittedReceiptDocument" } ] } }, { "name": "tx_hash", "required": false, "schema": { "type": "string" } } ], "refName": "ExecutionWithReceipt" } } }, { "name": "shard_id", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "state_changes", "required": true, "schema": { "type": "array", "items": { "type": "object", "description": "State change entry returned by neardata for a shard.", "required": [ "cause", "change", "type" ], "additionalProperties": false, "properties": [ { "name": "cause", "required": true, "schema": { "oneOf": [ { "type": "object", "required": [ "tx_hash", "type" ], "additionalProperties": false, "properties": [ { "name": "tx_hash", "required": true, "schema": { "type": "string" } }, { "name": "type", "required": true, "schema": { "type": "string" } } ], "refName": "StateChangeCauseTransactionProcessing" }, { "type": "object", "required": [ "receipt_hash", "type" ], "additionalProperties": false, "properties": [ { "name": "receipt_hash", "required": true, "schema": { "type": "string" } }, { "name": "type", "required": true, "schema": { "type": "string" } } ], "refName": "StateChangeCauseReceiptProcessing" }, { "type": "object", "required": [ "receipt_hash", "type" ], "additionalProperties": false, "properties": [ { "name": "receipt_hash", "required": true, "schema": { "type": "string" } }, { "name": "type", "required": true, "schema": { "type": "string" } } ], "refName": "StateChangeCauseActionReceiptGasReward" } ], "refName": "StateChangeCause" } }, { "name": "change", "required": true, "schema": { "oneOf": [ { "type": "object", "required": [ "account_id", "amount", "code_hash", "locked", "storage_paid_at", "storage_usage" ], "additionalProperties": false, "properties": [ { "name": "account_id", "required": true, "schema": { "type": "string" } }, { "name": "amount", "required": true, "schema": { "type": "string" } }, { "name": "code_hash", "required": true, "schema": { "type": "string" } }, { "name": "locked", "required": true, "schema": { "type": "string" } }, { "name": "storage_paid_at", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "storage_usage", "required": true, "schema": { "type": "integer", "format": "uint64" } } ], "refName": "StateChangeValueAccountUpdate" }, { "type": "object", "required": [ "access_key", "account_id", "public_key" ], "additionalProperties": false, "properties": [ { "name": "access_key", "required": true, "schema": { "type": "object", "additionalProperties": true } }, { "name": "account_id", "required": true, "schema": { "type": "string" } }, { "name": "public_key", "required": true, "schema": { "type": "string" } } ], "refName": "StateChangeValueAccessKeyUpdate" }, { "type": "object", "required": [ "account_id", "key_base64", "value_base64" ], "additionalProperties": false, "properties": [ { "name": "account_id", "required": true, "schema": { "type": "string" } }, { "name": "key_base64", "required": true, "schema": { "type": "string" } }, { "name": "value_base64", "required": true, "schema": { "type": "string" } } ], "refName": "StateChangeValueDataUpdate" }, { "type": "object", "required": [ "account_id", "key_base64" ], "additionalProperties": false, "properties": [ { "name": "account_id", "required": true, "schema": { "type": "string" } }, { "name": "key_base64", "required": true, "schema": { "type": "string" } } ], "refName": "StateChangeValueDataDeletion" } ], "refName": "StateChangeValue" } }, { "name": "type", "required": true, "schema": { "type": "string" } } ], "refName": "StateChangeItem" } } } ], "refName": "ShardDocument" } } } ], "refName": "BlockDocument" } ``` --- ## NEAR Data API - Last Optimistic Block - HTML path: https://docs.fastnear.com/apis/neardata/v0/last_block_optimistic - Markdown path: https://docs.fastnear.com/apis/neardata/v0/last_block_optimistic.md # NEAR Data API - Last Optimistic Block Redirect to the latest optimistic block Redirect to the most recent optimistic block — the freshest-possible tip, ahead of final settlement. ## Source links - https://docs.fastnear.com/apis/neardata/v0/last_block_optimistic - https://docs.fastnear.com/apis/neardata/openapi/blocks/get_last_block_optimistic ## Operation - Transport: http - Method: GET - Path: `/v0/last_block/optimistic` - Source spec: `apis/neardata/v0/last_block_optimistic.yaml` ## Networks - Mainnet: https://mainnet.neardata.xyz/ - Testnet: https://testnet.neardata.xyz/ ## Auth - API key via query `apiKey`: Optional FastNEAR subscription API key. Invalid values may return `401` before redirect handling. - This export intentionally omits any locally saved credentials ## Current request - Network: Mainnet - Method: GET - URL: https://mainnet.neardata.xyz/v0/last_block/optimistic - Active example: Mainnet ## Request reference ### Active example ```json { "body": null, "headers": {}, "path": {}, "query": {} } ``` ### Query parameters - `apiKey` (query, string): Optional FastNEAR subscription API key. Invalid values may return `401` before redirect handling. ## Response reference - Status: 200 - Media type: application/json - Summary: Full block document returned after automatic redirect following ### Response schema ```json { "type": "object", "description": "Full block document as served by neardata, including the block envelope and per-shard payloads.", "required": [ "block", "shards" ], "additionalProperties": false, "properties": [ { "name": "block", "required": true, "schema": { "type": "object", "description": "Block-level payload returned by neardata.", "required": [ "author", "chunks", "header" ], "additionalProperties": false, "properties": [ { "name": "author", "required": true, "schema": { "type": "string", "description": "Block producer account ID." } }, { "name": "chunks", "required": true, "schema": { "type": "array", "items": { "type": "object", "description": "Chunk header object as served by neardata.", "additionalProperties": true, "properties": [ { "name": "chunk_hash", "required": false, "schema": { "type": "string" } }, { "name": "gas_limit", "required": false, "schema": { "type": "integer" } }, { "name": "gas_used", "required": false, "schema": { "type": "integer" } }, { "name": "height_created", "required": false, "schema": { "type": "integer", "format": "uint64" } }, { "name": "height_included", "required": false, "schema": { "type": "integer", "format": "uint64" } }, { "name": "outcome_root", "required": false, "schema": { "type": "string" } }, { "name": "outgoing_receipts_root", "required": false, "schema": { "type": "string" } }, { "name": "prev_block_hash", "required": false, "schema": { "type": "string" } }, { "name": "shard_id", "required": false, "schema": { "type": "integer", "format": "uint64" } }, { "name": "tx_root", "required": false, "schema": { "type": "string" } } ], "refName": "ChunkHeader" } } }, { "name": "header", "required": true, "schema": { "type": "object", "description": "Block header object as served by neardata.", "additionalProperties": true, "properties": [ { "name": "chunks_included", "required": false, "schema": { "type": "integer", "format": "uint64" } }, { "name": "epoch_id", "required": false, "schema": { "type": "string" } }, { "name": "gas_price", "required": false, "schema": { "type": "string" } }, { "name": "hash", "required": false, "schema": { "type": "string" } }, { "name": "height", "required": false, "schema": { "type": "integer", "format": "uint64" } }, { "name": "next_epoch_id", "required": false, "schema": { "type": "string" } }, { "name": "prev_hash", "required": false, "schema": { "type": "string" } }, { "name": "prev_height", "required": false, "schema": { "type": "integer", "format": "uint64" } }, { "name": "timestamp", "required": false, "schema": { "type": "integer" } }, { "name": "timestamp_nanosec", "required": false, "schema": { "type": "string" } }, { "name": "total_supply", "required": false, "schema": { "type": "string" } } ], "refName": "BlockHeader" } } ], "refName": "BlockEnvelope" } }, { "name": "shards", "required": true, "schema": { "type": "array", "items": { "type": "object", "description": "Per-shard payload returned by neardata for a block.", "required": [ "chunk", "receipt_execution_outcomes", "shard_id", "state_changes" ], "additionalProperties": false, "properties": [ { "name": "chunk", "required": true, "schema": { "type": "object", "description": "Chunk payload returned by neardata for a single shard in a selected block.", "required": [ "author", "header", "receipts", "transactions" ], "additionalProperties": false, "properties": [ { "name": "author", "required": true, "schema": { "type": "string", "description": "Chunk producer account ID." } }, { "name": "header", "required": true, "schema": { "type": "object", "description": "Chunk header object as served by neardata.", "additionalProperties": true, "properties": [ { "name": "chunk_hash", "required": false, "schema": { "type": "string" } }, { "name": "gas_limit", "required": false, "schema": { "type": "integer" } }, { "name": "gas_used", "required": false, "schema": { "type": "integer" } }, { "name": "height_created", "required": false, "schema": { "type": "integer", "format": "uint64" } }, { "name": "height_included", "required": false, "schema": { "type": "integer", "format": "uint64" } }, { "name": "outcome_root", "required": false, "schema": { "type": "string" } }, { "name": "outgoing_receipts_root", "required": false, "schema": { "type": "string" } }, { "name": "prev_block_hash", "required": false, "schema": { "type": "string" } }, { "name": "shard_id", "required": false, "schema": { "type": "integer", "format": "uint64" } }, { "name": "tx_root", "required": false, "schema": { "type": "string" } } ], "refName": "ChunkHeader" } }, { "name": "receipts", "required": true, "schema": { "type": "array", "items": { "type": "object", "description": "Receipt object as served by neardata inside a chunk payload.", "required": [ "predecessor_id", "priority", "receipt", "receipt_id", "receiver_id" ], "additionalProperties": false, "properties": [ { "name": "predecessor_id", "required": true, "schema": { "type": "string" } }, { "name": "priority", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "receipt", "required": true, "schema": { "oneOf": [ { "type": "object", "required": [ "Action" ], "additionalProperties": false, "properties": [ { "name": "Action", "required": true, "schema": { "type": "object", "required": [ "actions", "gas_price", "input_data_ids", "is_promise_yield", "output_data_receivers", "signer_id", "signer_public_key" ], "additionalProperties": false, "properties": [ { "name": "actions", "required": true, "schema": { "type": "array", "items": { "type": "object", "additionalProperties": true, "refName": "ActionDocument" } } }, { "name": "gas_price", "required": true, "schema": { "type": "string" } }, { "name": "input_data_ids", "required": true, "schema": { "type": "array", "items": { "type": "string" } } }, { "name": "is_promise_yield", "required": true, "schema": { "type": "boolean" } }, { "name": "output_data_receivers", "required": true, "schema": { "type": "array", "items": { "type": "object", "required": [ "data_id", "receiver_id" ], "additionalProperties": false, "properties": [ { "name": "data_id", "required": true, "schema": { "type": "string" } }, { "name": "receiver_id", "required": true, "schema": { "type": "string" } } ], "refName": "OutputDataReceiverDocument" } } }, { "name": "signer_id", "required": true, "schema": { "type": "string" } }, { "name": "signer_public_key", "required": true, "schema": { "type": "string" } } ], "refName": "ActionReceiptDocument" } } ], "refName": "ActionReceiptBody" }, { "type": "object", "required": [ "Data" ], "additionalProperties": false, "properties": [ { "name": "Data", "required": true, "schema": { "type": "object", "required": [ "data", "data_id", "is_promise_resume" ], "additionalProperties": false, "properties": [ { "name": "data", "required": true, "schema": { "type": "string" } }, { "name": "data_id", "required": true, "schema": { "type": "string" } }, { "name": "is_promise_resume", "required": true, "schema": { "type": "boolean" } } ], "refName": "DataReceiptDocument" } } ], "refName": "DataReceiptBody" } ], "refName": "ReceiptBody" } }, { "name": "receipt_id", "required": true, "schema": { "type": "string" } }, { "name": "receiver_id", "required": true, "schema": { "type": "string" } } ], "refName": "ReceiptDocument" } } }, { "name": "transactions", "required": true, "schema": { "type": "array", "items": { "type": "object", "description": "Transaction entry returned inside a neardata chunk.", "required": [ "outcome", "transaction" ], "additionalProperties": false, "properties": [ { "name": "outcome", "required": true, "schema": { "type": "object", "description": "Execution result paired with an optional receipt object.", "required": [ "execution_outcome", "receipt" ], "additionalProperties": false, "properties": [ { "name": "execution_outcome", "required": true, "schema": { "type": "object", "required": [ "block_hash", "id", "outcome", "proof" ], "additionalProperties": false, "properties": [ { "name": "block_hash", "required": true, "schema": { "type": "string" } }, { "name": "id", "required": true, "schema": { "type": "string" } }, { "name": "outcome", "required": true, "schema": { "type": "object", "required": [ "executor_id", "gas_burnt", "logs", "metadata", "receipt_ids", "status", "tokens_burnt" ], "additionalProperties": false, "properties": [ { "name": "executor_id", "required": true, "schema": { "type": "string" } }, { "name": "gas_burnt", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "logs", "required": true, "schema": { "type": "array", "items": { "type": "string" } } }, { "name": "metadata", "required": true, "schema": { "type": "object", "additionalProperties": true } }, { "name": "receipt_ids", "required": true, "schema": { "type": "array", "items": { "type": "string" } } }, { "name": "status", "required": true, "schema": { "oneOf": [ { "type": "object", "required": [ "SuccessReceiptId" ], "additionalProperties": false, "properties": [ { "name": "SuccessReceiptId", "required": true, "schema": { "type": "string" } } ], "refName": "ExecutionOutcomeStatusSuccessReceiptId" }, { "type": "object", "required": [ "SuccessValue" ], "additionalProperties": false, "properties": [ { "name": "SuccessValue", "required": true, "schema": { "type": "string" } } ], "refName": "ExecutionOutcomeStatusSuccessValue" }, { "type": "object", "required": [ "Failure" ], "additionalProperties": false, "properties": [ { "name": "Failure", "required": true, "schema": { "type": "object", "additionalProperties": true } } ], "refName": "ExecutionOutcomeStatusFailure" } ], "refName": "ExecutionOutcomeStatus" } }, { "name": "tokens_burnt", "required": true, "schema": { "type": "string" } } ], "refName": "ExecutionOutcomeSummary" } }, { "name": "proof", "required": true, "schema": { "type": "array", "items": { "type": "object", "additionalProperties": true, "refName": "ExecutionProofItem" } } } ], "refName": "ExecutionOutcomeDocument" } }, { "name": "receipt", "required": true, "schema": { "type": "object", "description": "Receipt payload when neardata includes it for this entry.", "oneOf": [ { "type": "object", "description": "Receipt object as served by neardata inside a chunk payload.", "required": [ "predecessor_id", "priority", "receipt", "receipt_id", "receiver_id" ], "additionalProperties": false, "properties": [ { "name": "predecessor_id", "required": true, "schema": { "type": "string" } }, { "name": "priority", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "receipt", "required": true, "schema": { "oneOf": [ { "type": "object", "required": [ "Action" ], "additionalProperties": false, "properties": [ { "name": "Action", "required": true, "schema": { "type": "object", "required": [ "actions", "gas_price", "input_data_ids", "is_promise_yield", "output_data_receivers", "signer_id", "signer_public_key" ], "additionalProperties": false, "properties": [ { "name": "actions", "required": true, "schema": { "type": "array", "items": { "type": "object", "additionalProperties": true, "refName": "ActionDocument" } } }, { "name": "gas_price", "required": true, "schema": { "type": "string" } }, { "name": "input_data_ids", "required": true, "schema": { "type": "array", "items": { "type": "string" } } }, { "name": "is_promise_yield", "required": true, "schema": { "type": "boolean" } }, { "name": "output_data_receivers", "required": true, "schema": { "type": "array", "items": { "type": "object", "required": [ "data_id", "receiver_id" ], "additionalProperties": false, "properties": [ { "name": "data_id", "required": true, "schema": { "type": "string" } }, { "name": "receiver_id", "required": true, "schema": { "type": "string" } } ], "refName": "OutputDataReceiverDocument" } } }, { "name": "signer_id", "required": true, "schema": { "type": "string" } }, { "name": "signer_public_key", "required": true, "schema": { "type": "string" } } ], "refName": "ActionReceiptDocument" } } ], "refName": "ActionReceiptBody" }, { "type": "object", "required": [ "Data" ], "additionalProperties": false, "properties": [ { "name": "Data", "required": true, "schema": { "type": "object", "required": [ "data", "data_id", "is_promise_resume" ], "additionalProperties": false, "properties": [ { "name": "data", "required": true, "schema": { "type": "string" } }, { "name": "data_id", "required": true, "schema": { "type": "string" } }, { "name": "is_promise_resume", "required": true, "schema": { "type": "boolean" } } ], "refName": "DataReceiptDocument" } } ], "refName": "DataReceiptBody" } ], "refName": "ReceiptBody" } }, { "name": "receipt_id", "required": true, "schema": { "type": "string" } }, { "name": "receiver_id", "required": true, "schema": { "type": "string" } } ], "refName": "ReceiptDocument" }, { "type": "object", "additionalProperties": false, "refName": "OmittedReceiptDocument" } ] } }, { "name": "tx_hash", "required": false, "schema": { "type": "string" } } ], "refName": "ExecutionWithReceipt" } }, { "name": "transaction", "required": true, "schema": { "type": "object", "required": [ "actions", "hash", "nonce", "priority_fee", "public_key", "receiver_id", "signature", "signer_id" ], "additionalProperties": false, "properties": [ { "name": "actions", "required": true, "schema": { "type": "array", "items": { "type": "object", "additionalProperties": true, "refName": "ActionDocument" } } }, { "name": "hash", "required": true, "schema": { "type": "string" } }, { "name": "nonce", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "priority_fee", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "public_key", "required": true, "schema": { "type": "string" } }, { "name": "receiver_id", "required": true, "schema": { "type": "string" } }, { "name": "signature", "required": true, "schema": { "type": "string" } }, { "name": "signer_id", "required": true, "schema": { "type": "string" } } ], "refName": "SignedTransactionDocument" } } ], "refName": "ChunkTransactionWrapper" } } } ], "refName": "ChunkDocument" } }, { "name": "receipt_execution_outcomes", "required": true, "schema": { "type": "array", "items": { "type": "object", "description": "Execution result paired with an optional receipt object.", "required": [ "execution_outcome", "receipt" ], "additionalProperties": false, "properties": [ { "name": "execution_outcome", "required": true, "schema": { "type": "object", "required": [ "block_hash", "id", "outcome", "proof" ], "additionalProperties": false, "properties": [ { "name": "block_hash", "required": true, "schema": { "type": "string" } }, { "name": "id", "required": true, "schema": { "type": "string" } }, { "name": "outcome", "required": true, "schema": { "type": "object", "required": [ "executor_id", "gas_burnt", "logs", "metadata", "receipt_ids", "status", "tokens_burnt" ], "additionalProperties": false, "properties": [ { "name": "executor_id", "required": true, "schema": { "type": "string" } }, { "name": "gas_burnt", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "logs", "required": true, "schema": { "type": "array", "items": { "type": "string" } } }, { "name": "metadata", "required": true, "schema": { "type": "object", "additionalProperties": true } }, { "name": "receipt_ids", "required": true, "schema": { "type": "array", "items": { "type": "string" } } }, { "name": "status", "required": true, "schema": { "oneOf": [ { "type": "object", "required": [ "SuccessReceiptId" ], "additionalProperties": false, "properties": [ { "name": "SuccessReceiptId", "required": true, "schema": { "type": "string" } } ], "refName": "ExecutionOutcomeStatusSuccessReceiptId" }, { "type": "object", "required": [ "SuccessValue" ], "additionalProperties": false, "properties": [ { "name": "SuccessValue", "required": true, "schema": { "type": "string" } } ], "refName": "ExecutionOutcomeStatusSuccessValue" }, { "type": "object", "required": [ "Failure" ], "additionalProperties": false, "properties": [ { "name": "Failure", "required": true, "schema": { "type": "object", "additionalProperties": true } } ], "refName": "ExecutionOutcomeStatusFailure" } ], "refName": "ExecutionOutcomeStatus" } }, { "name": "tokens_burnt", "required": true, "schema": { "type": "string" } } ], "refName": "ExecutionOutcomeSummary" } }, { "name": "proof", "required": true, "schema": { "type": "array", "items": { "type": "object", "additionalProperties": true, "refName": "ExecutionProofItem" } } } ], "refName": "ExecutionOutcomeDocument" } }, { "name": "receipt", "required": true, "schema": { "type": "object", "description": "Receipt payload when neardata includes it for this entry.", "oneOf": [ { "type": "object", "description": "Receipt object as served by neardata inside a chunk payload.", "required": [ "predecessor_id", "priority", "receipt", "receipt_id", "receiver_id" ], "additionalProperties": false, "properties": [ { "name": "predecessor_id", "required": true, "schema": { "type": "string" } }, { "name": "priority", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "receipt", "required": true, "schema": { "oneOf": [ { "type": "object", "required": [ "Action" ], "additionalProperties": false, "properties": [ { "name": "Action", "required": true, "schema": { "type": "object", "required": [ "actions", "gas_price", "input_data_ids", "is_promise_yield", "output_data_receivers", "signer_id", "signer_public_key" ], "additionalProperties": false, "properties": [ { "name": "actions", "required": true, "schema": { "type": "array", "items": { "type": "object", "additionalProperties": true, "refName": "ActionDocument" } } }, { "name": "gas_price", "required": true, "schema": { "type": "string" } }, { "name": "input_data_ids", "required": true, "schema": { "type": "array", "items": { "type": "string" } } }, { "name": "is_promise_yield", "required": true, "schema": { "type": "boolean" } }, { "name": "output_data_receivers", "required": true, "schema": { "type": "array", "items": { "type": "object", "required": [ "data_id", "receiver_id" ], "additionalProperties": false, "properties": [ { "name": "data_id", "required": true, "schema": { "type": "string" } }, { "name": "receiver_id", "required": true, "schema": { "type": "string" } } ], "refName": "OutputDataReceiverDocument" } } }, { "name": "signer_id", "required": true, "schema": { "type": "string" } }, { "name": "signer_public_key", "required": true, "schema": { "type": "string" } } ], "refName": "ActionReceiptDocument" } } ], "refName": "ActionReceiptBody" }, { "type": "object", "required": [ "Data" ], "additionalProperties": false, "properties": [ { "name": "Data", "required": true, "schema": { "type": "object", "required": [ "data", "data_id", "is_promise_resume" ], "additionalProperties": false, "properties": [ { "name": "data", "required": true, "schema": { "type": "string" } }, { "name": "data_id", "required": true, "schema": { "type": "string" } }, { "name": "is_promise_resume", "required": true, "schema": { "type": "boolean" } } ], "refName": "DataReceiptDocument" } } ], "refName": "DataReceiptBody" } ], "refName": "ReceiptBody" } }, { "name": "receipt_id", "required": true, "schema": { "type": "string" } }, { "name": "receiver_id", "required": true, "schema": { "type": "string" } } ], "refName": "ReceiptDocument" }, { "type": "object", "additionalProperties": false, "refName": "OmittedReceiptDocument" } ] } }, { "name": "tx_hash", "required": false, "schema": { "type": "string" } } ], "refName": "ExecutionWithReceipt" } } }, { "name": "shard_id", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "state_changes", "required": true, "schema": { "type": "array", "items": { "type": "object", "description": "State change entry returned by neardata for a shard.", "required": [ "cause", "change", "type" ], "additionalProperties": false, "properties": [ { "name": "cause", "required": true, "schema": { "oneOf": [ { "type": "object", "required": [ "tx_hash", "type" ], "additionalProperties": false, "properties": [ { "name": "tx_hash", "required": true, "schema": { "type": "string" } }, { "name": "type", "required": true, "schema": { "type": "string" } } ], "refName": "StateChangeCauseTransactionProcessing" }, { "type": "object", "required": [ "receipt_hash", "type" ], "additionalProperties": false, "properties": [ { "name": "receipt_hash", "required": true, "schema": { "type": "string" } }, { "name": "type", "required": true, "schema": { "type": "string" } } ], "refName": "StateChangeCauseReceiptProcessing" }, { "type": "object", "required": [ "receipt_hash", "type" ], "additionalProperties": false, "properties": [ { "name": "receipt_hash", "required": true, "schema": { "type": "string" } }, { "name": "type", "required": true, "schema": { "type": "string" } } ], "refName": "StateChangeCauseActionReceiptGasReward" } ], "refName": "StateChangeCause" } }, { "name": "change", "required": true, "schema": { "oneOf": [ { "type": "object", "required": [ "account_id", "amount", "code_hash", "locked", "storage_paid_at", "storage_usage" ], "additionalProperties": false, "properties": [ { "name": "account_id", "required": true, "schema": { "type": "string" } }, { "name": "amount", "required": true, "schema": { "type": "string" } }, { "name": "code_hash", "required": true, "schema": { "type": "string" } }, { "name": "locked", "required": true, "schema": { "type": "string" } }, { "name": "storage_paid_at", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "storage_usage", "required": true, "schema": { "type": "integer", "format": "uint64" } } ], "refName": "StateChangeValueAccountUpdate" }, { "type": "object", "required": [ "access_key", "account_id", "public_key" ], "additionalProperties": false, "properties": [ { "name": "access_key", "required": true, "schema": { "type": "object", "additionalProperties": true } }, { "name": "account_id", "required": true, "schema": { "type": "string" } }, { "name": "public_key", "required": true, "schema": { "type": "string" } } ], "refName": "StateChangeValueAccessKeyUpdate" }, { "type": "object", "required": [ "account_id", "key_base64", "value_base64" ], "additionalProperties": false, "properties": [ { "name": "account_id", "required": true, "schema": { "type": "string" } }, { "name": "key_base64", "required": true, "schema": { "type": "string" } }, { "name": "value_base64", "required": true, "schema": { "type": "string" } } ], "refName": "StateChangeValueDataUpdate" }, { "type": "object", "required": [ "account_id", "key_base64" ], "additionalProperties": false, "properties": [ { "name": "account_id", "required": true, "schema": { "type": "string" } }, { "name": "key_base64", "required": true, "schema": { "type": "string" } } ], "refName": "StateChangeValueDataDeletion" } ], "refName": "StateChangeValue" } }, { "name": "type", "required": true, "schema": { "type": "string" } } ], "refName": "StateChangeItem" } } } ], "refName": "ShardDocument" } } } ], "refName": "BlockDocument" } ``` --- ## Transactions API - Account History - HTML path: https://docs.fastnear.com/apis/transactions/v0/account - Markdown path: https://docs.fastnear.com/apis/transactions/v0/account.md # Transactions API - Account History Fetch account transaction history Fetch account transaction history with optional filters for signer, success status, and sort order. ## Source links - https://docs.fastnear.com/apis/transactions/v0/account - https://docs.fastnear.com/apis/transactions/openapi/account/get_account ## Operation - Transport: http - Method: POST - Path: `/v0/account` - Source spec: `apis/transactions/v0/account.yaml` ## Networks - Mainnet: https://tx.main.fastnear.com/ - Testnet: https://tx.test.fastnear.com/ ## Auth - No auth required ## Current request - Network: Mainnet - Method: POST - URL: https://tx.main.fastnear.com/v0/account - Active example: Mainnet ### Request body ```json { "account_id": "intents.near", "desc": true, "is_real_signer": true, "is_success": true, "limit": 50 } ``` ## Request reference ### Active example ```json { "body": { "account_id": "intents.near", "desc": true, "is_real_signer": true, "is_success": true, "limit": 50 }, "headers": {}, "path": {}, "query": {} } ``` ### Inputs - `account_id` (body, required, string): NEAR account to query transactions for (may be a signer, predecessor, receiver, or related party). - `desc` (body, boolean): Sort newest-first when true; oldest-first when false or omitted. - `from_tx_block_height` (body, integer): Inclusive lower bound on the transaction's block height. - `is_action_arg` (body, boolean): Restrict to transactions where this account appeared in action arguments. - `is_any_signer` (body, boolean): Restrict to transactions where this account signed either the top-level transaction or a delegated action. - `is_delegated_signer` (body, boolean): Restrict to transactions where this account signed a delegated action. - `is_event_log` (body, boolean): Restrict to transactions where this account appeared in a JSON event log. - `is_explicit_refund_to` (body, boolean): Restrict to transactions where this account was the explicit `refund_to` target of an action receipt. - `is_function_call` (body, boolean): Restrict to transactions where this account was the target of a function-call action. - `is_predecessor` (body, boolean): Restrict to transactions where this account was the predecessor of a receipt. - `is_real_receiver` (body, boolean): Restrict to transactions where this account was the real receiver — excluding relayer receivers and gas refunds. - `is_real_signer` (body, boolean): Restrict to transactions where this account was the real signer — direct or delegated, excluding relayer signers. - `is_receiver` (body, boolean): Restrict to transactions where this account received a receipt. - `is_signer` (body, boolean): Restrict to transactions where this account signed the top-level transaction. - `is_success` (body, boolean): Restrict to transactions whose execution succeeded (true) or failed/pending (false). - `limit` (body, integer): Maximum rows to return in one page (1–200). - `resume_token` (body, string): Opaque pagination token returned on a prior page; omit for the first page. - `to_tx_block_height` (body, integer): Exclusive upper bound on the transaction's block height. ### Request schema ```json { "type": "object", "required": [ "account_id" ], "additionalProperties": false, "properties": [ { "name": "account_id", "required": true, "schema": { "type": "string", "description": "NEAR account to query transactions for (may be a signer, predecessor, receiver, or related party)." } }, { "name": "desc", "required": false, "schema": { "type": "boolean", "description": "Sort newest-first when true; oldest-first when false or omitted." } }, { "name": "from_tx_block_height", "required": false, "schema": { "type": "integer", "description": "Inclusive lower bound on the transaction's block height.", "format": "uint64" } }, { "name": "is_action_arg", "required": false, "schema": { "type": "boolean", "description": "Restrict to transactions where this account appeared in action arguments." } }, { "name": "is_any_signer", "required": false, "schema": { "type": "boolean", "description": "Restrict to transactions where this account signed either the top-level transaction or a delegated action." } }, { "name": "is_delegated_signer", "required": false, "schema": { "type": "boolean", "description": "Restrict to transactions where this account signed a delegated action." } }, { "name": "is_event_log", "required": false, "schema": { "type": "boolean", "description": "Restrict to transactions where this account appeared in a JSON event log." } }, { "name": "is_explicit_refund_to", "required": false, "schema": { "type": "boolean", "description": "Restrict to transactions where this account was the explicit `refund_to` target of an action receipt." } }, { "name": "is_function_call", "required": false, "schema": { "type": "boolean", "description": "Restrict to transactions where this account was the target of a function-call action." } }, { "name": "is_predecessor", "required": false, "schema": { "type": "boolean", "description": "Restrict to transactions where this account was the predecessor of a receipt." } }, { "name": "is_real_receiver", "required": false, "schema": { "type": "boolean", "description": "Restrict to transactions where this account was the real receiver — excluding relayer receivers and gas refunds." } }, { "name": "is_real_signer", "required": false, "schema": { "type": "boolean", "description": "Restrict to transactions where this account was the real signer — direct or delegated, excluding relayer signers." } }, { "name": "is_receiver", "required": false, "schema": { "type": "boolean", "description": "Restrict to transactions where this account received a receipt." } }, { "name": "is_signer", "required": false, "schema": { "type": "boolean", "description": "Restrict to transactions where this account signed the top-level transaction." } }, { "name": "is_success", "required": false, "schema": { "type": "boolean", "description": "Restrict to transactions whose execution succeeded (true) or failed/pending (false)." } }, { "name": "limit", "required": false, "schema": { "type": "integer", "description": "Maximum rows to return in one page (1–200).", "format": "uint" } }, { "name": "resume_token", "required": false, "schema": { "type": "string", "description": "Opaque pagination token returned on a prior page; omit for the first page.", "default": null } }, { "name": "to_tx_block_height", "required": false, "schema": { "type": "integer", "description": "Exclusive upper bound on the transaction's block height.", "format": "uint64" } } ], "refName": "AccountInput" } ``` ## Response reference - Status: 200 - Media type: application/json - Summary: Account history result set ### Response schema ```json { "type": "object", "required": [ "account_txs", "resume_token", "txs_count" ], "additionalProperties": false, "properties": [ { "name": "account_txs", "required": true, "schema": { "type": "array", "items": { "type": "object", "required": [ "account_id", "transaction_hash", "tx_block_height", "tx_block_timestamp", "tx_index", "is_signer", "is_delegated_signer", "is_real_signer", "is_any_signer", "is_predecessor", "is_explicit_refund_to", "is_receiver", "is_real_receiver", "is_function_call", "is_action_arg", "is_event_log", "is_success" ], "additionalProperties": false, "properties": [ { "name": "account_id", "required": true, "schema": { "type": "string" } }, { "name": "is_action_arg", "required": true, "schema": { "type": "boolean" } }, { "name": "is_any_signer", "required": true, "schema": { "type": "boolean" } }, { "name": "is_delegated_signer", "required": true, "schema": { "type": "boolean" } }, { "name": "is_event_log", "required": true, "schema": { "type": "boolean" } }, { "name": "is_explicit_refund_to", "required": true, "schema": { "type": "boolean" } }, { "name": "is_function_call", "required": true, "schema": { "type": "boolean" } }, { "name": "is_predecessor", "required": true, "schema": { "type": "boolean" } }, { "name": "is_real_receiver", "required": true, "schema": { "type": "boolean" } }, { "name": "is_real_signer", "required": true, "schema": { "type": "boolean" } }, { "name": "is_receiver", "required": true, "schema": { "type": "boolean" } }, { "name": "is_signer", "required": true, "schema": { "type": "boolean" } }, { "name": "is_success", "required": true, "schema": { "type": "boolean" } }, { "name": "transaction_hash", "required": true, "schema": { "type": "string" } }, { "name": "tx_block_height", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "tx_block_timestamp", "required": true, "schema": { "type": "string" } }, { "name": "tx_index", "required": true, "schema": { "type": "integer", "format": "uint32" } } ], "refName": "AccountTxRow" } } }, { "name": "resume_token", "required": true, "schema": { "type": "string" } }, { "name": "txs_count", "required": true, "schema": { "type": "integer", "format": "uint64" } } ], "refName": "AccountResponse" } ``` --- ## Transactions API - Block Lookup - HTML path: https://docs.fastnear.com/apis/transactions/v0/block - Markdown path: https://docs.fastnear.com/apis/transactions/v0/block.md # Transactions API - Block Lookup Fetch a block by height or hash Fetch a block row by height or hash and optionally expand its transactions and receipts. ## Source links - https://docs.fastnear.com/apis/transactions/v0/block - https://docs.fastnear.com/apis/transactions/openapi/blocks/get_block ## Operation - Transport: http - Method: POST - Path: `/v0/block` - Source spec: `apis/transactions/v0/block.yaml` ## Networks - Mainnet: https://tx.main.fastnear.com/ - Testnet: https://tx.test.fastnear.com/ ## Auth - No auth required ## Current request - Network: Mainnet - Method: POST - URL: https://tx.main.fastnear.com/v0/block - Active example: Mainnet ### Request body ```json { "block_id": 193916411, "with_receipts": true, "with_transactions": true } ``` ## Request reference ### Active example ```json { "body": { "block_id": 193916411, "with_receipts": true, "with_transactions": true }, "headers": {}, "path": {}, "query": {} } ``` ### Inputs - `block_id` (body, required, integer | string): Block height (integer) or base58-encoded block hash (string) to fetch. - `with_receipts` (body, boolean): Include the block's receipts in the response when true. - `with_transactions` (body, boolean): Include the block's transactions in the response when true. ### Request schema ```json { "type": "object", "required": [ "block_id" ], "additionalProperties": false, "properties": [ { "name": "block_id", "required": true, "schema": { "description": "Block height (integer) or base58-encoded block hash (string) to fetch.", "oneOf": [ { "type": "integer" }, { "type": "string" } ] } }, { "name": "with_receipts", "required": false, "schema": { "type": "boolean", "description": "Include the block's receipts in the response when true." } }, { "name": "with_transactions", "required": false, "schema": { "type": "boolean", "description": "Include the block's transactions in the response when true." } } ], "refName": "BlockInput" } ``` ## Response reference - Status: 200 - Media type: application/json - Summary: Block lookup result ### Response schema ```json { "type": "object", "required": [ "block", "block_txs", "block_receipts" ], "additionalProperties": false, "properties": [ { "name": "block", "required": true, "schema": { "type": "object", "required": [ "block_height", "block_hash", "prev_block_hash", "block_timestamp", "epoch_id", "next_epoch_id", "chunks_included", "author_id", "protocol_version", "gas_price", "total_supply", "num_transactions", "num_receipts", "gas_burnt", "tokens_burnt" ], "additionalProperties": false, "properties": [ { "name": "author_id", "required": true, "schema": { "type": "string" } }, { "name": "block_hash", "required": true, "schema": { "type": "string" } }, { "name": "block_height", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "block_ordinal", "required": false, "schema": { "type": "integer", "format": "uint64" } }, { "name": "block_timestamp", "required": true, "schema": { "type": "string" } }, { "name": "chunks_included", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "epoch_id", "required": true, "schema": { "type": "string" } }, { "name": "gas_burnt", "required": true, "schema": { "type": "string" } }, { "name": "gas_price", "required": true, "schema": { "type": "string" } }, { "name": "next_epoch_id", "required": true, "schema": { "type": "string" } }, { "name": "num_receipts", "required": true, "schema": { "type": "integer", "format": "uint32" } }, { "name": "num_transactions", "required": true, "schema": { "type": "integer", "format": "uint32" } }, { "name": "prev_block_hash", "required": true, "schema": { "type": "string" } }, { "name": "prev_block_height", "required": false, "schema": { "type": "integer", "format": "uint64" } }, { "name": "protocol_version", "required": true, "schema": { "type": "integer", "format": "uint32" } }, { "name": "tokens_burnt", "required": true, "schema": { "type": "string" } }, { "name": "total_supply", "required": true, "schema": { "type": "string" } } ] } }, { "name": "block_receipts", "required": true, "schema": { "type": "array", "items": { "type": "object", "required": [ "receipt_id", "block_height", "block_timestamp", "receipt_index", "appear_block_height", "appear_receipt_index", "transaction_hash", "tx_block_height", "tx_block_timestamp", "tx_index", "predecessor_id", "receiver_id", "receipt_type", "priority", "shard_id", "is_success" ], "additionalProperties": false, "properties": [ { "name": "appear_block_height", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "appear_receipt_index", "required": true, "schema": { "type": "integer", "format": "uint32" } }, { "name": "block_height", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "block_timestamp", "required": true, "schema": { "type": "string" } }, { "name": "is_success", "required": true, "schema": { "type": "boolean" } }, { "name": "predecessor_id", "required": true, "schema": { "type": "string" } }, { "name": "priority", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "receipt_id", "required": true, "schema": { "type": "string" } }, { "name": "receipt_index", "required": true, "schema": { "type": "integer", "format": "uint32" } }, { "name": "receipt_type", "required": true, "schema": { "type": "string" } }, { "name": "receiver_id", "required": true, "schema": { "type": "string" } }, { "name": "shard_id", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "transaction_hash", "required": true, "schema": { "type": "string" } }, { "name": "tx_block_height", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "tx_block_timestamp", "required": true, "schema": { "type": "string" } }, { "name": "tx_index", "required": true, "schema": { "type": "integer", "format": "uint32" } } ], "refName": "ReceiptTxRow" } } }, { "name": "block_txs", "required": true, "schema": { "type": "array", "items": { "type": "object", "required": [ "transaction_hash", "signer_id", "tx_block_height", "tx_index", "tx_block_hash", "tx_block_timestamp", "last_block_height", "is_completed", "shard_id", "receiver_id", "signer_public_key", "priority_fee", "nonce", "is_relayed", "real_signer_id", "real_receiver_id", "is_success", "gas_burnt", "tokens_burnt" ], "additionalProperties": false, "properties": [ { "name": "gas_burnt", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "is_completed", "required": true, "schema": { "type": "boolean" } }, { "name": "is_relayed", "required": true, "schema": { "type": "boolean" } }, { "name": "is_success", "required": true, "schema": { "type": "boolean" } }, { "name": "last_block_height", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "nonce", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "priority_fee", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "real_receiver_id", "required": true, "schema": { "type": "string" } }, { "name": "real_signer_id", "required": true, "schema": { "type": "string" } }, { "name": "receiver_id", "required": true, "schema": { "type": "string" } }, { "name": "shard_id", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "signer_id", "required": true, "schema": { "type": "string" } }, { "name": "signer_public_key", "required": true, "schema": { "type": "string" } }, { "name": "tokens_burnt", "required": true, "schema": { "type": "string" } }, { "name": "transaction_hash", "required": true, "schema": { "type": "string" } }, { "name": "tx_block_hash", "required": true, "schema": { "type": "string" } }, { "name": "tx_block_height", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "tx_block_timestamp", "required": true, "schema": { "type": "string" } }, { "name": "tx_index", "required": true, "schema": { "type": "integer", "format": "uint32" } } ], "refName": "BlockTxRow" } } } ], "refName": "BlockResponse" } ``` --- ## Transactions API - Block Range - HTML path: https://docs.fastnear.com/apis/transactions/v0/blocks - Markdown path: https://docs.fastnear.com/apis/transactions/v0/blocks.md # Transactions API - Block Range Fetch a list of blocks Fetch a bounded list of indexed blocks ordered ascending or descending. ## Source links - https://docs.fastnear.com/apis/transactions/v0/blocks - https://docs.fastnear.com/apis/transactions/openapi/blocks/get_blocks ## Operation - Transport: http - Method: POST - Path: `/v0/blocks` - Source spec: `apis/transactions/v0/blocks.yaml` ## Networks - Mainnet: https://tx.main.fastnear.com/ - Testnet: https://tx.test.fastnear.com/ ## Auth - No auth required ## Current request - Network: Mainnet - Method: POST - URL: https://tx.main.fastnear.com/v0/blocks - Active example: Mainnet ### Request body ```json { "desc": false, "from_block_height": 193916402, "limit": 10, "to_block_height": 193916411 } ``` ## Request reference ### Active example ```json { "body": { "desc": false, "from_block_height": 193916402, "limit": 10, "to_block_height": 193916411 }, "headers": {}, "path": {}, "query": {} } ``` ### Inputs - `desc` (body, boolean): Sort newest-first when true; oldest-first when false or omitted. - `from_block_height` (body, integer): Inclusive lower bound on block height. - `limit` (body, integer): Maximum blocks to return in one page (1–100). - `to_block_height` (body, integer): Exclusive upper bound on block height. ### Request schema ```json { "type": "object", "additionalProperties": false, "properties": [ { "name": "desc", "required": false, "schema": { "type": "boolean", "description": "Sort newest-first when true; oldest-first when false or omitted." } }, { "name": "from_block_height", "required": false, "schema": { "type": "integer", "description": "Inclusive lower bound on block height.", "format": "uint64" } }, { "name": "limit", "required": false, "schema": { "type": "integer", "description": "Maximum blocks to return in one page (1–100).", "format": "uint" } }, { "name": "to_block_height", "required": false, "schema": { "type": "integer", "description": "Exclusive upper bound on block height.", "format": "uint64" } } ], "refName": "BlocksInput" } ``` ## Response reference - Status: 200 - Media type: application/json - Summary: Block rows ### Response schema ```json { "type": "object", "required": [ "blocks" ], "additionalProperties": false, "properties": [ { "name": "blocks", "required": true, "schema": { "type": "array", "items": { "type": "object", "required": [ "block_height", "block_hash", "prev_block_hash", "block_timestamp", "epoch_id", "next_epoch_id", "chunks_included", "author_id", "protocol_version", "gas_price", "total_supply", "num_transactions", "num_receipts", "gas_burnt", "tokens_burnt" ], "additionalProperties": false, "properties": [ { "name": "author_id", "required": true, "schema": { "type": "string" } }, { "name": "block_hash", "required": true, "schema": { "type": "string" } }, { "name": "block_height", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "block_ordinal", "required": false, "schema": { "type": "integer", "format": "uint64" } }, { "name": "block_timestamp", "required": true, "schema": { "type": "string" } }, { "name": "chunks_included", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "epoch_id", "required": true, "schema": { "type": "string" } }, { "name": "gas_burnt", "required": true, "schema": { "type": "string" } }, { "name": "gas_price", "required": true, "schema": { "type": "string" } }, { "name": "next_epoch_id", "required": true, "schema": { "type": "string" } }, { "name": "num_receipts", "required": true, "schema": { "type": "integer", "format": "uint32" } }, { "name": "num_transactions", "required": true, "schema": { "type": "integer", "format": "uint32" } }, { "name": "prev_block_hash", "required": true, "schema": { "type": "string" } }, { "name": "prev_block_height", "required": false, "schema": { "type": "integer", "format": "uint64" } }, { "name": "protocol_version", "required": true, "schema": { "type": "integer", "format": "uint32" } }, { "name": "tokens_burnt", "required": true, "schema": { "type": "string" } }, { "name": "total_supply", "required": true, "schema": { "type": "string" } } ], "refName": "BlockRow" } } } ], "refName": "BlocksResponse" } ``` --- ## Transactions API - Receipt Lookup - HTML path: https://docs.fastnear.com/apis/transactions/v0/receipt - Markdown path: https://docs.fastnear.com/apis/transactions/v0/receipt.md # Transactions API - Receipt Lookup Fetch a receipt by ID Fetch a receipt by ID along with the transaction that produced it. ## Source links - https://docs.fastnear.com/apis/transactions/v0/receipt - https://docs.fastnear.com/apis/transactions/openapi/receipts/get_receipt ## Operation - Transport: http - Method: POST - Path: `/v0/receipt` - Source spec: `apis/transactions/v0/receipt.yaml` ## Networks - Mainnet: https://tx.main.fastnear.com/ - Testnet: https://tx.test.fastnear.com/ ## Auth - No auth required ## Current request - Network: Mainnet - Method: POST - URL: https://tx.main.fastnear.com/v0/receipt - Active example: Mainnet ### Request body ```json { "receipt_id": "gzqDSvd3ZMcVUWzBMP7j9KMWz89iZMkkEvW9g8QZjUP" } ``` ## Request reference ### Active example ```json { "body": { "receipt_id": "gzqDSvd3ZMcVUWzBMP7j9KMWz89iZMkkEvW9g8QZjUP" }, "headers": {}, "path": {}, "query": {} } ``` ### Inputs - `receipt_id` (body, required, string): Base58-encoded receipt ID to look up. ### Request schema ```json { "type": "object", "required": [ "receipt_id" ], "additionalProperties": false, "properties": [ { "name": "receipt_id", "required": true, "schema": { "type": "string", "description": "Base58-encoded receipt ID to look up." } } ], "refName": "ReceiptInput" } ``` ## Response reference - Status: 200 - Media type: application/json - Summary: Receipt lookup result ### Response schema ```json { "type": "object", "required": [ "receipt", "transaction" ], "additionalProperties": false, "properties": [ { "name": "receipt", "required": true, "schema": { "type": "object", "required": [ "receipt_id", "block_height", "block_timestamp", "receipt_index", "appear_block_height", "appear_receipt_index", "transaction_hash", "tx_block_height", "tx_block_timestamp", "tx_index", "predecessor_id", "receiver_id", "receipt_type", "priority", "shard_id", "is_success" ], "additionalProperties": false, "properties": [ { "name": "appear_block_height", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "appear_receipt_index", "required": true, "schema": { "type": "integer", "format": "uint32" } }, { "name": "block_height", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "block_timestamp", "required": true, "schema": { "type": "string" } }, { "name": "is_success", "required": true, "schema": { "type": "boolean" } }, { "name": "predecessor_id", "required": true, "schema": { "type": "string" } }, { "name": "priority", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "receipt_id", "required": true, "schema": { "type": "string" } }, { "name": "receipt_index", "required": true, "schema": { "type": "integer", "format": "uint32" } }, { "name": "receipt_type", "required": true, "schema": { "type": "string" } }, { "name": "receiver_id", "required": true, "schema": { "type": "string" } }, { "name": "shard_id", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "transaction_hash", "required": true, "schema": { "type": "string" } }, { "name": "tx_block_height", "required": true, "schema": { "type": "integer", "format": "uint64" } }, { "name": "tx_block_timestamp", "required": true, "schema": { "type": "string" } }, { "name": "tx_index", "required": true, "schema": { "type": "integer", "format": "uint32" } } ] } }, { "name": "transaction", "required": true, "schema": { "type": "object", "additionalProperties": true } } ], "refName": "ReceiptResponse" } ``` --- ## Transactions API - Transactions by Hash - HTML path: https://docs.fastnear.com/apis/transactions/v0/transactions - Markdown path: https://docs.fastnear.com/apis/transactions/v0/transactions.md # Transactions API - Transactions by Hash Fetch transactions by hash Fetch up to 20 indexed transactions by hash in one request. ## Source links - https://docs.fastnear.com/apis/transactions/v0/transactions - https://docs.fastnear.com/apis/transactions/openapi/transactions/get_transactions ## Operation - Transport: http - Method: POST - Path: `/v0/transactions` - Source spec: `apis/transactions/v0/transactions.yaml` ## Networks - Mainnet: https://tx.main.fastnear.com/ - Testnet: https://tx.test.fastnear.com/ ## Auth - No auth required ## Current request - Network: Mainnet - Method: POST - URL: https://tx.main.fastnear.com/v0/transactions - Active example: Mainnet ### Request body ```json { "tx_hashes": [ "FDrh13CdfGPXsmwUpZLfkZCoXWfpQmaFGj4zYWc1qfh", "Eq1a46bynaBAjoSxd2XGWdCxkZdrMvN9jMZVdZfPSjM5" ] } ``` ## Request reference ### Active example ```json { "body": { "tx_hashes": [ "FDrh13CdfGPXsmwUpZLfkZCoXWfpQmaFGj4zYWc1qfh", "Eq1a46bynaBAjoSxd2XGWdCxkZdrMvN9jMZVdZfPSjM5" ] }, "headers": {}, "path": {}, "query": {} } ``` ### Inputs - `tx_hashes` (body, required, array): Up to 20 base58-encoded transaction hashes to fetch in one request. ### Request schema ```json { "type": "object", "required": [ "tx_hashes" ], "additionalProperties": false, "properties": [ { "name": "tx_hashes", "required": true, "schema": { "type": "array", "description": "Up to 20 base58-encoded transaction hashes to fetch in one request.", "items": { "type": "string" } } } ], "refName": "TxInput" } ``` ## Response reference - Status: 200 - Media type: application/json - Summary: Matching transactions ### Response schema ```json { "type": "object", "required": [ "transactions" ], "additionalProperties": false, "properties": [ { "name": "transactions", "required": true, "schema": { "type": "array", "items": { "type": "object", "additionalProperties": true } } } ], "refName": "TransactionsResponse" } ``` --- ## Transfers API - Query Transfers - HTML path: https://docs.fastnear.com/apis/transfers/v0/transfers - Markdown path: https://docs.fastnear.com/apis/transfers/v0/transfers.md # Transfers API - Query Transfers Query transfers for an account Fetch transfer rows for one account with optional direction, asset, amount, and time filters. ## Source links - https://docs.fastnear.com/apis/transfers/v0/transfers - https://docs.fastnear.com/apis/transfers/openapi/transfers/get_transfers_by_account ## Operation - Transport: http - Method: POST - Path: `/v0/transfers` - Source spec: `apis/transfers/v0/transfers.yaml` ## Networks - Mainnet: https://transfers.main.fastnear.com/ ## Auth - No auth required ## Current request - Network: Mainnet - Method: POST - URL: https://transfers.main.fastnear.com/v0/transfers - Active example: Recent incoming NEAR transfers ### Request body ```json { "account_id": "root.near", "desc": true, "limit": 10 } ``` ## Request reference ### Active example ```json { "body": { "account_id": "intents.near", "asset_id": "native:near", "desc": true, "direction": "receiver", "limit": 10, "min_amount": "1000000000000000000000000" }, "headers": {}, "path": {}, "query": {} } ``` ### Inputs - `account_id` (body, required, string): NEAR account to query transfers for (the signer or receiver, depending on `direction`). - `asset_id` (body, string): Asset identifier such as `native:near` for NEAR or `` for fungible tokens. - `desc` (body, boolean): When true, sort newest-first; when false or omitted, sort oldest-first. - `direction` (body, required, string): Restrict to transfers where the account acts as `sender` or `receiver`; omit for both sides. - `from_timestamp_ms` (body, integer): Inclusive lower bound on block timestamp in milliseconds since the Unix epoch. - `ignore_system` (body, boolean): When true, hide system transfers (validator rewards, implicit account creation, refunds). - `limit` (body, integer): Maximum number of transfer rows to return in one page (1–100). - `min_amount` (body, string): Minimum absolute transfer amount in the asset's base units (e.g. yoctoNEAR), stringified u128. - `min_human_amount` (body, number): Minimum transfer amount in human-readable units (decimals already applied). - `min_usd_amount` (body, number): Minimum transfer amount in USD-equivalent at time of transfer. - `resume_token` (body, string): Opaque pagination token returned as `resume_token` on a prior page; omit for the first page. - `to_timestamp_ms` (body, integer): Exclusive upper bound on block timestamp in milliseconds since the Unix epoch. ### Request schema ```json { "type": "object", "required": [ "account_id", "direction" ], "additionalProperties": false, "properties": [ { "name": "account_id", "required": true, "schema": { "type": "string", "description": "NEAR account to query transfers for (the signer or receiver, depending on `direction`)." } }, { "name": "asset_id", "required": false, "schema": { "type": "string", "description": "Asset identifier such as `native:near` for NEAR or `` for fungible tokens." } }, { "name": "desc", "required": false, "schema": { "type": "boolean", "description": "When true, sort newest-first; when false or omitted, sort oldest-first." } }, { "name": "direction", "required": true, "schema": { "type": "string", "description": "Restrict to transfers where the account acts as `sender` or `receiver`; omit for both sides.", "enum": [ "sender", "receiver" ] } }, { "name": "from_timestamp_ms", "required": false, "schema": { "type": "integer", "description": "Inclusive lower bound on block timestamp in milliseconds since the Unix epoch.", "format": "uint64" } }, { "name": "ignore_system", "required": false, "schema": { "type": "boolean", "description": "When true, hide system transfers (validator rewards, implicit account creation, refunds)." } }, { "name": "limit", "required": false, "schema": { "type": "integer", "description": "Maximum number of transfer rows to return in one page (1–100).", "format": "uint" } }, { "name": "min_amount", "required": false, "schema": { "type": "string", "description": "Minimum absolute transfer amount in the asset's base units (e.g. yoctoNEAR), stringified u128.", "default": null } }, { "name": "min_human_amount", "required": false, "schema": { "type": "number", "description": "Minimum transfer amount in human-readable units (decimals already applied).", "format": "double" } }, { "name": "min_usd_amount", "required": false, "schema": { "type": "number", "description": "Minimum transfer amount in USD-equivalent at time of transfer.", "format": "double" } }, { "name": "resume_token", "required": false, "schema": { "type": "string", "description": "Opaque pagination token returned as `resume_token` on a prior page; omit for the first page.", "default": null } }, { "name": "to_timestamp_ms", "required": false, "schema": { "type": "integer", "description": "Exclusive upper bound on block timestamp in milliseconds since the Unix epoch.", "format": "uint64" } } ], "refName": "TransfersInput" } ``` ## Response reference - Status: 200 - Media type: application/json - Summary: Transfer rows for the requested account ### Response schema ```json { "type": "object", "required": [ "transfers", "resume_token" ], "additionalProperties": false, "properties": [ { "name": "resume_token", "required": true, "schema": { "type": "string" } }, { "name": "transfers", "required": true, "schema": { "type": "array", "items": { "type": "object", "required": [ "block_height", "block_timestamp", "receipt_id", "transfer_index", "signer_id", "predecessor_id", "receipt_account_id", "account_id", "asset_id", "asset_type", "amount", "transfer_type" ], "additionalProperties": false, "properties": [ { "name": "account_id", "required": true, "schema": { "type": "string" } }, { "name": "action_index", "required": false, "schema": { "type": "integer", "format": "uint16" } }, { "name": "amount", "required": true, "schema": { "type": "string" } }, { "name": "asset_id", "required": true, "schema": { "type": "string" } }, { "name": "asset_type", "required": true, "schema": { "type": "string" } }, { "name": "block_height", "required": true, "schema": { "type": "string" } }, { "name": "block_timestamp", "required": true, "schema": { "type": "string" } }, { "name": "end_of_block_balance", "required": false, "schema": { "type": "string" } }, { "name": "human_amount", "required": false, "schema": { "type": "number", "format": "double" } }, { "name": "log_index", "required": false, "schema": { "type": "integer", "format": "uint16" } }, { "name": "method_name", "required": false, "schema": { "type": "string" } }, { "name": "other_account_id", "required": false, "schema": { "type": "string" } }, { "name": "predecessor_id", "required": true, "schema": { "type": "string" } }, { "name": "receipt_account_id", "required": true, "schema": { "type": "string" } }, { "name": "receipt_id", "required": true, "schema": { "type": "string" } }, { "name": "signer_id", "required": true, "schema": { "type": "string" } }, { "name": "start_of_block_balance", "required": false, "schema": { "type": "string" } }, { "name": "transaction_id", "required": false, "schema": { "type": "string" } }, { "name": "transfer_index", "required": true, "schema": { "type": "integer", "format": "uint32" } }, { "name": "transfer_type", "required": true, "schema": { "type": "string" } }, { "name": "usd_amount", "required": false, "schema": { "type": "number", "format": "double" } } ], "refName": "TransferRow" } } } ], "refName": "TransfersResponse" } ``` --- ## About FastNear - FastNear handles 10B+ requests per month. - FastNear runs 100+ nodes worldwide. - One FastNear API key works across RPC and the indexed APIs. - Get an API key at [dashboard.fastnear.com](https://dashboard.fastnear.com).