Skip to content

@swapped/connect-sdk / react / UseDualAmountInputOptions

Type Alias: UseDualAmountInputOptions

UseDualAmountInputOptions = object

Defined in: src/react/amount-input/useDualAmountInput.ts:25

Options for useDualAmountInput.

Properties

balanceAmount?

optional balanceAmount?: number | null

Defined in: src/react/amount-input/useDualAmountInput.ts:55

Hard ceiling: raw (aggregated) balance in crypto units.


clampToMax?

optional clampToMax?: boolean

Defined in: src/react/amount-input/useDualAmountInput.ts:66

When true, typing above the blocking ceiling clamps instead of allowing the value. Clamps to balance in 'balance' mode, spendable otherwise.


exchangeRate

exchangeRate: number | null

Defined in: src/react/amount-input/useDualAmountInput.ts:27

Token → fiat rate. null disables the fiat side.


firstNonZeroDecimalInput?

optional firstNonZeroDecimalInput?: boolean

Defined in: src/react/amount-input/useDualAmountInput.ts:45

Expand dust past display decimals in the crypto input (amountDisplay). Independent of display firstNonZeroDecimal. Defaults to resolveFirstNonZeroDecimalInput (false when unset).


formatCryptoValue?

optional formatCryptoValue?: (value) => string

Defined in: src/react/amount-input/useDualAmountInput.ts:68

Decorates crypto min/max/balance in default error messages.

Parameters

value

number

Returns

string


maxAmount?

optional maxAmount?: number | null

Defined in: src/react/amount-input/useDualAmountInput.ts:53

Soft / spendable ceiling in crypto units (e.g. balance minus fee reserve).


maxAmountMode?

optional maxAmountMode?: MaxAmountMode

Defined in: src/react/amount-input/useDualAmountInput.ts:61

Which ceiling blocks submit. Soft above_spendable is a warning only in 'balance' mode when balanceAmount is also supplied. Defaults to 'balance'.


maxDecimals?

optional maxDecimals?: number

Defined in: src/react/amount-input/useDualAmountInput.ts:34

Max fraction digits while typing crypto. Defaults to getTokenDisplayDecimals for token.


maxFiatDecimals?

optional maxFiatDecimals?: number

Defined in: src/react/amount-input/useDualAmountInput.ts:39

Max fraction digits while typing fiat and for crypto → fiat conversion. Defaults to resolveMaxFiatDecimals (maxFiatDecimals store, then 2).


minAmount?

optional minAmount?: number | null

Defined in: src/react/amount-input/useDualAmountInput.ts:51

Optional minimum in crypto units.


token?

optional token?: TokenSymbol

Defined in: src/react/amount-input/useDualAmountInput.ts:29

Selected token — used for display formatting.


tokenDecimals

tokenDecimals: number

Defined in: src/react/amount-input/useDualAmountInput.ts:49

On-chain token decimals. Used for fiat → crypto conversion and Max clamp.


touchedDelay?

optional touchedDelay?: number

Defined in: src/react/amount-input/useDualAmountInput.ts:73

Delay in ms before blur marks the field touched. Defaults to 0.