@fruitsjs/core
Version:
Principal package with functions and models for building Fruits Eco-Blockchain applications.
26 lines (20 loc) • 825 B
text/typescript
import {ChainService} from '../../../service/chainService';
import {BlockIdList} from '../../../typings/blockIdList';
import {GetAccountBlocksArgs} from '../../../typings/args/getAccountBlocksArgs';
/**
* Use with [[ApiComposer]] and belongs to [[AccountApi]].
*
* See details at [[AccountApi.getAccountBlockIds]]
* @module core.api.factories
*/
export const getAccountBlockIds = (service: ChainService):
(args: GetAccountBlocksArgs) => Promise<BlockIdList> =>
(args): Promise<BlockIdList> => {
const params = {
account: args.accountId,
firstIndex: args.firstIndex,
lastIndex: args.lastIndex,
includeTransactions: args.includeTransactions || false
};
return service.query('getAccountBlockIds', params);
};