# 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 REST APIs. - 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 work without a key. Add a key for higher limits or paid access patterns. The same key works across every FastNear API above; 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 REST APIs that accept authenticated traffic. 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. - 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 do not require an API key. - The docs UI can still forward an optional FastNear key when you want authenticated behavior or higher limits on supported surfaces. - Add `?network=testnet` to move compatible pages to the testnet backend and seeded testnet defaults. ## 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. ## 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 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 REST APIs that accept authenticated traffic. Public endpoints remain readable for many common requests, 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). ## If you only need the rule - One FastNear API key works across RPC and supported REST traffic. - 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 directly. - Supported REST surfaces use the same key when authenticated traffic is enabled. - 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. ### 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 ## 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 - These embeds do not forward API keys or bearer tokens. - 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). --- ## 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 - FastNear subscriptions can 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. ## 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. --- ## 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. ## 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 paid access goes through [Auth & Access](https://docs.fastnear.com/auth), where the same key works as either an `Authorization: Bearer` header or an `?apiKey=` URL parameter. ## 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. ### 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. --- ## 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. ## Choose a network - [Mainnet Snapshots](https://docs.fastnear.com/snapshots/mainnet) - [Testnet Snapshots](https://docs.fastnear.com/snapshots/testnet) --- ## 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 - These pages do not use API keys or bearer tokens. - 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 ## 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. --- ## 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 - These pages do not currently use API keys or bearer tokens. - 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. ## 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. --- ## 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:CByX7HPjgSGFi5G26zwgZGDFCFyBHvSv1fe7AFzmVe3", "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:CByX7HPjgSGFi5G26zwgZGDFCFyBHvSv1fe7AFzmVe3", "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": 194263739 } } ``` ## Request reference ### Active example ```json { "body": { "jsonrpc": "2.0", "id": "fastnear", "method": "block", "params": { "block_id": 194263739 } }, "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 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": "9XN7MtDywZvfGx6TKy1MT2iCZkKuHikJXmNazxdZ4x6T" } } ``` ## Request reference ### Active example ```json { "body": { "jsonrpc": "2.0", "id": "fastnear", "method": "block", "params": { "block_id": "9XN7MtDywZvfGx6TKy1MT2iCZkKuHikJXmNazxdZ4x6T" } }, "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": 194263739 } } ``` ## Request reference ### Active example ```json { "body": { "jsonrpc": "2.0", "id": "fastnear", "method": "block_effects", "params": { "block_id": 194263739 } }, "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 method arguments - `method_name` (body, required, 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": [ "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 method arguments" } }, { "name": "method_name", "required": true, "schema": { "type": "string" } }, { "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 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) - `prefix_base64` (body, required, string): Base64-encoded storage 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", "prefix_base64", "finality" ], "properties": [ { "name": "account_id", "required": true, "schema": { "type": "string", "description": "NEAR account ID" } }, { "name": "include_proof", "required": false, "schema": { "type": "boolean" } }, { "name": "prefix_base64", "required": true, "schema": { "type": "string", "description": "Base64-encoded storage key" } }, { "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 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 that a 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 — 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": "transaction" } } ``` ## 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": "transaction" } }, "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 — `transaction` proves inclusion of the top-level transaction, `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 — `transaction` proves inclusion of the top-level transaction, `receipt` proves inclusion of a specific receipt produced during execution.", "enum": [ "transaction", "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 that a transaction or receipt 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": "transaction", "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": "transaction", "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 — `transaction` proves inclusion of the top-level transaction, `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 — `transaction` proves inclusion of the top-level transaction, `receipt` proves inclusion of a specific receipt produced during execution.", "enum": [ "transaction", "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 head. ## 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 signed transaction and immediately get its hash — no wait for execution. ## 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 - `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" } }, { "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 signed transaction and wait for its commit — the legacy synchronous send, superseded by `send_tx`. ## 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 - `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" } }, { "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 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 — 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 - `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" } }, { "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 signed transaction and wait for its final execution outcome — the current synchronous send. ## 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 - `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" } }, { "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 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 - `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" } }, { "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 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) - `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", "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) - `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", "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) - `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", "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) - `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", "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) - `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", "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) - `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", "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 `block` and `shards`.", "additionalProperties": true } ``` --- ## 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 object for the requested shard ID.", "additionalProperties": true } ``` --- ## 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 object returned by `/headers`, corresponding to the full response's `block` field.", "additionalProperties": true } ``` --- ## 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 `block` and `shards`.", "additionalProperties": true } ``` --- ## 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": "Shard object for the requested shard ID.", "additionalProperties": true } ``` --- ## 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 `block` and `shards`.", "additionalProperties": true } ``` --- ## 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 `block` and `shards`.", "additionalProperties": true } ``` --- ## 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 `block` and `shards`.", "additionalProperties": true } ``` --- ## 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) - `desc` (body, boolean) - `from_tx_block_height` (body, integer) - `is_action_arg` (body, boolean) - `is_any_signer` (body, boolean) - `is_delegated_signer` (body, boolean) - `is_event_log` (body, boolean) - `is_explicit_refund_to` (body, boolean) - `is_function_call` (body, boolean) - `is_predecessor` (body, boolean) - `is_real_receiver` (body, boolean) - `is_real_signer` (body, boolean) - `is_receiver` (body, boolean) - `is_signer` (body, boolean) - `is_success` (body, boolean) - `limit` (body, integer) - `resume_token` (body, string) - `to_tx_block_height` (body, integer) ### Request schema ```json { "type": "object", "required": [ "account_id" ], "additionalProperties": false, "properties": [ { "name": "account_id", "required": true, "schema": { "type": "string" } }, { "name": "desc", "required": false, "schema": { "type": "boolean" } }, { "name": "from_tx_block_height", "required": false, "schema": { "type": "integer", "format": "uint64" } }, { "name": "is_action_arg", "required": false, "schema": { "type": "boolean" } }, { "name": "is_any_signer", "required": false, "schema": { "type": "boolean" } }, { "name": "is_delegated_signer", "required": false, "schema": { "type": "boolean" } }, { "name": "is_event_log", "required": false, "schema": { "type": "boolean" } }, { "name": "is_explicit_refund_to", "required": false, "schema": { "type": "boolean" } }, { "name": "is_function_call", "required": false, "schema": { "type": "boolean" } }, { "name": "is_predecessor", "required": false, "schema": { "type": "boolean" } }, { "name": "is_real_receiver", "required": false, "schema": { "type": "boolean" } }, { "name": "is_real_signer", "required": false, "schema": { "type": "boolean" } }, { "name": "is_receiver", "required": false, "schema": { "type": "boolean" } }, { "name": "is_signer", "required": false, "schema": { "type": "boolean" } }, { "name": "is_success", "required": false, "schema": { "type": "boolean" } }, { "name": "limit", "required": false, "schema": { "type": "integer", "format": "uint" } }, { "name": "resume_token", "required": false, "schema": { "type": "string", "default": null } }, { "name": "to_tx_block_height", "required": false, "schema": { "type": "integer", "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) - `with_receipts` (body, boolean) - `with_transactions` (body, boolean) ### Request schema ```json { "type": "object", "required": [ "block_id" ], "additionalProperties": false, "properties": [ { "name": "block_id", "required": true, "schema": { "oneOf": [ { "type": "integer" }, { "type": "string" } ] } }, { "name": "with_receipts", "required": false, "schema": { "type": "boolean" } }, { "name": "with_transactions", "required": false, "schema": { "type": "boolean" } } ], "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) - `from_block_height` (body, integer) - `limit` (body, integer) - `to_block_height` (body, integer) ### Request schema ```json { "type": "object", "additionalProperties": false, "properties": [ { "name": "desc", "required": false, "schema": { "type": "boolean" } }, { "name": "from_block_height", "required": false, "schema": { "type": "integer", "format": "uint64" } }, { "name": "limit", "required": false, "schema": { "type": "integer", "format": "uint" } }, { "name": "to_block_height", "required": false, "schema": { "type": "integer", "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) ### Request schema ```json { "type": "object", "required": [ "receipt_id" ], "additionalProperties": false, "properties": [ { "name": "receipt_id", "required": true, "schema": { "type": "string" } } ], "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) ### Request schema ```json { "type": "object", "required": [ "tx_hashes" ], "additionalProperties": false, "properties": [ { "name": "tx_hashes", "required": true, "schema": { "type": "array", "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) - `asset_id` (body, string) - `desc` (body, boolean) - `direction` (body, required, string) - `from_timestamp_ms` (body, integer) - `ignore_system` (body, boolean) - `limit` (body, integer) - `min_amount` (body, string) - `min_human_amount` (body, number) - `min_usd_amount` (body, number) - `resume_token` (body, string) - `to_timestamp_ms` (body, integer) ### Request schema ```json { "type": "object", "required": [ "account_id", "direction" ], "additionalProperties": false, "properties": [ { "name": "account_id", "required": true, "schema": { "type": "string" } }, { "name": "asset_id", "required": false, "schema": { "type": "string" } }, { "name": "desc", "required": false, "schema": { "type": "boolean" } }, { "name": "direction", "required": true, "schema": { "type": "string", "enum": [ "sender", "receiver" ] } }, { "name": "from_timestamp_ms", "required": false, "schema": { "type": "integer", "format": "uint64" } }, { "name": "ignore_system", "required": false, "schema": { "type": "boolean" } }, { "name": "limit", "required": false, "schema": { "type": "integer", "format": "uint" } }, { "name": "min_amount", "required": false, "schema": { "type": "string", "default": null } }, { "name": "min_human_amount", "required": false, "schema": { "type": "number", "format": "double" } }, { "name": "min_usd_amount", "required": false, "schema": { "type": "number", "format": "double" } }, { "name": "resume_token", "required": false, "schema": { "type": "string", "default": null } }, { "name": "to_timestamp_ms", "required": false, "schema": { "type": "integer", "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" } ```