Appearance
@swapped/connect-sdk / react / UseDualAmountInputOptions
Type Alias: UseDualAmountInputOptions
UseDualAmountInputOptions =
object
Defined in: src/react/amount-input/useDualAmountInput.ts:25
Options for useDualAmountInput.
Properties
balanceAmount?
optionalbalanceAmount?:number|null
Defined in: src/react/amount-input/useDualAmountInput.ts:55
Hard ceiling: raw (aggregated) balance in crypto units.
clampToMax?
optionalclampToMax?: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?
optionalfirstNonZeroDecimalInput?: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?
optionalformatCryptoValue?: (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?
optionalmaxAmount?:number|null
Defined in: src/react/amount-input/useDualAmountInput.ts:53
Soft / spendable ceiling in crypto units (e.g. balance minus fee reserve).
maxAmountMode?
optionalmaxAmountMode?: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?
optionalmaxDecimals?:number
Defined in: src/react/amount-input/useDualAmountInput.ts:34
Max fraction digits while typing crypto. Defaults to getTokenDisplayDecimals for token.
maxFiatDecimals?
optionalmaxFiatDecimals?: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?
optionalminAmount?:number|null
Defined in: src/react/amount-input/useDualAmountInput.ts:51
Optional minimum in crypto units.
token?
optionaltoken?: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?
optionaltouchedDelay?:number
Defined in: src/react/amount-input/useDualAmountInput.ts:73
Delay in ms before blur marks the field touched. Defaults to 0.