/// import { Schema } from '@liskhq/lisk-codec'; import { Logger } from './logger'; import { ImmutableMethodContext, ImmutableSubStore, SubStore } from './state_machine/types'; import { RPC_MODES } from './constants'; export interface SocketPaths { readonly ipc: { readonly path: string; }; } export declare enum ChannelType { InMemory = "inMemory", ChildProcess = "ipc" } export interface PluginOptions extends Record { readonly loadAsChildProcess?: boolean; } export interface ValidatorConfig { readonly address: string; readonly encryptedPassphrase: string; readonly hashOnion: { readonly count: number; readonly distance: number; readonly hashes: string[]; }; } export interface NetworkConfig { version: string; port: number; seedPeers: { ip: string; port: number; }[]; host?: string; blacklistedIPs?: string[]; fixedPeers?: { ip: string; port: number; }[]; whitelistedPeers?: { ip: string; port: number; }[]; maxOutboundConnections?: number; maxInboundConnections?: number; wsMaxPayload?: number; advertiseAddress?: boolean; } export interface GenesisConfig { block: { fromFile?: string; blob?: string; }; chainID: string; maxTransactionsSize: number; blockTime: number; bftBatchSize: number; minimumCertifyHeight: number; } export interface TransactionPoolConfig { readonly maxTransactions?: number; readonly maxTransactionsPerAccount?: number; readonly transactionExpiryTime?: number; readonly minEntranceFeePriority?: string; readonly minReplacementFeeDifference?: string; } export interface SystemConfig { version: string; dataPath: string; logLevel: string; keepEventsForHeights: number; keepInclusionProofsForHeights: number; inclusionProofKeys: string[]; backup: { height: number; }; enableMetrics: boolean; } type RecursivePartial = { [P in keyof T]?: RecursivePartial; }; export interface RPCConfig { modes: (typeof RPC_MODES.IPC | typeof RPC_MODES.WS | typeof RPC_MODES.HTTP)[]; port: number; host: string; allowedMethods?: string[]; accessControlAllowOrigin: string; } export interface LegacyConfig { sync: boolean; brackets: { startHeight: number; snapshotHeight: number; snapshotBlockID: string; }[]; } export interface GeneratorConfig { keys: { fromFile?: string; }; } export interface PluginConfig extends Record { readonly loadAsChildProcess?: boolean; } export interface ApplicationConfig { system: SystemConfig; rpc: RPCConfig; legacy: LegacyConfig; genesis: GenesisConfig; network: NetworkConfig; transactionPool: TransactionPoolConfig; generator: GeneratorConfig; modules: { [key: string]: Record; }; plugins: { [key: string]: PluginConfig; }; } export type EngineConfig = Omit; export type ApplicationConfigForPlugin = Omit; export type PartialApplicationConfig = RecursivePartial; export interface EndpointInfo { readonly namespace: string; readonly method: string; } export interface RegisteredSchema { block: Schema; header: Schema; transaction: Schema; asset: Schema; event: Schema; } export interface SchemaWithDefault extends Schema { readonly default?: Record; } export interface PluginEndpointContext { params: Record; logger: Logger; } export interface ModuleEndpointContext extends PluginEndpointContext { getStore: (moduleID: Buffer, storePrefix: Buffer) => ImmutableSubStore; getOffchainStore: (moduleID: Buffer, storePrefix: Buffer) => SubStore; getImmutableMethodContext: () => ImmutableMethodContext; header: { height: number; timestamp: number; aggregateCommit: { height: number; }; }; chainID: Buffer; } export type EndpointHandler = (context: PluginEndpointContext | ModuleEndpointContext) => Promise; export type EndpointHandlers = Map; type Primitive = string | number | bigint | boolean | null | undefined; type Replaced = T extends TReplace | TKeep ? T extends TReplace ? TWith | Exclude : T : { [P in keyof T]: Replaced; }; export type JSONObject = Replaced; export interface Event { readonly module: string; readonly name: string; readonly topics: Buffer[]; readonly index: number; readonly data: Buffer; } export type EventJSON = JSONObject; export {};