import { hexstring, P2P } from '@shardeum-foundation/lib-types'; export declare let cycles: P2P.CycleCreatorTypes.CycleRecord[]; export declare let cyclesByMarker: { [marker: string]: P2P.CycleCreatorTypes.CycleRecord; }; export declare let oldest: P2P.CycleCreatorTypes.CycleRecord; export declare let newest: P2P.CycleCreatorTypes.CycleRecord; /** FUNCTIONS */ export declare function init(): void; export declare function reset(): void; export declare function getNewest(): P2P.CycleCreatorTypes.CycleRecord; export declare function append(cycle: P2P.CycleCreatorTypes.CycleRecord): void; export declare function prepend(cycle: P2P.CycleCreatorTypes.CycleRecord): void; export declare function validate(prev: P2P.CycleCreatorTypes.CycleRecord, next: P2P.CycleCreatorTypes.CycleRecord): boolean; export declare function getCycleChain(start: any, end?: any): P2P.CycleCreatorTypes.CycleRecord[]; /** * Find a stored cycle with a timestamp. * This will fail if a timestamp is newer or older than cycles stored on this node * getCycleNumberFromTimestamp() will allow for predictions about future or past cycles. * @param timestamp */ export declare function getStoredCycleByTimestamp(timestamp: any): P2P.CycleCreatorTypes.CycleRecord; /** * Get a cycle from a timestamp. * Future timestamps are allowed. Timestamps for cycles older than stored are allow if the allowOlder flag is set * @param timestamp timestamp of the TX. NOTE by default the sync settle time will be added. set addSyncSettleTime = false to avoid this * @param allowOlder this allows calculating a cycle number for a cycle that is not stored. * @param addSyncSettleTime add in the sync settle time to the request. */ export declare function getCycleNumberFromTimestamp(timestamp: number, allowOlder?: boolean, addSyncSettleTime?: boolean): number; export declare function prune(keep: number): void; /** HELPER FUNCTIONS */ export declare function computeCycleMarker(fields: any): string; export declare function getDebug(): string; /** Returns the last appended cycle's marker. */ export declare function getCurrentCycleMarker(): hexstring; /** * this gets the most recently finished cycle and puts it in a logs str wth message and time * this cycle is never the most current one as we start working on the next as soon as we update * newest * @param msg * @returns */ export declare function getNewestCycleInfoLogStr(msg: string): string;