near-sdk (Rust) 4.0.0-pre.5
This release comes with changes to clean up the API to get ready for a stable release as well as adding new features such as more near_sdk::store updated collection types! Notable changes include:
- A pre-release, not marked stable on GitHub.
- The newest stable release in the 4.0 line: near-sdk (Rust) 4.0.0
- Newest near-sdk (Rust): near-sdk (Rust) 5.30.0
This release comes with changes to clean up the API to get ready for a stable release as well as adding new features such as more near_sdk::store updated collection types! Notable changes include:
- fix(standards): Fix NFT impl macros to not import
HashMapandnear_sdk::json_types::U128. PR 571. - Add drain iterator for
near_sdk::store::UnorderedMap. PR 613.- Will remove all values and iterate over owned values that were removed
- Fix codegen for methods inside a
#[near_bindgen]to allow usingmut selfwhich will generate the same code asselfand will not persist state. PR 616. - Make function call terminology consistent by switching from method name usages. PR 633.
- This is only a breaking change if inspecting the
VmActions of receipts in mocked environments. All other changes are positional argument names.
- This is only a breaking change if inspecting the
- Implement new iterator for
collections::Vecto optimize fornthandcount. PR 634- This is useful specifically for things like pagination, where
.skip(x)will not load the firstxelements anymore - Does not affect any
storecollections, which are already optimized, this just optimizes the legacycollectionsthat useVec
- This is useful specifically for things like pagination, where
- Add consts for near, yocto, and tgas. PR 640.
near_sdk::ONE_NEAR,near_sdk::ONE_YOCTO,near_sdk::Gas::ONE_TERA
- Update SDK dependencies for
nearcorecrates used for mocking (0.10) andborsh(0.9) - Implemented
Debugfor allcollectionandstoretypes. PR 647 - Added new internal mint function to allow specifying or ignoring refund. PR 618
- store: Implement caching
LookupSettype. This is the new iteration of the previous version ofnear_sdk::collections::LookupSetthat has an updated API, and is located atnear_sdk::store::LookupSet. PR 654, PR 664. - Deprecate
testing_env_with_promise_results,setup_with_config, andsetupdue to these functions being unneeded anymore or have unintended side effects PR 671- Added missing pattern for only including context and vm config to
testing_env!to remove friction
- Added missing pattern for only including context and vm config to
- Added
_arraysuffix versions ofsha256,keccak256, andkeccak512hash functions inenvPR 646- These return a fixed length array instead of heap allocating with
Vec<u8>
- These return a fixed length array instead of heap allocating with
- Added
ripemd160_arrayhash function that returns a fixed length byte array PR 648 - Added
ecrecoverunderunstablefeature for recovering signer address by message hash and a corresponding signature. PR 658. - standards: Add require statement to ensure minimum needed gas in FT and NFT transfers at start of method. PR 678