Skip to content

@swapped/connect-sdk / react / UseCoinbaseAmountResult

Type Alias: UseCoinbaseAmountResult

UseCoinbaseAmountResult = object

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

Result of useCoinbaseAmount.

Properties

amount

amount: string

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

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:17

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:31

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


amountFiatFloat

amountFiatFloat: number | null

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

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


amountFloat

amountFloat: number | null

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

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


balanceMax

balanceMax: number | null

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

Hard maximum: raw aggregated balance, or null.


balanceMaxFiat

balanceMaxFiat: number | null

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

Hard maximum in fiat, or null when unavailable.


error

error: CoinbaseAmountError | null

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

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:47

Token → fiat exchange rate, or null when unavailable.


feeReserve

feeReserve: number | null

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

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


feeReserveFiat

feeReserveFiat: number | null

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

Fee reserve in fiat, or null when unavailable.


formatted

formatted: object

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

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:49

Whether a usable exchange rate is available for fiat conversion.


isLoading

isLoading: boolean

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

Whether withdrawal limits are still loading.


isValid

isValid: boolean

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

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:108

Last limits-fetch error, or null.


maxAmount

maxAmount: number | null

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

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


maxAmountFiat

maxAmountFiat: number | null

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

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


maxDecimals

maxDecimals: number | null

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

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:51

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


minAmountFiat

minAmountFiat: number | null

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

Minimum withdrawable amount in fiat, or null when unavailable.


refetchLimits

refetchLimits: () => Promise<void>

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

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:104

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:19

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:24

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:33

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:40

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:84

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:82

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


warning

warning: CoinbaseAmountError | null

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

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