Crate defuse_near_utils

Source

Modules§

digest
time

Macros§

method_name

Structs§

Lock
A persistent lock, which stores its state (whether it’s locked or unlocked) on-chain, so that the inner value can be accessed depending on the current state of the lock.
NestedPrefix
PanicOnClone
This struct is used as a tool to make it possible to derive borsh serialization in such a way where serialization can take over a reference and include it as if it’s owned by the struct/enum being serialized. The reference can be taken in the function PanicOnClone::from_ref().

Constants§

MAX_JSON_LENGTH_RECURSION_LIMIT
NOTE: The NEAR runtime limits the Wasm operand stack height to 16,384 entries (max_stack_height genesis parameter). Each recursive call to MaxJsonLength::max_json_length_at consumes stack entries for params, locals, operand depth, and gas metering overhead — the exact amount depends on the monomorphized Args type. Since different trait implementations produce different frame sizes, we use a conservative limit that stays well within budget across all reasonable type nesting. See the NEAR specification on contract preparation for details: https://nomicon.io/RuntimeSpec/Preparation
REFUND_MEMO
Memo used for refund events.
TOTAL_LOG_LENGTH_LIMIT
Maximum length of a single log entry in NEAR runtime. See: https://github.com/near/nearcore/blob/v2.5.0/runtime/near-vm-runner/src/logic/logic.rs#L42

Traits§

MaxJsonLength
NearSdkLog
NestPrefix
PanicError
PromiseExt
UnwrapOrPanic
UnwrapOrPanicError

Functions§

gas_left
promise_result_checked_json
promise_result_checked_json_with_args
promise_result_checked_json_with_len
promise_result_checked_void
Returns Ok(()) if the promise at result_idx succeeded with an empty result. This is the expected outcome for void-returning cross-contract calls (e.g. ft_transfer, nft_transfer, mt_batch_transfer).

Type Aliases§

PromiseJsonResult
PromiseResult