Hook
(Added by the [Hooks amendment][].)
A Hook
object describes a smart contract, which can be triggered by a transaction to perform predefined operations. The operations are defined by the Hook
creator and can interact with the ledger and transactions.
Example JSON
Fields
A Hook
object has the following fields:
Field | JSON Type | [Internal Type][] | Required? | Description |
---|---|---|---|---|
| String | Account | Yes | The account that created the Hook. |
| 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. |
| String | Hash256 | Yes | The ID of the transaction that most recently modified this object. |
| Number | UInt32 | Yes | The [ledger index][] of the ledger that contains the transaction that most recently modified this object. |
| Array | Array | Yes | An array of hook objects. Each object has the following fields: |
| String | UInt16 | Yes | The value |
Hook Fields
The following fields are used in the hook object:
Field | JSON Type | Internal Type | Description |
---|---|---|---|
| String | Hash256 | The hash of the hook. |
| Array | Array | The parameters of the hook. |
| Number | UInt32 | Additional flags for the hook. |
Hook ID Format
The ID of a Hook
object is the [SHA-512Half][] of the following values, concatenated in order:
The Hook space key (
0x0048
)The AccountID of the sender of the [SetHook transaction][] that created the
Hook
object
Last updated