2024-01-15 16:12:01 -08:00
|
|
|
import type { PeerId } from "@libp2p/interface";
|
2023-12-05 19:26:52 +05:30
|
|
|
|
2024-08-13 05:23:20 +05:30
|
|
|
import { PubsubTopic, ThisOrThat } from "./misc.js";
|
|
|
|
|
import type { IBaseProtocolCore } from "./protocols.js";
|
|
|
|
|
import type { ShardInfo } from "./sharding.js";
|
2024-03-12 16:40:08 +05:30
|
|
|
|
2024-05-09 16:51:08 +05:30
|
|
|
export type MetadataQueryResult = ThisOrThat<"shardInfo", ShardInfo>;
|
2023-12-05 19:26:52 +05:30
|
|
|
|
2024-01-19 20:42:52 +05:30
|
|
|
// IMetadata always has shardInfo defined while it is optionally undefined in IBaseProtocol
|
2024-03-11 18:50:34 +05:30
|
|
|
export interface IMetadata extends Omit<IBaseProtocolCore, "shardInfo"> {
|
2024-08-13 05:23:20 +05:30
|
|
|
pubsubTopics: PubsubTopic[];
|
2024-05-09 16:51:08 +05:30
|
|
|
confirmOrAttemptHandshake(peerId: PeerId): Promise<MetadataQueryResult>;
|
|
|
|
|
query(peerId: PeerId): Promise<MetadataQueryResult>;
|
2023-12-05 19:26:52 +05:30
|
|
|
}
|