tovarish-relayer/lib/services/events.d.ts

198 lines
9.5 KiB
TypeScript
Raw Permalink Normal View History

2024-11-19 13:22:27 +03:00
import { BaseTornadoService, BaseMultiTornadoService, BaseEncryptedNotesService, BaseGovernanceService, BaseRegistryService, BaseTornadoServiceConstructor, BaseMultiTornadoServiceConstructor, BaseEncryptedNotesServiceConstructor, BaseGovernanceServiceConstructor, BaseRegistryServiceConstructor, BaseEchoServiceConstructor, BaseEchoService, CachedRelayers, BatchEventsService, BaseEvents, DepositsEvents, WithdrawalsEvents, MultiDepositsEvents, MultiWithdrawalsEvents, EncryptedNotesEvents, AllGovernanceEvents, EchoEvents, BatchEventServiceConstructor, BatchEventOnProgress, NetIdType, AllRelayerRegistryEvents, BaseRevenueService, BaseRevenueServiceConstructor, StakeBurnedEvents, BatchBlockOnProgress, BatchBlockServiceConstructor, BatchBlockService, BatchTransactionService } from '@tornado/core';
2024-11-13 04:42:13 +03:00
import type { Logger } from 'winston';
import { TreeCache } from './treeCache';
export interface NodeEventsConstructor extends BatchEventServiceConstructor {
netId: NetIdType;
logger: Logger;
getInstanceName: () => string;
}
export declare class NodeEventsService extends BatchEventsService {
netId: NetIdType;
logger: Logger;
getInstanceName: () => string;
constructor(serviceConstructor: NodeEventsConstructor);
}
2024-11-19 13:22:27 +03:00
export interface NodeBlocksConstructor extends BatchBlockServiceConstructor {
netId: NetIdType;
logger: Logger;
getInstanceName: () => string;
}
export declare class NodeBlocksService extends BatchBlockService {
netId: NetIdType;
logger: Logger;
getInstanceName: () => string;
constructor(serviceConstructor: NodeBlocksConstructor);
}
export declare class NodeTransactionsService extends BatchTransactionService {
netId: NetIdType;
logger: Logger;
getInstanceName: () => string;
constructor(serviceConstructor: NodeBlocksConstructor);
}
2024-11-13 04:42:13 +03:00
export interface NodeTornadoServiceConstructor extends BaseTornadoServiceConstructor {
cacheDirectory: string;
userDirectory: string;
nativeCurrency: string;
logger: Logger;
treeCache?: TreeCache;
}
export declare class NodeTornadoService extends BaseTornadoService {
cacheDirectory: string;
userDirectory: string;
nativeCurrency: string;
logger: Logger;
treeCache?: TreeCache;
constructor(serviceConstructor: NodeTornadoServiceConstructor);
updateEventProgress({ fromBlock, toBlock, count }: Parameters<BatchEventOnProgress>[0]): void;
2024-11-19 13:22:27 +03:00
updateTransactionProgress({ currentIndex, totalIndex }: Parameters<BatchBlockOnProgress>[0]): void;
updateBlockProgress({ currentIndex, totalIndex }: Parameters<BatchBlockOnProgress>[0]): void;
2024-11-13 04:42:13 +03:00
getEventsFromDB(): Promise<BaseEvents<DepositsEvents | WithdrawalsEvents>>;
getEventsFromCache(): Promise<import("@tornado/core").CachedEvents<DepositsEvents | WithdrawalsEvents>>;
2024-11-19 13:22:27 +03:00
validateEvents<S>({ events, newEvents, lastBlock, }: BaseEvents<DepositsEvents | WithdrawalsEvents> & {
newEvents: (DepositsEvents | WithdrawalsEvents)[];
2024-11-13 04:42:13 +03:00
}): Promise<S>;
saveEvents({ events, lastBlock }: BaseEvents<DepositsEvents | WithdrawalsEvents>): Promise<void>;
updateEvents<S>(): Promise<{
events: (DepositsEvents | WithdrawalsEvents)[];
lastBlock: number;
validateResult: Awaited<S>;
}>;
}
2024-11-19 13:22:27 +03:00
export interface NodeMultiTornadoServiceConstructor extends BaseMultiTornadoServiceConstructor {
cacheDirectory: string;
userDirectory: string;
nativeCurrency: string;
logger: Logger;
treeCache?: TreeCache;
}
export declare class NodeMultiTornadoService extends BaseMultiTornadoService {
cacheDirectory: string;
userDirectory: string;
nativeCurrency: string;
logger: Logger;
treeCache?: TreeCache;
constructor(serviceConstructor: NodeMultiTornadoServiceConstructor);
updateEventProgress({ fromBlock, toBlock, count }: Parameters<BatchEventOnProgress>[0]): void;
updateTransactionProgress({ currentIndex, totalIndex }: Parameters<BatchBlockOnProgress>[0]): void;
updateBlockProgress({ currentIndex, totalIndex }: Parameters<BatchBlockOnProgress>[0]): void;
getEventsFromDB(): Promise<BaseEvents<MultiDepositsEvents | MultiWithdrawalsEvents>>;
getEventsFromCache(): Promise<import("@tornado/core").CachedEvents<MultiDepositsEvents | MultiWithdrawalsEvents>>;
validateEvents<S>({ events, newEvents, lastBlock, }: BaseEvents<MultiDepositsEvents | MultiWithdrawalsEvents> & {
newEvents: (MultiDepositsEvents | MultiWithdrawalsEvents)[];
}): Promise<S>;
saveEvents({ events, newEvents, lastBlock, }: BaseEvents<MultiDepositsEvents | MultiWithdrawalsEvents> & {
newEvents: (MultiDepositsEvents | MultiWithdrawalsEvents)[];
}): Promise<void>;
updateEvents<S>(): Promise<{
events: (MultiDepositsEvents | MultiWithdrawalsEvents)[];
lastBlock: number;
validateResult: Awaited<S>;
}>;
}
2024-11-13 04:42:13 +03:00
export interface NodeEchoServiceConstructor extends BaseEchoServiceConstructor {
cacheDirectory: string;
userDirectory: string;
logger: Logger;
}
export declare class NodeEchoService extends BaseEchoService {
cacheDirectory: string;
userDirectory: string;
logger: Logger;
constructor(serviceConstructor: NodeEchoServiceConstructor);
updateEventProgress({ fromBlock, toBlock, count }: Parameters<BatchEventOnProgress>[0]): void;
getEventsFromDB(): Promise<BaseEvents<EchoEvents>>;
getEventsFromCache(): Promise<import("@tornado/core").CachedEvents<EchoEvents>>;
saveEvents({ events, lastBlock }: BaseEvents<EchoEvents>): Promise<void>;
updateEvents<S>(): Promise<{
events: EchoEvents[];
lastBlock: number;
validateResult: Awaited<S>;
}>;
}
export interface NodeEncryptedNotesServiceConstructor extends BaseEncryptedNotesServiceConstructor {
cacheDirectory: string;
userDirectory: string;
logger: Logger;
}
export declare class NodeEncryptedNotesService extends BaseEncryptedNotesService {
cacheDirectory: string;
userDirectory: string;
logger: Logger;
constructor(serviceConstructor: NodeEncryptedNotesServiceConstructor);
updateEventProgress({ fromBlock, toBlock, count }: Parameters<BatchEventOnProgress>[0]): void;
getEventsFromDB(): Promise<BaseEvents<EncryptedNotesEvents>>;
getEventsFromCache(): Promise<import("@tornado/core").CachedEvents<EncryptedNotesEvents>>;
saveEvents({ events, lastBlock }: BaseEvents<EncryptedNotesEvents>): Promise<void>;
updateEvents<S>(): Promise<{
events: EncryptedNotesEvents[];
lastBlock: number;
validateResult: Awaited<S>;
}>;
}
export interface NodeGovernanceServiceConstructor extends BaseGovernanceServiceConstructor {
cacheDirectory: string;
userDirectory: string;
logger: Logger;
}
export declare class NodeGovernanceService extends BaseGovernanceService {
cacheDirectory: string;
userDirectory: string;
logger: Logger;
constructor(serviceConstructor: NodeGovernanceServiceConstructor);
updateEventProgress({ fromBlock, toBlock, count }: Parameters<BatchEventOnProgress>[0]): void;
2024-11-19 13:22:27 +03:00
updateTransactionProgress({ currentIndex, totalIndex }: Parameters<BatchBlockOnProgress>[0]): void;
2024-11-13 04:42:13 +03:00
getEventsFromDB(): Promise<BaseEvents<AllGovernanceEvents>>;
getEventsFromCache(): Promise<import("@tornado/core").CachedEvents<AllGovernanceEvents>>;
saveEvents({ events, lastBlock }: BaseEvents<AllGovernanceEvents>): Promise<void>;
updateEvents<S>(): Promise<{
events: AllGovernanceEvents[];
lastBlock: number;
validateResult: Awaited<S>;
}>;
}
export interface NodeRegistryServiceConstructor extends BaseRegistryServiceConstructor {
cacheDirectory: string;
userDirectory: string;
logger: Logger;
}
export declare class NodeRegistryService extends BaseRegistryService {
cacheDirectory: string;
userDirectory: string;
logger: Logger;
constructor(serviceConstructor: NodeRegistryServiceConstructor);
updateEventProgress({ fromBlock, toBlock, count }: Parameters<BatchEventOnProgress>[0]): void;
getEventsFromDB(): Promise<BaseEvents<AllRelayerRegistryEvents>>;
getEventsFromCache(): Promise<import("@tornado/core").CachedEvents<AllRelayerRegistryEvents>>;
saveEvents({ events, lastBlock }: BaseEvents<AllRelayerRegistryEvents>): Promise<void>;
updateEvents<S>(): Promise<{
events: AllRelayerRegistryEvents[];
lastBlock: number;
validateResult: Awaited<S>;
}>;
getRelayersFromDB(): Promise<CachedRelayers>;
getRelayersFromCache(): Promise<CachedRelayers>;
saveRelayers({ lastBlock, timestamp, relayers }: CachedRelayers): Promise<void>;
}
export interface NodeRevenueServiceConstructor extends BaseRevenueServiceConstructor {
cacheDirectory: string;
userDirectory: string;
logger: Logger;
}
export declare class NodeRevenueService extends BaseRevenueService {
cacheDirectory: string;
userDirectory: string;
logger: Logger;
constructor(serviceConstructor: NodeRevenueServiceConstructor);
updateEventProgress({ fromBlock, toBlock, count }: Parameters<BatchEventOnProgress>[0]): void;
2024-11-19 13:22:27 +03:00
updateTransactionProgress({ currentIndex, totalIndex }: Parameters<BatchBlockOnProgress>[0]): void;
updateBlockProgress({ currentIndex, totalIndex }: Parameters<BatchBlockOnProgress>[0]): void;
2024-11-13 04:42:13 +03:00
getEventsFromDB(): Promise<BaseEvents<StakeBurnedEvents>>;
getEventsFromCache(): Promise<import("@tornado/core").CachedEvents<StakeBurnedEvents>>;
saveEvents({ events, lastBlock }: BaseEvents<StakeBurnedEvents>): Promise<void>;
updateEvents<S>(): Promise<{
events: StakeBurnedEvents[];
lastBlock: number;
validateResult: Awaited<S>;
}>;
}