- Find the specified
sffield in the originating transaction
- Write the serialized version of the field to the output buffer
int64_t otxn_field ( uint32_t write_ptr, uint32_t write_len, uint32_t field_id );
int64_t account_field_len = otxn_field(account_field, 20, sfAccount);
|write_ptr||uint32_t||Pointer to a buffer of a suitable size to store the output.|
|write_len||uint32_t||Length of the output buffer.|
To compute this manually take the serialized
The field code is not written to the output buffer, only the payload of the field is.
At time of writing for Hooks Public Testnet,
sfAccountare returned without the leading variable length byte.
|int64_t||The number of bytes written|
If negative, an error:
- pointers/lengths specified outside of hook memory.
- output buffer was not large enough to hold the serialized field
- the field was not found in the originating transaction