@funkit/connect
Version:
Funkit Connect SDK elevates DeFi apps via web2 sign-ins and one-click checkouts.
43 lines (42 loc) • 2.22 kB
TypeScript
import React from 'react';
import type { FunkitWithdrawalConfig, MultiMethodWithdrawalConfig } from '../../providers/FunkitCheckoutContext';
export interface SourceTokenOption {
symbol: string;
/** Display label (may differ from symbol, e.g. "USDC (Perps)") */
label: string;
iconSrc?: string;
}
export declare function WithdrawAmountInput({ withdrawalInputAmount, setWithdrawalInputAmount, sourceTokenBalance, isWithdrawAmountTooLow, isWithdrawAmountTooHigh, isWithdrawAmountAboveBalance, isWithdrawAmountValid, minWithdrawalDisplayValue, config, sourceTokenOptions, onSourceTokenChange, selectedSourceToken, sourceTokenUsdPrice, }: {
config: Exclude<FunkitWithdrawalConfig, MultiMethodWithdrawalConfig>;
sourceTokenBalance: string;
/** User-entered amount in source-token units (e.g. "0.5" for 0.5 ETH). */
withdrawalInputAmount: string;
setWithdrawalInputAmount: (s: string) => void;
isWithdrawAmountTooLow: boolean;
/**
* Amount exceeds the configured max. The over-cap explanation lives in the
* bottom-bar footer, so the inline input error is suppressed — but only when
* the amount is otherwise affordable. If it also exceeds the balance,
* "Insufficient balance" still shows (see below).
*/
isWithdrawAmountTooHigh: boolean;
/** Amount exceeds the available balance — takes priority over the over-cap hint. */
isWithdrawAmountAboveBalance: boolean;
isWithdrawAmountValid: boolean;
/**
* Minimum-withdrawal value formatted for display. Token units when the
* config provides `getMinWithdrawalAmount` (Lighter Secure); USD otherwise.
* The component picks the rendering style from `isLighter`.
*/
minWithdrawalDisplayValue: number;
sourceTokenOptions?: SourceTokenOption[];
onSourceTokenChange?: (opt: SourceTokenOption) => void;
/** Currently selected source token symbol (drives chip label + icon). */
selectedSourceToken?: string;
/**
* USD price per unit of the source token (e.g. ~1620 for ETH).
* When omitted, the USD equivalent is rendered as "-" rather than
* assuming a 1:1 stablecoin rate.
*/
sourceTokenUsdPrice?: number;
}): React.JSX.Element;