fryorcraken.eth 53af8994bd
feat: added I prefix to protocols interfaces
This will enable the remove of `Waku` prefix on all protocol
implementations, which is redundant due to the context.
2022-12-12 22:36:09 +11:00

32 lines
806 B
TypeScript

import type { ConnectionManager } from "@libp2p/interface-connection-manager";
import type { PeerStore } from "@libp2p/interface-peer-store";
import type { Registrar } from "@libp2p/interface-registrar";
import { ENR } from "@waku/enr";
import { PointToPointProtocol } from "./protocols.js";
export interface IPeerExchange extends PointToPointProtocol {
query(
params: PeerExchangeQueryParams,
callback: (response: PeerExchangeResponse) => Promise<void> | void
): Promise<void>;
}
export interface PeerExchangeQueryParams {
numPeers: number;
}
export interface PeerExchangeResponse {
peerInfos: PeerInfo[];
}
export interface PeerInfo {
ENR?: ENR;
}
export interface PeerExchangeComponents {
connectionManager: ConnectionManager;
peerStore: PeerStore;
registrar: Registrar;
}