Skip to content

@swapped/connect-sdk / react / UseCoinbaseAmountResult

Type Alias: UseCoinbaseAmountResult ​

UseCoinbaseAmountResult = object

Defined in: src/react/coinbase/hooks/useCoinbaseAmount.ts:9

Result of useCoinbaseAmount.

Properties ​

amount ​

amount: string

Defined in: src/react/coinbase/hooks/useCoinbaseAmount.ts:14

Full-precision crypto amount (canonical; safe to submit). Prefer amountDisplay for binding to an input.


amountDisplay ​

amountDisplay: string

Defined in: src/react/coinbase/hooks/useCoinbaseAmount.ts:19

Crypto string for binding to the input (value={amountDisplay}). Echoes typed text while editing crypto; display-formatted when derived from fiat.


amountFiat ​

amountFiat: string

Defined in: src/react/coinbase/hooks/useCoinbaseAmount.ts:33

Fiat amount string (2 dp). Empty when fiat is unavailable.


amountFiatFloat ​

amountFiatFloat: number | null

Defined in: src/react/coinbase/hooks/useCoinbaseAmount.ts:37

Numeric representation of amountFiat, or null when empty or invalid.


amountFloat ​

amountFloat: number | null

Defined in: src/react/coinbase/hooks/useCoinbaseAmount.ts:31

Numeric representation of amount, or null when empty or invalid.


balanceMax ​

balanceMax: number | null

Defined in: src/react/coinbase/hooks/useCoinbaseAmount.ts:57

Hard maximum: raw aggregated balance, or null.


balanceMaxFiat ​

balanceMaxFiat: number | null

Defined in: src/react/coinbase/hooks/useCoinbaseAmount.ts:65

Hard maximum in fiat, or null when unavailable.


error ​

error: CoinbaseAmountError | null

Defined in: src/react/coinbase/hooks/useCoinbaseAmount.ts:91

Blocking dual crypto/fiat validation error after touch, or null. Switch on error.crypto.code (or error.fiat?.code) for i18n.


exchangeRate ​

exchangeRate: number | null

Defined in: src/react/coinbase/hooks/useCoinbaseAmount.ts:49

Token → fiat exchange rate, or null when unavailable.


feeReserve ​

feeReserve: number | null

Defined in: src/react/coinbase/hooks/useCoinbaseAmount.ts:59

Fee reserve held back from the spendable max, or null when unavailable.


feeReserveFiat ​

feeReserveFiat: number | null

Defined in: src/react/coinbase/hooks/useCoinbaseAmount.ts:67

Fee reserve in fiat, or null when unavailable.


formatted ​

formatted: object

Defined in: src/react/coinbase/hooks/useCoinbaseAmount.ts:69

Display-ready limit strings. Prefer over formatting raw limits yourself.

feeReserve ​

feeReserve: string | null

Display-ready fee reserve (crypto), or null.

feeReserveFiat ​

feeReserveFiat: string | null

Display-ready fee reserve (fiat), or null.

maxAmount ​

maxAmount: string | null

Display-ready spendable maximum (crypto), or null.

maxAmountFiat ​

maxAmountFiat: string | null

Display-ready spendable maximum (fiat), or null.

minAmount ​

minAmount: string | null

Display-ready minimum (crypto), or null.

minAmountFiat ​

minAmountFiat: string | null

Display-ready minimum (fiat), or null.


isFiatAvailable ​

isFiatAvailable: boolean

Defined in: src/react/coinbase/hooks/useCoinbaseAmount.ts:51

Whether a usable exchange rate is available for fiat conversion.


isLoading ​

isLoading: boolean

Defined in: src/react/coinbase/hooks/useCoinbaseAmount.ts:108

Whether withdrawal limits are still loading.


isValid ​

isValid: boolean

Defined in: src/react/coinbase/hooks/useCoinbaseAmount.ts:101

Whether the amount has no blocking failure. Soft above_spendable in 'balance' mode does not invalidate.


limitsError ​

limitsError: Error | null

Defined in: src/react/coinbase/hooks/useCoinbaseAmount.ts:110

Last limits-fetch error, or null.


maxAmount ​

maxAmount: number | null

Defined in: src/react/coinbase/hooks/useCoinbaseAmount.ts:55

Soft / spendable maximum (balance minus fee reserve), or null.


maxAmountFiat ​

maxAmountFiat: number | null

Defined in: src/react/coinbase/hooks/useCoinbaseAmount.ts:63

Soft / spendable maximum in fiat, or null when unavailable.


maxDecimals ​

maxDecimals: number | null

Defined in: src/react/coinbase/hooks/useCoinbaseAmount.ts:47

Max fraction digits applied while typing for the selected token. From CoinbaseProvider maxDecimals, or getTokenDisplayDecimals.


minAmount ​

minAmount: number | null

Defined in: src/react/coinbase/hooks/useCoinbaseAmount.ts:53

Minimum withdrawable token amount, or null while loading / unavailable.


minAmountFiat ​

minAmountFiat: number | null

Defined in: src/react/coinbase/hooks/useCoinbaseAmount.ts:61

Minimum withdrawable amount in fiat, or null when unavailable.


refetchLimits ​

refetchLimits: () => Promise<void>

Defined in: src/react/coinbase/hooks/useCoinbaseAmount.ts:112

Re-fetch min/max/fee-reserve limits for the current selection.

Returns ​

Promise<void>


requiresAdjustment ​

requiresAdjustment: boolean

Defined in: src/react/coinbase/hooks/useCoinbaseAmount.ts:106

Whether the amount is above the spendable ceiling and will be auto-adjusted on submit.


setAmount ​

setAmount: (value) => void

Defined in: src/react/coinbase/hooks/useCoinbaseAmount.ts:21

Update the crypto amount. Sanitizes crypto amount input and recomputes fiat.

Parameters ​

value ​

string

Returns ​

void


setAmountExact ​

setAmountExact: (value, options?) => void

Defined in: src/react/coinbase/hooks/useCoinbaseAmount.ts:26

Set a pre-computed crypto amount (Max / programmatic). Bypasses the typing sanitizer so full precision is preserved.

Parameters ​

value ​

string

options? ​
touch? ​

boolean

Returns ​

void


setAmountFiat ​

setAmountFiat: (value) => void

Defined in: src/react/coinbase/hooks/useCoinbaseAmount.ts:35

Update the fiat amount and recompute crypto. No-op when fiat is unavailable.

Parameters ​

value ​

string

Returns ​

void


setMax ​

setMax: () => void

Defined in: src/react/coinbase/hooks/useCoinbaseAmount.ts:42

Set the amount to the Max for the current CoinbaseProvider mode: raw balance in 'balance' mode, spendable max in 'spendable' mode.

Returns ​

void


setTouched ​

setTouched: (touched) => void

Defined in: src/react/coinbase/hooks/useCoinbaseAmount.ts:86

Mark the field as touched - call on blur or before submit.

Parameters ​

touched ​

boolean

Returns ​

void


touched ​

touched: boolean

Defined in: src/react/coinbase/hooks/useCoinbaseAmount.ts:84

Whether the field has been blurred or submitted (gates showing error).


warning ​

warning: CoinbaseAmountError | null

Defined in: src/react/coinbase/hooks/useCoinbaseAmount.ts:96

Non-blocking soft-ceiling warning after touch (above_spendable in 'balance' mode), or null.