encodeStateBounded

function
serialize/codec.ts:592
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

BoundedEncodeResult, The encoded value and whether anything had to be dropped.