Hook State
Last updated
Last updated
(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.
A HookState
object has the following fields:
Field | JSON Type | [Internal Type][] | Required? | Description |
---|---|---|---|---|
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 the HookState
object
The HookNamespace
of the hook.
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.