mirror of
https://github.com/logos-messaging/js-waku.git
synced 2026-01-08 00:33:12 +00:00
* move protocol result type to interfaces * chore: update type names for verbosity * feat(filter-core): convert error throws to return types * chore: update types & imports * update Filter API * chore: update createSubscription * chore: update imports & rename * chore: update all tests * chore: resolve conflicts & merge (2/n) * chore: resolve conflicts & merge (3/n) * chore: resolve conflicts & merge (4/n) * chore: resolve conflicts & merge (5/n) * chore: resolve conflicts & merge (6/n) * chore: use idiomatic approach * chore: fix tests * chore: address comments * chore: fix test * rm: only
32 lines
816 B
TypeScript
32 lines
816 B
TypeScript
import type { PeerId } from "@libp2p/interface";
|
|
import type { PeerStore } from "@libp2p/interface";
|
|
import type { ConnectionManager } from "@libp2p/interface-internal";
|
|
|
|
import { IEnr } from "./enr.js";
|
|
import { ThisOrThat } from "./misc.js";
|
|
import { IBaseProtocolCore } from "./protocols.js";
|
|
|
|
export interface IPeerExchange extends IBaseProtocolCore {
|
|
query(params: PeerExchangeQueryParams): Promise<PeerExchangeQueryResult>;
|
|
}
|
|
|
|
export type PeerExchangeQueryResult = ThisOrThat<"peerInfos", PeerInfo[]>;
|
|
|
|
export interface PeerExchangeQueryParams {
|
|
numPeers: number;
|
|
peerId: PeerId;
|
|
}
|
|
|
|
export interface PeerExchangeResponse {
|
|
peerInfos: PeerInfo[];
|
|
}
|
|
|
|
export interface PeerInfo {
|
|
ENR?: IEnr;
|
|
}
|
|
|
|
export interface PeerExchangeComponents {
|
|
connectionManager: ConnectionManager;
|
|
peerStore: PeerStore;
|
|
}
|