@artela-network/registry
Version:
A collection of configs, artifacts, and schemas for Hyperlane
33 lines (32 loc) • 1.54 kB
TypeScript
import type { Logger } from 'pino';
import type { ChainMap, ChainMetadata, ChainName, WarpCoreConfig } from '@hyperlane-xyz/sdk';
import { ChainAddresses, WarpRouteId } from '../types.js';
import { RegistryType, UpdateChainParams, type ChainFiles, type IRegistry, type RegistryContent } from './IRegistry.js';
import { SynchronousRegistry } from './SynchronousRegistry.js';
export interface FileSystemRegistryOptions {
uri: string;
logger?: Logger;
}
/**
* A registry that uses a local file system path as its data source.
* Requires file system access so it cannot be used in the browser.
*/
export declare class FileSystemRegistry extends SynchronousRegistry implements IRegistry {
readonly type = RegistryType.FileSystem;
constructor(options: FileSystemRegistryOptions);
getUri(itemPath?: string): string;
listRegistryContent(): RegistryContent;
getMetadata(): ChainMap<ChainMetadata>;
getAddresses(): ChainMap<ChainAddresses>;
removeChain(chainName: ChainName): void;
addWarpRoute(config: WarpCoreConfig): void;
protected listFiles(dirPath: string): string[];
protected createOrUpdateChain(chain: UpdateChainParams): void;
protected createChainFile(chainName: ChainName, fileName: keyof ChainFiles, data: any, cache: ChainMap<any>, prefix?: string): void;
protected createFile(file: {
filePath: string;
data: string;
}): void;
protected removeFiles(filePaths: string[]): void;
protected getWarpRoutesForIds(ids: WarpRouteId[]): WarpCoreConfig[];
}