Appearance
@swapped/connect-sdk / react / UseDualAmountInputOptions
Type Alias: UseDualAmountInputOptions
UseDualAmountInputOptions =
object
Defined in: src/react/amount-input/useDualAmountInput.ts:22
Options for useDualAmountInput.
Properties
balanceAmount?
optionalbalanceAmount?:number|null
Defined in: src/react/amount-input/useDualAmountInput.ts:42
Hard ceiling: raw (aggregated) balance in crypto units.
clampToMax?
optionalclampToMax?:boolean
Defined in: src/react/amount-input/useDualAmountInput.ts:53
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:24
Token → fiat rate. null disables the fiat side.
formatCryptoValue?
optionalformatCryptoValue?: (value) =>string
Defined in: src/react/amount-input/useDualAmountInput.ts:55
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:40
Soft / spendable ceiling in crypto units (e.g. balance minus fee reserve).
maxAmountMode?
optionalmaxAmountMode?:MaxAmountMode
Defined in: src/react/amount-input/useDualAmountInput.ts:48
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:31
Max fraction digits while typing crypto. Defaults to getTokenDisplayDecimals for token.
minAmount?
optionalminAmount?:number|null
Defined in: src/react/amount-input/useDualAmountInput.ts:38
Optional minimum in crypto units.
token?
optionaltoken?:TokenSymbol
Defined in: src/react/amount-input/useDualAmountInput.ts:26
Selected token — used for display formatting and default decimals.
tokenDecimals?
optionaltokenDecimals?:number
Defined in: src/react/amount-input/useDualAmountInput.ts:36
Max fraction digits for crypto derived from a fiat edit. Defaults to getTokenDecimals for token.
touchedDelay?
optionaltouchedDelay?:number
Defined in: src/react/amount-input/useDualAmountInput.ts:60
Delay in ms before blur marks the field touched. Defaults to 0.