hook_account
Behaviour
Section titled “Behaviour”- Write the 20 byte Account ID to the write_ptr
- Retrieve the 20 byte Account ID the Hook is executing on.
Definition
Section titled “Definition”int64_t hook_account ( uint32_t write_ptr, uint32_t write_len);
“JavaScript function hook_account(): ErrorCode | ByteArray
</TabItem></Tabs>
### Example
<Tabs><TabItem label="C">```cuint8_t hook_acc_id[20];int64_t bytes_written = hook_account(hook_acc_id, 20);
const hook_acc_id =hook_account()
Parameters
Section titled “Parameters”Name | Type | Description |
---|---|---|
write_ptr | uint32_t | Pointer to a buffer of a suitable size to store the output. Should be at least 20 bytes. |
write_len | uint32_t | Length of the output buffer. |
No parameters
Return Code
Section titled “Return Code”Type | Description |
---|---|
int64_t | The number of bytes written |
Type | Description |
---|---|
ErrorCode or ByteArray | Returns the Account ID the Hook is executing on, or an error code if the retrieval fails. |