Skip to content

inspectEnvelope(bytes): WireEnvelopeParts

Defined in: packages/wire/src/envelope.ts:286

Take a valid envelope apart into owned copies of every part, whichever module wrote it.

The inverse of serializeEnvelope for bytes already known to be an artifact: framing the parts again reproduces the input, and framing them with one part changed yields a valid envelope around the change. It expects no magic and maps no failure to a module’s parse error, so it is not a decoder for untrusted bytes; that is deserializeEnvelope.

Uint8Array

WireEnvelopeParts

With INVALID_ARGUMENT when bytes is not a valid envelope.