OpenViSTAI · Agents · Blockchain · Crypto
Menu
Developer Tools

near-sdk

near-sdk is a Rust library for writing smart contracts on the NEAR blockchain. Its `#[near]` attribute generates contract-compatible code from Rust types and implementations, and the library includes facilities for contract initialization, unit testing and asynchronous cross-contract calls.

Independent OpenViST project profile, based on linked sources.

near-sdk — OpenViST project profile in Developer Tools.
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use near-sdk when implementing NEAR smart-contract logic in Rust. The repository's documented cargo-near workflow can then build a contract and ABI, create a testnet development account or guide deployment.

Who it is for

  • Rust developers building smart contracts for NEAR.
  • Contract authors who need state and method definitions, initialization logic or asynchronous interactions with other contracts.

Documented uses

  • Define contract state and callable methods in Rust.
  • Initialize contract state with an initialization method.
  • Write unit tests for contract methods.
  • Schedule calls to other contracts and handle callbacks or aggregate promise results.
  • Use shared interfaces and implementations for NEAR fungible-token, non-fungible-token and upgradability standards.
Before you choose

Requirements & limits

The repository is public and identifies its license as Apache-2.0.

  • The README states Rust 1.95.0 as the minimum supported version and cautions that a security patch release could require a higher toolchain version.
  • The SDK is a library; cargo-near is a separate CLI tool documented for build, testnet development-account creation and deployment workflows.
  • The repository includes a distinct near-contract-standards crate with interfaces and implementations for upgradability, NEP-141 fungible tokens and NEP-171 non-fungible tokens.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Build a NEAR contract with cargo-near

Compile a contract project and produce its ABI using the documented cargo-near workflow.

Before you start

  • A NEAR Rust contract project with a Cargo.toml file.
  • Rust 1.95.0 or later, the SDK's stated minimum supported Rust version.
  • The separate cargo-near command-line tool installed.

Steps

  1. Install cargo-near using one of the README's listed installation methods.

  2. Open a terminal in the directory containing the contract's Cargo.toml.

  3. Run the command below to build the contract and ABI.

    Documented command
    cargo near build

Expected outcome

The command builds the NEAR smart contract and its ABI.

Guide limitations

  • The README notes that ABI/schema problems can be bypassed with cargo near build non-reproducible-wasm --no-abi; this skips ABI generation and is described as a workaround while resolving those problems.
  • This guide covers building only, not deployment.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
10 October 2026
Original website title
near/near-sdk-rs · Official homepage title · retained in its source language