Cargo Features

near-sdk = { version = "5.2.1", default-features = false, features = ["expensive-debug", "unstable", "legacy", "abi", "unit-testing", "wee_alloc"] }
default = wee_alloc

The wee_alloc feature is set by default whenever near-sdk is added without default-features = false somewhere in the dependency tree.


Affects env::ecrecover, store::tree_map


Affects near-sdk::collections

abi = near-abi, schemars

Enables unstable__schema of borsh, abi of near-account-id, near-gas, near-sdk-macros, and near-token

unit-testing = near-crypto, near-parameters, near-primitives, near-primitives-core, near-vm-runner

Affects env::set_blockchain_interface, environment::mock, near-sdk::test_utils, primitives::MerkleHash


Affects near-sdk::near

Features from optional dependencies

In crates that don't use the dep: syntax, optional dependencies automatically become Cargo features. These features may have been created by mistake, and this functionality may be removed in the future.

near-abi not wasm32 abi?
near-crypto not wasm32 unit-testing?
near-parameters not wasm32 unit-testing?
near-primitives not wasm32 unit-testing?
near-primitives-core not wasm32 unit-testing?
near-vm-runner not wasm32 unit-testing?
schemars not wasm32 abi?
wee_alloc wasm32 default