Hook State
(Added by the [Hooks amendment][].)
A HookState
object describes the state of a hook, which is a piece of code running on Xahau that can interact with transactions. The HookState
object stores the state of the hook, which can be modified by the hook's code.
Example JSON
Fields
A HookState
object has the following fields:
OwnerNode
String
UInt64
Yes
A hint indicating which page of the owner's directory links to this object, in case the directory consists of multiple pages.
HookStateKey
String
Hash256
Yes
The key that uniquely identifies this hook state.
HookStateData
String
VL
Yes
The data stored by the hook. This can be any data that the hook's code decides to store.
LedgerEntryType
String
UInt16
Yes
The value 0x0043
, mapped to the string HookState
, indicates that this object is a HookState object.
HookState ID Format
The ID of a HookState
object is the [SHA-512Half][] of the following values, concatenated in order:
The HookState space key (
0x0076
)The AccountID of the account that owns the hook
The
HookStateKey
of theHookState
objectThe
HookNamespace
of the hook.
Last updated