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

19 lines
480 B
TypeScript

import type { GossipSub } from "@chainsafe/libp2p-gossipsub";
import type {
IDecodedMessage,
IDecoder,
IEncoder,
IMessage,
} from "./message.js";
import type { Callback, SendResult } from "./protocols.js";
export interface IRelay extends GossipSub {
send: (encoder: IEncoder, message: IMessage) => Promise<SendResult>;
addObserver: <T extends IDecodedMessage>(
decoder: IDecoder<T>,
callback: Callback<T>
) => () => void;
getMeshPeers: () => string[];
}