@ledgerhq/live-common
Version:
Common ground for the Ledger Live apps
28 lines • 1.17 kB
TypeScript
import { BigNumber } from "bignumber.js";
import type { Unit } from "@ledgerhq/types-cryptoassets";
export type FormattedAmount = Readonly<{
display: string;
value: BigNumber;
}>;
export declare function formatAmountForInput(unit: Unit, amount: BigNumber, locale: string): string;
export declare function formatFiatForInput(unit: Unit, amount: BigNumber, locale: string): string;
export declare function processRawInput(rawValue: string, unit: Unit, locale: string): FormattedAmount;
export declare function processFiatInput(rawValue: string, fiatUnit: Unit, locale: string): Readonly<{
display: string;
clampedDisplay: string;
value: BigNumber;
isOverLimit: boolean;
}>;
export declare function calculateFiatEquivalent(params: {
amount: BigNumber;
lastTransactionAmount: BigNumber;
lastFiatAmount: BigNumber;
calculateFiatFromCrypto: (amount: BigNumber) => BigNumber | null | undefined;
}): BigNumber | null;
export declare function shouldSyncInput(params: {
isQuickAction: boolean;
useAllAmountChanged: boolean;
isActiveInput: boolean;
hasInputValue: boolean;
}): boolean;
//# sourceMappingURL=amountInput.d.ts.map