Expand description
§NEAR-SDK-RS 4.0 pre-release
Some helper for NEAR 4.0 after upgrading from previous versions.
Re-exports§
pub use crate::timestamp::*;
Modules§
- timestamp
- Because we can’t use the chrono crate (even with serde and wasmbind
it doesn’t seems to compile properly), here we are. Because we have
near_sdk::env::block_timestamp_ms()
, here tries to convert that.
Functions§
- as_
scientific_ notation - Return the scientific notation of a given value, based on the digit you want to keep. This offers you to calculate using the number of kept digits, hence simplifying calculations.
- assert_
predecessor_ is_ current Deprecated - Assert predecessor is current, very frequently used assertion. Similar to near_sdk::utils::assert_self except you can enter a custom message for claribility.
- expect_
lightweight Deprecated - The equivalent of .expect() but a lightweight version to reduce compiled-wasm size.
- is_
promise_ success Deprecated - Checks for successful promise.
- near_
to_ yoctonear - NEAR to yoctonear conversion.
- yoctonear_
to_ near - Converts yoctoNEAR to NEAR. If there are many decimal places, will only leave the “first 5 decimals.”