UNPKG

@hyperlane-xyz/utils

Version:

General utilities and types for the Hyperlane network

31 lines 1.6 kB
import { Address, Checkpoint, CheckpointWithId, HexString, ReorgEvent, S3CheckpointWithId, SignatureLike } from './types.js'; export interface ValidatorConfig { address: string; localDomain: number; mailbox: string; } /** * Utilities for validators to construct and verify checkpoints. */ export declare class BaseValidator { protected readonly config: ValidatorConfig; constructor(config: ValidatorConfig); get address(): string; announceDomainHash(): string; static checkpointDomainHash(localDomain: number, merkle_tree_address: Address): string; static message(checkpoint: Checkpoint, messageId: HexString): string; static messageHash(checkpoint: Checkpoint, messageId: HexString): Uint8Array<ArrayBufferLike>; static recoverAddressFromCheckpoint(checkpoint: Checkpoint, signature: SignatureLike, messageId: HexString): Address; static recoverAddressFromCheckpointWithId({ checkpoint, message_id }: CheckpointWithId, signature: SignatureLike): Address; static recoverAddress({ value, signature }: S3CheckpointWithId): Address; matchesSigner(checkpoint: Checkpoint, signature: SignatureLike, messageId: HexString): boolean; getLatestCheckpointIndex(): Promise<number>; storageLocation(): string; getLatestCheckpointUrl(): string; getReorgStatus(): Promise<ReorgEvent | null>; } /** * Create signature for validator announce */ export declare const createAnnounce: (validatorPrivKey: string, storageLocation: string, mailboxAddress: string, localDomain: number) => Promise<string>; //# sourceMappingURL=validator.d.ts.map