Expand description
Functions for interacting with the current runtime.
Constants§
- ADDRESSABLE_
ENTITY_ FIELD_ IDX - Index for the addressable entity field of block info.
- ADDRESSABLE_
ENTITY_ LENGTH - The default size of the addressable entity flag.
- BLOCK_
HEIGHT_ FIELD_ IDX - Index for the block height field of block info.
- BLOCK_
TIME_ FIELD_ IDX - Index for the block time field of block info.
- DEFAULT_
HASH_ LENGTH - The default length of hashes such as account hash, state hash, hash addresses, etc.
- PARENT_
BLOCK_ HASH_ FIELD_ IDX - Index for the parent block hash field of block info.
- PROTOCOL_
VERSION_ FIELD_ IDX - Index for the protocol version field of block info.
- PROTOCOL_
VERSION_ LENGTH - The default size of ProtocolVersion. It’s 3×u32 (major, minor, patch), so 12 bytes.
- STATE_
HASH_ FIELD_ IDX - Index for the state hash field of block info.
Functions§
- blake2b
- Returns a 32-byte BLAKE2b digest
- call_
contract - Calls the given stored contract, passing the given arguments to it.
- call_
package_ version - Invokes the specified
entry_point_nameof stored logic at a specificcontract_package_hashaddress, for a specific pair ofmajor_versionandcontract_versionand passing the providedruntime_argsto it - call_
versioned_ contract - Invokes the specified
entry_point_nameof stored logic at a specificcontract_package_hashaddress, for the most current version of a contract package by default or a specificcontract_versionif one is provided, and passing the providedruntime_argsto it - emit_
message - Emits a message on a topic.
- get_
addressable_ entity - Returns whether or not the addressable entity is turned on.
- get_
block_ height - Returns the block height.
- get_
blocktime - Returns the current
BlockTime. - get_
call_ initiator - Returns the call stack initiator
- get_
call_ stack - Returns the call stack.
- get_
caller - Returns the caller of the current context, i.e. the
AccountHashof the account which made the deploy request. - get_
immediate_ caller - Returns the immidiate caller within the call stack.
- get_key
- Returns the requested named
Keyfrom the current context. - get_
named_ arg - Returns given named argument passed to the host for the current module invocation.
- get_
parent_ block_ hash - Returns the parent block hash.
- get_
phase - Returns the current
Phase. - get_
protocol_ version - Returns the protocol version.
- get_
state_ hash - Returns the state root hash.
- has_key
- Returns
trueifnameexists in the current context’s named keys. - is_
valid_ uref - Validates uref against named keys.
- list_
authorization_ keys - Returns the set of
AccountHashfrom the calling account’s contextauthorization_keys. - list_
named_ keys - Returns the named keys of the current context.
- manage_
message_ topic - Manages a message topic.
- Prints a debug message
- put_key
- Stores the given
Keyundernamein the current context’s named keys. - random_
bytes - Returns 32 pseudo random bytes.
- remove_
key - Removes the
Keystored undernamein the current context’s named keys. - ret
- Returns the given
CLValueto the host, terminating the currently running module. - revert
- Stops execution of a contract and reverts execution effects with a given
ApiError. - try_
get_ named_ arg - Returns given named argument passed to the host for the current module invocation.
If the argument is not found, returns
None.