Skip to main content

PackageManager class

Basic package manager for iden3 communication protocol

PackageManager implements IPackageManager interface

Signature:

export declare class PackageManager implements IPackageManager 

Implements: IPackageManager

Constructors

ConstructorModifiersDescription
(constructor)()Creates an instance of PackageManager.

Properties

PropertyModifiersTypeDescription
packersMap<MediaType, IPacker>

Methods

MethodModifiersDescription
getMediaType(envelope)gets media type from an envelope
pack(mediaType, payload, params)packs payload with a packer that is assigned to media type forwards packer params to implementation
registerPackers(packers)registers new packer in the manager
unpack(envelope)unpacks packed envelope to basic protocol message and returns media type of the envelope
unpackWithType(mediaType, envelope)unpacks an envelope with a known media type