NEAR Protocol API Reference

website·Indexed 40 days ago

https://wiki.near.org

Comprehensive documentation for the NEAR RPC API, including endpoints for querying block and chunk details, managing transactions via send_tx, retrieving account and contract state, and accessing network information such as validator status and gas prices.

Tokens
106.8K
Snippets
455
Records
821
Agent score
60%

What's inside NEAR

  1. Overview of NEAR Chain Signatures

    Chain Signatures enable NEAR accounts and smart contracts to sign and execute transactions across multiple blockchain protocols. This allows a single NEAR account to own diverse assets and manage cross-chain accounts without needing multiple wallets. It is a 'one-way' solution for outbound transactions; for accessing state on external blockchains, Omnibridge should be used instead.
  2. Overview of the did:near method

    The did:near method provides W3C-compliant decentralized identifiers on the NEAR blockchain. It supports two primary types of DIDs:

    1. Named Account DIDs: Derived from NEAR account names (e.g., did:near:alice.near). These are resolved directly from on-chain FullAccess keys.
    2. Registry DIDs: Base58-encoded identifiers (e.g., did:near:CF5Ri...). These are resolved via a smart contract registry using the identity_owner method.
  3. Overview of Omni Bridge Technical Architecture

    Omni Bridge is a cross-chain infrastructure enabling token transfers between NEAR Protocol and other blockchain networks. It utilizes a combination of Multi-Party Computation (MPC), chain-specific light clients, and a permissionless relayer network to balance security and decentralization.
  4. Overview of NEAR Auth

    NEAR Auth enables users to sign real NEAR transactions using Web2 identities (Google, Apple, email, or passkeys) without requiring a seed phrase or wallet extension. It uses Auth0 for logins and a Multi-Party Computation (MPC) network to secure signing keys, ensuring no single party holds the user's private key. Each identity deterministically derives its own NEAR key.
  5. Overview of NEAR Connect wallet connector

    NEAR Connect is a robust, secure, and lightweight wallet connector for the NEAR blockchain. Unlike traditional connectors that bundle all wallet code into a single package, NEAR Connect executes wallet integration code in isolated sandboxed environments (iframes) to reduce supply chain risk. It uses a shared manifest to load wallet code at runtime, ensuring wallets remain up-to-date without requiring package updates. It supports 10+ wallets, including HOT Wallet, Meteor Wallet, Nightly, and WalletConnect, and has zero external dependencies.
  6. Overview of NEAR Protocol architecture

    NEAR is a Layer-1, sharded, proof-of-stake blockchain.

    • Layer-1: Serves as the foundational layer that maintains secure and immutable transaction records.
    • Sharded: The network is split into pieces that operate in parallel to increase transaction processing speed and efficiency.
    • Proof-of-Stake (PoS): A consensus mechanism that is more energy-efficient than proof-of-work, where users stake NEAR tokens to secure and run the network.
  7. Overview of Linkdrops (NEP-452)

    Linkdrops follow the NEP-452 standard, allowing developers to distribute assets and onboard users to Web3 applications using simple web links. This is achieved by utilizing access keys and the Keypom platform. The process generally involves generating a key pair, creating a drop on the Keypom contract, and providing the private key to the recipient via a link.
  8. Overview of NEAR Chain Signatures workflow

    Chain signatures allow NEAR accounts and smart contracts to control assets and execute transactions on other blockchain protocols. The process consists of five primary steps:

    1. Deriving the Foreign Address: Determine the address on the target chain controlled by the NEAR account.
    2. Creating the Transaction: Construct the transaction or message to be signed.
    3. Requesting the Signature: Call the NEAR MPC contract to sign the transaction payload.
    4. Formatting the Signature: Format the signature received from the MPC contract and attach it to the transaction.
    5. Relaying the Signed Transaction: Broadcast the signed transaction to the destination blockchain.
  9. Overview of Privy for NEAR

    Privy is a third-party service that enables users to log in to dApps using email or social accounts (Google, Facebook, Twitter, etc.). Upon login, Privy creates a NEAR wallet for the user, allowing them to fund the account and interact with the application without needing to manage seed phrases manually.
  10. Overview of Oracles on NEAR Protocol

    Blockchain oracles on NEAR act as intermediaries connecting smart contracts with external off-chain data. Common use cases include real-time price feeds for assets, event information (e.g., sports or weather), and API access to external web services. Because oracles are third-party services, developers should evaluate their reliability, security, and decentralization to mitigate risks of data manipulation or single points of failure.
  11. Overview of Liquid Staking on NEAR

    Liquid staking on NEAR uses a smart contract to issue a fungible token representing staked NEAR. Unlike regular staking, which requires a 4-epoch (approx. 24-28 hours) wait to unstake and withdraw, liquid staking allows users to maintain liquidity by swapping the liquid token for NEAR on a DEX or by following the standard unstake/withdraw process. The contract distributes stakes across multiple high-performing validators to reduce the risk of downtime and reward loss, though this may result in a slightly lower average reward rate compared to direct delegation to a single validator.
  12. Overview of the NEAR Indexer framework

    The NEAR Indexer is a micro-framework designed to handle real-time events on the blockchain. It allows developers to capture and index streams of blocks in a customized manner, enabling both high-level data aggregation and low-level introspection of blockchain events. It is particularly useful for dApps that need to access state from smart contracts more efficiently than querying the network RPC.