Skip to content

@swapped/connect-sdk / react / useCoinbaseWithdrawal

Function: useCoinbaseWithdrawal()

useCoinbaseWithdrawal(): UseCoinbaseWithdrawalResult

Defined in: src/react/coinbase/hooks/useCoinbaseWithdrawal/useCoinbaseWithdrawal.ts:62

React hook for the Coinbase withdrawal flow.

Typical path: startWithdrawal() → if requires2fa, collect a code and call confirmWithdrawal. A wrong code keeps status: 'requires2fa' and sets is2faInvalid so the UI can show feedback and retry. startWithdrawal builds the request from CoinbaseProvider selection (optional overrides), auto-adjusts above-max amounts (optional onAmountAdjusted callback may veto), and is rate-limited by cooldown (see useCoinbaseWithdrawalCooldown); confirming 2FA is not.

Returns

UseCoinbaseWithdrawalResult