@fruitsjs/core
Version:
Principal package with functions and models for building Fruits Eco-Blockchain applications.
17 lines (15 loc) • 583 B
text/typescript
import {ChainService} from '../../../service/chainService';
import {Block} from '../../../typings/block';
/**
* Use with [[ApiComposer]] and belongs to [[BlockApi]].
*
* See details at [[BlockApi.getBlockByTimestamp]]
* @module core.api.factories
*/
export const getBlockByTimestamp = (service: ChainService):
(timestamp: number, includeTransactions: boolean) => Promise<Block> =>
(timestamp: number, includeTransactions: boolean): Promise<Block> =>
service.query('getBlock', {
timestamp,
includeTransactions
});