@multiformats/multiaddr
    Preparing search index...

    Interface ProtocolCodec

    interface ProtocolCodec {
        aliases?: string[];
        code: number;
        name: string;
        path?: boolean;
        resolvable?: boolean;
        size?: number;
        bytesToValue(bytes: Uint8Array): string;
        stringToValue(value: string): string;
        validate(value: string): void;
        valueToBytes(value: string): Uint8Array;
        valueToString(value: string): string;
    }
    Index

    Properties

    aliases?: string[]

    If specified this protocol codec will also be used to decode tuples with these names from string multiaddrs.

    code: number

    A numeric code that will be used in the binary representation of the tuple.

    name: string

    A string name that will be used in the string representation of the addr.

    path?: boolean

    If this protocol is a path protocol.

    This will be removed in a future release

    resolvable?: boolean

    If this protocol can be resolved using configured resolvers.

    This will be removed in a future release

    size?: number

    Size defines the expected length of the address part of the tuple - valid values are -1 (or the V constant) for variable length (this will be varint encoded in the binary representation), 0 for no address part or a number that represents a fixed-length address.

    Methods

    • Where the multiaddr has been encoded as a string, decode the value if necessary, unescaping any escaped values

      Parameters

      • value: string

      Returns string

    • Perform any necessary validation on the string value

      Parameters

      • value: string

      Returns void

    • To encode the multiaddr as a string, escape any necessary values

      Parameters

      • value: string

      Returns string