2023-03-21 01:44:35 +00:00
|
|
|
import type { GossipSub } from "@chainsafe/libp2p-gossipsub";
|
2023-03-31 01:17:41 +00:00
|
|
|
import type { PeerIdStr, TopicStr } from "@chainsafe/libp2p-gossipsub/types";
|
2022-12-05 06:00:24 +00:00
|
|
|
|
2023-03-31 01:17:41 +00:00
|
|
|
import { IReceiver } from "./receiver.js";
|
2023-03-21 01:07:59 +00:00
|
|
|
import type { ISender } from "./sender.js";
|
2022-12-05 06:00:24 +00:00
|
|
|
|
2023-03-21 01:07:59 +00:00
|
|
|
interface IRelayAPI {
|
2023-03-31 01:17:41 +00:00
|
|
|
readonly gossipSub: GossipSub;
|
|
|
|
start: () => Promise<void>;
|
|
|
|
getMeshPeers: (topic?: TopicStr) => PeerIdStr[];
|
2022-12-05 06:00:24 +00:00
|
|
|
}
|
2023-03-15 20:47:56 +00:00
|
|
|
|
2023-03-31 01:17:41 +00:00
|
|
|
export type IRelay = IRelayAPI & ISender & IReceiver;
|