Cargo Features

[dependencies]
near-sdk = { version = "5.1.0", 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.

expensive-debug
unstable

Affects env::ecrecover, store::tree_map

legacy

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

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?

Enables near-crypto ^0.20

near-parameters not wasm32 unit-testing?

Enables near-parameters ^0.20

near-primitives not wasm32 unit-testing?

Enables near-primitives ^0.20

near-primitives-core not wasm32 unit-testing?

Enables near-primitives-core ^0.20

near-vm-runner not wasm32 unit-testing?

Enables near-vm-runner ^0.20

schemars not wasm32 abi?
wee_alloc wasm32 default