UNPKG

lotus-sdk

Version:

Central repository for several classes of tools for integrating with, and building for, the Lotusia ecosystem

21 lines 1.16 kB
import { PublicKey } from '../publickey.js'; export interface ElectionResult { coordinatorIndex: number; coordinatorPublicKey: PublicKey; sortedSigners: PublicKey[]; indexMapping: Map<number, number>; electionProof: string; } export declare enum ElectionMethod { LEXICOGRAPHIC = "lexicographic", HASH_BASED = "hash-based", FIRST_SIGNER = "first-signer", LAST_SIGNER = "last-signer" } export declare function electCoordinator(signers: PublicKey[], method?: ElectionMethod): ElectionResult; export declare function verifyElectionResult(signers: PublicKey[], result: ElectionResult, method?: ElectionMethod): boolean; export declare function isCoordinator(signers: PublicKey[], signerIndex: number, method?: ElectionMethod): boolean; export declare function getCoordinatorPublicKey(signers: PublicKey[], method?: ElectionMethod): PublicKey; export declare function getBackupCoordinator(signers: PublicKey[], currentCoordinatorIndex: number, method?: ElectionMethod): number | null; export declare function getCoordinatorPriorityList(signers: PublicKey[], method?: ElectionMethod): number[]; //# sourceMappingURL=election.d.ts.map