La referencia de la API está disponible solo en inglés por ahora.

encodeStateBounded

function
serialize/codec.ts:353
signature
encodeStateBounded(input, maxBytes, options): BoundedEncodeResult

Encodes a value, shrinking it until its serialized form fits within maxBytes.

Parameters

NameTypeDescription
inputunknownAny value.
NameTypeDescription
maxBytesnumberByte budget for the serialized form.
NameTypeDescription
optionsEncodeOptionsPassed through to encodeState.

Returns

BoundedEncodeResultThe encoded value and whether anything had to be dropped.