mirror of
https://github.com/logos-messaging/logos-messaging-js.git
synced 2026-03-21 22:33:10 +00:00
18 lines
559 B
TypeScript
18 lines
559 B
TypeScript
import type { PeerId } from "@libp2p/interface";
|
|
|
|
import type { ShardInfo } from "./enr.js";
|
|
import type {
|
|
IBaseProtocol,
|
|
ProtocolResult,
|
|
ShardingParams
|
|
} from "./protocols.js";
|
|
|
|
export type QueryResult = ProtocolResult<"shardInfo", ShardInfo>;
|
|
|
|
// IMetadata always has shardInfo defined while it is optionally undefined in IBaseProtocol
|
|
export interface IMetadata extends Omit<IBaseProtocol, "shardInfo"> {
|
|
shardInfo: ShardingParams;
|
|
confirmOrAttemptHandshake(peerId: PeerId): Promise<QueryResult>;
|
|
query(peerId: PeerId): Promise<QueryResult>;
|
|
}
|