Skip to content

STO APIs

APIs for parsing and manipulating serialized transaction objects (STOs) — locating a field or array element by code, and inserting or removing a field to build a new object. These functions used to share the "Utility APIs" page; for the return-value and error-code conventions they follow, see Utility APIs.

All five use the hook engine's own lightweight scanner rather than the ledger's deserializer, so they do not accept the 0x99 NOP byte that emit/prepare skip: sto_validate reports a NOP-padded buffer as invalid and the others return PARSE_ERROR. Run such a template through prepare first if you need to inspect or edit it. See nop-bytes.


Index

FunctionPurpose
sto_validateCheck that a buffer is a well-formed serialized object.
sto_subfieldLocate a field within an STO (returns packed offset+length).
sto_subarrayLocate an array element within an STO array.
sto_emplaceInsert or replace a field within an STO.
sto_eraseRemove a field from an STO.