Skip to content

@swapped/connect-sdk / react / UseAmountInputOptions

Type Alias: UseAmountInputOptions ​

UseAmountInputOptions = object

Defined in: src/react/amount-input/useAmountInput.ts:18

Options for useAmountInput.

Properties ​

balanceAmount? ​

optional balanceAmount?: number | null

Defined in: src/react/amount-input/useAmountInput.ts:35

Hard ceiling: raw (aggregated) balance. When set, values above it produce above_balance.


formatValue? ​

optional formatValue?: (value) => string

Defined in: src/react/amount-input/useAmountInput.ts:43

Decorates min/max/balance in default error messages ($10.00, 0.5 USDC).

Parameters ​

value ​

number

Returns ​

string


maxAmount? ​

optional maxAmount?: number | null

Defined in: src/react/amount-input/useAmountInput.ts:30

Soft / spendable ceiling (e.g. balance minus fee reserve). When set, values above it produce above_spendable.


maxAmountMode? ​

optional maxAmountMode?: MaxAmountMode

Defined in: src/react/amount-input/useAmountInput.ts:41

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/useAmountInput.ts:23

Max fraction digits passed to sanitizeAmountInput. Omit for no limit (crypto). 0 forces integers.


minAmount? ​

optional minAmount?: number | null

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

Optional minimum. When set, values below it fail validation.


touchedDelay? ​

optional touchedDelay?: number

Defined in: src/react/amount-input/useAmountInput.ts:48

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