import BigNumber from "bignumber.js"; import type { CounterValuesState } from "@ledgerhq/live-countervalues/types"; import type { Currency } from "@ledgerhq/types-cryptoassets"; import type { AccountLike, Operation } from "@ledgerhq/types-live"; export declare const MAX_SMALL_VALUE_OPERATIONS_THRESHOLD_USD = 0.5; export declare const SMALL_VALUE_OPERATIONS_THRESHOLD_REFERENCE_CURRENCY: import("@ledgerhq/types-cryptoassets").FiatCurrency; export declare const clampSmallValueThresholdUsd: (threshold: number, fallback: number) => number; export declare const floorThresholdToCurrencyMinorUnit: (threshold: number, currency: Currency) => BigNumber | null; export declare const convertThresholdMinorUnitToMajor: (thresholdMinorUnit: BigNumber, currency: Currency) => BigNumber; export declare const formatThresholdMinorUnitForInput: (thresholdMinorUnit: BigNumber, currency: Currency) => string; export declare function convertThresholdFromUsdToCountervalueMinorUnit({ counterValueCurrency, countervaluesState, thresholdUsd, }: { counterValueCurrency: Currency; countervaluesState: CounterValuesState; thresholdUsd: number; }): BigNumber | null; export declare function convertThresholdFromCountervalueMinorUnitToUsd({ counterValueCurrency, countervaluesState, thresholdMinorUnit, }: { counterValueCurrency: Currency; countervaluesState: CounterValuesState; thresholdMinorUnit: BigNumber; }): number | null; /** * Returns `true` when an incoming token operation should be hidden as a * "small-value" (dust) transaction. * * An operation is considered dust when: * - it belongs to a TokenAccount, AND * - its type is "IN" (incoming transfer), AND * - either its crypto value is exactly zero, OR its fiat countervalue is * strictly below the configured threshold (defaults to $0.5, overridable * via ff). * * When the fiat countervalue cannot be computed (e.g. price feed unavailable), * the operation is NOT filtered so that legitimate transactions are never * accidentally hidden. * * The comparison is performed in the user's countervalue currency space: * we convert the operation amount (token minor units) to user-fiat minor * units via the stored `{from: token, to: user_fiat}` countervalue pair, * then compare against the threshold expressed in the same units. * * The countervalues state only stores `{from: token, to: user_fiat}` pairs * (never `{from: USD, to: token}`), so the threshold is expressed directly * in user_fiat minor units as `floor(thresholdUsd × 10^user_fiat.magnitude)`. * This is a ~1:1 USD/fiat approximation that is acceptable for a dust filter. */ export declare function isSmallValueTokenOperation({ operation, account, countervaluesState, userCounterValueCurrency, thresholdUsd, }: { operation: Operation; account: AccountLike; countervaluesState: CounterValuesState; /** The user's selected countervalue (fiat) currency, e.g. EUR. * The countervalues state stores `{from: token, to: this currency}` pairs. */ userCounterValueCurrency: Currency; /** USD threshold below which an incoming token operation is considered dust. * Defaults to MAX_SMALL_VALUE_OPERATIONS_THRESHOLD_USD ($0.5). * Pass the value from the `lldHideSmallValueTokenOperations` feature flag */ thresholdUsd?: number; }): boolean; //# sourceMappingURL=smallValueOperationsThreshold.d.ts.map