Releases: near/near-sdk-rs
Releases · near/near-sdk-rs
near-sdk-macros-v5.1.0
chore: Release package near-sdk-macros version 5.1.0
near-contract-standards-v5.1.0
near-sdk-v5.0.0
Highlights
This release mostly maintains backwards compatibility with the previous version, but it also includes several breaking changes that improve developer experience and bring security and performance fixes. The most notable changes are:
- Contract source metadata (NEP-330) is now implemented by default for all the contracts out of the box, which means that you can call
contract_source_metadata()
function and receive{ version?: string, link?: string, standards?: { standard: string, version: string }[] }
(#1106) - Type-safe NEAR balance, gas amounts, and account ids were implemented:
- Use
near_sdk::NearToken
instead of u128/U128/Balance (#1104) - Use
near_sdk::Gas
instead of u64/Gas (#1082) - Use
near_sdk::AccountId
ornear_sdk::AccountIdRef
instead of String aliases for account ids (#1108)
- Use
- Update borsh to 1.0.0 (#1075)
- You will have to be explicit about the borsh re-export with
#[borsh(crate = "near_sdk::borsh")]
, see the example in the README
- You will have to be explicit about the borsh re-export with
- New host functions exposed:
- Slimmed down the dependencies by default, most notably, you may still need to explicitly enable
legacy
feature fornear_sdk::collections
andunit-testing
feature fornear_sdk::testing_env
andnear_sdk::mock
(#1149) - Updated
nearcore
crates from0.17
->0.20
, but contracts rarely use these directly so no breaking changes are expected (#1130) - Support Result types in
#[handle_result]
regardless of how they're referred to (#1099) Self
is now prohibited in non-init methods to prevent common footguns (#1073)- Require explicit
Unlimited
orLimited
when specifying allowances to prevent0
to be silently treated as unlimited allowance (#976) - Performance improvement to
TreeMap.range
(#964) - Deprecated
near_sdk::store::UnorderedMap
andnear_sdk::store::UnorderedSet
due to not meeting the original requirements (iteration over a collection of more than 2k elements runs out of gas) (#1139) - Deprecated
near_sdk::collections::LegacyTreeMap
(#963)
The best way to develop NEAR contracts in Rust is by using cargo-near
CLI.
It provides a convenient way to create, build, test, and deploy contracts!
Get your fully configured development environment in under 1 minute using GitHub CodeSpaces configured for NEAR!
near-sdk-macros-v5.0.0
release: v5.0.0 (#1148)
near-contract-standards-v5.0.0
Fixed
- Fixed a typo in the storage_deposit refund computation (introduced in 5.0.0-alpha.1 release) (#1146)
near-sdk-v5.0.0-alpha.3
near-sdk-macros-v5.0.0-alpha.3
chore: release v5.0.0-alpha.3 (#1138)
near-contract-standards-v5.0.0-alpha.3
Fixed
- Fixed a typo in the storage_deposit refund computation (introduced in 5.0.0-alpha.1 release) (#1146)
near-sdk-v5.0.0-alpha.2
near-sdk-macros-v5.0.0-alpha.2
chore: release 5.0.0-alpha.2 (#1115) Signed-off-by: Vlad Frolov <[email protected]> Co-authored-by: Vlad Frolov <[email protected]>