Expand description
Splitting a serialized XRPL object (STObject) into fields.
Each field is a header (type code and field code) and a value. The parser does not rebuild the object; it returns slices of the original bytes: checking a signature needs exactly the bytes the validator signed, not our copy of them.
All types found in validations, manifests, transactions, metadata and state objects are supported: fixed and variable length, amounts, nested objects and arrays, paths, Issue, the XChain bridge. An unknown type is an error: silently skipping what we don’t understand is not allowed.
Modules§
Structs§
- Field
- An object field: header and value as slices of the original bytes.
- FieldId
- A field by its (type, code) pair, as in the xrpld field definitions.
Enums§
Constants§
- ARRAY_
END - MAX_
DEPTH - Nesting depth limit for objects and arrays. xrpld uses 10 (
STVar); this one leaves headroom but is still finite: the parser is recursive, and network input with thousands of nesting levels would otherwise overflow the stack. - OBJECT_
END - End of a nested object (type 14, field 1) and of an array (type 15, field 1).
Functions§
- children
- Fields of a nested object or elements of an array, from the field’s value.
- extent
- Where the value of a field of type
type_codeis, if the header ended atat: (value start, length).Nonefor an object or array: their value runs up to the end marker. - fields
- Splits an object into fields in their original order.
- find
- head
- The field header at
at: type, field code and the offset right after the header. - items
- Array elements from the array’s value: every element is an object, whatever
field names it (as in XRPLA’s
wire.cppand STArray in xrpld). An element’s value is its fields without the end marker. - signing_
bytes - Object bytes for signing: all fields except signatures, in their original order.
- u32_of
- u64_of