# 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 [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 {/* FASTNEAR_AI_DISCOVERY: This is the operational entry point for AI agents, crawlers, and automation runtimes. It explains what information to gather before the first request, which FastNear API to start with, how auth works across APIs, and what an agent answer should contain. */} 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. - 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 Public endpoints often work without a key. Add a key for higher limits, a shared authenticated posture, or paid access patterns. The same key works 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" curl "https://rpc.mainnet.fastnear.com" \ -H "Authorization: Bearer ${API_KEY}" \ -H "Content-Type: application/json" \ --data '{"method":"block","params":{"finality":"final"},"id":1,"jsonrpc":"2.0"}' ``` ```bash title="URL parameter" curl "https://rpc.mainnet.fastnear.com?apiKey=${API_KEY}" ``` Get a key from [dashboard.fastnear.com](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. Many public reads still work without a key. 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 ${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=${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'}, }), }); ``` ## When auth is missing Many public FastNear endpoints are still readable without a key. If the agent can answer the user's question from public traffic, do that. When a key is required for higher limits, paid access, or authenticated traffic: - tell the user to create or retrieve a key from [dashboard.fastnear.com](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 {/* FASTNEAR_AI_DISCOVERY: This page is for AI agents deciding which FastNear surface to use from a user's intent. It explains how to route from the user's goal to the best first surface, when to combine surfaces, and which common mistakes to avoid. */} 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 {/* FASTNEAR_AI_DISCOVERY: This page gives AI agents concrete multi-step workflows for common FastNear tasks. Each playbook names the minimum inputs, the first API to use, when to widen to another API, and what a useful answer should contain. */} 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 plain-language flows 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) ## Worked walkthroughs Read this page as a short ladder: first resolve who the account is, then classify the wallet shape, then use one richer provenance flow when you want to turn a live BOS artifact into a minted record. ### Resolve a public key, then fetch the account snapshot Use this when you have a public key first and the next user-facing question is “which account is this?” followed immediately by “what does that account look like right now?” Strategy Resolve identity first, then reuse the same account ID for one readable wallet snapshot. 01GET /v1/public_key gives the candidate account_id values for the key. 02jq lifts the account you actually want to inspect next. 03GET /v1/account/.../full answers balances, NFTs, and staking in one response. **What you're doing** - Resolve the public key to one or more account IDs. - Extract the first matching account ID with `jq`. - Reuse that value in the full account snapshot endpoint. ```bash API_BASE_URL=https://api.fastnear.com PUBLIC_KEY='ed25519:YOUR_PUBLIC_KEY' # Example public key from the docs page model: # PUBLIC_KEY='ed25519:CCaThr3uokqnUs6Z5vVnaDcJdrfuTpYJHJWcAGubDjT' ENCODED_PUBLIC_KEY="$(jq -rn --arg public_key "$PUBLIC_KEY" '$public_key | @uri')" ACCOUNT_ID="$( curl -s "$API_BASE_URL/v1/public_key/$ENCODED_PUBLIC_KEY" \ | tee /tmp/fastnear-public-key.json \ | jq -r '.account_ids[0]' )" jq '{account_ids}' /tmp/fastnear-public-key.json curl -s "$API_BASE_URL/v1/account/$ACCOUNT_ID/full" \ | jq '{ account_id, state, token_count: (.tokens | length), nft_count: (.nfts | length), pool_count: (.pools | length) }' ``` **Why this next step?** The public-key lookup tells you which account you are dealing with. The full account snapshot is the natural next read when you want balances, NFTs, staking, and pools in one response. If the key maps to multiple accounts instead of one, move to [V1 Public Key Lookup All](https://docs.fastnear.com/api/v1/public-key-all) or loop through each returned `account_id`. ### Am I locked or liquid? Use this when the user story is “show me whether this wallet is exposed through direct staking pools, liquid staking tokens, or both.” Strategy Compare staking positions and FT balances before you interpret the wallet. 01GET /v1/account/.../staking finds direct pool exposure. 02GET /v1/account/.../ft finds liquid staking tokens that sit beside or instead of direct pools. 03jq turns those two indexed reads into direct_only, liquid_only, or mixed. **Network** - mainnet **Official references** - [Validator staking](https://docs.near.org/concepts/basics/staking) - [Using liquid staking](https://docs.near.org/primitives/liquid-staking) This example is intentionally observational. It classifies what FastNear can see from staking positions and FT balances today. It does not prove every possible synthetic or off-platform staking exposure. **What you're doing** - Read indexed direct staking positions from the account staking endpoint. - Read indexed FT balances from the account FT endpoint. - Classify the account into `direct_only`, `liquid_only`, `mixed`, or `no_visible_staking_position`. - Print the direct pool list and the liquid staking token list that informed the classification. ```bash API_BASE_URL=https://api.fastnear.com ACCOUNT_ID=YOUR_ACCOUNT_ID LIQUID_PROVIDERS_JSON='["meta-pool.near","lst.rhealab.near","linear-protocol.near"]' ``` 1. Fetch the direct staking view. ```bash curl -s "$API_BASE_URL/v1/account/$ACCOUNT_ID/staking" \ | tee /tmp/account-staking.json \ | jq '{account_id, pools}' ``` 2. Fetch fungible token balances so you can detect liquid staking positions. ```bash curl -s "$API_BASE_URL/v1/account/$ACCOUNT_ID/ft" \ | tee /tmp/account-ft.json >/dev/null ``` 3. Classify the account from those two indexed views. ```bash jq -n \ --slurpfile staking /tmp/account-staking.json \ --slurpfile ft /tmp/account-ft.json \ --argjson providers "$LIQUID_PROVIDERS_JSON" ' ($staking[0].pools // []) as $direct_pools | ($ft[0].tokens // []) as $tokens | ($tokens | map(select(.contract_id as $id | $providers | index($id)))) as $liquid_tokens | { classification: if (($direct_pools | length) > 0 and ($liquid_tokens | length) > 0) then "mixed" elif (($direct_pools | length) > 0) then "direct_only" elif (($liquid_tokens | length) > 0) then "liquid_only" else "no_visible_staking_position" end, direct_pools: ($direct_pools | map(.pool_id)), liquid_tokens: ( $liquid_tokens | map({ contract_id, balance, last_update_block_height }) ) }' ``` **Why this next step?** If the classification is `direct_only`, the next operational question is usually about unstake and withdraw timing. If it is `liquid_only`, the next question is usually about redeeming or swapping the liquid token. If it is `mixed`, you should treat those as two separate exit paths rather than assuming one flow covers both. ### Archive a BOS widget version as a provenance NFT Use this when the user story is “this BOS widget is a real on-chain artifact. Mint an NFT that records exactly which version I archived.” Strategy Read the exact widget first, then mint only after the provenance fields are deterministic. 01GET /v1/account/.../nft checks whether the receiver already holds archive NFTs from this collection. 02RPC call_function get on social.near reads the exact widget source and its SocialDB write block. 03Hash the source, mint nft_mint on testnet, then verify the provenance fields through nft_tokens_for_owner. **Networks** - mainnet for reading the widget from `social.near` - testnet for safely minting the provenance NFT on `nft.examples.testnet` **Official references** - [Pre-deployed NFT contract](https://docs.near.org/tutorials/nfts/js/predeployed-contract) - [NEP-171 NFT standard](https://docs.near.org/primitives/nft/standard) - [SocialDB API and contract surface](https://github.com/NearSocial/social-db#api) **What you're doing** - Check whether the receiver already holds NFTs from the archive collection. - Read one exact BOS widget from `social.near`, including its widget-level SocialDB block. - Hash the widget source and turn that into provenance metadata. - Mint a testnet NFT whose metadata records the author, widget path, SocialDB block, and source hash. - Verify that the minted token still carries those provenance fields. Pinned source widget: - author account: `mob.near` - widget path: `mob.near/widget/Profile` - widget-level SocialDB block: `86494825` ```bash API_BASE_URL=https://test.api.fastnear.com MAINNET_RPC_URL=https://rpc.mainnet.fastnear.com TESTNET_RPC_URL=https://rpc.testnet.fastnear.com AUTHOR_ACCOUNT_ID=mob.near WIDGET_NAME=Profile DESTINATION_COLLECTION_ID=nft.examples.testnet RECEIVER_ACCOUNT_ID=YOUR_ACCOUNT_ID.testnet SIGNER_ACCOUNT_ID="$RECEIVER_ACCOUNT_ID" ``` 1. Use FastNear API to see whether the receiver already holds NFTs from the archive collection. ```bash curl -s "$API_BASE_URL/v1/account/$RECEIVER_ACCOUNT_ID/nft" \ | tee /tmp/provenance-account-nfts.json >/dev/null jq --arg destination_collection_id "$DESTINATION_COLLECTION_ID" '{ existing_archive_tokens: [ .tokens[]? | select(.contract_id == $destination_collection_id) | { contract_id, token_id, last_update_block_height } ] }' /tmp/provenance-account-nfts.json ``` 2. Read the exact widget body and widget-level SocialDB block from mainnet. ```bash WIDGET_ARGS_BASE64="$( jq -nc --arg author_account_id "$AUTHOR_ACCOUNT_ID" --arg widget_name "$WIDGET_NAME" '{ keys: [($author_account_id + "/widget/" + $widget_name)], options: {with_block_height: true} }' | base64 | tr -d '\n' )" curl -s "$MAINNET_RPC_URL" \ -H 'content-type: application/json' \ --data "$(jq -nc --arg args_base64 "$WIDGET_ARGS_BASE64" '{ jsonrpc: "2.0", id: "fastnear", method: "query", params: { request_type: "call_function", account_id: "social.near", method_name: "get", args_base64: $args_base64, finality: "final" } }')" \ | jq '.result.result | implode | fromjson' \ | tee /tmp/bos-widget.json >/dev/null jq --arg author_account_id "$AUTHOR_ACCOUNT_ID" --arg widget_name "$WIDGET_NAME" '{ widget_path: ($author_account_id + "/widget/" + $widget_name), socialdb_block_height: .[$author_account_id].widget[$widget_name][":block"], source_preview: ( .[$author_account_id].widget[$widget_name][""] | split("\n")[0:8] ) }' /tmp/bos-widget.json ``` 3. Hash the widget source and build deterministic provenance metadata. ```bash jq -r --arg author_account_id "$AUTHOR_ACCOUNT_ID" --arg widget_name "$WIDGET_NAME" ' .[$author_account_id].widget[$widget_name][""] ' /tmp/bos-widget.json > /tmp/bos-widget-source.jsx WIDGET_BLOCK_HEIGHT="$( jq -r --arg author_account_id "$AUTHOR_ACCOUNT_ID" --arg widget_name "$WIDGET_NAME" ' .[$author_account_id].widget[$widget_name][":block"] ' /tmp/bos-widget.json )" SOURCE_SHA256="$(shasum -a 256 /tmp/bos-widget-source.jsx | awk '{print $1}')" SOURCE_HASH_SHORT="$(printf '%s' "$SOURCE_SHA256" | cut -c1-12)" TOKEN_ID="bos-widget-$SOURCE_HASH_SHORT" PROVENANCE_METADATA_JSON="$( jq -nc \ --arg author_account_id "$AUTHOR_ACCOUNT_ID" \ --arg widget_name "$WIDGET_NAME" \ --arg widget_path "$AUTHOR_ACCOUNT_ID/widget/$WIDGET_NAME" \ --arg block_height "$WIDGET_BLOCK_HEIGHT" \ --arg source_sha256 "$SOURCE_SHA256" '{ title: ("BOS widget archive: " + $widget_path), description: ("Archived from social.near on mainnet at block " + $block_height), copies: 1, extra: ({ author_account_id: $author_account_id, widget_name: $widget_name, widget_path: $widget_path, source_contract_id: "social.near", source_network: "mainnet", socialdb_block_height: ($block_height | tonumber), source_sha256: $source_sha256 } | @json) }' )" printf '%s\n' "$PROVENANCE_METADATA_JSON" | jq '.' ``` 4. Mint the provenance NFT on testnet. ```bash near call "$DESTINATION_COLLECTION_ID" nft_mint "$(jq -nc \ --arg token_id "$TOKEN_ID" \ --arg receiver_id "$RECEIVER_ACCOUNT_ID" \ --argjson metadata "$PROVENANCE_METADATA_JSON" '{ token_id: $token_id, receiver_id: $receiver_id, metadata: $metadata }')" \ --accountId "$SIGNER_ACCOUNT_ID" \ --deposit 0.1 \ --networkId testnet ``` 5. Verify that the minted NFT carries the provenance fields you expect. Poll a few times instead of assuming failure if the token does not appear immediately after the mint transaction returns. ```bash NFT_TOKEN_ARGS_BASE64="$( jq -nc --arg token_id "$TOKEN_ID" '{token_id: $token_id}' \ | base64 | tr -d '\n' )" for attempt in 1 2 3 4 5; do curl -s "$TESTNET_RPC_URL" \ -H 'content-type: application/json' \ --data "$(jq -nc \ --arg account_id "$DESTINATION_COLLECTION_ID" \ --arg args_base64 "$NFT_TOKEN_ARGS_BASE64" '{ jsonrpc: "2.0", id: "fastnear", method: "query", params: { request_type: "call_function", account_id: $account_id, method_name: "nft_token", args_base64: $args_base64, finality: "final" } }')" \ | jq '.result.result | implode | fromjson' \ | tee /tmp/bos-widget-provenance-token.json >/dev/null if jq -e '. != null' /tmp/bos-widget-provenance-token.json >/dev/null; then break fi sleep 1 done jq '{ token_id, owner_id, title: .metadata.title, provenance: (.metadata.extra | fromjson) }' /tmp/bos-widget-provenance-token.json ``` **Why this next step?** FastNear API gives you the quick receiver-side check. Mainnet RPC gives you the exact widget body and SocialDB block. Testnet minting turns that into a durable NFT record. If you later want to prove which historical transaction wrote the widget, hand off to the NEAR Social proof investigations on [Transactions API examples](https://docs.fastnear.com/tx/examples). ## Common jobs ### What does this account actually hold right now? **Start here** - [V1 Full Account View](https://docs.fastnear.com/api/v1/account-full) when you want the fastest readable answer to “what is in this account right now?” **Next page if needed** - [V1 Account FT](https://docs.fastnear.com/api/v1/account-ft), [V1 Account NFT](https://docs.fastnear.com/api/v1/account-nft), or [V1 Account Staking](https://docs.fastnear.com/api/v1/account-staking) if the broad summary is useful but you now want to stay on just one asset family. - [Transactions API account history](https://docs.fastnear.com/tx/account) if the next question becomes “how did this account get here?” instead of “what does it hold?” **Stop when** - The summary already answers the holdings question in one response. **Switch when** - The user asks for exact account state, access-key semantics, or protocol-native fields. Move to [RPC Reference](https://docs.fastnear.com/rpc). - The user asks for activity or execution history rather than current holdings. Move to [Transactions API](https://docs.fastnear.com/tx). ### Resolve a public key to one or more accounts **Start here** - [V1 Public Key Lookup](https://docs.fastnear.com/api/v1/public-key) when you want the primary account match. - [V1 Public Key Lookup All](https://docs.fastnear.com/api/v1/public-key-all) when you need the full set of associated accounts. **Next page if needed** - [V1 Full Account View](https://docs.fastnear.com/api/v1/account-full) after resolution if the user immediately wants balances or holdings for the returned accounts. **Stop when** - You have identified the account or accounts that belong to the key. **Switch when** - The user starts asking about exact access-key permissions, nonces, or current key state. Move to [View Access Key](https://docs.fastnear.com/rpc/account/view-access-key) or [View Access Key List](https://docs.fastnear.com/rpc/account/view-access-key-list). - The user wants recent activity for the resolved accounts rather than just identity resolution. Move to [Transactions API](https://docs.fastnear.com/tx). ### Does this account hold FTs, NFTs, or staking positions? **Start here** - [V1 Account FT](https://docs.fastnear.com/api/v1/account-ft) when the question is just about fungible-token balances. - [V1 Account NFT](https://docs.fastnear.com/api/v1/account-nft) when the question is specifically about NFT holdings. - [V1 Account Staking](https://docs.fastnear.com/api/v1/account-staking) when the question is really about staking positions, not the whole wallet picture. **Next page if needed** - [V1 Full Account View](https://docs.fastnear.com/api/v1/account-full) if the user later wants the whole account picture after starting from one asset family. - [Transactions API account history](https://docs.fastnear.com/tx/account) if the user stops asking “what does this account hold?” and starts asking how it got there. **Stop when** - The asset-specific endpoint already answers the holdings question without making you rebuild the whole account picture. **Switch when** - The indexed view is not enough and the user needs the exact on-chain answer. Move to [RPC Reference](https://docs.fastnear.com/rpc). - The question becomes historical or execution-oriented instead of “what does this account hold now?” Move to [Transactions API](https://docs.fastnear.com/tx). ## 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. - Forgetting that `?network=testnet` works only on compatible pages. ## 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. Many public reads still work without one, but the auth model stays simple when you do need a key: use the same credential everywhere and send it either as a Bearer header or an `apiKey` query parameter. Get a key at [dashboard.fastnear.com](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. - Many public reads still work without a key. - Prefer `Authorization: Bearer ${API_KEY}` for production backends. - Use `?apiKey=${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 ${API_KEY}` | production backends, workers, automations, and proxies | Best default. Keeps credentials out of copied URLs and most URL logs. | | `?apiKey=${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 curl "https://rpc.mainnet.fastnear.com" \ -H "Authorization: Bearer ${API_KEY}" \ -H "Content-Type: application/json" \ --data '{"method":"block","params":{"finality":"final"},"id":1,"jsonrpc":"2.0"}' ``` ## `?apiKey=` query parameter example ```bash curl "https://rpc.mainnet.fastnear.com?apiKey=${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 even when public reads often work without a key. - The docs UI can forward an optional 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 ``` ## 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 plain-language flows 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) ## Worked investigation ### Check one contract key, then follow its history Use this investigation when one contract storage key looks suspicious and you want the latest indexed value, the write history for that same key, and one final `view_state` check. Strategy Start with one exact key, widen only into that key’s history, then finish with one chain-state confirmation. 01get-latest-key gives the newest indexed row for the exact key you care about. 02get-history-key or history-by-key shows how that same key changed over time. 03RPC view_state is the final exact read when you need to compare index history with the chain right now. **Goal** - Explain what this storage key looks like in the index, how it changed, and whether `view_state` agrees right now. | Surface | Endpoint | How we use it | Why we use it | | --- | --- | --- | --- | | Latest indexed value | KV FastData [`get-latest-key`](https://docs.fastnear.com/fastdata/kv/get-latest-key) | Fetch the newest indexed row for the exact key first | Gives the fastest narrow answer before widening into history | | Indexed key history | KV FastData [`get-history-key`](https://docs.fastnear.com/fastdata/kv/get-history-key) or [`history-by-key`](https://docs.fastnear.com/fastdata/kv/history-by-key) | Pull the same key’s change history over time | Shows whether the current value is stable, recent, or part of a suspicious sequence | | Broader write pattern | KV FastData [`latest-by-account`](https://docs.fastnear.com/fastdata/kv/latest-by-account) or [`history-by-predecessor`](https://docs.fastnear.com/fastdata/kv/history-by-predecessor) | Check the account or predecessor if the one key is only part of a larger pattern | Helps explain whether the key changed by itself or as part of a bigger write set | | Exact state check | RPC [`view_state`](https://docs.fastnear.com/rpc/contract/view-state) | Confirm the current on-chain state once the indexed pattern is clear | Separates indexed storage history from the exact state the chain would return now | **What a useful answer should include** - the exact key and contract scope investigated - the latest indexed value and what changed in history - whether `view_state` matched the indexed current value ### Exact key history shell walkthrough Use this when one fully qualified key is already known and you want to move cleanly from “what is the latest indexed row?” to “how did this exact key get here?” **What you're doing** - Read one latest indexed key with the exact contract, predecessor, and key path. - Extract the exact `key` with `jq`. - Reuse that key in `POST /v0/history` to pull the write history for the same key. ```bash KV_BASE_URL=https://kv.main.fastnear.com CURRENT_ACCOUNT_ID=social.near PREDECESSOR_ID=james.near KEY='graph/follow/sleet.near' ENCODED_KEY="$(jq -rn --arg key "$KEY" '$key | @uri')" EXACT_KEY="$( curl -s "$KV_BASE_URL/v0/latest/$CURRENT_ACCOUNT_ID/$PREDECESSOR_ID/$ENCODED_KEY" \ | tee /tmp/kv-latest.json \ | jq -r '.entries[0].key' )" jq '{ latest: ( .entries[0] | { current_account_id, predecessor_id, block_height, key, value } ) }' /tmp/kv-latest.json curl -s "$KV_BASE_URL/v0/history" \ -H 'content-type: application/json' \ --data "$(jq -nc --arg key "$EXACT_KEY" '{key: $key, limit: 10}')" \ | jq '{ page_token, entries: [ .entries[] | { current_account_id, predecessor_id, block_height, value } ] }' ``` **Why this next step?** The first lookup answers “what do we have right now?” Reusing the exact `key` in `POST /v0/history` answers “how did it get here?” If that result is too broad, narrow back down with [GET History by Exact Key](https://docs.fastnear.com/fastdata/kv/get-history-key). ## Common jobs ### Look up one exact key right now **Start here** - [GET Latest by Exact Key](https://docs.fastnear.com/fastdata/kv/get-latest-key) when one fully qualified key is already known. **Next page if needed** - [GET History by Exact Key](https://docs.fastnear.com/fastdata/kv/get-history-key) if the question becomes “how did this key change?” **Stop when** - The latest indexed row already answers the storage question. **Switch when** - The user needs the exact current chain state rather than the index. Move to [View State](https://docs.fastnear.com/rpc/contract/view-state). ### Turn one exact key into a change history **Start here** - [GET History by Exact Key](https://docs.fastnear.com/fastdata/kv/get-history-key) for path-based history lookup. - [History by Key](https://docs.fastnear.com/fastdata/kv/history-by-key) when the fully qualified key route is the better fit. **Next page if needed** - Revisit [GET Latest by Exact Key](https://docs.fastnear.com/fastdata/kv/get-latest-key) if you want the current indexed value alongside the history. **Stop when** - You can explain how the key changed over time. **Switch when** - The user asks whether the latest indexed value matches the chain right now. ### Trace writes from one predecessor **Start here** - [All by Predecessor](https://docs.fastnear.com/fastdata/kv/all-by-predecessor) for latest rows across contracts touched by one predecessor. - [History by Predecessor](https://docs.fastnear.com/fastdata/kv/history-by-predecessor) when you need the write history over time. **Next page if needed** - Narrow to an exact key if one row becomes the real focus. **Stop when** - You can answer what this predecessor changed and where. **Switch when** - The user stops asking about indexed writes and starts asking about the current chain state. ### Batch-check several known keys **Start here** - [Multi Lookup](https://docs.fastnear.com/fastdata/kv/multi) when you already know a fixed set of fully qualified keys. **Next page if needed** - Move one interesting key to [GET History by Exact Key](https://docs.fastnear.com/fastdata/kv/get-history-key) if the batch result raises a historical question. **Stop when** - The batch response already answers which of the keys matter. **Switch when** - You no longer have a fixed key list and need to inspect the contract or predecessor more broadly. ## 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 near-realtime and block-family surface. Use it when you want fresh block slices, redirect helpers, or recent finalized and optimistic block reads without presenting it as a streaming product. ## 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. - Block-family helpers and redirect flows. - Lightweight freshness checks and monitoring paths. ## 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 - [Optimistic block](https://docs.fastnear.com/neardata/block-optimistic) for freshest block polling. - [Final block by height](https://docs.fastnear.com/neardata/block) and [Block headers](https://docs.fastnear.com/neardata/block-headers) for finalized block-family queries. - [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 helper redirects. ## Need a workflow? Use [NEAR Data API Examples](https://docs.fastnear.com/neardata/examples) for plain-language flows like optimistic polling, finalized confirmation, redirect helpers, and escalation into canonical RPC 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) ## Worked investigation ### Catch a new block early, then confirm it after finality Use this investigation when you want to notice a new block as early as possible, but the final answer still needs a finalized block and sometimes an exact RPC read. Strategy Let NEAR Data tell you something changed, then reuse the same block family for the stable confirmation. 01block-optimistic or last-block-optimistic gives the earliest useful signal. 02block or last-block-final confirms whether the same observation survived into finalized history. 03RPC block is only the last step, once you know the exact height or hash that matters. **Goal** - Notice a recent block quickly, then check the same thing again once finality catches up. | Surface | Endpoint | How we use it | Why we use it | | --- | --- | --- | --- | | Fastest detection | NEAR Data [`block-optimistic`](https://docs.fastnear.com/neardata/block-optimistic) | Poll optimistic block reads to notice a new block-family change as early as possible | Gives the earliest useful signal before finalized confirmation exists | | Latest optimistic helper | NEAR Data [`last-block-optimistic`](https://docs.fastnear.com/neardata/last-block-optimistic) | Use the redirect helper when the client should always follow the newest optimistic target | Keeps the polling client simple when “latest” matters more than explicit heights | | Stable confirmation | NEAR Data [`block`](https://docs.fastnear.com/neardata/block) or [`last-block-final`](https://docs.fastnear.com/neardata/last-block-final) | Re-check the same block family once finality catches up | Confirms that the observed optimistic change survived into finalized history | | Light block summary | NEAR Data [`block-headers`](https://docs.fastnear.com/neardata/block-headers) | Read header-level data if only timing or progression is needed | Avoids wider block payloads when header-level confirmation is enough | | Exact RPC follow-up | RPC [Block by ID](https://docs.fastnear.com/rpc/block/block-by-id) or [Block by Height](https://docs.fastnear.com/rpc/block/block-by-height) | Fetch the exact block once you know which one matters | This is the point where RPC becomes useful if you need the protocol's own block object | **What a useful answer should include** - which optimistic observation first triggered the investigation - when the same observation became finalized - whether the exact RPC block changed the interpretation ### Finalized block follow-up shell walkthrough Use this when you want the helper route to pick the latest finalized block for you, but you still want to confirm the exact block in RPC. **What you're doing** - Inspect the redirect returned by `GET /v0/last_block/final`. - Fetch the resolved block document. - Extract `block.header.height` with `jq`. - Reuse that height in RPC `block` by height. ```bash NEARDATA_BASE_URL=https://mainnet.neardata.xyz RPC_URL=https://rpc.mainnet.fastnear.com FINAL_LOCATION="$( curl -s -D - -o /dev/null "$NEARDATA_BASE_URL/v0/last_block/final" \ | awk 'tolower($1) == "location:" {print $2}' \ | tr -d '\r' )" printf 'Redirect target: %s\n' "$FINAL_LOCATION" curl -s "$NEARDATA_BASE_URL$FINAL_LOCATION" \ | tee /tmp/neardata-final-block.json \ | jq '{height: .block.header.height, hash: .block.header.hash}' BLOCK_HEIGHT="$(jq -r '.block.header.height' /tmp/neardata-final-block.json)" curl -s "$RPC_URL" \ -H 'content-type: application/json' \ --data "$(jq -nc --arg block_height "$BLOCK_HEIGHT" '{ jsonrpc: "2.0", id: "fastnear", method: "block", params: { block_id: ($block_height | tonumber) } }')" \ | jq '{height: .result.header.height, hash: .result.header.hash, chunks: (.result.chunks | length)}' ``` **Why this next step?** The redirect helper is the easiest way to poll for “latest finalized.” Once it gives you a concrete block height, RPC is the natural next read if you want the exact block object the protocol would return. ## Common jobs ### Monitor the optimistic head **Start here** - [Optimistic block](https://docs.fastnear.com/neardata/block-optimistic) for the freshest block-family read. **Next page if needed** - [Last optimistic block redirect](https://docs.fastnear.com/neardata/last-block-optimistic) if your client wants a helper route that always points at the newest optimistic block. **Stop when** - You can report the latest optimistic head or detect freshness drift. **Switch when** - The user needs finalized stability instead of maximum freshness. Move to [Final block by height](https://docs.fastnear.com/neardata/block) or [Last final block redirect](https://docs.fastnear.com/neardata/last-block-final). ### Track finalized block progress safely **Start here** - [Final block by height](https://docs.fastnear.com/neardata/block) when you already know the height you want to confirm. - [Block headers](https://docs.fastnear.com/neardata/block-headers) when header-level polling is enough. **Next page if needed** - [Last final block redirect](https://docs.fastnear.com/neardata/last-block-final) when the client should follow the newest finalized block without computing the height first. **Stop when** - You can show finalized progress without pulling in deeper protocol detail. **Switch when** - The user needs exact block fields or transaction semantics. Move to [RPC Reference](https://docs.fastnear.com/rpc). ### Use redirect helpers in a polling client **Start here** - [Last final block redirect](https://docs.fastnear.com/neardata/last-block-final) or [Last optimistic block redirect](https://docs.fastnear.com/neardata/last-block-optimistic) depending on the freshness requirement. **Next page if needed** - Follow the block URL returned by the helper and keep reading from there. **Stop when** - The client can reliably follow the helper route and consume the final block resource. **Switch when** - Redirect behavior itself becomes a problem for the client. Move to the direct block routes instead. ### Move from recent block polling to exact RPC inspection **Start here** - Use the relevant NEAR Data block route to find the recent block or block-family event of interest. **Next page if needed** - [Block by Height](https://docs.fastnear.com/rpc/block/block-by-height), [Block by ID](https://docs.fastnear.com/rpc/block/block-by-id), or another RPC method once you know the exact block or follow-up object you need. **Stop when** - You can clearly name the recent block that deserves RPC follow-up. **Switch when** - The user asks for the exact protocol structure, not just recent block polling. ## Common mistakes - Treating NEAR Data like a push stream instead of a polling API. - Starting with RPC when the real need is a recent block monitor. - Forgetting that redirect helpers may return `401` before redirecting if the key is invalid, or may be awkward for some HTTP clients. - Staying on NEAR Data when the user has already asked for exact protocol-native block details. ## Related guides - [NEAR Data API](https://docs.fastnear.com/neardata) - [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) --- ## 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 plain-language flows 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 Use this page when you already know the answer lives in RPC and you want the shortest path to it. The goal is not to memorize every method. It is to start with the right RPC read or write, stop as soon as the response answers the question, and only switch to a higher-level API when that would save time. ## Transaction Submission and Tracking Start here when the real question is not just “how do I send this?” but “which RPC endpoint should I use, and how do I track the transaction all the way to done?” ### Submit a transaction, then track it from hash to final execution Use this when the user story is simple: “I have a signed transaction. Which endpoint do I call first, and what should I poll after I get the hash?” Not every tx question wants the same RPC method. The practical pattern is to submit fast, then track deliberately. This walkthrough is intentionally pinned and historical. It uses one real mainnet transaction that wrote a NEAR Social follow edge: - transaction hash: `FLLmTvFx9vCof79scy2uUviF5WwYmevkz9TZ8azPGVQb` - signer: `mike.near` - receiver: `social.near` - included block height: `79574923` - receipt execution block for the SocialDB write: `79574924` Because this transaction is already old and finalized, you cannot literally replay its true pending window. That is fine. The point here is to teach the right submission and tracking pattern, then inspect one pinned transaction with the same tools. Strategy Submit fast, poll the simpler status path first, and only drop into the receipt tree when the headline status stops being enough. 01RPC broadcast_tx_async is the low-latency submission surface when your client will track separately. 02RPC tx is the default polling surface for included, optimistic, and final guarantees. 03RPC EXPERIMENTAL_tx_status is the deeper follow-up when you need the receipt tree, not the default loop. **What you're deciding** - which submission endpoint to reach for first - what to poll after you have a tx hash - how `wait_until` thresholds relate to included, optimistic, and final guarantees - when to stop using `tx` and switch to `EXPERIMENTAL_tx_status` ```mermaid flowchart LR S["Sign transaction"] --> A["broadcast_tx_async
returns tx hash"] A --> T["tx polling
INCLUDED_FINAL -> FINAL"] T --> F["Transaction fully done"] T -. "only when needed" .-> E["EXPERIMENTAL_tx_status
receipt tree + outcomes"] F -. "optional readable story" .-> X["POST /v0/transactions"] ``` | Method | Use it when | What comes back | Position here | | --- | --- | --- | --- | | [`broadcast_tx_async`](https://docs.fastnear.com/rpc/transaction/broadcast-tx-async) | your client wants to own tracking after submission | just the tx hash | **default submit path** | | [`send_tx`](https://docs.fastnear.com/rpc/transaction/send-tx) | you want the node to wait to a chosen threshold for you | tx result up to `wait_until` | blocking alternative | | [`broadcast_tx_commit`](https://docs.fastnear.com/rpc/transaction/broadcast-tx-commit) | older code or quick one-call confirmation is the point | execution result with commit-style waiting | legacy convenience | | [`tx`](https://docs.fastnear.com/rpc/transaction/tx-status) | you already have the tx hash and want to know how far it got | status plus outcomes at the threshold you asked for | **default tracking path** | | [`EXPERIMENTAL_tx_status`](https://docs.fastnear.com/rpc/transaction/experimental-tx-status) | you need receipt-tree detail or a richer async story | full receipt tree and detailed outcomes | deep follow-up only | **Status and wait map** `wait_until` values are waiting thresholds, not a permanent lifecycle enum you should treat as the user's one true transaction status. The word `pending` is still useful in human conversation, but here it means “the transaction has been submitted and is not yet included.” | Phase or threshold | What it means in practice | Best RPC surface | | --- | --- | --- | | pre-inclusion / pending | the client has submitted the tx, but it is not yet anchored in a block | your own submission state plus retry/backoff logic | | `INCLUDED` | the tx is in a block, but that block may not be final yet | `tx` | | `INCLUDED_FINAL` | the inclusion block is final | `tx` | | `EXECUTED_OPTIMISTIC` | execution has happened with optimistic finality | `tx` or `send_tx` | | `FINAL` | all relevant execution has completed and finalized | `tx` by default, `EXPERIMENTAL_tx_status` when you need more detail | The key practical distinction is simple: - use `broadcast_tx_async` when the tx hash is enough to keep going - use `tx` as the normal tracking loop - use `EXPERIMENTAL_tx_status` when the next question is about the receipt tree rather than the headline status **What you're doing** - Show what a live submission would look like with `broadcast_tx_async`. - Poll the pinned tx with `tx` at two thresholds: `INCLUDED_FINAL` and `FINAL`. - Only after that inspect the same tx with `EXPERIMENTAL_tx_status`. - Optionally pivot to Transactions API if the human-readable story is what matters next. ```bash RPC_URL=https://rpc.mainnet.fastnear.com TX_BASE_URL=https://tx.main.fastnear.com TX_HASH=FLLmTvFx9vCof79scy2uUviF5WwYmevkz9TZ8azPGVQb SIGNER_ACCOUNT_ID=mike.near RECEIVER_ID=social.near ``` 1. If this were a live client flow, submit with `broadcast_tx_async` and keep the returned hash. ```bash curl -s "$RPC_URL" \ -H 'content-type: application/json' \ --data '{ "jsonrpc": "2.0", "id": "fastnear", "method": "broadcast_tx_async", "params": ["BASE64_SIGNED_TX"] }' \ | jq . ``` In a real app, that response is the moment you stop waiting on submission and start tracking by tx hash. 2. Poll with `tx` at the first threshold that answers the user question. ```bash curl -s "$RPC_URL" \ -H 'content-type: application/json' \ --data "$(jq -nc \ --arg tx_hash "$TX_HASH" \ --arg signer_account_id "$SIGNER_ACCOUNT_ID" '{ jsonrpc: "2.0", id: "fastnear", method: "tx", params: { tx_hash: $tx_hash, sender_account_id: $signer_account_id, wait_until: "INCLUDED_FINAL" } }')" \ | jq '{ final_execution_status: .result.final_execution_status, status: .result.status, transaction_handoff: .result.transaction_outcome.outcome.status }' ``` What to notice: - on a live tx, this threshold is useful when you care that the tx is safely included before you claim success to the user - on this historical tx, it returns immediately because the transaction is long past inclusion - `transaction_outcome.outcome.status` still tells you that the original action handed off into receipt execution 3. Poll again with `FINAL` when you want the completed transaction story rather than just safe inclusion. ```bash curl -s "$RPC_URL" \ -H 'content-type: application/json' \ --data "$(jq -nc \ --arg tx_hash "$TX_HASH" \ --arg signer_account_id "$SIGNER_ACCOUNT_ID" '{ jsonrpc: "2.0", id: "fastnear", method: "tx", params: { tx_hash: $tx_hash, sender_account_id: $signer_account_id, wait_until: "FINAL" } }')" \ | jq '{ final_execution_status: .result.final_execution_status, status: .result.status, receipts_outcome_count: (.result.receipts_outcome | length) }' ``` What to notice: - for a historical tx, this call also returns immediately - in a real tracking loop, this is the threshold that answers “is the transaction actually done?” - for many apps, this is where you stop and move on 4. Only switch to `EXPERIMENTAL_tx_status` when you need the richer receipt tree. ```bash curl -s "$RPC_URL" \ -H 'content-type: application/json' \ --data "$(jq -nc \ --arg tx_hash "$TX_HASH" \ --arg signer_account_id "$SIGNER_ACCOUNT_ID" '{ jsonrpc: "2.0", id: "fastnear", method: "EXPERIMENTAL_tx_status", params: { tx_hash: $tx_hash, sender_account_id: $signer_account_id, wait_until: "FINAL" } }')" \ | jq '{ final_execution_status: .result.final_execution_status, status: .result.status, transaction_handoff: .result.transaction_outcome.outcome.status, receipts_outcome_count: (.result.receipts_outcome | length) }' ``` This is where you go when “did it finish?” turns into “show me the receipt tree and the full async execution story.” 5. Optional: pivot to Transactions API only when you want the readable story surface. ```bash curl -s "$TX_BASE_URL/v0/transactions" \ -H 'content-type: application/json' \ --data "$(jq -nc --arg tx_hash "$TX_HASH" '{tx_hashes: [$tx_hash]}')" \ | jq '{ 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 }, actions: ( .transactions[0].transaction.actions | map(if type == "string" then . else keys[0] end) ), transaction_handoff: .transactions[0].transaction_outcome.outcome.status }' ``` That last step is intentionally optional. The RPC truth is already enough for submission and tracking. This is only the human-readable story surface when the next user question becomes “what actually happened?” instead of “how far did the tx get?” **Recommended pattern** - Use `broadcast_tx_async` plus `tx` polling when you want the best client control and the fastest feedback. - Use `send_tx` when you really do want one blocking call to wait up to a chosen threshold. - Use `EXPERIMENTAL_tx_status` when the normal polling loop stops being enough and the receipt tree becomes the real question. ## Account and Key Mechanics Start here when the question is about exact permissions, exact key state, or one contract-level write flow. ### Audit and remove old Near Social function-call keys Use this when you know an account has accumulated older `social.near` function-call keys and you want to inspect them, choose one intentionally, and remove it with raw RPC submission. Strategy Use exact key reads to narrow the target first, then sign exactly one delete. 01RPC view_access_key_list finds only the function-call keys scoped to social.near. 02RPC view_access_key double-checks the one key you plan to remove, and POST /v0/account is only for optional account-level context. 03RPC send_tx submits the DeleteKey, then RPC view_access_key_list closes the loop. **What you're doing** - Use RPC itself to list every access key on the account. - Narrow that list to function-call keys scoped to `social.near`. - Inspect one candidate key exactly before you delete it. - Build and sign a `DeleteKey` transaction with a full-access key, then submit it through RPC and verify the key is gone. Two caveats matter up front: - The deleting key must be a full-access key. A function-call key cannot sign a `DeleteKey` action. - This flow is about exact key state and cleanup. The optional Transactions API step below gives account-level context, not authoritative per-key “last used” forensics. ```bash export NETWORK_ID=mainnet export RPC_URL=https://rpc.mainnet.fastnear.com export TX_BASE_URL=https://tx.main.fastnear.com export ACCOUNT_ID=YOUR_ACCOUNT_ID export SOCIAL_RECEIVER_ID=social.near export DELETE_PUBLIC_KEY='ed25519:PASTE_THE_KEY_YOU_PLAN_TO_REMOVE' export FULL_ACCESS_PUBLIC_KEY='ed25519:PASTE_THE_FULL_ACCESS_PUBLIC_KEY_YOU_WILL_SIGN_WITH' export FULL_ACCESS_PRIVATE_KEY='ed25519:PASTE_THE_MATCHING_FULL_ACCESS_PRIVATE_KEY' ``` 1. List all access keys on the account, then narrow to `social.near` function-call keys. ```bash curl -s "$RPC_URL" \ -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" } }')" \ | tee /tmp/fastnear-access-keys.json >/dev/null jq -r --arg receiver "$SOCIAL_RECEIVER_ID" ' .result.keys[] | select((.access_key.permission | type) == "object") | select(.access_key.permission.FunctionCall.receiver_id == $receiver) | { public_key, nonce: .access_key.nonce, receiver_id: .access_key.permission.FunctionCall.receiver_id, method_names: .access_key.permission.FunctionCall.method_names, allowance: (.access_key.permission.FunctionCall.allowance // "unlimited") } ' /tmp/fastnear-access-keys.json ``` Pick one `public_key` from that filtered list and set `DELETE_PUBLIC_KEY` to it. 2. Inspect the specific candidate key one more time before deleting it. ```bash curl -s "$RPC_URL" \ -H 'content-type: application/json' \ --data "$(jq -nc \ --arg account_id "$ACCOUNT_ID" \ --arg public_key "$DELETE_PUBLIC_KEY" '{ jsonrpc: "2.0", id: "fastnear", method: "query", params: { request_type: "view_access_key", account_id: $account_id, public_key: $public_key, finality: "final" } }')" \ | jq '{nonce: .result.nonce, permission: .result.permission}' ``` 3. Optional: pull recent function-call activity for the account to decide whether you want to investigate more before cleanup. ```bash curl -s "$TX_BASE_URL/v0/account" \ -H 'content-type: application/json' \ --data "$(jq -nc --arg account_id "$ACCOUNT_ID" '{ account_id: $account_id, is_function_call: true, limit: 10 }')" \ | jq '{ account_txs: [ .account_txs[] | { transaction_hash, tx_block_height, is_success } ] }' ``` That query helps answer “has this account still been doing function-call work recently?”, but it does not prove that a specific access key was the one used. 4. Sign a `DeleteKey` transaction for `DELETE_PUBLIC_KEY` with a full-access key. Run this in a directory where `near-api-js@5` is installed. The command reads the environment variables above, fetches the latest nonce for `FULL_ACCESS_PUBLIC_KEY`, fetches a fresh final block hash, signs a `DeleteKey` action, and stores the resulting `signed_tx_base64` in `SIGNED_TX_BASE64`. ```bash SIGNED_TX_BASE64="$( node --input-type=module <<'EOF' const { ACCOUNT_ID, NETWORK_ID = 'mainnet', RPC_URL = 'https://rpc.mainnet.fastnear.com', DELETE_PUBLIC_KEY, FULL_ACCESS_PUBLIC_KEY, FULL_ACCESS_PRIVATE_KEY, } = process.env; for (const name of [ 'ACCOUNT_ID', 'DELETE_PUBLIC_KEY', 'FULL_ACCESS_PUBLIC_KEY', 'FULL_ACCESS_PRIVATE_KEY', ]) { if (!process.env[name]) { throw new Error(`Missing ${name}`); } } async function rpc(method, params) { const response = await fetch(RPC_URL, { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ jsonrpc: '2.0', id: 'fastnear', method, params, }), }); const json = await response.json(); if (json.error) { throw new Error(JSON.stringify(json.error)); } return json.result; } const keyPair = KeyPair.fromString(FULL_ACCESS_PRIVATE_KEY); const derivedPublicKey = keyPair.getPublicKey().toString(); if (derivedPublicKey !== FULL_ACCESS_PUBLIC_KEY) { throw new Error( `FULL_ACCESS_PUBLIC_KEY does not match FULL_ACCESS_PRIVATE_KEY (${derivedPublicKey})` ); } const signer = await InMemorySigner.fromKeyPair(NETWORK_ID, ACCOUNT_ID, keyPair); const accessKey = await rpc('query', { request_type: 'view_access_key', account_id: ACCOUNT_ID, public_key: FULL_ACCESS_PUBLIC_KEY, finality: 'final', }); const block = await rpc('block', { finality: 'final' }); const transaction = transactions.createTransaction( ACCOUNT_ID, utils.PublicKey.fromString(FULL_ACCESS_PUBLIC_KEY), ACCOUNT_ID, BigInt(accessKey.nonce) + 1n, [transactions.deleteKey(utils.PublicKey.fromString(DELETE_PUBLIC_KEY))], utils.serialize.base_decode(block.header.hash) ); const [, signedTx] = await transactions.signTransaction( transaction, signer, ACCOUNT_ID, NETWORK_ID ); process.stdout.write(Buffer.from(signedTx.encode()).toString('base64')); EOF )" ``` 5. Submit the signed transaction through raw RPC and wait for `FINAL`. ```bash curl -s "$RPC_URL" \ -H 'content-type: application/json' \ --data "$(jq -nc --arg signed_tx_base64 "$SIGNED_TX_BASE64" '{ jsonrpc: "2.0", id: "fastnear", method: "send_tx", params: { signed_tx_base64: $signed_tx_base64, wait_until: "FINAL" } }')" \ | jq '{ final_execution_status: .result.final_execution_status, transaction_hash: .result.transaction.hash, status: .result.status }' ``` 6. Re-run the access-key list and verify that the deleted key is gone. ```bash if curl -s "$RPC_URL" \ -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 -e --arg public_key "$DELETE_PUBLIC_KEY" ' .result.keys[] | select(.public_key == $public_key) ' >/dev/null; then echo "Key is still present: $DELETE_PUBLIC_KEY" else echo "Key deleted: $DELETE_PUBLIC_KEY" fi ``` **Why this next step?** Re-running `view_access_key_list` closes the loop on the same RPC method you used for discovery. If the delete succeeded there, you do not need an indexed API to prove the cleanup. ### Which transaction added this `social.near` function-call key, and who authorized it? Use this when you can already see a live access key on the account, but you want to trace it back to the `AddKey` transaction that created it and identify which public key actually authorized that change. Strategy Start from the live key, then walk backward only as far as you need. 01RPC view_access_key gives the current stored nonce, which is the best historical clue you have. 02POST /v0/account turns that nonce into a tight candidate window instead of a whole-account search. 03POST /v0/transactions tells you whether the key was added directly or through delegated authorization, and POST /v0/receipt is only for the exact AddKey execution block. **What you're doing** - Read the exact key first with RPC and keep its current nonce as the clue. - Convert that nonce into a tight block-height window for the likely `AddKey` receipt. - Search account history only inside that window instead of scanning the whole account. - Hydrate the candidate transaction and distinguish three different keys: - the key that got added - the top-level signer public key - the delegated authorizing public key, if the change was wrapped in a `Delegate` action Three nonce details matter up front: - New access keys start with a nonce derived from block height at roughly `block_height * 1_000_000`, so dividing the current nonce by `1_000_000` gives a useful search window. - The `AddKey` action payload often shows `access_key.nonce: 0`. That is not the stored nonce you later see from `view_access_key`. - If the key has been used heavily since creation, widen the search window a bit more. ```bash export NETWORK_ID=mainnet export RPC_URL=https://rpc.mainnet.fastnear.com export TX_BASE_URL=https://tx.main.fastnear.com export ACCOUNT_ID=YOUR_ACCOUNT_ID export TARGET_PUBLIC_KEY='ed25519:PASTE_THE_ACCESS_KEY_YOU_WANT_TO_TRACE' # Sample live key observed on April 18, 2026: # export ACCOUNT_ID=mike.near # export TARGET_PUBLIC_KEY='ed25519:7GZgXkMPEyGXqRhxaLvHxWn6fVfeyuQGMqnLVQAh7bs' ``` 1. Read the exact key first, then turn its current nonce into a search window. ```bash curl -s "$RPC_URL" \ -H 'content-type: application/json' \ --data "$(jq -nc \ --arg account_id "$ACCOUNT_ID" \ --arg public_key "$TARGET_PUBLIC_KEY" '{ jsonrpc: "2.0", id: "fastnear", method: "query", params: { request_type: "view_access_key", account_id: $account_id, public_key: $public_key, finality: "final" } }')" \ | tee /tmp/key-origin-view.json >/dev/null CURRENT_NONCE="$(jq -r '.result.nonce' /tmp/key-origin-view.json)" ESTIMATED_RECEIPT_BLOCK="$(( CURRENT_NONCE / 1000000 + 1 ))" SEARCH_FROM="$(( ESTIMATED_RECEIPT_BLOCK - 20 ))" SEARCH_TO="$(( ESTIMATED_RECEIPT_BLOCK + 5 ))" jq -n \ --arg account_id "$ACCOUNT_ID" \ --arg target_public_key "$TARGET_PUBLIC_KEY" \ --argjson current_nonce "$CURRENT_NONCE" \ --argjson estimated_receipt_block "$ESTIMATED_RECEIPT_BLOCK" \ --argjson search_from "$SEARCH_FROM" \ --argjson search_to "$SEARCH_TO" \ --arg permission "$(jq -c '.result.permission' /tmp/key-origin-view.json)" '{ account_id: $account_id, target_public_key: $target_public_key, current_nonce: $current_nonce, estimated_receipt_block: $estimated_receipt_block, search_from_tx_block_height: $search_from, search_to_tx_block_height: $search_to, permission: ($permission | fromjson) }' ``` If you use the sample key above, the estimated receipt block should land at `112057392`. 2. Search account history only inside that block neighborhood. ```bash curl -s "$TX_BASE_URL/v0/account" \ -H 'content-type: application/json' \ --data "$(jq -nc \ --arg account_id "$ACCOUNT_ID" \ --argjson from_tx_block_height "$SEARCH_FROM" \ --argjson to_tx_block_height "$SEARCH_TO" '{ account_id: $account_id, is_real_signer: true, from_tx_block_height: $from_tx_block_height, to_tx_block_height: $to_tx_block_height, desc: false, limit: 50 }')" \ | tee /tmp/key-origin-candidates.json >/dev/null jq '{ txs_count, candidate_txs: [ .account_txs[] | { transaction_hash, tx_block_height, is_signer, is_real_signer, is_predecessor, is_receiver } ] }' /tmp/key-origin-candidates.json ``` With the sample `mike.near` key above, this window returns one candidate transaction: `6ZT8UGPRC6L3NGs2qHnECPVexKWNQ5LWLK9w95tgj3tV` at outer tx block `112057390`. 3. Hydrate those candidates and keep only the transaction that actually added your target key. ```bash TX_HASHES_JSON="$( jq -c '[.account_txs[].transaction_hash]' /tmp/key-origin-candidates.json )" curl -s "$TX_BASE_URL/v0/transactions" \ -H 'content-type: application/json' \ --data "$(jq -nc --argjson tx_hashes "$TX_HASHES_JSON" '{tx_hashes: $tx_hashes}')" \ | tee /tmp/key-origin-transactions.json >/dev/null jq --arg target_public_key "$TARGET_PUBLIC_KEY" ' .transactions[] | . as $tx | ( ($tx.transaction.actions[]? | .AddKey? | select(.public_key == $target_public_key) | { authorization_mode: "direct", top_level_signer_id: $tx.transaction.signer_id, top_level_signer_public_key: $tx.transaction.public_key, authorizing_public_key: $tx.transaction.public_key, added_public_key: .public_key, add_key_payload_nonce: .access_key.nonce, permission: .access_key.permission }), ($tx.transaction.actions[]? | .Delegate? | .delegate_action as $delegate | $delegate.actions[]? | .AddKey? | select(.public_key == $target_public_key) | { authorization_mode: "delegated", top_level_signer_id: $tx.transaction.signer_id, top_level_signer_public_key: $tx.transaction.public_key, authorizing_public_key: $delegate.public_key, added_public_key: .public_key, add_key_payload_nonce: .access_key.nonce, permission: .access_key.permission }) ) | { transaction_hash: $tx.transaction.hash, tx_block_height: $tx.execution_outcome.block_height, tx_block_hash: $tx.execution_outcome.block_hash, receiver_id: $tx.transaction.receiver_id } + . ' /tmp/key-origin-transactions.json | tee /tmp/key-origin-match.json ``` If `authorization_mode` is `direct`, the top-level signer public key and the authorizing public key are the same. If `authorization_mode` is `delegated`, the key that actually authorized the `AddKey` lives inside `Delegate.delegate_action.public_key`. With the sample `mike.near` key above, the match is delegated: - `transaction_hash`: `6ZT8UGPRC6L3NGs2qHnECPVexKWNQ5LWLK9w95tgj3tV` - `top_level_signer_public_key`: `ed25519:Ez817Dgs2uYP5a6GoijzFarcS3SWPT5eEB82VJXsd4oM` - `authorizing_public_key`: `ed25519:GaYgzN1eZUgwA7t8a5pYxFGqtF4kon9dQaDMjPDejsiu` - `added_public_key`: `ed25519:7GZgXkMPEyGXqRhxaLvHxWn6fVfeyuQGMqnLVQAh7bs` 4. Optional: if you need the exact `AddKey` receipt block too, pivot one more time by receipt ID. ```bash ADD_KEY_RECEIPT_ID="$( jq -r --arg target_public_key "$TARGET_PUBLIC_KEY" ' .transactions[] | .receipts[] | select(any((.receipt.receipt.Action.actions // [])[]; .AddKey.public_key? == $target_public_key)) | .receipt.receipt_id ' /tmp/key-origin-transactions.json | head -n 1 )" curl -s "$TX_BASE_URL/v0/receipt" \ -H 'content-type: application/json' \ --data "$(jq -nc --arg receipt_id "$ADD_KEY_RECEIPT_ID" '{receipt_id: $receipt_id}')" \ | jq '{ receipt_id: .receipt.receipt_id, receipt_block_height: .receipt.block_height, tx_block_height: .receipt.tx_block_height, predecessor_id: .receipt.predecessor_id, receiver_id: .receipt.receiver_id, transaction_hash: .receipt.transaction_hash }' ``` For the sample key above, the exact `AddKey` receipt is `C5jsTftYwPiibyxdoDKd4LXFFru8n4weDKLV4cfb1bcX` in receipt block `112057392`, while the outer transaction landed earlier in block `112057390`. **Why this next step?** Start with exact current key state because it gives you the nonce clue. A tight `/v0/account` window turns that clue into a small candidate set. `/v0/transactions` tells you whether the key was added directly or through delegated authorization. `/v0/receipt` is the optional last step when you need the exact `AddKey` receipt block, not just the outer transaction. ### Register FT storage if needed, then transfer tokens Use this when the user story is “send fungible tokens safely, but first prove whether the receiver is already registered for storage on that FT contract.” Strategy Read storage first, then spend the minimum write calls needed to make the transfer stick. 01RPC call_function storage_balance_of tells you whether the receiver is already registered. 02RPC call_function storage_balance_bounds only matters if you need the exact minimum deposit before writing. 03RPC send_tx submits storage_deposit and ft_transfer, then RPC call_function ft_balance_of proves the result. **Network** - testnet **Official references** - [FT storage and transfer](https://docs.near.org/integrations/fungible-tokens) - [Pre-deployed FT contract](https://docs.near.org/tutorials/fts/predeployed-contract) This walkthrough uses the safe public contract `ft.predeployed.examples.testnet`. Before you start, make sure the sender already holds some `gtNEAR` there. If not, mint a small balance first with the pre-deployed contract guide above and then come back to this flow. **What you're doing** - Use exact RPC view calls to check whether the receiver already has FT storage on the contract. - If needed, fetch the minimum storage requirement. - Sign and submit `storage_deposit`, then `ft_transfer`. - Verify the receiver balance with the same contract’s own view method. ```bash export NETWORK_ID=testnet export RPC_URL=https://rpc.testnet.fastnear.com export TOKEN_CONTRACT_ID=ft.predeployed.examples.testnet export SENDER_ACCOUNT_ID=YOUR_ACCOUNT_ID.testnet export RECEIVER_ACCOUNT_ID=YOUR_RECEIVER_ID.testnet export SENDER_PUBLIC_KEY='ed25519:YOUR_FULL_ACCESS_PUBLIC_KEY' export SENDER_PRIVATE_KEY='ed25519:YOUR_MATCHING_PRIVATE_KEY' export AMOUNT_YOCTO_GTNEAR='10000000000000000000000' ``` 1. Check whether the receiver is already registered on the FT contract. ```bash STORAGE_BALANCE_ARGS_BASE64="$( jq -nc --arg account_id "$RECEIVER_ACCOUNT_ID" '{ account_id: $account_id }' | base64 | tr -d '\n' )" curl -s "$RPC_URL" \ -H 'content-type: application/json' \ --data "$(jq -nc \ --arg account_id "$TOKEN_CONTRACT_ID" \ --arg args_base64 "$STORAGE_BALANCE_ARGS_BASE64" '{ jsonrpc: "2.0", id: "fastnear", method: "query", params: { request_type: "call_function", account_id: $account_id, method_name: "storage_balance_of", args_base64: $args_base64, finality: "final" } }')" \ | tee /tmp/ft-storage-balance.json >/dev/null jq '{ registered: ((.result.result | implode | fromjson) != null), storage_balance: (.result.result | implode | fromjson) }' /tmp/ft-storage-balance.json ``` 2. If the receiver is not registered yet, fetch the minimum storage deposit. ```bash MIN_STORAGE_YOCTO="$( curl -s "$RPC_URL" \ -H 'content-type: application/json' \ --data "$(jq -nc --arg account_id "$TOKEN_CONTRACT_ID" '{ jsonrpc: "2.0", id: "fastnear", method: "query", params: { request_type: "call_function", account_id: $account_id, method_name: "storage_balance_bounds", args_base64: "e30=", finality: "final" } }')" \ | tee /tmp/ft-storage-bounds.json \ | jq -r '.result.result | implode | fromjson | .min' )" printf 'Minimum storage deposit: %s yoctoNEAR\n' "$MIN_STORAGE_YOCTO" ``` 3. Define one reusable signer for contract function calls. Run this in a directory where `near-api-js@5` is installed. The function below reads the exported shell variables above and turns each function call into a signed payload for raw RPC submission. ```bash sign_function_call() { METHOD_NAME="$1" \ ARGS_JSON="$2" \ DEPOSIT_YOCTO="$3" \ GAS_TGAS="$4" \ node --input-type=module <<'EOF' const { NETWORK_ID = 'testnet', RPC_URL = 'https://rpc.testnet.fastnear.com', TOKEN_CONTRACT_ID, SENDER_ACCOUNT_ID, SENDER_PUBLIC_KEY, SENDER_PRIVATE_KEY, METHOD_NAME, ARGS_JSON, DEPOSIT_YOCTO = '0', GAS_TGAS = '100', } = process.env; for (const name of [ 'TOKEN_CONTRACT_ID', 'SENDER_ACCOUNT_ID', 'SENDER_PUBLIC_KEY', 'SENDER_PRIVATE_KEY', 'METHOD_NAME', 'ARGS_JSON', ]) { if (!process.env[name]) { throw new Error(`Missing ${name}`); } } async function rpc(method, params) { const response = await fetch(RPC_URL, { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ jsonrpc: '2.0', id: 'fastnear', method, params, }), }); const json = await response.json(); if (json.error) { throw new Error(JSON.stringify(json.error)); } return json.result; } const keyPair = KeyPair.fromString(SENDER_PRIVATE_KEY); const signer = await InMemorySigner.fromKeyPair( NETWORK_ID, SENDER_ACCOUNT_ID, keyPair ); const derivedPublicKey = keyPair.getPublicKey().toString(); if (derivedPublicKey !== SENDER_PUBLIC_KEY) { throw new Error( `SENDER_PUBLIC_KEY does not match SENDER_PRIVATE_KEY (${derivedPublicKey})` ); } const accessKey = await rpc('query', { request_type: 'view_access_key', account_id: SENDER_ACCOUNT_ID, public_key: SENDER_PUBLIC_KEY, finality: 'final', }); const block = await rpc('block', { finality: 'final' }); const action = transactions.functionCall( METHOD_NAME, Buffer.from(ARGS_JSON), BigInt(GAS_TGAS) * 10n ** 12n, BigInt(DEPOSIT_YOCTO) ); const transaction = transactions.createTransaction( SENDER_ACCOUNT_ID, utils.PublicKey.fromString(SENDER_PUBLIC_KEY), TOKEN_CONTRACT_ID, BigInt(accessKey.nonce) + 1n, [action], utils.serialize.base_decode(block.header.hash) ); const [, signedTx] = await transactions.signTransaction( transaction, signer, SENDER_ACCOUNT_ID, NETWORK_ID ); process.stdout.write(Buffer.from(signedTx.encode()).toString('base64')); EOF } ``` 4. If needed, register the receiver for storage first. ```bash if jq -e '.result.result | implode | fromjson == null' /tmp/ft-storage-balance.json >/dev/null; then SIGNED_TX_BASE64="$( sign_function_call \ storage_deposit \ "$(jq -nc --arg account_id "$RECEIVER_ACCOUNT_ID" '{ account_id: $account_id, registration_only: true }')" \ "$MIN_STORAGE_YOCTO" \ 100 )" curl -s "$RPC_URL" \ -H 'content-type: application/json' \ --data "$(jq -nc --arg signed_tx_base64 "$SIGNED_TX_BASE64" '{ jsonrpc: "2.0", id: "fastnear", method: "send_tx", params: { signed_tx_base64: $signed_tx_base64, wait_until: "FINAL" } }')" \ | jq '{ final_execution_status: .result.final_execution_status, transaction_hash: .result.transaction.hash }' fi ``` 5. Transfer the FT after storage is ready. ```bash SIGNED_TX_BASE64="$( sign_function_call \ ft_transfer \ "$(jq -nc \ --arg receiver_id "$RECEIVER_ACCOUNT_ID" \ --arg amount "$AMOUNT_YOCTO_GTNEAR" '{ receiver_id: $receiver_id, amount: $amount, memo: "FastNear RPC example" }')" \ 1 \ 100 )" curl -s "$RPC_URL" \ -H 'content-type: application/json' \ --data "$(jq -nc --arg signed_tx_base64 "$SIGNED_TX_BASE64" '{ jsonrpc: "2.0", id: "fastnear", method: "send_tx", params: { signed_tx_base64: $signed_tx_base64, wait_until: "FINAL" } }')" \ | jq '{ final_execution_status: .result.final_execution_status, transaction_hash: .result.transaction.hash, status: .result.status }' ``` 6. Verify the receiver’s FT balance with the contract’s own view method. ```bash RECEIVER_BALANCE_ARGS_BASE64="$( jq -nc --arg account_id "$RECEIVER_ACCOUNT_ID" '{ account_id: $account_id }' | base64 | tr -d '\n' )" curl -s "$RPC_URL" \ -H 'content-type: application/json' \ --data "$(jq -nc \ --arg account_id "$TOKEN_CONTRACT_ID" \ --arg args_base64 "$RECEIVER_BALANCE_ARGS_BASE64" '{ jsonrpc: "2.0", id: "fastnear", method: "query", params: { request_type: "call_function", account_id: $account_id, method_name: "ft_balance_of", args_base64: $args_base64, finality: "final" } }')" \ | jq '{ receiver_balance: (.result.result | implode | fromjson) }' ``` **Why this next step?** This is a good RPC example because every step stays close to the contract itself: first check storage state, then send the minimum required change calls, then verify the post-transfer balance directly on the contract. ## Contract Reads and Raw State Start here when the question is “does this contract method tell me enough?” versus “should I read the storage directly?” ### Read a counter straight from contract state, then confirm it with the view method Use this when the user story is simple: “I know this contract exposes a counter, but can I read that number straight from storage without calling the contract code?” This walkthrough uses the live public testnet contract `counter.near-examples.testnet`. The number can change over time. That is fine. The point is that both reads agree when you run them: - `view_state` reads the raw `STATE` entry directly from contract storage - `call_function get_num` asks the contract for the same current number through its public view API Strategy Read the raw storage first, decode the bytes you got back, then let the contract confirm the same answer through its view method. 01RPC view_state reads the raw STATE entry without running contract code. 02Decode the base64 value into bytes, then interpret those bytes with the contract’s known Borsh layout. 03RPC call_function get_num is the friendly cross-check that the raw-state read and the view method still agree. The mental model matters more than the counter itself: - `view_state` is a direct storage read from the trie - `call_function` executes a read-only method on the contract - both can answer the same question, but they do different work to get there ```mermaid flowchart LR S["RPC view_state
prefix STATE"] --> R["Raw STATE bytes"] R --> D["Decode base64 + Borsh"] D --> N["Signed counter value"] C["RPC call_function get_num"] --> J["JSON method result"] N --> X["Compare"] J --> X X --> A["Same current counter value"] ``` **What you're doing** - Read the raw `STATE` key from contract storage. - Decode the returned bytes into the current signed counter value. - Call `get_num` through the view method and confirm that the method answer matches the raw-state decode. ```bash export NETWORK_ID=testnet export RPC_URL=https://rpc.testnet.fastnear.com export CONTRACT_ID=counter.near-examples.testnet export STATE_PREFIX_BASE64=U1RBVEU= ``` 1. Read the raw contract state first. ```bash curl -s "$RPC_URL" \ -H 'content-type: application/json' \ --data "$(jq -nc \ --arg account_id "$CONTRACT_ID" \ --arg prefix_base64 "$STATE_PREFIX_BASE64" '{ jsonrpc: "2.0", id: "fastnear", method: "query", params: { request_type: "view_state", account_id: $account_id, prefix_base64: $prefix_base64, finality: "final" } }')" \ | tee /tmp/counter-view-state.json >/dev/null jq '{ block_height: .result.block_height, key_base64: .result.values[0].key, value_base64: .result.values[0].value }' /tmp/counter-view-state.json jq -r '.result.values[0].key | @base64d' /tmp/counter-view-state.json ``` That last command should print `STATE`. This is the key family you already knew ahead of time, so `view_state` can go straight to the raw storage entry without asking the contract to execute any method. 2. Decode the returned value bytes into the signed counter. ```bash RAW_VALUE_BASE64="$(jq -r '.result.values[0].value' /tmp/counter-view-state.json)" python3 - "$RAW_VALUE_BASE64" <<'PY' | jq . raw = base64.b64decode(sys.argv[1]) print(json.dumps({ "value_base64": sys.argv[1], "bytes": list(raw), "hex": raw.hex(), "signed_i8": int.from_bytes(raw, "little", signed=True), "unsigned_u8": int.from_bytes(raw, "little", signed=False), })) PY ``` For this specific contract, one byte is enough because the Rust counter stores `val: i8` inside the contract state. That is why a raw value like `CQ==` decodes to one byte `0x09`, which reads as the signed integer `9`. One small signed-value note is worth keeping in your head: if the counter were negative, the same one-byte payload would still decode correctly as a signed two's-complement `i8`. For example, `/w==` is the single byte `0xff`, which means `-1` as `signed_i8`, not `255`. The reusable recipe is small: - `view_state` gives you base64-encoded raw bytes - you decode those bytes with the contract’s known storage layout - for larger contracts, that layout may be more complex, but the idea is the same: bytes first, schema second 3. Now ask the contract the friendly way and compare. ```bash curl -s "$RPC_URL" \ -H 'content-type: application/json' \ --data "$(jq -nc --arg account_id "$CONTRACT_ID" '{ jsonrpc: "2.0", id: "fastnear", method: "query", params: { request_type: "call_function", account_id: $account_id, method_name: "get_num", args_base64: "e30=", finality: "final" } }')" \ | tee /tmp/counter-call-function.json >/dev/null jq '{ block_height: .result.block_height, view_method_value: (.result.result | implode | fromjson) }' /tmp/counter-call-function.json ``` 4. Compare both answers directly. ```bash RAW_STATE_NUMBER="$( python3 - "$RAW_VALUE_BASE64" <<'PY' raw = base64.b64decode(sys.argv[1]) print(int.from_bytes(raw, "little", signed=True)) PY )" VIEW_METHOD_NUMBER="$( jq -r '.result.result | implode | fromjson' /tmp/counter-call-function.json )" jq -n \ --argjson raw_state "$RAW_STATE_NUMBER" \ --argjson view_method "$VIEW_METHOD_NUMBER" '{ raw_state: $raw_state, view_method: $view_method, agrees_now: ($raw_state == $view_method) }' ``` If `agrees_now` is `true`, you have proved the point of the example: - `view_state` answered the question by reading storage directly - `call_function get_num` answered the same question by running the contract’s public read method **Why this next step?** Use `view_state` when the real question is about exact storage and you already know the key family. Use `call_function` when you want the contract’s public read API. If the next question becomes historical instead of “what is it right now?”, that is the moment to widen into [KV FastData API](https://docs.fastnear.com/fastdata/kv). ## Chunk and Shard Tracing Start here when the question is no longer just “did this transaction succeed?” but “which shard-local chunk actually executed each leg of the work?” ### Trace a generated transfer receipt from one shard chunk to another Use this when the contract call itself was only the start of the story. In this pinned mainnet case, the signed transaction starts on shard `11`, then a generated `Transfer` receipt finishes on shard `6`. That cross-shard handoff is exactly why chunk-level inspection matters. This walkthrough is pinned to: - transaction `8xrcQU6Sr1jhnigenBbpfGzk9jN24rLmMqSWT7TF7xJP` from `7419369993.tg` to `game.hot.tg` calling `l2_claim` - origin chunk `BfydTxiPbGY34pejscBytYSXpBsk9gWA2ixKoAe7VsVw` on shard `11` in block `194623170` - first receipt chunk `FJWpAYzVXbZwqJUbGXELTnnBBkdvc6W8vWkwuUA3Zwz9` on shard `11` in block `194623171` - generated `Transfer` receipt `TtRn4DzLKzFmGEn5YqoZ35ts411Hz6Ci6WQMjphPMn4` - destination chunk `EPauY1GBaeAgGf1TikxFcPUhmYsVhLf1cwy14vAYsUuU` on shard `6` in block `194623172` Strategy Recover the receipt chain first, inspect the generated receipt directly, then map each leg back to the shard chunk that actually carried it. 01RPC EXPERIMENTAL_tx_status quickly shows the receipt graph and which later blocks the work moved into. 02RPC EXPERIMENTAL_receipt lets you inspect the generated receipt payload directly instead of inferring it from logs alone. 03RPC chunk by block-and-shard or by chunk hash proves which shard-local execution unit actually carried each step. The two experimental methods here are a good fit for advanced tracing: `EXPERIMENTAL_tx_status` finds the receipt graph quickly, and `EXPERIMENTAL_receipt` shows the generated receipt body before you map it back to chunks. ```mermaid flowchart LR A["Tx 8xrc...
block 194623170
chunk Bfyd...
shard 11"] --> B["Receipt AFC2...
block 194623171
chunk FJWp...
shard 11
ft_mint logs"] B --> C["Generated receipt TtRn...
Transfer 1800930478788300000000 yoctoNEAR"] C --> D["Chunk EPau...
block 194623172
shard 6
receipt executes"] ``` **What you're doing** - Recover the receipt chain from the transaction first. - Inspect the generated `Transfer` receipt body directly. - Use chunk coordinates when you know the block and shard. - Use chunk hash when another tool already handed you the exact destination chunk. ```bash export NETWORK_ID=mainnet export RPC_URL=https://rpc.mainnet.fastnear.com export TX_HASH=8xrcQU6Sr1jhnigenBbpfGzk9jN24rLmMqSWT7TF7xJP export SIGNER_ACCOUNT_ID=7419369993.tg export ORIGIN_BLOCK_HEIGHT=194623170 export ORIGIN_SHARD_ID=11 export RECEIPT_BLOCK_HEIGHT=194623171 export RECEIPT_SHARD_ID=11 export GENERATED_RECEIPT_ID=TtRn4DzLKzFmGEn5YqoZ35ts411Hz6Ci6WQMjphPMn4 export DESTINATION_CHUNK_HASH=EPauY1GBaeAgGf1TikxFcPUhmYsVhLf1cwy14vAYsUuU ``` 1. Start with `EXPERIMENTAL_tx_status` so you can see the receipt graph before you think about chunks. ```bash curl -s "$RPC_URL" \ -H 'content-type: application/json' \ --data "$(jq -nc \ --arg tx_hash "$TX_HASH" \ --arg signer_account_id "$SIGNER_ACCOUNT_ID" '{ jsonrpc: "2.0", id: "fastnear", method: "EXPERIMENTAL_tx_status", params: [$tx_hash, $signer_account_id] }')" \ | tee /tmp/chunk-trace-status.json >/dev/null jq '{ final_execution_status: .result.final_execution_status, transaction_handoff: .result.transaction_outcome.outcome.status, receipts: ( .result.receipts_outcome | map({ receipt_id: .id, executor_id: .outcome.executor_id, block_hash, status: .outcome.status }) ) }' /tmp/chunk-trace-status.json ``` What to notice: - the signed transaction hands off into receipt `AFC2xUPuuA6BKMMvAV47LLPtzsg3Moh7frvLSuyMeZ2Y` - later in the same receipt graph, `TtRn4DzLKzFmGEn5YqoZ35ts411Hz6Ci6WQMjphPMn4` executes for `7419369993.tg` - the high-level tx status is already enough to tell you that the real work continued after the original signed transaction 2. Inspect the generated receipt directly so you can prove that the follow-up object is a real `Transfer` receipt. ```bash curl -s "$RPC_URL" \ -H 'content-type: application/json' \ --data "$(jq -nc --arg receipt_id "$GENERATED_RECEIPT_ID" '{ jsonrpc: "2.0", id: "fastnear", method: "EXPERIMENTAL_receipt", params: { receipt_id: $receipt_id } }')" \ | tee /tmp/chunk-trace-receipt.json >/dev/null jq '{ predecessor_id: .result.predecessor_id, receiver_id: .result.receiver_id, signer_id: .result.receipt.Action.signer_id, signer_public_key: .result.receipt.Action.signer_public_key, actions: .result.receipt.Action.actions }' /tmp/chunk-trace-receipt.json ``` This is the point where the shard story becomes concrete: the contract flow generated a `Transfer` action receipt from `system` to `7419369993.tg` with deposit `1800930478788300000000`. 3. Use chunk by block and shard to locate the original signed transaction on shard `11`. ```bash curl -s "$RPC_URL" \ -H 'content-type: application/json' \ --data "$(jq -nc \ --argjson block_id "$ORIGIN_BLOCK_HEIGHT" \ --argjson shard_id "$ORIGIN_SHARD_ID" '{ jsonrpc: "2.0", id: "fastnear", method: "chunk", params: { block_id: $block_id, shard_id: $shard_id } }')" \ | jq --arg tx_hash "$TX_HASH" '{ header: { chunk_hash: .result.header.chunk_hash, shard_id: .result.header.shard_id, height_created: .result.header.height_created }, matching_transaction: ( .result.transactions[] | select(.hash == $tx_hash) | { hash, signer_id, receiver_id } ) }' ``` This is the cleanest use of `chunk` by block and shard: you already know the coordinates, and you want the exact shard-local execution unit that carried the original signed transaction. 4. Stay on the same route for the next block and watch the first receipt execute on the same shard. ```bash curl -s "$RPC_URL" \ -H 'content-type: application/json' \ --data "$(jq -nc \ --argjson block_id "$RECEIPT_BLOCK_HEIGHT" \ --argjson shard_id "$RECEIPT_SHARD_ID" '{ jsonrpc: "2.0", id: "fastnear", method: "chunk", params: { block_id: $block_id, shard_id: $shard_id } }')" \ | jq '{ header: { chunk_hash: .result.header.chunk_hash, shard_id: .result.header.shard_id, height_created: .result.header.height_created, tx_root: .result.header.tx_root, gas_used: .result.header.gas_used }, tx_count: (.result.transactions | length), receipt_count: (.result.receipts | length), matching_receipt: ( .result.receipts[] | select(.receipt_id == "AFC2xUPuuA6BKMMvAV47LLPtzsg3Moh7frvLSuyMeZ2Y") | { receipt_id, predecessor_id, receiver_id } ) }' ``` This is the chunk moment that makes the whole concept natural: - the chunk has `tx_root = 11111111111111111111111111111111` - `tx_count` is `0` - but the shard still burned gas and executed receipt `AFC2...` In other words, this shard did real work in that block even though no new signed transaction appeared directly inside the chunk. 5. Switch to chunk by hash once another tool has already given you the exact destination chunk. ```bash curl -s "$RPC_URL" \ -H 'content-type: application/json' \ --data "$(jq -nc --arg chunk_id "$DESTINATION_CHUNK_HASH" '{ jsonrpc: "2.0", id: "fastnear", method: "chunk", params: { chunk_id: $chunk_id } }')" \ | jq --arg receipt_id "$GENERATED_RECEIPT_ID" '{ header: { chunk_hash: .result.header.chunk_hash, shard_id: .result.header.shard_id, height_created: .result.header.height_created, tx_root: .result.header.tx_root, gas_used: .result.header.gas_used }, tx_count: (.result.transactions | length), receipt_count: (.result.receipts | length), matching_receipt: ( .result.receipts[] | select(.receipt_id == $receipt_id) | { receipt_id, predecessor_id, receiver_id } ) }' ``` This confirms the cross-shard hop: - the generated `Transfer` receipt executes in chunk `EPau...` - that chunk lives on shard `6`, not shard `11` - the signed transaction started on one shard, but the later receipt finished on another **Why this next step?** Use [`Chunk by Block and Shard`](https://docs.fastnear.com/rpc/protocol/chunk-by-block-shard) when you know the block and shard coordinates and want to ask “what did this shard execute in this block?” Use [`Chunk by Hash`](https://docs.fastnear.com/rpc/protocol/chunk-by-hash) when another tool has already handed you the exact chunk hash. Use [`EXPERIMENTAL_tx_status`](https://docs.fastnear.com/rpc/transaction/experimental-tx-status) and [`EXPERIMENTAL_receipt`](https://docs.fastnear.com/rpc/transaction/experimental-receipt) when the real question is receipt-driven tracing. If you also need state changes and produced receipts, widen to [Block Shard](https://docs.fastnear.com/neardata/block-shard). ## 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? Use this when the user story is “I’m about to publish a profile change, widget update, or graph write under `mike.near`, and I want a plain go/no-go answer before I open wallet signing.” Strategy Ask social.near for the two things that matter before you sign anything. 01RPC view_account makes sure the signer account exists and can actually submit a transaction. 02RPC call_function get_account_storage tells you whether the target account has room left on social.near. 03RPC call_function is_write_permission_granted only comes into play when a different signer is trying to write on that account’s behalf. This is the same question real NEAR Social clients have to answer before they try a write: - does the target account already have storage on `social.near`? - if it does, is there still room left in that storage? - if a different signer is trying to write under that account, has write permission already been granted? **Official references** - [SocialDB API and contract surface](https://github.com/NearSocial/social-db#api) **What you're doing** - Check that the signer account itself exists and can pay gas. - Ask `social.near` how much storage the target account has left. - If the signer differs from the target account, ask `social.near` whether that delegated write is already allowed. - Turn those exact RPC answers into one simple “ready now” or “fix this first” summary. ```bash export NETWORK_ID=mainnet export RPC_URL=https://rpc.mainnet.fastnear.com export SOCIAL_CONTRACT_ID=social.near export ACCOUNT_ID=mike.near export SIGNER_ACCOUNT_ID=mike.near ``` 1. Check the signer account itself first. ```bash curl -s "$RPC_URL" \ -H 'content-type: application/json' \ --data "$(jq -nc --arg account_id "$SIGNER_ACCOUNT_ID" '{ jsonrpc: "2.0", id: "fastnear", method: "query", params: { request_type: "view_account", account_id: $account_id, finality: "final" } }')" \ | tee /tmp/social-publish-signer.json >/dev/null jq --arg signer_account_id "$SIGNER_ACCOUNT_ID" '{ signer_account_id: $signer_account_id, amount: .result.amount, locked: .result.locked, storage_usage: .result.storage_usage }' /tmp/social-publish-signer.json ``` If this query fails, you do not have a signer account to work with. If it succeeds, you know the signer exists and can at least pay gas. 2. Ask `social.near` how much storage is already available for the account you want to write under. ```bash SOCIAL_STORAGE_ARGS_BASE64="$( jq -nc --arg account_id "$ACCOUNT_ID" '{ account_id: $account_id }' | base64 | tr -d '\n' )" curl -s "$RPC_URL" \ -H 'content-type: application/json' \ --data "$(jq -nc \ --arg account_id "$SOCIAL_CONTRACT_ID" \ --arg args_base64 "$SOCIAL_STORAGE_ARGS_BASE64" '{ jsonrpc: "2.0", id: "fastnear", method: "query", params: { request_type: "call_function", account_id: $account_id, method_name: "get_account_storage", args_base64: $args_base64, finality: "final" } }')" \ | tee /tmp/social-account-storage.json >/dev/null jq --arg account_id "$ACCOUNT_ID" '{ account_id: $account_id, storage: (.result.result | implode | fromjson), storage_ready: ((.result.result | implode | fromjson | .available_bytes) > 0) }' /tmp/social-account-storage.json ``` If `available_bytes` is greater than zero, storage is not the blocker. If this method returns `null` or `available_bytes` is zero, the account needs a `storage_deposit` top-up before a new write can land. 3. If the signer is different from the target account, check delegated write permission too. ```bash if [ "$SIGNER_ACCOUNT_ID" = "$ACCOUNT_ID" ]; then jq -n --arg account_id "$ACCOUNT_ID" '{ account_id: $account_id, signer_matches_target: true, permission_granted: true, reason: "owner write" }' else WRITE_PERMISSION_ARGS_BASE64="$( jq -nc \ --arg predecessor_id "$SIGNER_ACCOUNT_ID" \ --arg key "$ACCOUNT_ID" '{ predecessor_id: $predecessor_id, key: $key }' | base64 | tr -d '\n' )" curl -s "$RPC_URL" \ -H 'content-type: application/json' \ --data "$(jq -nc \ --arg account_id "$SOCIAL_CONTRACT_ID" \ --arg args_base64 "$WRITE_PERMISSION_ARGS_BASE64" '{ jsonrpc: "2.0", id: "fastnear", method: "query", params: { request_type: "call_function", account_id: $account_id, method_name: "is_write_permission_granted", args_base64: $args_base64, finality: "final" } }')" \ | jq '{ signer_matches_target: false, permission_granted: (.result.result | implode | fromjson) }' fi ``` 4. Turn the storage and permission checks into one readable answer. ```bash AVAILABLE_BYTES="$( jq -r ' .result.result | if length == 0 then "0" else (implode | fromjson | .available_bytes // 0 | tostring) end ' /tmp/social-account-storage.json )" if [ "$SIGNER_ACCOUNT_ID" = "$ACCOUNT_ID" ]; then PERMISSION_GRANTED=true else PERMISSION_GRANTED="$( curl -s "$RPC_URL" \ -H 'content-type: application/json' \ --data "$(jq -nc \ --arg account_id "$SOCIAL_CONTRACT_ID" \ --arg args_base64 "$WRITE_PERMISSION_ARGS_BASE64" '{ jsonrpc: "2.0", id: "fastnear", method: "query", params: { request_type: "call_function", account_id: $account_id, method_name: "is_write_permission_granted", args_base64: $args_base64, finality: "final" } }')" \ | jq -r '.result.result | implode | fromjson' )" fi jq -n \ --arg account_id "$ACCOUNT_ID" \ --arg signer_account_id "$SIGNER_ACCOUNT_ID" \ --argjson available_bytes "$AVAILABLE_BYTES" \ --argjson permission_granted "$PERMISSION_GRANTED" '{ account_id: $account_id, signer_account_id: $signer_account_id, storage_ready: ($available_bytes > 0), permission_ready: $permission_granted, ready_to_publish_now: (($available_bytes > 0) and $permission_granted) }' ``` If that final object says `ready_to_publish_now: true`, RPC has already answered the question. If it says `false`, you know whether the blocker is storage, delegated permission, or both. **Why this next step?** This keeps the whole question on exact on-chain reads. `social.near` itself answers whether the target account has room left and whether a delegated signer is already allowed to write. That is a better NEAR Social readiness check than guessing from wallet state alone. ### What does `mob.near/widget/Profile` actually contain right now? Use this when the question is simple: “show me the live source for `mob.near/widget/Profile`, tell me when that widget key was last written, and keep me on exact RPC reads.” Strategy Stay on exact SocialDB reads, and only widen into history if the question turns forensic. 01RPC call_function keys shows the widget catalog and the last-write blocks under mob.near/widget/*. 02RPC call_function get reads the exact source for widget/Profile. 03If the next question becomes “which transaction wrote this?”, hand off to the widget proof recipe in /tx/examples. **Official references** - [SocialDB API and contract surface](https://github.com/NearSocial/social-db#api) **What you're doing** - Ask `social.near` for the widget catalog under `mob.near`. - Keep the block heights so you know when each widget key last changed. - Confirm that `Profile` is really there, then read its exact source through the same contract. - If the next question becomes “which transaction wrote this widget?”, switch to the NEAR Social proof recipes in [Transactions Examples](https://docs.fastnear.com/tx/examples). ```bash export NETWORK_ID=mainnet export RPC_URL=https://rpc.mainnet.fastnear.com export SOCIAL_CONTRACT_ID=social.near export ACCOUNT_ID=mob.near export WIDGET_NAME=Profile ``` 1. List the widget catalog and keep the last-write block heights. ```bash WIDGET_KEYS_ARGS_BASE64="$( jq -nc --arg account_id "$ACCOUNT_ID" '{ keys: [($account_id + "/widget/*")], options: {return_type: "BlockHeight"} }' | base64 | tr -d '\n' )" curl -s "$RPC_URL" \ -H 'content-type: application/json' \ --data "$(jq -nc \ --arg account_id "$SOCIAL_CONTRACT_ID" \ --arg args_base64 "$WIDGET_KEYS_ARGS_BASE64" '{ jsonrpc: "2.0", id: "fastnear", method: "query", params: { request_type: "call_function", account_id: $account_id, method_name: "keys", args_base64: $args_base64, finality: "final" } }')" \ | tee /tmp/social-widget-keys.json >/dev/null jq --arg account_id "$ACCOUNT_ID" ' .result.result | implode | fromjson | .[$account_id].widget | to_entries | sort_by(.value * -1) | map({ widget_name: .key, last_write_block: .value }) | .[0:20] ' /tmp/social-widget-keys.json ``` 2. Confirm that `Profile` is really in the catalog, then print the exact source stored in SocialDB. ```bash WIDGET_GET_ARGS_BASE64="$( jq -nc \ --arg account_id "$ACCOUNT_ID" \ --arg widget_name "$WIDGET_NAME" '{ keys: [($account_id + "/widget/" + $widget_name)] }' | base64 | tr -d '\n' )" curl -s "$RPC_URL" \ -H 'content-type: application/json' \ --data "$(jq -nc \ --arg account_id "$SOCIAL_CONTRACT_ID" \ --arg args_base64 "$WIDGET_GET_ARGS_BASE64" '{ jsonrpc: "2.0", id: "fastnear", method: "query", params: { request_type: "call_function", account_id: $account_id, method_name: "get", args_base64: $args_base64, finality: "final" } }')" \ | tee /tmp/social-widget-source.json >/dev/null jq -r \ --arg account_id "$ACCOUNT_ID" \ --arg widget_name "$WIDGET_NAME" ' .result.result | implode | fromjson | .[$account_id].widget[$widget_name] | split("\n")[0:25] | join("\n") ' /tmp/social-widget-source.json ``` 3. Pull the last-write block for the same widget so you keep one useful historical anchor. ```bash jq -r \ --arg account_id "$ACCOUNT_ID" \ --arg widget_name "$WIDGET_NAME" ' .result.result | implode | fromjson | .[$account_id].widget[$widget_name] ' /tmp/social-widget-keys.json \ | xargs -I{} printf 'Last write block for %s/%s: %s\n' "$ACCOUNT_ID" "$WIDGET_NAME" "{}" ``` At the time of writing, the live last-write block for `mob.near/widget/Profile` was `86494825`. Keep that block if you later want to prove which transaction wrote this version. **Why this next step?** Sometimes the right RPC answer is just: here is the widget, here is the live source, and here is the block height to keep if provenance matters later. ## Common jobs ### Check exact account or access-key state **Start here** - [View Account](https://docs.fastnear.com/rpc/account/view-account) for exact account fields. - [View Access Key](https://docs.fastnear.com/rpc/account/view-access-key) or [View Access Key List](https://docs.fastnear.com/rpc/account/view-access-key-list) for key inspection. **Next page if needed** - [FastNear API full account view](https://docs.fastnear.com/api/v1/account-full) if you want a readable holdings summary after checking the exact RPC state. - [Transactions API account history](https://docs.fastnear.com/tx/account) if the next question is "what has this account been doing?" **Stop when** - The RPC fields already answer the state or permission question. **Switch when** - The user wants balances, NFTs, staking, or another readable account summary. - The user really wants recent activity history rather than current state. ### Trace shard-local execution through chunks **Start here** - Start with the chunk-tracing example above when the real question is “which chunk or shard actually executed this receipt?” - [Chunk by Block and Shard](https://docs.fastnear.com/rpc/protocol/chunk-by-block-shard) when you already know the block and shard coordinates. - [Chunk by Hash](https://docs.fastnear.com/rpc/protocol/chunk-by-hash) when another tool already handed you the exact chunk hash. **Next page if needed** - [Experimental Receipt](https://docs.fastnear.com/rpc/transaction/experimental-receipt) when you need the generated receipt body itself. - [Block Shard](https://docs.fastnear.com/neardata/block-shard) when chunk data alone is not enough and you need state changes or produced receipts too. - [Transactions Examples](https://docs.fastnear.com/tx/examples) when the question turns into a broader async or callback investigation. **Stop when** - You can name which chunk and shard carried the work that mattered. **Switch when** - The user really wants a readable transaction story instead of shard-local execution details. Move to [Transactions API](https://docs.fastnear.com/tx). ### Check one exact block or protocol snapshot **Start here** - [Block by ID](https://docs.fastnear.com/rpc/block/block-by-id) or [Block by Height](https://docs.fastnear.com/rpc/block/block-by-height) when you already know which block you care about. - [Latest Block](https://docs.fastnear.com/rpc/protocol/latest-block) when the question is “what is the current head right now?” - [Status](https://docs.fastnear.com/rpc/protocol/status), [Health](https://docs.fastnear.com/rpc/protocol/health), or [Network Info](https://docs.fastnear.com/rpc/protocol/network-info) when the real question is about node or network condition, not transaction history. **Next page if needed** - [Block Effects](https://docs.fastnear.com/rpc/block/block-effects) if the block payload tells you what block you are looking at but not what changed in it. - [Transactions API block history](https://docs.fastnear.com/tx/block) or [Transactions API block range](https://docs.fastnear.com/tx/blocks) if the question becomes “what actually happened around this block?” rather than “what does this block payload say?” **Stop when** - One exact block or protocol response already answers the question directly. **Switch when** - The user wants to watch fresh blocks arrive rather than inspect one exact snapshot. Move to [NEAR Data API](https://docs.fastnear.com/neardata). - The user needs a readable story across many transactions, not just one block payload. Move to [Transactions API](https://docs.fastnear.com/tx). ### What does this contract return right now? **Start here** - Start with the counter example above when the real decision is “should I use `call_function` or `view_state`?” or “can I read this storage directly instead of calling a method?” - [Call Function](https://docs.fastnear.com/rpc/contract/call-function) when you already know the view method you want and just need the exact return value. - [View State](https://docs.fastnear.com/rpc/contract/view-state) when the real question is about raw contract storage or key prefixes, not a method result. - [View Code](https://docs.fastnear.com/rpc/contract/view-code) when the real question is “is there code here at all?” or “which code hash is deployed?” **Next page if needed** - [FastNear API](https://docs.fastnear.com/api) if the raw contract answer is technically correct but the user actually wanted a readable holdings or account summary. - [KV FastData API](https://docs.fastnear.com/fastdata/kv) if the next question becomes “what did this storage key look like over time?” instead of “what is it right now?” **Stop when** - The view call, storage read, or code hash already answers the contract question exactly. **Switch when** - The user wants indexed history or a simpler summary instead of raw contract output. - The user stops asking “what does it return right now?” and starts asking “what changed over time?” ### Send and confirm a transaction **Start here** - Start with the worked example above when the real question is which submission endpoint to use and how to track the transaction through completion. - [Send Transaction](https://docs.fastnear.com/rpc/transaction/send-tx) when you want RPC submission with explicit waiting semantics. - [Broadcast Transaction Async](https://docs.fastnear.com/rpc/transaction/broadcast-tx-async) or [Broadcast Transaction Commit](https://docs.fastnear.com/rpc/transaction/broadcast-tx-commit) when those exact submission modes are the point. - [Transaction Status](https://docs.fastnear.com/rpc/transaction/tx-status) to confirm the final result. **Next page if needed** - [Transactions by Hash](https://docs.fastnear.com/tx/transactions) for a readable history record after submission. - [Receipt Lookup](https://docs.fastnear.com/tx/receipt) when you need to investigate downstream execution or callback flow. - [Transactions Examples](https://docs.fastnear.com/tx/examples) when the next question is “one batched action failed, did the earlier actions roll back too?” **Stop when** - You have the submission result and final status you needed. **Switch when** - The next question is about receipts, affected accounts, or execution history in a human-friendly order. - You need a fuller investigation workflow instead of one status check. ## 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 operator-oriented flows 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) ## Worked investigation ### Choose and execute the right mainnet recovery path Use this investigation when an operator says “I need this node back online” and you need to decide whether the right path is optimized `fast-rpc`, standard RPC, or archival hot/cold recovery. Strategy Pick the recovery class first, then run the smallest command sequence that matches that class. 01Decide whether the real need is optimized fast-rpc, standard RPC, or archival recovery. 02If the answer is archival, capture one exact snapshot block height first and keep reusing it. 03Run only the commands for that chosen path, instead of mixing optimized, standard, and archival steps together. **Goal** - Turn a vague recovery request into the right mainnet snapshot path and the minimum command sequence to get moving safely. | Path or command | How we use it | Why we use it | | --- | --- | --- | | Mainnet optimized `fast-rpc` path | Choose it first when the goal is the fastest high-performance RPC recovery and the node can support the optimized profile | It is the preferred fast recovery path when archival retention is not required | | Mainnet standard RPC path | Use it when the operator needs a simpler RPC recovery without the optimized profile | It gives a straightforward default recovery route into the normal nearcore data path | | Latest archival block lookup | Fetch the latest archival snapshot height before archival recovery | Anchors the hot/cold downloads to a specific archival snapshot block | | Archival hot-data command | Run it first and place the result on NVMe | Hot archival data must land on the fast storage tier to support the node correctly | | Archival cold-data command | Run it after hot data and place it on the cold storage tier | Completes archival recovery without forcing all archival data onto the expensive hot tier | **What a useful answer should include** - which recovery path was chosen and why - which critical env vars matter for the chosen path - where data should land on disk - whether the operator should stay in FastNear snapshot docs or move to general nearcore bootstrap docs ### Mainnet archival recovery shell walkthrough Use this when you have already decided that archival mainnet is the right path and now need the exact command sequence with one shared block anchor. **What you're doing** - Fetch the latest archival mainnet snapshot height once. - Store it in `LATEST`. - Reuse that exact block height for both the hot-data and cold-data downloads. ```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 ``` **Why this next step?** Hot and cold archival data need to come from the same snapshot cut. Reusing one captured `LATEST` value across both commands keeps the archival dataset internally consistent and makes later nearcore configuration much less surprising. ## Common jobs ### Bootstrap an optimized mainnet `fast-rpc` node **Start here** - [Mainnet snapshots](https://docs.fastnear.com/snapshots/mainnet), specifically the optimized `fast-rpc` path. **Next page if needed** - Revisit the standard mainnet RPC path if the node cannot support the optimized profile. **Stop when** - You have the right `fast-rpc` command and environment variables for the target machine. **Switch when** - The real requirement is archival retention rather than fast sync. ### Recover a standard RPC node to the default nearcore path **Start here** - [Mainnet snapshots](https://docs.fastnear.com/snapshots/mainnet) or [Testnet snapshots](https://docs.fastnear.com/snapshots/testnet), depending on network, and choose the standard RPC snapshot path for that environment. **Next page if needed** - Adjust `DATA_PATH`, `THREADS`, or bandwidth settings only after the standard path is clear. **Stop when** - You can run the correct RPC recovery command with the expected data path. **Switch when** - The operator actually needs archival history or hot/cold data placement. ### Bring up archival mainnet hot and cold data correctly **Start here** - [Mainnet snapshots](https://docs.fastnear.com/snapshots/mainnet), archival section. **Next page if needed** - Fetch the latest archival snapshot height, then run separate hot-data and cold-data downloads with the correct paths. **Stop when** - The hot-data and cold-data plan is clear and the order of operations is correct. **Switch when** - The operator is really looking for general nearcore bootstrap guidance beyond FastNear snapshots. ### Bootstrap testnet archival hot data **Start here** - [Testnet snapshots](https://docs.fastnear.com/snapshots/testnet), archival section. **Next page if needed** - Fetch the latest testnet archival snapshot height before the download step. **Stop when** - You have the right testnet archival hot-data command and block anchor. **Switch when** - The user is not doing infrastructure bootstrap and should be routed back to API or RPC docs. ## 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 plain-language flows 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) ## Worked walkthrough ### Find one suspicious transfer, then chase its receipt Use this when the user story is “I know funds moved, but I want the exact execution anchor behind that movement without dragging in the whole account history yet.” Strategy Stay narrow on movement first, then pivot once into execution history. 01POST /v0/transfers gives you the tight outgoing window and the specific movement worth chasing. 02jq lifts one receipt_id without dragging in the rest of the account history. 03POST /v0/receipt turns that movement into one execution anchor you can keep following in /tx. **What you're doing** - Query a bounded outgoing transfer window for one account on mainnet. - Pull out one transfer that looks like the movement you care about. - Reuse its `receipt_id` in Transactions API to move from balance movement into execution history. ```bash TRANSFERS_BASE_URL=https://transfers.main.fastnear.com TX_BASE_URL=https://tx.main.fastnear.com ACCOUNT_ID=YOUR_ACCOUNT_ID FROM_TIMESTAMP_MS=1711929600000 TO_TIMESTAMP_MS=1712016000000 RECEIPT_ID="$( curl -s "$TRANSFERS_BASE_URL/v0/transfers" \ -H 'content-type: application/json' \ --data "$(jq -nc \ --arg account_id "$ACCOUNT_ID" \ --argjson from_timestamp_ms "$FROM_TIMESTAMP_MS" \ --argjson to_timestamp_ms "$TO_TIMESTAMP_MS" '{ account_id: $account_id, direction: "sender", from_timestamp_ms: $from_timestamp_ms, to_timestamp_ms: $to_timestamp_ms, desc: true, limit: 10 }')" \ | tee /tmp/transfers-window.json \ | jq -r '.transfers[0].receipt_id' )" jq '{ resume_token, transfers: [ .transfers[] | { transaction_id, receipt_id, asset_id, amount, other_account_id, block_height } ] }' /tmp/transfers-window.json curl -s "$TX_BASE_URL/v0/receipt" \ -H 'content-type: application/json' \ --data "$(jq -nc --arg receipt_id "$RECEIPT_ID" '{receipt_id: $receipt_id}')" \ | jq '{ receipt_id: .receipt.receipt_id, transaction_hash: .receipt.transaction_hash, receiver_id: .receipt.receiver_id, tx_block_height: .receipt.tx_block_height }' ``` **Why this next step?** The transfer query answers the first question quickly: did this account send funds in this window, and to whom? Looking up the `receipt_id` gives you the exact execution anchor for that movement without dragging in the whole account history yet. If you still need more rows afterward, keep paginating with the same `resume_token` and unchanged filters. ## Common jobs ### Find outgoing transfers for one account in a narrow time window **Start here** - [Query Transfers](https://docs.fastnear.com/transfers/query) with the account, outgoing direction, and the tightest useful time filter. **Next page if needed** - Narrow again by asset or amount if the response still contains unrelated transfers. **Stop when** - You can answer who sent what, when, and in which asset. **Switch when** - The user asks why the transfer happened or what other actions surrounded it. Move to [Transactions API](https://docs.fastnear.com/tx). ### Keep paging through a transfer feed without losing your place **Start here** - [Query Transfers](https://docs.fastnear.com/transfers/query) for the first page of recent events, using the tightest stable filters you can. **Next page if needed** - Reuse the exact returned `resume_token` to fetch the next page with the same filters. - Keep the filters unchanged while you paginate, or you are no longer looking at the same feed. **Stop when** - You have enough pages to answer the requested feed, support review, or compliance check. **Switch when** - The user asks for transaction metadata beyond transfer events. - The feed needs balances or holdings, not just movement. Move to [FastNear API](https://docs.fastnear.com/api). ### Escalate from transfer-only history to full transaction investigation **Start here** - [Query Transfers](https://docs.fastnear.com/transfers/query) to identify the specific transfer events that matter. **Next page if needed** - [Transactions API account history](https://docs.fastnear.com/tx/account) if the user wants the surrounding execution story for the same account. - [Transactions by Hash](https://docs.fastnear.com/tx/transactions) when you already know which transaction to inspect next. **Stop when** - You have identified the right transfer event and the right next API to open. **Switch when** - The user explicitly needs receipt-level detail or exact RPC confirmation. Move to [Transactions API](https://docs.fastnear.com/tx) first, then [RPC Reference](https://docs.fastnear.com/rpc) if needed. ## 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. - Starting here for testnet questions; this API is mainnet-only today. ## 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 plain-language flows 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) If you want the longer case-study version of the same surface, jump to [Berry Club](https://docs.fastnear.com/tx/examples/berry-club) for historical board reconstruction or [OutLayer](https://docs.fastnear.com/tx/examples/outlayer) for worker and callback tracing. ## Start Here These are the smallest useful anchors on the page: start with one tx hash, then one receipt ID, and only go deeper when the simpler story stops being enough. ### I have one transaction hash. What happened? Use this investigation when the user story is as plain as it gets: “someone pasted me one transaction hash. I just want to know whether it worked, what it did, and which block it landed in.” This is the beginner-to-intermediate on-ramp for the page. Before receipts, promise chains, or forensics, there is one simpler skill every NEAR engineer needs: turn a bare tx hash into one short human story. Strategy Start with the readable tx record, then drop into RPC or receipts only if the first answer is not enough. 01POST /v0/transactions gives signer, receiver, action types, block height, and the first receipt handoff. 02RPC EXPERIMENTAL_tx_status is only for the exact protocol-side success semantics. 03POST /v0/receipt only matters if the first receipt becomes the new anchor. **Goal** - Start from one transaction hash and recover the shortest useful answer: signer, receiver, action type, included block, and whether the transaction handed off into a successful execution path. For this pinned example: - transaction hash: `AdgNifPYpoDNS5ckfBZm36Ai6LuL5bTstuKsVdGjKwGp` - signer: `mike.near` - receiver: `global-counter.mike.near` - included block height: `194263342` - first receipt ID: `5GhZcpfKWhrpaZo5Am74QfEUFQnZBz48G7hfoLPVDXcq` The plain-English answer for this one is simple: `mike.near` submitted a single `Transfer` action to `global-counter.mike.near`, the transaction landed in block `194263342`, and the chain handed it off into one successful receipt. ```mermaid flowchart LR H["One tx hash
AdgNifPY..."] --> T["Fetch transaction"] T --> A["Read signer, receiver, actions, block"] A --> S["Short human story"] T -. "if needed later" .-> R["First receipt ID
5GhZcpfK..."] ``` | Surface | Endpoint | How we use it | Why we use it | | --- | --- | --- | --- | | Readable transaction story | Transactions API [`POST /v0/transactions`](https://docs.fastnear.com/tx/transactions) | Start from the tx hash and print signer, receiver, included block, action list, and first receipt handoff | Gives the fastest readable answer to “what did this tx do?” | | Canonical status follow-up | RPC [`EXPERIMENTAL_tx_status`](https://docs.fastnear.com/rpc/transaction/experimental-tx-status) | Reuse the same tx hash and signer only if you need exact protocol-native status semantics | Useful when the next question becomes “success according to RPC, exactly?” | | Receipt handoff | Transactions API [`POST /v0/receipt`](https://docs.fastnear.com/tx/receipt) | Reuse the first receipt ID if the next question turns into a receipt-level story | Provides the natural bridge to the next investigation when the transaction hash is no longer the best anchor | **What a useful answer should include** - who signed the transaction - which account received it - which action type it carried - which block included it - one plain-English sentence that explains the transaction without receipt jargon #### Transaction hash to human story shell walkthrough Use this when you want the shortest possible path from one tx hash to one readable answer. **What you're doing** - Fetch the transaction by hash and print the main story fields. - Confirm the final status only if you need exact RPC semantics. - Keep the first receipt ID only as the optional next step. ```bash TX_BASE_URL=https://tx.main.fastnear.com RPC_URL=https://rpc.mainnet.fastnear.com TX_HASH=AdgNifPYpoDNS5ckfBZm36Ai6LuL5bTstuKsVdGjKwGp SIGNER_ACCOUNT_ID=mike.near ``` 1. Fetch the transaction and print the basic story. ```bash FIRST_RECEIPT_ID="$( curl -s "$TX_BASE_URL/v0/transactions" \ -H 'content-type: application/json' \ --data "$(jq -nc --arg tx_hash "$TX_HASH" '{tx_hashes: [$tx_hash]}')" \ | tee /tmp/basic-tx-story.json \ | jq -r '.transactions[0].transaction_outcome.outcome.status.SuccessReceiptId' )" jq '{ 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 }, actions: ( .transactions[0].transaction.actions | map(if type == "string" then . else keys[0] end) ), first_receipt_id: .transactions[0].transaction_outcome.outcome.status.SuccessReceiptId, receipt_count: (.transactions[0].receipts | length) }' /tmp/basic-tx-story.json # Expected action list: ["Transfer"] # Expected first receipt ID: 5GhZcpfKWhrpaZo5Am74QfEUFQnZBz48G7hfoLPVDXcq ``` 2. If you need exact RPC status semantics, confirm them with `EXPERIMENTAL_tx_status`. ```bash curl -s "$RPC_URL" \ -H 'content-type: application/json' \ --data "$(jq -nc \ --arg tx_hash "$TX_HASH" \ --arg signer_account_id "$SIGNER_ACCOUNT_ID" '{ jsonrpc: "2.0", id: "fastnear", method: "EXPERIMENTAL_tx_status", params: { tx_hash: $tx_hash, sender_account_id: $signer_account_id, wait_until: "FINAL" } }')" \ | jq '{ final_execution_status: .result.final_execution_status, status: .result.status, transaction_handoff: .result.transaction_outcome.outcome.status }' ``` 3. If the next question becomes “what was that first receipt?”, pivot once and stop. ```bash curl -s "$TX_BASE_URL/v0/receipt" \ -H 'content-type: application/json' \ --data "$(jq -nc --arg receipt_id "$FIRST_RECEIPT_ID" '{receipt_id: $receipt_id}')" \ | jq '{ receipt_id: .receipt.receipt_id, receiver_id: .receipt.receiver_id, is_success: .receipt.is_success, receipt_block_height: .receipt.block_height, transaction_hash: .receipt.transaction_hash }' ``` That last step is optional on purpose. If all you wanted was the transaction story, the first step was enough. Keep going only when the receipt itself becomes the new anchor. **Why this next step?** `POST /v0/transactions` is the cleanest starting point when all you have is a tx hash and need one readable answer. RPC is the follow-up for exact status semantics. `POST /v0/receipt` is the handoff when the next question stops being about the transaction as a whole and starts being about one receipt inside it. ### Turn one ugly receipt ID from logs into a human story Use this investigation when all you have is one ugly `receipt_id` from logs, traces, or an error report, and you want to turn it into a plain-English answer a teammate can understand. If you already have the transaction hash instead of the receipt ID, start with the simpler investigation just above and only drop down to this one when the receipt itself becomes the best anchor. Strategy Resolve the receipt first, then recover the parent transaction and stop once the story is readable. 01POST /v0/receipt tells you which transaction and execution block the receipt belongs to. 02POST /v0/transactions turns that raw receipt into signer, receiver, and action context. 03RPC tx status is optional follow-up only when “human story” turns into “exact protocol semantics.” **Goal** - Start from one receipt ID and recover the shortest useful story: who created it, where it executed, which transaction spawned it, and what that transaction was actually trying to do. For this pinned example, the “ugly receipt ID from logs” is: - receipt ID: `5GhZcpfKWhrpaZo5Am74QfEUFQnZBz48G7hfoLPVDXcq` - originating transaction hash: `AdgNifPYpoDNS5ckfBZm36Ai6LuL5bTstuKsVdGjKwGp` - signer: `mike.near` - receiver: `global-counter.mike.near` - transaction block height: `194263342` - receipt execution block height: `194263343` The human story behind that one receipt is simple: `mike.near` signed a plain `Transfer` transaction to `global-counter.mike.near`, the network turned it into one action receipt, and that receipt executed successfully in the next block. ```mermaid flowchart LR L["One ugly receipt ID
5GhZcpfK..."] --> R["Lookup receipt"] R --> T["Recover tx hash
AdgNifPY..."] T --> S["Read transaction actions"] S --> H["Human story:
mike.near sent 5 NEAR to global-counter.mike.near"] ``` | Surface | Endpoint | How we use it | Why we use it | | --- | --- | --- | --- | | Receipt anchor | Transactions API [`POST /v0/receipt`](https://docs.fastnear.com/tx/receipt) | Look up the receipt ID first and print the accounts, execution block, success flag, and linked transaction hash | Gives you the shortest path from a raw receipt ID to “what object am I even looking at?” | | Transaction story | Transactions API [`POST /v0/transactions`](https://docs.fastnear.com/tx/transactions) | Reuse the recovered transaction hash and print signer, receiver, ordered actions, and included block | Turns the raw receipt into a readable story of what the signer actually submitted | | Canonical follow-up | RPC [`tx`](https://docs.fastnear.com/rpc/transaction/tx-status) or [`EXPERIMENTAL_tx_status`](https://docs.fastnear.com/rpc/transaction/experimental-tx-status) | Confirm protocol-native semantics only if the indexed answer is still not enough | Useful when the question shifts from “tell me the story” to “show me the exact RPC status semantics” | **What a useful answer should include** - which accounts created and executed the receipt - which transaction hash the receipt belongs to - what the transaction actually did - whether the receipt was the main event or just one step in a larger cascade - one plain-English sentence that a teammate could read without decoding receipt jargon #### Ugly receipt ID to human story shell walkthrough ## Failure and Async This is where the page stops being simple lookup and starts teaching NEAR execution semantics: atomic batches, later async failures, and callback order. Use this when you already have one raw `receipt_id` from logs and want to turn it into a readable explanation fast. **What you're doing** - Resolve the receipt first. - Extract `receipt.transaction_hash` with `jq`. - Reuse that transaction hash in `POST /v0/transactions`. - Finish with one human summary you could paste into chat or a ticket. ```bash TX_BASE_URL=https://tx.main.fastnear.com RECEIPT_ID='5GhZcpfKWhrpaZo5Am74QfEUFQnZBz48G7hfoLPVDXcq' ``` 1. Resolve the receipt and figure out what object you are looking at. ```bash TX_HASH="$( curl -s "$TX_BASE_URL/v0/receipt" \ -H 'content-type: application/json' \ --data "$(jq -nc --arg receipt_id "$RECEIPT_ID" '{receipt_id: $receipt_id}')" \ | tee /tmp/receipt-lookup.json \ | jq -r '.receipt.transaction_hash' )" jq '{ receipt: { receipt_id: .receipt.receipt_id, predecessor_id: .receipt.predecessor_id, receiver_id: .receipt.receiver_id, receipt_type: .receipt.receipt_type, is_success: .receipt.is_success, receipt_block_height: .receipt.block_height, transaction_hash: .receipt.transaction_hash, tx_block_height: .receipt.tx_block_height } }' /tmp/receipt-lookup.json ``` 2. Reuse the transaction hash and turn the receipt into a readable transaction story. ```bash curl -s "$TX_BASE_URL/v0/transactions" \ -H 'content-type: application/json' \ --data "$(jq -nc --arg tx_hash "$TX_HASH" '{tx_hashes: [$tx_hash]}')" \ | tee /tmp/receipt-parent-transaction.json >/dev/null jq '{ transaction: { transaction_hash: .transactions[0].transaction.hash, signer_id: .transactions[0].transaction.signer_id, receiver_id: .transactions[0].transaction.receiver_id, tx_block_height: .transactions[0].execution_outcome.block_height, action_types: ( .transactions[0].transaction.actions | map(if type == "string" then . else keys[0] end) ), transfer_deposit_yocto: ( .transactions[0].transaction.actions[0].Transfer.deposit // null ) }, receipt_count: (.transactions[0].receipts | length) }' /tmp/receipt-parent-transaction.json ``` 3. Turn that into one human sentence. ```bash jq -r ' .transactions[0] as $tx | "Receipt \($tx.execution_outcome.outcome.receipt_ids[0]) belongs to tx \($tx.transaction.hash): \($tx.transaction.signer_id) sent 5 NEAR to \($tx.transaction.receiver_id). The tx landed in block \($tx.execution_outcome.block_height), and the receipt executed successfully in block \($tx.receipts[0].execution_outcome.block_height)." ' /tmp/receipt-parent-transaction.json ``` For another receipt, keep the same pattern but change the final sentence to match the action types you just printed. That is the core trick: you do not need to explain every receipt field. You need to recover just enough context to say what the signer did, where the receipt executed, and whether this receipt was the main event or only one step in a bigger cascade. **Why this next step?** `POST /v0/receipt` tells you what the raw receipt is attached to. `POST /v0/transactions` tells you what the signer was actually trying to do. Once you have those two pieces together, you can usually explain the receipt in one sentence before deciding whether you really need block context, account history, or canonical RPC status. ### Prove that one failed action reverted the whole batch Use this investigation when one transaction tried to create and fund a new account, add a key, and then call a method on that same new account. The final action failed because the fresh account had no contract code. The real question is simple: did the earlier actions stick, or did the whole batch revert? On NEAR, the actions inside one transaction batch execute in order inside the same first action receipt. If one action in that receipt fails, the earlier actions in that same batch do not stick. That is different from later async receipts or promise chains, where the first receipt can succeed and some later receipt can still fail independently. Strategy Prove what the batch tried, which action failed, and whether anything from the earlier actions actually stuck. 01POST /v0/transactions shows the ordered batch exactly as the signer submitted it. 02RPC EXPERIMENTAL_tx_status shows the failing FunctionCall and the protocol-side failure reason. 03RPC view_account on the intended new account proves whether the earlier create, fund, and key-add actions stuck at all. **Goal** - Prove, from one pinned testnet transaction, that the final `FunctionCall` failed and the earlier `CreateAccount`, `Transfer`, and `AddKey` actions did not stick. **Official references** - [Transaction foundations](https://docs.fastnear.com/transaction-flow/foundations) - [Runtime execution](https://docs.fastnear.com/transaction-flow/runtime-execution) This pinned failure was captured on **April 18, 2026** on testnet: - transaction hash: `CrhH3xLzbNwNMGgZkgptXorwh8YmqxRGuA6Mc11MkU6M` - signer account: `temp.mike.testnet` - intended new account: `rollback-mo4vmkig.temp.mike.testnet` - included block height: `246365118` - included block hash: `6f5zTKDqQRwrxMywzvxeRvYcCERJmAnatJaqUEtQYUNM` - ordered actions: `CreateAccount -> Transfer -> AddKey -> FunctionCall` - failing method: `definitely_missing_method` - RPC failure: `CodeDoesNotExist` on `rollback-mo4vmkig.temp.mike.testnet` ```mermaid flowchart LR T["One signed transaction"] --> A["CreateAccount"] A --> B["Transfer 0.01 NEAR"] B --> C["AddKey"] C --> D["FunctionCall definitely_missing_method()"] D --> E["Failure: CodeDoesNotExist"] E --> R["Whole batch reverts"] R --> N["No new account"] R --> K["No new key"] R --> F["No funded receiver state"] ``` | Surface | Endpoint | How we use it | Why we use it | | --- | --- | --- | --- | | Intended batch | Transactions API [`POST /v0/transactions`](https://docs.fastnear.com/tx/transactions) | Fetch the pinned transaction hash and print the ordered action list, receiver, and included block metadata | Shows exactly what the signer tried to do before you reason about what stuck | | Exact failure | RPC [`EXPERIMENTAL_tx_status`](https://docs.fastnear.com/rpc/transaction/experimental-tx-status) | Query the same transaction with `wait_until: "FINAL"` and inspect `status.Failure` | Tells you which action failed and why the whole batch reverted at the protocol level | | Post-state proof | RPC [`query(view_account)`](https://docs.fastnear.com/rpc/account/view-account) | Query the intended new account after finality | If the created account still does not exist, then the earlier `CreateAccount`, `Transfer`, and `AddKey` from that same batch did not stick either | One detail is worth calling out before the shell walkthrough: the indexed transaction record still shows `transaction_outcome.outcome.status = SuccessReceiptId`, because the signed transaction successfully became its first action receipt. The proof that the batch reverted comes from the RPC top-level `status.Failure` on that first receipt, plus the post-state check that the intended new account never existed. **What a useful answer should include** - the exact action order the signer submitted - which action index failed and why - the included block height and hash for the batch - proof that the intended new account still does not exist after finality - a short conclusion that the earlier `CreateAccount`, `Transfer`, and `AddKey` actions did not stick once the final `FunctionCall` failed #### Failed batched transaction shell walkthrough Use this when you want one concrete failed batch that you can inspect step by step with public FastNear testnet endpoints. **What you're doing** - Read the indexed transaction record to recover the intended action batch. - Use RPC transaction status to prove the final `FunctionCall` failed and reverted the batch. - Use one post-state RPC read to prove the new account never existed after finality. ```bash TX_BASE_URL=https://tx.test.fastnear.com RPC_URL=https://rpc.testnet.fastnear.com TX_HASH=CrhH3xLzbNwNMGgZkgptXorwh8YmqxRGuA6Mc11MkU6M SIGNER_ACCOUNT_ID=temp.mike.testnet NEW_ACCOUNT_ID=rollback-mo4vmkig.temp.mike.testnet ``` 1. Fetch the transaction and print the intended action batch. ```bash curl -s "$TX_BASE_URL/v0/transactions" \ -H 'content-type: application/json' \ --data "$(jq -nc --arg tx_hash "$TX_HASH" '{tx_hashes: [$tx_hash]}')" \ | tee /tmp/failed-batch-transaction.json >/dev/null jq '{ 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, included_block_hash: .transactions[0].execution_outcome.block_hash }, batch: { action_count: (.transactions[0].transaction.actions | length), action_types: ( .transactions[0].transaction.actions | map(if type == "string" then . else keys[0] end) ), final_function_call_method_name: ( .transactions[0].transaction.actions[3].FunctionCall.method_name ) }, first_receipt_handoff: .transactions[0].transaction_outcome.outcome.status }' /tmp/failed-batch-transaction.json # Expected action order: # 1. CreateAccount # 2. Transfer # 3. AddKey # 4. FunctionCall ``` 2. Query RPC transaction status and inspect the exact top-level failure. ```bash curl -s "$RPC_URL" \ -H 'content-type: application/json' \ --data "$(jq -nc \ --arg tx_hash "$TX_HASH" \ --arg signer_account_id "$SIGNER_ACCOUNT_ID" '{ jsonrpc: "2.0", id: "fastnear", method: "EXPERIMENTAL_tx_status", params: { tx_hash: $tx_hash, sender_account_id: $signer_account_id, wait_until: "FINAL" } }')" \ | tee /tmp/failed-batch-rpc-status.json >/dev/null jq '{ final_execution_status: .result.final_execution_status, failed_action_index: .result.status.Failure.ActionError.index, failure: .result.status.Failure.ActionError.kind.FunctionCallError.CompilationError.CodeDoesNotExist }' /tmp/failed-batch-rpc-status.json # Expected failed_action_index: 3 # Expected failure account_id: rollback-mo4vmkig.temp.mike.testnet ``` 3. Query the intended new account after finality and prove it still does not exist. ```bash curl -s "$RPC_URL" \ -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" } }')" \ | tee /tmp/failed-batch-view-account.json >/dev/null jq '{ error: .error.cause.name, message: .error.data, requested_account_id: .error.cause.info.requested_account_id, proof_block_height: .error.cause.info.block_height }' /tmp/failed-batch-view-account.json # Expected error: "UNKNOWN_ACCOUNT" ``` That one post-state check is enough here. If `CreateAccount` had stuck, `view_account` would resolve. Because the account still does not exist, the earlier `Transfer` and `AddKey` from the same batched receipt did not stick either. **Why this next step?** For another failed batch, keep the same pattern: read what the transaction tried to do from [`POST /v0/transactions`](https://docs.fastnear.com/tx/transactions), confirm the exact top-level failure with RPC transaction status, then inspect post-state on the account, key, contract, or other object that would have changed if the earlier actions had stuck. ### Why did this contract call look successful, but a later receipt failed? Use this investigation when one contract call logged success, changed its own local state, and even the top-level RPC `status` looks successful, but the app still broke because a later detached cross-contract receipt failed. This is the opposite of the failed batch example above. There, one action failed inside the first action receipt, so nothing in that batch stuck. Here, the first contract receipt really did succeed and its state change really did stick. The failure happened later, in a separate receipt. Strategy First get the human timeline, then prove where the async story split. 01POST /v0/transactions gives the easiest first pass: which receipt ran first, and which receipt failed later. 02RPC EXPERIMENTAL_tx_status proves the important NEAR nuance that top-level success and later descendant failure can both be true. 03RPC call_function on the router contract tells you whether the first receipt's own local state change stuck. **Goal** - Prove, from one pinned testnet transaction, that `seq-dr.mike.testnet.kickoff_append(...)` succeeded on its own receipt, then a detached `append(...)` call failed one block later with `CodeDoesNotExist`. **Official references** - [Transaction foundations](https://docs.fastnear.com/transaction-flow/foundations) - [Runtime execution](https://docs.fastnear.com/transaction-flow/runtime-execution) This pinned async failure was captured on **April 18, 2026** on testnet: - transaction hash: `AUciGAq54XZtEuVXA9bSq4k6h13LmspoKtLegcWGRmQz` - signer account: `temp.mike.testnet` - first contract receiver: `seq-dr.mike.testnet` - detached target account: `asyncfail-in2hwikn.temp.mike.testnet` - transaction inclusion block: `246368568` - successful first receipt: `6XgWxB9QVkgGKJaLcjDphGHYTK5d1suNe2cH1WHRWnoS` at block `246368569` - later failed receipt: `2A5JG8N1BxyR57WbrjqntTSf1UwR4RXR79MD2Zg3K2es` at block `246368570` - first method: `kickoff_append` - later failed method: `append` - top-level RPC `status`: `SuccessValue` ```mermaid flowchart LR T["Signed tx
kickoff_append(...)"] --> R["First receipt on seq-dr.mike.testnet
SuccessValue + kickoff log"] R --> S["Router stores local state
kicked += late-failure"] R --> D["Detached cross-contract receipt
append(...)"] D --> F["Later failure
CodeDoesNotExist"] S -. "state from the first receipt still sticks" .-> K["kicked() still contains late-failure"] ``` | Surface | Endpoint | How we use it | Why we use it | | --- | --- | --- | --- | | Transaction skeleton | Transactions API [`POST /v0/transactions`](https://docs.fastnear.com/tx/transactions) | Fetch the pinned transaction and print the included block plus the per-receipt timeline | Gives the shortest readable overview of which receipt ran first and which receipt failed later | | Exact status semantics | RPC [`EXPERIMENTAL_tx_status`](https://docs.fastnear.com/rpc/transaction/experimental-tx-status) | Inspect the top-level `status`, the first contract receipt outcome, and the later failed receipt outcome | Proves that top-level success and later descendant failure can coexist in one async story | | Current contract state | RPC [`query(call_function)`](https://docs.fastnear.com/rpc/contract/call-function) | Call `seq-dr.mike.testnet.kicked()` | Shows that the first receipt's local state change stuck even though the later detached receipt failed | One NEAR detail matters here: receipt success is not transitive. `seq-dr.mike.testnet` returned success on its own receipt because `kickoff_append(...)` only logged and detached the next hop. The detached `append(...)` receipt was a separate piece of async work, so its later failure did not rewind the router's earlier state change. **What a useful answer should include** - that the signed transaction successfully handed off into the first router receipt - that the router receipt itself succeeded and emitted the `dishonest_router:kickoff:late-failure` log - that the later detached receipt to `asyncfail-in2hwikn.temp.mike.testnet` failed with `CodeDoesNotExist` - that the router's own state still contains `late-failure`, so the first receipt's local side effect stuck - one sentence explaining why this is different from a failed batched transaction #### Later receipt failure shell walkthrough Use this when the user story is “the contract call looked fine, but something failed later, and I need to prove exactly where the story split.” **What you're doing** - Read the transaction and its receipt timeline from the indexed view. - Use RPC transaction status to show that the top-level story still ended in `SuccessValue` even though a later receipt failed. - Read the router's current state to show that the first receipt's local side effect stuck. ```bash TX_BASE_URL=https://tx.test.fastnear.com RPC_URL=https://rpc.testnet.fastnear.com TX_HASH=AUciGAq54XZtEuVXA9bSq4k6h13LmspoKtLegcWGRmQz SIGNER_ACCOUNT_ID=temp.mike.testnet ROUTER_ACCOUNT_ID=seq-dr.mike.testnet FIRST_RECEIPT_ID=6XgWxB9QVkgGKJaLcjDphGHYTK5d1suNe2cH1WHRWnoS FAILED_RECEIPT_ID=2A5JG8N1BxyR57WbrjqntTSf1UwR4RXR79MD2Zg3K2es ``` 1. Fetch the transaction and print the receipt timeline in block order. ```bash curl -s "$TX_BASE_URL/v0/transactions" \ -H 'content-type: application/json' \ --data "$(jq -nc --arg tx_hash "$TX_HASH" '{tx_hashes: [$tx_hash]}')" \ | tee /tmp/later-receipt-failure-transaction.json >/dev/null jq '{ transaction: { hash: .transactions[0].transaction.hash, signer_id: .transactions[0].transaction.signer_id, receiver_id: .transactions[0].transaction.receiver_id, tx_block_height: .transactions[0].execution_outcome.block_height, tx_handoff: .transactions[0].transaction_outcome.outcome.status }, receipts: [ .transactions[0].receipts[] | { receipt_id: .receipt.receipt_id, receiver_id: .receipt.receiver_id, block_height: .execution_outcome.block_height, method_name: (.receipt.receipt.Action.actions[0].FunctionCall.method_name // "system_transfer"), status: .execution_outcome.outcome.status } ] }' /tmp/later-receipt-failure-transaction.json # What to notice: # - the first contract receipt on seq-dr.mike.testnet succeeded in block 246368569 # - the later append(...) receipt failed in block 246368570 ``` 2. Query RPC transaction status and compare the top-level story with the later failed receipt. ```bash curl -s "$RPC_URL" \ -H 'content-type: application/json' \ --data "$(jq -nc \ --arg tx_hash "$TX_HASH" \ --arg signer_account_id "$SIGNER_ACCOUNT_ID" '{ jsonrpc: "2.0", id: "fastnear", method: "EXPERIMENTAL_tx_status", params: { tx_hash: $tx_hash, sender_account_id: $signer_account_id, wait_until: "FINAL" } }')" \ | tee /tmp/later-receipt-failure-rpc.json >/dev/null jq \ --arg first_receipt_id "$FIRST_RECEIPT_ID" \ --arg failed_receipt_id "$FAILED_RECEIPT_ID" '{ top_level_status: .result.status, transaction_handoff: .result.transaction_outcome.outcome.status, first_contract_receipt: ( .result.receipts_outcome[] | select(.id == $first_receipt_id) | { receipt_id: .id, executor_id: .outcome.executor_id, logs: .outcome.logs, status: .outcome.status } ), later_failed_receipt: ( .result.receipts_outcome[] | select(.id == $failed_receipt_id) | { receipt_id: .id, executor_id: .outcome.executor_id, status: .outcome.status } ) }' /tmp/later-receipt-failure-rpc.json # What to notice: # - top_level_status is still SuccessValue # - the first contract receipt logged dishonest_router:kickoff:late-failure # - the later append(...) receipt failed with CodeDoesNotExist ``` 3. Read the router's current state and confirm that the first receipt's local side effect stuck. ```bash curl -s "$RPC_URL" \ -H 'content-type: application/json' \ --data "$(jq -nc --arg account_id "$ROUTER_ACCOUNT_ID" '{ jsonrpc: "2.0", id: "fastnear", method: "query", params: { request_type: "call_function", account_id: $account_id, method_name: "kicked", args_base64: "e30=", finality: "final" } }')" \ | tee /tmp/later-receipt-failure-kicked.json >/dev/null jq '{ kicked: (.result.result | implode | fromjson), contains_late_failure: ((.result.result | implode | fromjson) | index("late-failure") != null) }' /tmp/later-receipt-failure-kicked.json ``` That last read is the practical proof that the first receipt's local state change stuck. The later failed receipt did not rewind the router's earlier `kicked.push(...)`. **Why this next step?** When a NEAR app “looked successful” and still broke later, the thing to ask is not just “what was the transaction status?” but “which receipt succeeded, and which later receipt failed?” This example gives you that exact split: indexed receipt timeline for the shape, RPC status for the exact semantics, and one contract-state read to prove the earlier side effect stuck. ### Trace an async promise chain and prove callback order Use this investigation when one transaction creates promise work for later, a second transaction resumes it, and the real question is not “did both transactions succeed?” but “did the cross-contract callbacks actually run in the order I intended?” Strategy Treat the two tx hashes as one async story: prove the work was live, recover the requested order, then compare it with observed downstream state. 01RPC call_function on the deferred-work view proves the promise work was really live before the resume step. 02POST /v0/transactions gives both block anchors and the exact order that the resume transaction requested. 03RPC EXPERIMENTAL_tx_status plus the downstream recorder view prove where the callbacks actually ran and in what visible order. **Goal** - Turn two transaction hashes into one readable proof story: what promise work was created, what order the resume call requested, and what order later showed up in downstream contract state. If your codebase or helper scripts call this a “stage/release” or “yield/resume” flow, that is fine. For docs, the more useful mental model is simpler: - **create promise work**: one transaction sets up deferred async work for later - **resume promise work**: a later transaction asks the contract to continue that work in a requested order - **trace the async path**: receipt trees show where the cross-contract callbacks actually ran - **observe state**: downstream contract state shows what order became visible to users or integrators ```mermaid flowchart LR Y["Tx 1
creates promise work"] --> H["Yielded promises become live
staged_calls_for(...)"] H --> R["Tx 2
resumes promises in order beta -> alpha -> gamma"] R --> C["Async cross-contract callbacks"] C --> B["Recorder state
beta"] B --> A["Recorder state
alpha"] A --> G["Recorder state
gamma"] Y -. "main receipt-tree evidence lives here" .-> D["Original promise DAG"] R -. "requested order lives here" .-> P["Resume payload"] G -. "observed order ends here" .-> O["Observed downstream order"] ``` That distinction matters because a successful resume transaction still does not prove the observed order by itself. You also need evidence that the promised work was really live before resume, and evidence that downstream state changed in the same order the resume call requested. For NEAR engineers, the important mental model is: the resume transaction tells you the **requested order**, but the original promise transaction usually remains the primary forensic anchor because the resumed callbacks still live on that original async receipt tree. Downstream contract state is what lets you compare requested order with observed order. | Surface | Endpoint | How we use it | Why we use it | | --- | --- | --- | --- | | Promise-chain trace capture | RPC [`EXPERIMENTAL_tx_status`](https://docs.fastnear.com/rpc/transaction/experimental-tx-status) | Query the original promise transaction hash and the later resume transaction hash with `wait_until: "FINAL"`, usually hot RPC first and archival RPC on `UNKNOWN_TRANSACTION` | The receipt DAG is the primary proof surface for callback order and tells you which receipts belong to which async transaction tree | | Promise-readiness check | RPC [`query(call_function)`](https://docs.fastnear.com/rpc/contract/call-function) | Poll the contract view that exposes deferred promise work, such as `staged_calls_for({ caller_id })`, with `finality: "final"` until the yielded promises appear | Confirms the promise work was really live before the resume transaction tried to continue it | | Requested-order anchor | Transactions API [`POST /v0/transactions`](https://docs.fastnear.com/tx/transactions) | Fetch both transaction hashes to recover `block_height`, `block_hash`, `receiver_id`, indexed execution status, and the resume payload | Gives each transaction a durable block anchor and preserves the exact order the resume step requested | | Downstream state snapshots | RPC [`query(call_function)`](https://docs.fastnear.com/rpc/contract/call-function) | Read the downstream recorder state before resume, then poll it after resume until the expected entries appear | Proves actual callback order in contract state, not just metadata in the receipt tree | | Receipt pivot | Transactions API [`POST /v0/receipt`](https://docs.fastnear.com/tx/receipt) | Use any interesting yielded or downstream receipt ID to reconnect it to the originating transaction | Lets you move quickly from one receipt in the DAG back to the broader transaction story | | Per-block reconstruction | Transactions API [`POST /v0/block`](https://docs.fastnear.com/tx/block) | Fetch the included block and the cascade blocks with receipts enabled | Reconstructs the block-by-block execution timeline once you know which blocks matter | | Account activity context | Transactions API [`POST /v0/account`](https://docs.fastnear.com/tx/account) | Fetch function-call history for the contracts that participated in the cascade over the same window | Gives humans a simpler account-history view to compare against the trace | | Block-pinned state replay | RPC [`query(call_function)`](https://docs.fastnear.com/rpc/contract/call-function) | Re-run the recorder view with `block_id` pinned to the interesting heights | Turns final state into a time series so you can say when state changed, not just what it became | **What a useful answer should include** - a one-sentence conclusion in plain language, such as “the first transaction created three deferred promises, the second transaction resumed them in order `beta -> alpha -> gamma`, and the recorder state later confirmed that same callback order” - why the original promise transaction, not only the resume transaction, is usually the primary forensic anchor - the requested callback order and the observed downstream effect order - the blocks where the observable state changed - any receipt or account pivots the next investigator should keep ## SocialDB Proofs These examples start from readable NEAR Social state and walk back to the exact write that made it true. ### Prove that `mike.near` set `profile.name` to `Mike Purvis`, then recover the SocialDB profile write transaction Use this investigation when the user story is “I can see `Mike Purvis` on `mike.near`'s NEAR Social profile, but I want to prove exactly when that field was written and which transaction wrote it.” Strategy Start from the readable field value, then turn its field-level block into one receipt and one write transaction. 01NEAR Social POST /get gives both the current profile.name value and the field-level :block. 02POST /v0/block turns that block into the concrete mike.near -> social.near receipt and transaction hash. 03POST /v0/transactions proves the write payload, and RPC call_function get confirms the field still resolves that way now. **Goal** - Start from one readable SocialDB profile field, then recover the exact receipt and originating transaction that wrote it. **Official references** - [SocialDB API and contract surface](https://github.com/NearSocial/social-db#api) - [NEAR Social live read surface](https://api.near.social) This follows the same proof recipe as the follow-edge investigation, but it teaches one extra SocialDB nuance: for historical proof, the field-level `:block` is usually more precise than the parent object's `:block`. In this live case, `mike.near/profile/name` was written at block `78675795`, while the broader `mike.near/profile` object later advanced to a different block because unrelated sibling fields changed. FastNear's role is to turn that field-level block into a receipt, then a transaction, and then a readable write payload. For this live example, the current `profile.name` value is `Mike Purvis`, the field-level SocialDB write block is `78675795`, the receipt ID is `2gbAmEEdcCNARuCorquXStftqvWFmPG2GSaMJXFw5qiN`, the originating transaction hash is `6zMb9L6rLNufZGUgCmeHTh5LvFsn3R92dPxuubH6MRsZ`, and the outer transaction block is `78675794`. | Surface | Endpoint | How we use it | Why we use it | | --- | --- | --- | --- | | Semantic field lookup | NEAR Social `POST /get` | Read `mike.near/profile/name` with block metadata enabled | Gives the human-readable field value and the field-level SocialDB `:block` anchor where that value was written | | Receipt bridge | Transactions API [`POST /v0/block`](https://docs.fastnear.com/tx/block) | Use the SocialDB field block with `with_receipts: true`, then filter the block receipts back down to `mike.near -> social.near` | Turns the field-level write block into a concrete receipt and originating transaction hash | | Transaction story | Transactions API [`POST /v0/transactions`](https://docs.fastnear.com/tx/transactions) | Fetch the originating transaction by hash and decode the first `FunctionCall.args` payload | Proves that the underlying write was a `social.near set` call that carried `profile.name` and the surrounding profile fields in the same payload | | Canonical current-state confirmation | RPC [`query(call_function)`](https://docs.fastnear.com/rpc/contract/call-function) | Call `social.near get` directly at `final` | Confirms the field still has that value now, even though the earlier steps already proved the specific historical write | **What a useful answer should include** - whether `mike.near/profile/name` still resolves to `Mike Purvis` - the field-level SocialDB write block height (`78675795`) and why that anchor is better than the parent profile block for this question - the specific receipt ID and originating transaction hash behind that write - proof that the write was a `set` call carrying `profile.name` and other profile fields in the same payload - the distinction between the receipt execution block (`78675795`) and the outer transaction inclusion block (`78675794`) #### NEAR Social profile-proof shell walkthrough Use this when you want a concrete, repeatable proof chain from one readable NEAR Social profile field to the exact SocialDB write transaction behind it. **What you're doing** - Read the current `profile.name` field from NEAR Social and capture its field-level SocialDB write block. - Reuse that block height in FastNear block receipts to recover the receipt ID and transaction hash. - Reuse the transaction hash in `POST /v0/transactions` to prove the payload was a `social.near set` write carrying `profile.name`. - Finish with canonical RPC confirmation that the field still resolves to the same value at `final`. ```bash SOCIAL_API_BASE_URL=https://api.near.social TX_BASE_URL=https://tx.main.fastnear.com RPC_URL=https://rpc.mainnet.fastnear.com ACCOUNT_ID=mike.near PROFILE_FIELD=profile/name ``` 1. Read the profile field from NEAR Social and capture the field-level SocialDB write block. ```bash PROFILE_BLOCK_HEIGHT="$( curl -s "$SOCIAL_API_BASE_URL/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} }')" \ | tee /tmp/mike-profile-name.json \ | jq -r --arg account_id "$ACCOUNT_ID" \ '.[ $account_id ].profile.name[":block"]' )" 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"] }' /tmp/mike-profile-name.json # Expected current_name: "Mike Purvis" # Expected field block height: 78675795 ``` 2. Reuse that block height in FastNear block receipts and recover the receipt and transaction bridge. ```bash PROFILE_TX_HASH="$( curl -s "$TX_BASE_URL/v0/block" \ -H 'content-type: application/json' \ --data "$(jq -nc --argjson block_id "$PROFILE_BLOCK_HEIGHT" '{ block_id: $block_id, with_transactions: false, with_receipts: true }')" \ | tee /tmp/mike-profile-block.json \ | jq -r --arg account_id "$ACCOUNT_ID" ' first( .block_receipts[] | select(.predecessor_id == $account_id and .receiver_id == "social.near") | .transaction_hash )' )" 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 } ) ) }' /tmp/mike-profile-block.json # Expected receipt ID: 2gbAmEEdcCNARuCorquXStftqvWFmPG2GSaMJXFw5qiN # Expected transaction hash: 6zMb9L6rLNufZGUgCmeHTh5LvFsn3R92dPxuubH6MRsZ ``` 3. Reuse the derived transaction hash in `POST /v0/transactions` and decode the SocialDB write payload. ```bash curl -s "$TX_BASE_URL/v0/transactions" \ -H 'content-type: application/json' \ --data "$(jq -nc --arg tx_hash "$PROFILE_TX_HASH" '{tx_hashes: [$tx_hash]}')" \ | tee /tmp/mike-profile-transaction.json >/dev/null jq '{ 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 | { method_name, profile_name: (.args | @base64d | fromjson | .data["mike.near"].profile.name), description: (.args | @base64d | fromjson | .data["mike.near"].profile.description), tags: ( .args | @base64d | fromjson | .data["mike.near"].profile.tags | keys ) } ) }' /tmp/mike-profile-transaction.json ``` 4. Finish with canonical current-state confirmation via raw RPC. ```bash SOCIAL_GET_ARGS_BASE64="$( jq -nr --arg account_id "$ACCOUNT_ID" --arg profile_field "$PROFILE_FIELD" '{ keys: [($account_id + "/" + $profile_field)] } | @base64' )" curl -s "$RPC_URL" \ -H 'content-type: application/json' \ --data "$(jq -nc --arg args_base64 "$SOCIAL_GET_ARGS_BASE64" '{ jsonrpc: "2.0", id: "fastnear", method: "query", params: { request_type: "call_function", account_id: "social.near", method_name: "get", args_base64: $args_base64, finality: "final" } }')" \ | tee /tmp/mike-profile-rpc.json >/dev/null jq --arg account_id "$ACCOUNT_ID" '{ finality: "final", current_name: ( .result.result | implode | fromjson | .[$account_id].profile.name ) }' /tmp/mike-profile-rpc.json ``` That last step confirms the field still resolves to `Mike Purvis` now. The earlier NEAR Social and FastNear steps are what proved which historical write set that field and which transaction carried the write. **Why this next step?** NEAR Social gives you the semantic field value. FastNear block receipts give you the bridge to a specific write. FastNear transaction lookup turns that write into a readable profile payload. RPC gives you canonical current-state confirmation. ### Prove that `mike.near` followed `mob.near`, then recover the SocialDB write transaction Use this investigation when the user story is “I can see that `mike.near` follows `mob.near`, but I want to prove exactly when that follow edge was written and which transaction wrote it.” Strategy Start from the semantic follow edge, then use its write block as the bridge back to one receipt and one transaction. 01NEAR Social POST /get gives the readable follow edge and the SocialDB :block where it was written. 02POST /v0/block turns that write block into the specific receipt and transaction hash behind the edge. 03POST /v0/transactions proves the graph.follow plus index.graph payload, and RPC call_function get confirms the edge still exists now. **Goal** - Start from the readable NEAR Social follow edge, then recover the exact receipt and originating transaction that wrote it into SocialDB. **Official references** - [SocialDB API and contract surface](https://github.com/NearSocial/social-db#api) - [NEAR Social live read surface](https://api.near.social) The readable follow edge comes from NEAR Social data, not from FastNear. The important bridge is the SocialDB `:block` metadata: it tells you the receipt execution block where that value was written. That block is not the same thing as the original outer transaction inclusion block. FastNear's job in this workflow is to turn that block height into a receipt, then into a transaction, and finally into a readable execution story. For this live example, the current edge is `mike.near -> mob.near`, the SocialDB write block is `79574924`, the receipt ID is `UiyiQaqHbkkMxkrB6rDkYr7X5EQLt8QG9MDATrES7Th`, the originating transaction hash is `FLLmTvFx9vCof79scy2uUviF5WwYmevkz9TZ8azPGVQb`, and the outer transaction block is `79574923`. | Surface | Endpoint | How we use it | Why we use it | | --- | --- | --- | --- | | Semantic edge lookup | NEAR Social `POST /get` | Read `mike.near/graph/follow/mob.near` with block metadata enabled | Gives the human-readable follow edge and the SocialDB `:block` anchor where that value was written | | Receipt bridge | Transactions API [`POST /v0/block`](https://docs.fastnear.com/tx/block) | Use the SocialDB block height with `with_receipts: true`, then filter the block receipts back down to `mike.near -> social.near` | Turns the SocialDB write block into a concrete receipt and originating transaction hash | | Transaction story | Transactions API [`POST /v0/transactions`](https://docs.fastnear.com/tx/transactions) | Fetch the originating transaction by hash and decode the first `FunctionCall.args` payload | Proves that the underlying write was a `social.near set` call that wrote both `graph.follow` and `index.graph` entries | | Canonical current-state confirmation | RPC [`query(call_function)`](https://docs.fastnear.com/rpc/contract/call-function) | Call `social.near get` directly at `final` | Confirms the follow edge still exists now, even though the earlier steps already proved the specific historical write | **What a useful answer should include** - whether the `mike.near -> mob.near` follow edge exists now - the SocialDB write block height (`79574924`) and why it is a receipt execution block - the specific receipt ID and originating transaction hash behind that write - proof that the write was a `set` call carrying both `graph.follow.mob.near` and the matching `index.graph` entry - the distinction between the receipt execution block (`79574924`) and the outer transaction inclusion block (`79574923`) #### NEAR Social follow-proof shell walkthrough Use this when you want a concrete, repeatable proof chain from one readable NEAR Social follow edge to the exact SocialDB write transaction behind it. **What you're doing** - Read the current follow edge from NEAR Social and capture the SocialDB write block. - Reuse that block height in FastNear block receipts to recover the receipt ID and transaction hash. - Reuse the transaction hash in `POST /v0/transactions` to prove the payload was a `social.near set` write. - Finish with canonical RPC confirmation that the edge still exists at `final`. ```bash SOCIAL_API_BASE_URL=https://api.near.social TX_BASE_URL=https://tx.main.fastnear.com RPC_URL=https://rpc.mainnet.fastnear.com ACCOUNT_ID=mike.near TARGET_ACCOUNT_ID=mob.near ``` 1. Read the follow edge from NEAR Social and capture the SocialDB write block. ```bash FOLLOW_BLOCK_HEIGHT="$( curl -s "$SOCIAL_API_BASE_URL/get" \ -H 'content-type: application/json' \ --data "$(jq -nc \ --arg account_id "$ACCOUNT_ID" \ --arg target_account_id "$TARGET_ACCOUNT_ID" '{ keys: [($account_id + "/graph/follow/" + $target_account_id)], options: {with_block_height: true} }')" \ | tee /tmp/mike-follow-edge.json \ | jq -r --arg account_id "$ACCOUNT_ID" --arg target_account_id "$TARGET_ACCOUNT_ID" \ '.[ $account_id ].graph.follow[ $target_account_id ][":block"]' )" jq --arg account_id "$ACCOUNT_ID" --arg target_account_id "$TARGET_ACCOUNT_ID" '{ follow_edge: .[$account_id].graph.follow[$target_account_id][""], follow_block_height: .[$account_id].graph.follow[$target_account_id][":block"] }' /tmp/mike-follow-edge.json # Expected follow block height: 79574924 ``` 2. Reuse that block height in FastNear block receipts and recover the receipt and transaction bridge. ```bash FOLLOW_TX_HASH="$( curl -s "$TX_BASE_URL/v0/block" \ -H 'content-type: application/json' \ --data "$(jq -nc --argjson block_id "$FOLLOW_BLOCK_HEIGHT" '{ block_id: $block_id, with_transactions: false, with_receipts: true }')" \ | tee /tmp/mike-follow-block.json \ | jq -r --arg account_id "$ACCOUNT_ID" ' first( .block_receipts[] | select(.predecessor_id == $account_id and .receiver_id == "social.near") | .transaction_hash )' )" jq --arg account_id "$ACCOUNT_ID" '{ follow_receipt: ( first( .block_receipts[] | select(.predecessor_id == $account_id and .receiver_id == "social.near") | { receipt_id, transaction_hash, block_height, tx_block_height } ) ) }' /tmp/mike-follow-block.json # Expected receipt ID: UiyiQaqHbkkMxkrB6rDkYr7X5EQLt8QG9MDATrES7Th # Expected transaction hash: FLLmTvFx9vCof79scy2uUviF5WwYmevkz9TZ8azPGVQb ``` 3. Reuse the derived transaction hash in `POST /v0/transactions` and decode the SocialDB write payload. ```bash curl -s "$TX_BASE_URL/v0/transactions" \ -H 'content-type: application/json' \ --data "$(jq -nc --arg tx_hash "$FOLLOW_TX_HASH" '{tx_hashes: [$tx_hash]}')" \ | tee /tmp/mike-follow-transaction.json >/dev/null jq '{ 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 | { method_name, follow_edge: (.args | @base64d | fromjson | .data["mike.near"].graph.follow["mob.near"]), index_graph: ( .args | @base64d | fromjson | .data["mike.near"].index.graph | fromjson | map(select(.value.accountId == "mob.near")) ) } ) }' /tmp/mike-follow-transaction.json ``` 4. Finish with canonical current-state confirmation via raw RPC. ```bash SOCIAL_GET_ARGS_BASE64="$( jq -nr --arg account_id "$ACCOUNT_ID" --arg target_account_id "$TARGET_ACCOUNT_ID" '{ keys: [($account_id + "/graph/follow/" + $target_account_id)] } | @base64' )" curl -s "$RPC_URL" \ -H 'content-type: application/json' \ --data "$(jq -nc --arg args_base64 "$SOCIAL_GET_ARGS_BASE64" '{ jsonrpc: "2.0", id: "fastnear", method: "query", params: { request_type: "call_function", account_id: "social.near", method_name: "get", args_base64: $args_base64, finality: "final" } }')" \ | tee /tmp/mike-follow-rpc.json >/dev/null jq --arg account_id "$ACCOUNT_ID" --arg target_account_id "$TARGET_ACCOUNT_ID" '{ finality: "final", current_follow_edge: ( .result.result | implode | fromjson | .[$account_id].graph.follow[$target_account_id] ) }' /tmp/mike-follow-rpc.json ``` That last step confirms the follow edge still exists now. The earlier NEAR Social and FastNear steps are what proved which historical write created the edge and which transaction carried that write. **Why this next step?** NEAR Social gives you the semantic edge. FastNear block receipts give you the bridge to a specific write. FastNear transaction lookup turns that write into a readable story. RPC gives you canonical current-state confirmation. ### Which transaction wrote `mob.near/widget/Profile`? Use this investigation when the question is “I already know `mob.near/widget/Profile` exists right now. Which transaction wrote the widget version I am looking at?” This is the natural tx-side companion to the lighter RPC widget inspection and the provenance-NFT workflow. The job is straightforward: - start from the widget's own SocialDB block - turn that block into one `mob.near -> social.near` receipt - recover the originating transaction - decode the `set` payload and prove it really carried the widget source Strategy Treat the widget’s write block as the whole bridge: block to receipt, receipt to transaction, transaction to source code. 01POST /v0/block starts from the widget block and narrows it to one mob.near -> social.near receipt. 02POST /v0/transactions turns that receipt into one readable set payload carrying the widget source. 03RPC call_function get is the final current-state confirmation that the widget still exists now. **Goal** - Turn one widget-level SocialDB block into one readable answer: which transaction wrote `mob.near/widget/Profile`, which receipt executed the write, and what exact widget source appeared in that payload. **Official references** - [SocialDB API and contract surface](https://github.com/NearSocial/social-db#api) For this live anchor: - account: `mob.near` - widget: `Profile` - SocialDB write block: `86494825` - receipt ID: `CZyjiBjphzE95tFEqi1YH6eLCLhqknaW4SQ5R4L6pkC6` - originating transaction hash: `9QDupdK2ewMxfSvMmdGEkdBcVnoL4TexmXY2FnMRxfia` - outer transaction block: `86494824` | Surface | Endpoint | How we use it | Why we use it | | --- | --- | --- | --- | | Block-to-receipt bridge | Transactions API [`POST /v0/block`](https://docs.fastnear.com/tx/block) | Start from block `86494825` with `with_receipts: true`, then filter back down to `mob.near -> social.near` | Turns the widget's write block into one concrete receipt and one concrete transaction hash | | Transaction story | Transactions API [`POST /v0/transactions`](https://docs.fastnear.com/tx/transactions) | Fetch the originating transaction and decode the `FunctionCall.args` payload | Proves the write was a `social.near set` call carrying the `mob.near/widget/Profile` source code | | Canonical current-state confirmation | RPC [`query(call_function)`](https://docs.fastnear.com/rpc/contract/call-function) | Call `social.near get` directly at `final` for the same widget path | Confirms that the widget still exists now, even though the earlier steps already proved which historical transaction wrote it | **What a useful answer should include** - the write block height and why it is the receipt execution block, not the outer transaction block - the specific receipt ID and originating transaction hash behind the widget write - proof that the write payload was a `set` call carrying `mob.near/widget/Profile` - one plain-English sentence like “`mob.near` wrote `widget/Profile` in tx `9QDup...`, and the payload really did store the current profile widget source” #### NEAR Social widget write-proof shell walkthrough ## Settlement Trace This is the richest single-trace investigation on the page: one live NEAR Intents settlement, from top-level tx to the receipts and events that explain it. Use this when you want to turn one widget block anchor into the exact transaction that wrote it. **What you're doing** - Start from the widget's last-write block. - Reuse that block height in FastNear block receipts to recover the receipt and transaction bridge. - Reuse the transaction hash in `POST /v0/transactions` to decode the stored widget source. - Finish with raw RPC confirmation that the widget still exists now. ```bash TX_BASE_URL=https://tx.main.fastnear.com RPC_URL=https://rpc.mainnet.fastnear.com ACCOUNT_ID=mob.near WIDGET_NAME=Profile WIDGET_BLOCK_HEIGHT=86494825 ``` 1. Start from the widget's last-write block and recover the SocialDB receipt plus transaction hash. ```bash WIDGET_TX_HASH="$( curl -s "$TX_BASE_URL/v0/block" \ -H 'content-type: application/json' \ --data "$(jq -nc --argjson block_id "$WIDGET_BLOCK_HEIGHT" '{ block_id: $block_id, with_transactions: false, with_receipts: true }')" \ | tee /tmp/mob-widget-block.json \ | jq -r --arg account_id "$ACCOUNT_ID" ' first( .block_receipts[] | select(.predecessor_id == $account_id and .receiver_id == "social.near") | .transaction_hash )' )" jq --arg account_id "$ACCOUNT_ID" '{ widget_write_receipt: ( first( .block_receipts[] | select(.predecessor_id == $account_id and .receiver_id == "social.near") | { receipt_id, transaction_hash, block_height, tx_block_height } ) ) }' /tmp/mob-widget-block.json # Expected receipt ID: CZyjiBjphzE95tFEqi1YH6eLCLhqknaW4SQ5R4L6pkC6 # Expected transaction hash: 9QDupdK2ewMxfSvMmdGEkdBcVnoL4TexmXY2FnMRxfia ``` 2. Reuse the transaction hash and decode the SocialDB `set` payload. ```bash curl -s "$TX_BASE_URL/v0/transactions" \ -H 'content-type: application/json' \ --data "$(jq -nc --arg tx_hash "$WIDGET_TX_HASH" '{tx_hashes: [$tx_hash]}')" \ | tee /tmp/mob-widget-transaction.json >/dev/null jq '{ 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].transaction.actions[0].FunctionCall | { method_name, widget_source_head: ( .args | @base64d | fromjson | .data["mob.near"].widget.Profile[""] | split("\n")[0:12] ) } ) }' /tmp/mob-widget-transaction.json ``` That second step is the payoff. You are no longer just saying “something in that block updated SocialDB.” You are proving that tx `9QDup...` called `social.near set` and carried the actual `mob.near/widget/Profile` widget body in its args. 3. Finish with canonical current-state confirmation via raw RPC. ```bash SOCIAL_GET_ARGS_BASE64="$( jq -nr --arg account_id "$ACCOUNT_ID" --arg widget_name "$WIDGET_NAME" '{ keys: [($account_id + "/widget/" + $widget_name)] } | @base64' )" curl -s "$RPC_URL" \ -H 'content-type: application/json' \ --data "$(jq -nc --arg args_base64 "$SOCIAL_GET_ARGS_BASE64" '{ jsonrpc: "2.0", id: "fastnear", method: "query", params: { request_type: "call_function", account_id: "social.near", method_name: "get", args_base64: $args_base64, finality: "final" } }')" \ | tee /tmp/mob-widget-rpc.json >/dev/null jq --arg account_id "$ACCOUNT_ID" --arg widget_name "$WIDGET_NAME" '{ finality: "final", current_widget_head: ( .result.result | implode | fromjson | .[$account_id].widget[$widget_name] | split("\n")[0:5] ) }' /tmp/mob-widget-rpc.json ``` That last step confirms the widget still exists now. The earlier block and transaction steps are what proved which historical write created it. **Why this next step?** The widget's write block gives you the bridge. FastNear block receipts turn that bridge into one receipt and one transaction hash. FastNear transaction lookup turns the hash into readable write proof. RPC then confirms that the widget still exists now. ### Trace one NEAR Intents settlement and show what actually happened Use this investigation when the user story is “I have one `intents.near` transaction. Show me what actually happened on-chain, which contracts participated, and which events prove it.” Strategy Treat one settlement like a readable trace before you treat it like protocol theory. 01POST /v0/transactions gives the settlement skeleton: entrypoint, first downstream contracts, and early logs. 02POST /v0/block reuses the same anchor when you want the block-level context around that settlement. 03RPC EXPERIMENTAL_tx_status is where you go for the canonical receipt DAG and the event names that prove what actually moved. **Goal** - Start from one fixed `intents.near` transaction and turn it into a readable settlement story: which method kicked things off, which downstream contracts appeared, and which event families tell you what moved. **Official references** - [NEAR Intents overview](https://docs.near.org/chain-abstraction/intents/overview) - [Intent types and execution](https://docs.near-intents.org/integration/verifier-contract/intent-types-and-execution) - [Account abstraction](https://docs.near-intents.org/integration/verifier-contract/account-abstraction) For the live trace below, use this fixed mainnet settlement anchor captured on **April 18, 2026**: - transaction hash: `4cfei8p4HBeNxJnCLjfShhDYGmXZwFVwFgY1sYpyygE7` - signer and receiver: `intents.near` - included block height: `194573310` The fast mental model is simple: - `intents.near` runs the settlement entrypoint - downstream receipts fan out to the contracts that actually move or withdraw assets - event logs tell you which settlement actions happened, with names like `token_diff`, `intents_executed`, `mt_transfer`, and `mt_withdraw` For this specific settlement, the short human answer is already pretty good: - `intents.near` called `execute_intents` - downstream receipts hit `v2_1.omni.hot.tg` and `bridge-refuel.hot.tg` - the trace emitted `token_diff`, `intents_executed`, `mt_transfer`, `mt_withdraw`, and `mt_burn` If you want the protocol background, the core matching shape is the two-party `token_diff` intent: one side signs the asset diff it wants, the other side signs the opposite diff, and the matched pair gets submitted for settlement. For operational tracing, though, it is usually clearer to start from one real settlement and read the chain evidence directly. ```mermaid flowchart LR T["One mainnet transaction
4cfei8p4..."] --> I["intents.near
execute_intents"] I --> R["Downstream receipts"] R --> C["Other contracts participate"] R --> E["Event logs appear"] E --> TD["token_diff"] E --> IE["intents_executed"] E --> MT["mt_transfer / mt_withdraw"] ``` The public FastNear surfaces are enough to answer the practical question: | Surface | Endpoint | How we use it | Why we use it | | --- | --- | --- | --- | | Settlement skeleton | Transactions API [`POST /v0/transactions`](https://docs.fastnear.com/tx/transactions) | Start from the fixed transaction hash and print the main transaction plus the first downstream receipts | Gives you the fastest readable answer to “what did this settlement call into next?” | | Block context | Transactions API [`POST /v0/block`](https://docs.fastnear.com/tx/block) | Fetch the included block with receipts enabled and filter it back down to the same transaction hash | Shows where the settlement landed and which receipts from that transaction appeared in the block | | Canonical receipt and event proof | RPC [`EXPERIMENTAL_tx_status`](https://docs.fastnear.com/rpc/transaction/experimental-tx-status) | Ask for the same transaction with `wait_until: "FINAL"` and inspect `receipts_outcome` plus `EVENT_JSON` logs | Gives you the protocol-native DAG, executor IDs, and event names that explain what the settlement actually did | **What a useful answer should include** - the settlement entrypoint you observed on `intents.near` - which downstream contracts and methods appeared right after it - which event families the trace emitted - a one-sentence summary of what happened, in plain language This example intentionally stays on public FastNear surfaces. NEAR Intents Explorer and the 1Click Explorer are useful too, but their Explorer API is JWT-gated and not the right default for a public docs walkthrough. #### NEAR Intents settlement shell walkthrough Use this when you want one concrete `intents.near` settlement that you can inspect immediately with public FastNear endpoints. **What you're doing** - Pull the readable settlement story from Transactions API. - Reuse the included block hash in `POST /v0/block` to inspect the containing block. - Confirm the canonical receipt DAG and event families with `EXPERIMENTAL_tx_status`. ```bash TX_BASE_URL=https://tx.main.fastnear.com RPC_URL=https://rpc.mainnet.fastnear.com INTENTS_TX_HASH=4cfei8p4HBeNxJnCLjfShhDYGmXZwFVwFgY1sYpyygE7 INTENTS_SIGNER_ID=intents.near ``` 1. Start with the settlement transaction itself and recover the first readable receipt flow. ```bash INTENTS_BLOCK_HASH="$( curl -s "$TX_BASE_URL/v0/transactions" \ -H 'content-type: application/json' \ --data "$(jq -nc --arg tx_hash "$INTENTS_TX_HASH" '{tx_hashes: [$tx_hash]}')" \ | tee /tmp/intents-transaction.json \ | jq -r '.transactions[0].execution_outcome.block_hash' )" jq '{ 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 }, receipt_flow: [ .transactions[0].receipts[:6][] | { receipt_id: .receipt.receipt_id, receiver_id: .receipt.receiver_id, block_height: .execution_outcome.block_height, methods: ( [.receipt.receipt.Action.actions[]?.FunctionCall.method_name] | map(select(. != null)) ), first_log: (.execution_outcome.outcome.logs[0] // null) } ] }' /tmp/intents-transaction.json ``` That first step already gives you a strong operator answer: `intents.near` ran the settlement transaction, and the early downstream receipts show which contracts joined the cascade. 2. Reuse the block hash to inspect the containing block with receipts enabled. ```bash curl -s "$TX_BASE_URL/v0/block" \ -H 'content-type: application/json' \ --data "$(jq -nc --arg block_id "$INTENTS_BLOCK_HASH" '{ block_id: $block_id, with_receipts: true, with_transactions: false }')" \ | tee /tmp/intents-block.json >/dev/null jq --arg tx_hash "$INTENTS_TX_HASH" '{ block_height: .block.block_height, block_hash: .block.block_hash, tx_receipts: [ .block_receipts[] | select(.transaction_hash == $tx_hash) | { receipt_id, predecessor_id, receiver_id, block_height } ] }' /tmp/intents-block.json ``` 3. Confirm the canonical receipt DAG and extract the event families from RPC. ```bash curl -s "$RPC_URL" \ -H 'content-type: application/json' \ --data "$(jq -nc \ --arg tx_hash "$INTENTS_TX_HASH" \ --arg sender_account_id "$INTENTS_SIGNER_ID" '{ jsonrpc: "2.0", id: "fastnear", method: "EXPERIMENTAL_tx_status", params: { tx_hash: $tx_hash, sender_account_id: $sender_account_id, wait_until: "FINAL" } }')" \ | tee /tmp/intents-rpc.json >/dev/null jq '{ final_execution_status: .result.final_execution_status, receipts_outcome: [ .result.receipts_outcome[:6][] | { receipt_id: .id, executor_id: .outcome.executor_id, first_log: (.outcome.logs[0] // null) } ] }' /tmp/intents-rpc.json jq -r ' .result.receipts_outcome[] | .outcome.logs[] | select(startswith("EVENT_JSON:")) | capture("event\":\"(?[^\"]+)\"").event ' /tmp/intents-rpc.json | sort -u ``` **Why this next step?** `POST /v0/transactions` tells you what the settlement called into. `POST /v0/block` shows where that settlement landed in block context. `EXPERIMENTAL_tx_status` is the canonical follow-up when you need executor IDs, receipt-DAG structure, and raw event names to explain what actually happened. ## Common jobs ### Look up one transaction **Start here** - [Transactions by Hash](https://docs.fastnear.com/tx/transactions) when you already know the transaction ID. **Next page if needed** - [Receipt Lookup](https://docs.fastnear.com/tx/receipt) if the interesting part is now a downstream receipt. - [Block](https://docs.fastnear.com/tx/block) if the block context matters. - [Transaction Status](https://docs.fastnear.com/rpc/transaction/tx-status) if you need canonical RPC confirmation. **Stop when** - You can explain the outcome, affected accounts, and the main execution takeaway. **Switch when** - The user asks for exact RPC-level status semantics or submission behavior. - The transaction lookup alone is not enough to explain downstream execution. ### Investigate a receipt **Start here** - [Receipt Lookup](https://docs.fastnear.com/tx/receipt) when the receipt ID is your best anchor. **Next page if needed** - [Transactions by Hash](https://docs.fastnear.com/tx/transactions) to reconnect the receipt to the originating transaction story. - [Account History](https://docs.fastnear.com/tx/account) if you need to see the surrounding activity for one of the touched accounts. **Stop when** - You can say where the receipt fits in the execution flow and why it matters. **Switch when** - The user needs exact canonical confirmation beyond the indexed receipt view. Move to [RPC Reference](https://docs.fastnear.com/rpc). - The question shifts from one receipt to a broader history investigation. ### Review recent account activity **Start here** - [Account History](https://docs.fastnear.com/tx/account) for an account-centric activity feed. **Next page if needed** - [Transactions by Hash](https://docs.fastnear.com/tx/transactions) for a specific transaction from the feed. - [Receipt Lookup](https://docs.fastnear.com/tx/receipt) if one receipt becomes the real focus. **Stop when** - The account history already answers what the account has been doing. **Switch when** - The user actually wants transfer-only movement instead of broader execution context. Move to [Transfers API](https://docs.fastnear.com/transfers). - The user actually wants exact current state or holdings, not history. Move to [RPC Reference](https://docs.fastnear.com/rpc) or [FastNear API](https://docs.fastnear.com/api). ### Reconstruct a bounded block window **Start here** - [Blocks](https://docs.fastnear.com/tx/blocks) for a bounded block-range scan. - [Block](https://docs.fastnear.com/tx/block) when you already know the exact block you want. **Next page if needed** - [Transactions by Hash](https://docs.fastnear.com/tx/transactions) to inspect a specific item from the block window. - [Receipt Lookup](https://docs.fastnear.com/tx/receipt) when one receipt becomes the important follow-up. **Stop when** - The bounded history window answers the question without dropping into lower-level protocol details. **Switch when** - The user needs exact canonical block fields or transaction finality. Move to [RPC Reference](https://docs.fastnear.com/rpc). - The user really wants freshest polling-oriented block reads rather than indexed history. Move to [NEAR Data API](https://docs.fastnear.com/neardata). ## 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. - Reusing opaque pagination tokens in a different endpoint or filter context. ## 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) - [Choosing the Right Surface](https://docs.fastnear.com/agents/choosing-surfaces) - [Agent Playbooks](https://docs.fastnear.com/agents/playbooks) --- ## Berry Club: Reconstruct historical boards - 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) {/* FASTNEAR_AI_DISCOVERY: This case study shows how to reconstruct Berry Club boards with FastNear. It separates current-state reads via get_lines from historical archaeology via block ranges, account history, transaction hydration, and replayed draw payloads. */} # Berry Club: Reconstruct historical boards Use this when the question is: “what did Berry Club look like during one era, and which `draw` calls made the board look that way?” This is a read-only Transactions case study. If all you need is the board right now, use `get_lines` and stop. If you want to explain how the board got there, switch to block history, account history, hydrated `draw` calls, and replay. Strategy Read the live board first, bound the era second, and only then replay the draws that explain it. 01RPC call_function get_lines gives the current 50x50 board and tells you what “now” looks like. 02POST /v0/blocks plus POST /v0/account bounds one era and yields candidate draw hashes. 03POST /v0/transactions hydrates those draws so you can replay them into historical checkpoints. Keep these close: - [js.fastnear.com](https://js.fastnear.com/) - [fastnear/js-monorepo](https://github.com/fastnear/js-monorepo) - [Transactions API: Account History](https://docs.fastnear.com/tx/account) - [Transactions API: Transactions by Hash](https://docs.fastnear.com/tx/transactions) - [Transactions API: Block Range](https://docs.fastnear.com/tx/blocks) - [RPC: call_function](https://docs.fastnear.com/rpc/contract/call-function) Berry Club archaeology is a mainnet-only story in this guide. The rendered checkpoints below come from reproducible mainnet snapshot data checked into this repo. ## The short version Berry Club gives you a clean current-state read through `get_lines`, but it does not give you a ready-made “board at block N” endpoint. That splits the job into two parts: - use RPC `call_function` when the question is “what does the board look like now?” - use indexed history when the question is “which writes produced that board?” - use archival RPC only when you want to materialize a known checkpoint directly ```mermaid flowchart TD A["RPC call_function: get_lines"] --> B["Current 50x50 board"] C["Transactions API: /v0/blocks"] --> D["Bound the era"] D --> E["/v0/account for berryclub.ek.near"] E --> F["Candidate draw transaction hashes"] F --> G["/v0/transactions hydration"] G --> H["Replay draw writes into a historical board"] ``` ## Why Berry Club is a good NEAR history example Berry Club gives you both sides of the problem in one contract: - a clean current-state read through `get_lines` - a long-running stream of `draw` transactions with ordinary `FunctionCall` args - a board format simple enough to decode and replay in normal JavaScript That makes it a very NEAR-native history example: one view method for current state, one write method for changes, and indexed history when you want to explain how the current state came to exist. ## 1. Read the current board first The live demo uses `berryclub.ek.near` and calls `get_lines` as a read-only view: ```javascript await near.view({ contractId: 'berryclub.ek.near', methodName: 'get_lines', args: { lines: [...Array(50).keys()], }, }); ``` That is the “board right now” path. It does not tell you how the board got there. | Question | Best surface | Why | | --- | --- | --- | | what does the board look like now? | [RPC `call_function`](https://docs.fastnear.com/rpc/contract/call-function) | the contract already exposes current state through `get_lines` | | which draws happened in this era? | [`/v0/account`](https://docs.fastnear.com/tx/account) + [`/v0/transactions`](https://docs.fastnear.com/tx/transactions) | indexed history gives you bounded candidate writes and hydrated args | | what did the board look like at a known checkpoint? | archival RPC or full replay | use archival state for direct materialization, or replay historical writes yourself | ## 2. Decode `get_lines` into a 50x50 grid The useful part of the `js.fastnear.com` Berry Club markup is the line decoder: - each returned line is base64 - decode it to bytes - skip the first 4 bytes - then read 32-bit little-endian colors every 8 bytes ```javascript function decodeLine(encodedLine) { const bytes = Buffer.from(encodedLine, 'base64'); const colors = []; for (let offset = 4; offset < bytes.length; offset += 8) { colors.push(bytes.readUInt32LE(offset) & 0xffffff); } return colors; } ``` Apply that to all 50 returned lines and you have a full 50x50 board ready to render. ## 3. Bound the era you care about Start by bounding the era before you hunt for draws. The checked-in launch checkpoint in this repo sits at block `21898354`, and the midpoint checkpoint sits at block `97601515`. Use the block-range surface first: ```bash curl -sS https://tx.main.fastnear.com/v0/blocks \ -H 'content-type: application/json' \ --data '{ "from_block_height": 21898350, "to_block_height": 21898355, "desc": false, "limit": 5 }' ``` Then switch to account history and ask for Berry Club activity inside a bounded block window: ```bash curl -sS https://tx.main.fastnear.com/v0/account \ -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": true, "limit": 40 }' ``` This is the useful sequence: - `/v0/blocks` helps you reason about the block neighborhood - `/v0/account` gives you candidate Berry Club transaction hashes in that neighborhood ## 4. Hydrate and keep only `draw` calls Once you have candidate hashes, hydrate them and keep only top-level `draw` calls whose receiver is `berryclub.ek.near`. The payloads are just normal `FunctionCall` args shaped like `{ pixels: [...] }`: ```bash curl -sS https://tx.main.fastnear.com/v0/transactions \ -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) }' ``` That gives you exactly what replay needs: - which transaction wrote pixels - which coordinates were touched - which colors were written ## 5. Replay historical draws into a board For a full replay, keep a 50x50 array in memory and apply hydrated `draw` transactions oldest-first. ```javascript const board = Array.from({ length: 50 }, () => Array(50).fill(0)); function applyDraw(boardState, drawArgs) { for (const pixel of drawArgs.pixels) { if (pixel.x < 0 || pixel.x >= 50 || pixel.y < 0 || pixel.y >= 50) { continue; } boardState[pixel.y][pixel.x] = pixel.color; } } for (const drawTx of drawTransactionsOldestFirst) { applyDraw(board, drawTx.args); } ``` Keep the split straight: - `get_lines` is current state - `tx/account` plus `tx/transactions` is replay material ## 6. Rendered checkpoints by era The gallery below uses checked-in snapshot data generated from Berry Club mainnet history: - `launch` is the latest successful `draw` within the first 24 hours after the first successful draw - `mid` is the latest successful `draw` at or before the midpoint timestamp of Berry Club history - `recent` is the latest successful `draw` seen during the snapshot rebuild run Rendered snapshot gallery: launch, mid, and recent checkpoints from checked-in `src/data/berryClubSnapshots.json`. These rendered checkpoints currently resolve to: - `launch`: `BDNFpCpLXjBrgjR6z6wCZmB9EWdHnVMdqau3iTWTRE5H` at block `21898354` - `mid`: `Hq5qwsuiM2emJrqczWM9awCa7o6sTBYqYpcifUX2SUhQ` at block `97601515` - `recent`: `8tBip5M2TrozhSyepAA3tYXpyKooi5t7b9c64wXjFvfL` at block `194588754` ## Where to go for signed interactions Keep this page read-only. If you want the live signed interaction path for `draw` and `buy_tokens`, go here instead: - [js.fastnear.com](https://js.fastnear.com/) - [fastnear/js-monorepo Berry Club example](https://github.com/fastnear/js-monorepo/tree/main/examples/static/berryclub) That is the right place for wallet-connected flows. This page is for historical reconstruction. --- ## OutLayer: Trace one request from caller to callback - HTML path: https://docs.fastnear.com/tx/examples/outlayer - Markdown path: https://docs.fastnear.com/tx/examples/outlayer.md **Source:** [https://docs.fastnear.com/tx/examples/outlayer](https://docs.fastnear.com/tx/examples/outlayer) {/* FASTNEAR_AI_DISCOVERY: This case study shows how to use FastNear RPC and Transactions API to trace a live OutLayer execution in NEAR-native terms. It separates the visible request/worker/callback flow that FastNear can trace now from the documented under-the-hood yield/resume and CKD/MPC trust path. */} # OutLayer: Trace one request from caller to callback Use this when the question is: “I can see OutLayer on-chain. Which transaction opened the work, which later transaction came from the worker, and where did callback, charging, and refund behavior show up?” This is the advanced async case study in the Transactions examples family. Keep the NEAR frame first: one caller-side `FunctionCall`, one later worker-side transaction, and receipt-level follow-up only when you need to inspect the finish. Strategy Find the caller tx and the worker tx first, then use receipts only when the finish path becomes the real question. 01POST /v0/account is the fastest way to discover the caller-side and worker-side hashes that belong to the same story. 02POST /v0/transactions hydrates both hashes and shows the readable request, worker resolution, and early logs. 03Only after that do you inspect receipt-level callback, charging, and refund behavior or fall back to exact RPC identity checks. Useful references: - [Account History](https://docs.fastnear.com/tx/account) - [Transactions by Hash](https://docs.fastnear.com/tx/transactions) - [View Account](https://docs.fastnear.com/rpc/account/view-account) - [OutLayer NEAR Integration](https://outlayer.fastnear.com/docs/near-integration) - [OutLayer Secrets / CKD](https://outlayer.fastnear.com/docs/secrets) ## The short version If you run into OutLayer on-chain, the practical questions are usually: - which transaction created the async work item? - which later transaction came from the worker? - where did callback, charging, and refund behavior show up? That is not a current-state question. It is an execution-history question. The useful FastNear move is to pair one caller-side `request_execution` transaction with one worker-side resolution transaction, and then drop to receipt inspection only for the finish. ```mermaid sequenceDiagram autonumber participant Caller as "Caller" participant Outlayer as "outlayer.*" participant Worker as "worker.outlayer.*" participant Near as "NEAR runtime" Caller->>Outlayer: FunctionCall request_execution Outlayer-->>Near: establish async work + accounting context Worker->>Outlayer: resolve_execution or submit_execution_output_and_resolve Outlayer-->>Near: completion logs, callback path, charging, refunds ``` Everything above is visible today with FastNear and RPC. ## 1. Hydrate one request transaction and one worker resolution If you want the whole shape immediately, start with a known pair of hashes and hydrate both. This pair worked on April 18, 2026: - `AJgn2DB7BaD3487wXii8rGM648eqvkFDqJ1zXCxfuRk4` — caller-side `request_execution` - `AVbxfPyN5P1ryFh7HPstWbjiSantPYWfMpiwKcJ7hXTs` — worker-side `submit_execution_output_and_resolve` ```bash title="Hydrate a request hash and a worker-resolution hash" curl -sS https://tx.main.fastnear.com/v0/transactions \ -H 'content-type: application/json' \ --data '{ "tx_hashes":[ "AJgn2DB7BaD3487wXii8rGM648eqvkFDqJ1zXCxfuRk4", "AVbxfPyN5P1ryFh7HPstWbjiSantPYWfMpiwKcJ7hXTs" ] }' | jq '.transactions[] | { hash: .transaction.hash, signer: .transaction.signer_id, receiver: .transaction.receiver_id, actions: [.transaction.actions[] | keys[0]], logs: (.receipts[0].execution_outcome.outcome.logs[:2]) }' ``` In the sampled output: - the request hash came from `solarflux.near` to `outlayer.near` - the logs showed a resolved project: `zavodil.near/near-email` - the worker hash came from `worker.outlayer.near` to `outlayer.near` - the worker logs said `Stored pending output` and `Resolving execution ... (combined flow)` That is already the visible loop: the original `FunctionCall` established the async work item, the worker came back later as a separate signer, and the contract resolved the result on-chain. If you only copy one command from this page, copy this one. ## 2. Find the two hashes yourself If you do not already have a pair of hashes, switch to [Transactions API: Account History](https://docs.fastnear.com/tx/account). ```bash title="Recent mainnet activity for outlayer.near" curl -sS https://tx.main.fastnear.com/v0/account \ -H 'content-type: application/json' \ --data '{"account_id":"outlayer.near","desc":true}' \ | jq '{txs_count, first: .account_txs[0]}' ``` On April 18, 2026 this surface reported more than 5,000 traced transactions for `outlayer.near`, and the newest sampled hash was: ```text AVbxfPyN5P1ryFh7HPstWbjiSantPYWfMpiwKcJ7hXTs ``` That hash was not the original user request. It was already a worker-side follow-up. That is why account history is the right first search surface: you are not trying to summarize the contract, you are trying to find two concrete transactions in one execution story. ```mermaid flowchart TD A["Transactions API: /v0/account for outlayer.*"] --> B["Find recent transaction hashes"] B --> C["Caller-side request_execution hash"] B --> D["Worker-side resolution hash"] C --> E["Hydrate both with /v0/transactions"] D --> E E --> F["Inspect logs, request_id, project/source, callback receipts, charging, refunds"] ``` ## 3. Inspect the callback and refund phase If you want to go past “a worker called back,” inspect the receipt list on the hydrated worker transaction. ```bash title="Show receipt-level follow-up for the worker resolution" curl -sS https://tx.main.fastnear.com/v0/transactions \ -H 'content-type: application/json' \ --data '{"tx_hashes":["AVbxfPyN5P1ryFh7HPstWbjiSantPYWfMpiwKcJ7hXTs"]}' \ | jq '.transactions[0] | { hash: .transaction.hash, receipts: [ .receipts[] | { predecessor: .receipt.predecessor_id, receiver: .receiver_id, actions: [.receipt.receipt.Action.actions[] | keys[0]], logs: .execution_outcome.outcome.logs } ] }' ``` What to look for: - `FunctionCall:on_execution_response` - charging logs such as `[[yNEAR charged: "..."]]` - completion events such as `execution_completed` - follow-up `Transfer` receipts This is where `receipt` becomes the right abstraction: not at the beginning of the tutorial, but when you are debugging the actual finish path. ## 4. Confirm the contract identity if you need it Use raw RPC when you want exact account identity and code-hash checks. This is the identity step, not the history step. ```bash title="Mainnet: view_account for outlayer.near" curl -sS https://rpc.mainnet.fastnear.com \ -H 'content-type: application/json' \ --data '{ "jsonrpc":"2.0", "id":"1", "method":"query", "params":{ "request_type":"view_account", "finality":"final", "account_id":"outlayer.near" } }' | jq '.result | {amount, locked, code_hash, storage_usage}' ``` ```bash title="Testnet: view_account for outlayer.testnet" curl -sS https://rpc.testnet.fastnear.com \ -H 'content-type: application/json' \ --data '{ "jsonrpc":"2.0", "id":"1", "method":"query", "params":{ "request_type":"view_account", "finality":"final", "account_id":"outlayer.testnet" } }' | jq '.result | {amount, locked, code_hash, storage_usage}' ``` As of April 18, 2026, both contracts returned the same code hash: ```text 94uKcoDB3QbEpxDj1xsw9CQwu9bAY1PoVPr2BZYRRv4K ``` That is a strong hint that the same contract binary is deployed on both networks. ## 5. What is happening under the hood? The visible story above is what a NEAR builder needs first. The deeper story explains why this flow is interesting. ### Observable now FastNear and RPC can already show you: - the caller-side `request_execution` - the worker-side `resolve_execution` or `submit_execution_output_and_resolve` - the finish receipts where callback, charging, and refund behavior materialize Your own integration is still ordinary NEAR async composition: call `outlayer.*`, then handle your callback. ### Documented under the hood The OutLayer docs describe a deeper internal model: `outlayer.*` uses NEAR yield/resume semantics as its own internal async boundary, off-chain work runs inside TEE workers, and protected secrets use a separate keystore trust path backed by DAO-gated CKD requests to the NEAR MPC signer. The important precision for NEAR readers is that yield/resume is not being presented here as something your caller contract directly writes. NEAR's yield/resume primitives are same-account primitives, so if that mechanism is used here, the yielded and resumed actor is `outlayer.*`, not the original caller contract. For the raw runtime model, see [Advanced Features](https://docs.fastnear.com/transaction-flow/advanced-features). The Secrets / CKD docs describe that keystore path as two-level: the keystore gets a derivation key through a DAO-gated MPC path, then uses that cached derivation capability for protected secrets during app executions. That is a trust-path explanation, not a claim that every ordinary OutLayer execution makes a fresh DAO -> MPC round trip. The live public gateway account for that keystore / DAO path is still unresolved in our current public chain evidence, so keep that part in the documented-under-the-hood bucket rather than the observable-now bucket. ```mermaid flowchart TB subgraph Observable["Observable now with FastNear / RPC"] Caller["User or calling contract"] -->|FunctionCall request_execution| Entry["outlayer.*"] Entry -->|later worker activity| Worker["worker.outlayer.*"] Worker -->|resolve_execution or submit_execution_output_and_resolve| Entry Entry -->|on_execution_response, charging, refund transfers| Finish["Callback / finish receipts"] end subgraph Internal["Documented under the hood"] Yield["outlayer.* internal yield point"] --> TEE["TEE worker executes WASM"] TEE -->|resume with output| Yield TEE --> Keystore["TEE keystore for protected secrets"] Keystore -->|documented DAO-gated request_key| DAO["DAO gateway (documented)"] DAO -->|documented CKD request| MPC["v1.signer / v1.signer-prod.testnet"] MPC -->|derivation key for keystore| Keystore end Entry -. same logical execution .-> Yield classDef observable fill:#e7f1ff,stroke:#2563eb,color:#0f172a; classDef internal fill:#fff4e5,stroke:#b45309,color:#0f172a; class Caller,Entry,Worker,Finish observable; class Yield,TEE,Keystore,DAO,MPC internal; ``` ## Read deeper - [Transactions API](https://docs.fastnear.com/tx) for account history, receipts, and transaction hydration - [Advanced Features](https://docs.fastnear.com/transaction-flow/advanced-features) for NEAR yield/resume semantics - [Async Model](https://docs.fastnear.com/transaction-flow/async-model) for promise and callback vocabulary - [OutLayer NEAR Integration](https://outlayer.fastnear.com/docs/near-integration) for the documented contract-facing interface - [OutLayer Secrets / CKD](https://outlayer.fastnear.com/docs/secrets) for the documented keystore, DAO, and MPC trust path --- ## 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" } ```