import type { FailureReason, FiatStepResponse } from '@funkit/connect-core'; import type { TFunction } from 'i18next'; /** * What the alert says when the flow is sent back to the quote with an error. * * The server answers a refusal it cannot place on a field — a provider that * will not fill the amount, a form the provider no longer holds, an outage — * by re-presenting the quote with `error` set. Nothing on the amount screen * shows that, so without this the user watches the form they just filled * close and is left on the amount with no word why (design 2114:8131: the * default iOS alert over the deposit screen). */ export interface QuoteRefusalAlert { title: string; message: string; } export declare function showPaymentUnavailableAlert(t: TFunction, applePay: boolean, scheme?: 'light' | 'dark'): void; export declare function showQuoteRefusalAlert(error: FailureReason, t: TFunction, scheme?: 'light' | 'dark'): void; /** The error a step response carries back onto the quote, if it does. */ export declare function quoteRefusal(stepResponse: FiatStepResponse | undefined): FailureReason | undefined; /** * A refusal for asking to spend more than this buyer may. * * It belongs on the amount field, not in an alert. The server re-presents the * quote with `limits.max` narrowed to the cap that refused, so the screen names * the number and offers the way down to it — the same answer every other * maximum gets (ENG-6302). An alert on top of that says it twice, in wording * that is in none of the designs, and leaves the buyer to dismiss it before * they can act on the ceiling underneath. */ export declare function isOverLimit(error: FailureReason): boolean; /** * Whether the screen can actually name the cap an over-limit refusal carries. * * `isOverLimit` suppresses the alert because the amount field shows the ceiling * instead, and the contract makes `limits.max` required on a `QUOTE`, so a * ceiling is there to show. But the suppression and the recovery read different * fields, and nothing in the types ties them together: a server that answered * with a zero or unparseable max would silence the alert and leave the field * offering the range that was just refused — no alert and no number. * * So the invariant is checked rather than trusted. Staying silent is only right * when there is something to be silent about. */ export declare function hasOverLimitCeiling(stepResponse: FiatStepResponse | undefined, refusedMaximum: { amount: string; } | undefined, amount: string): boolean; export declare function quoteRefusalAlert(error: FailureReason, t: TFunction): QuoteRefusalAlert; /** Select the contact-screen recovery, if the refusal belongs on that screen. */ export declare function contactRefusal(error: FailureReason | undefined): 'reverify' | 'change' | 'rate-limited' | undefined; //# sourceMappingURL=quoteRefusal.d.ts.map