Narrow an inbound envelope to a NAP request type. This is a plain downcast with no runtime check; routes validate the fields they read.
Envelope matched by exact type.
type
The same object typed as T.
T
const { subId } = asRequest<RelaySubscribeMessage>(message); Copy
const { subId } = asRequest<RelaySubscribeMessage>(message);
Narrow an inbound envelope to a NAP request type. This is a plain downcast with no runtime check; routes validate the fields they read.