UNPKG

@accounter/server

Version:
11 lines (10 loc) 711 B
import { Currency } from '../../../shared/enums.js'; import type { LedgerProto } from '../../../shared/types/index.js'; /** * Aggregates all main ledger entries of a single conversion side (base or quote) into one * representative LedgerProto. The entries are expected to share the same currency; foreign and * local amounts are summed while meta fields are copied from the first entry. For a side with a * single entry the result is equivalent to that entry. */ export declare function aggregateConversionSideEntries(entries: LedgerProto[]): LedgerProto; export declare function conversionFeeCalculator(base: LedgerProto, quote: LedgerProto, officialRate: number, defaultLocalCurrency: Currency): number;