UNPKG

@fruitsjs/core

Version:

Principal package with functions and models for building Fruits Eco-Blockchain applications.

24 lines (20 loc) 856 B
import {ChainService} from '../../../service/chainService'; import {Account} from '../../../typings/account'; import {GetAccountArgs} from '../../../typings/args/getAccountArgs'; /** * Use with [[ApiComposer]] and belongs to [[AccountApi]]. * * See details at [[AccountApi.getAccount]] * @module core.api.factories */ export const getAccount = (service: ChainService): (args: GetAccountArgs) => Promise<Account> => (args: GetAccountArgs): Promise<Account> => { const params = { account: args.accountId, height : args.commitmentAtHeight, // || undefined, getCommittedAmount : args.includeCommittedAmount, // || undefined, estimateCommitment : args.includeEstimatedCommitment, // || undefined }; return service.query('getAccount', params); };