interface IMetadata {
    addLibp2pEventListener: (<K>(type, listener, options?) => void);
    allPeers: (() => Promise<Peer[]>);
    connectedPeers: (() => Promise<Peer[]>);
    multicodec: string;
    pubsubTopics: string[];
    removeLibp2pEventListener: {
        <K>(type, listener?, options?): void;
        (type, listener?, options?): void;
    };
    confirmOrAttemptHandshake(peerId): Promise<MetadataQueryResult>;
    query(peerId): Promise<MetadataQueryResult>;
}

Hierarchy

Properties

addLibp2pEventListener: (<K>(type, listener, options?) => void)

Type declaration

    • <K>(type, listener, options?): void
    • Type Parameters

      • K extends keyof Libp2pEvents<ServiceMap>

      Parameters

      • type: K
      • listener: null | EventHandler<Libp2pEvents<ServiceMap>[K]>
      • Optional options: boolean | AddEventListenerOptions

      Returns void

allPeers: (() => Promise<Peer[]>)

Type declaration

    • (): Promise<Peer[]>
    • Returns Promise<Peer[]>

connectedPeers: (() => Promise<Peer[]>)

Type declaration

    • (): Promise<Peer[]>
    • Returns Promise<Peer[]>

multicodec: string
pubsubTopics: string[]
removeLibp2pEventListener: {
    <K>(type, listener?, options?): void;
    (type, listener?, options?): void;
}

Type declaration

    • <K>(type, listener?, options?): void
    • Type Parameters

      • K extends keyof Libp2pEvents<ServiceMap>

      Parameters

      • type: K
      • Optional listener: null | EventHandler<Libp2pEvents<ServiceMap>[K]>
      • Optional options: boolean | EventListenerOptions

      Returns void

    • (type, listener?, options?): void
    • Parameters

      • type: string
      • Optional listener: EventHandler<Event>
      • Optional options: boolean | EventListenerOptions

      Returns void

Methods