import { Bignum } from "@mlcc/crypto"; import { IRepository } from "./repository"; export interface IBlocksRepository extends IRepository { /** * Find a block by its ID. */ findById(id: string): Promise; /** * Count the number of records in the database. */ count(): Promise; /** * Get all of the common blocks from the database. */ common(ids: string[]): Promise; /** * Get all of the blocks within the given height range and order them by height. */ heightRange(start: number, end: number): Promise; /** * Get the last created block from the database. */ latest(): Promise; /** * Get the most recently created blocks ids from the database. * @return {Promise} */ recent(count: number): Promise; /** * Get statistics about all blocks from the database. */ statistics(): Promise<{ numberOfTransactions: number; totalFee: Bignum; totalAmount: Bignum; count: number; }>; /** * Get top count blocks */ top(count: number): Promise; /** * Delete the block from the database. */ delete(id: string): Promise; }