2024-01-15 16:12:01 -08:00
|
|
|
import type { PeerId } from "@libp2p/interface";
|
2023-12-05 19:26:52 +05:30
|
|
|
|
|
|
|
|
import type { ShardInfo } from "./enr.js";
|
2024-03-07 21:59:32 +05:30
|
|
|
import type {
|
|
|
|
|
IBaseProtocol,
|
2024-03-07 22:11:02 +05:30
|
|
|
ProtocolResult,
|
2024-03-07 21:59:32 +05:30
|
|
|
ShardingParams
|
|
|
|
|
} from "./protocols.js";
|
|
|
|
|
|
2024-03-07 22:11:02 +05:30
|
|
|
export type QueryResult = ProtocolResult<"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
|
|
|
|
|
export interface IMetadata extends Omit<IBaseProtocol, "shardInfo"> {
|
|
|
|
|
shardInfo: ShardingParams;
|
2024-03-07 21:59:32 +05:30
|
|
|
confirmOrAttemptHandshake(peerId: PeerId): Promise<QueryResult>;
|
|
|
|
|
query(peerId: PeerId): Promise<QueryResult>;
|
2023-12-05 19:26:52 +05:30
|
|
|
}
|