hook
Concepts
Section titled “Concepts”Behaviour
Section titled “Behaviour”hookis a user defined function called byxahaudin order to fire your hook.- Your
hookfunction calls eitheracceptorrejectto pass or reject the originating transaction. - If execution reaches the end of the function it is implicitly an
accept.
Definition
Section titled “Definition”int64_t hook ( uint32_t reserved)type Hook = (reserved: number) => numberExample
Section titled “Example”int64_t hook(uint32_t reserved){ return 0;}const Hook = (reserved: number) => { return 0}Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| reserved | uint32_t | Reserved for future use. |
| Name | Type | Description |
|---|---|---|
| reserved | number | Reserved for future use. |
Return Code
Section titled “Return Code”| Type | Description |
|---|---|
| int64_t | An arbitrary return code you wish to return from your hook. This will be present in the metadata of the originating transaction. |
| Type | Description |
|---|---|
| number | An arbitrary return code you wish to return from your hook. This will be present in the metadata of the originating transaction. |