Appearance
useCoinbaseSelection
Full snapshot of the Coinbase withdraw selection for review screens and submit gating.
When to use
When a component needs token + network + funding + amount together (for example a confirm step). Prefer the focused hooks (token, network, amount) for pickers.
Example
tsx
import {
useCoinbaseSelection,
useCoinbaseWithdrawal,
useCoinbaseWithdrawalCooldown,
} from '@swapped/connect-sdk/react'
function ReviewAndSubmit() {
const {
selectedCurrency,
selectedNetwork,
amount,
canSubmit,
reset,
} = useCoinbaseSelection()
const { startWithdrawal, isStartingWithdrawal } = useCoinbaseWithdrawal()
const { isInCooldown } = useCoinbaseWithdrawalCooldown()
return (
<div>
<p>
Withdraw {amount} {selectedCurrency} on {selectedNetwork}
</p>
<button type="button" onClick={reset}>
Reset
</button>
<button
type="button"
disabled={!canSubmit || isStartingWithdrawal || isInCooldown}
onClick={() => void startWithdrawal()}
>
Confirm
</button>
</div>
)
}Returns
| Field | Purpose |
|---|---|
selectedCurrency / selectedBalance | Token |
selectedNetwork / selectedNetworkItem | Network |
selectedFundingTokens / fundingTokens / aggregatedBalance | Funding |
amount / amountFloat / minAmount / maxAmount | Amount |
canSubmit | Ready to call startWithdrawal() |
reset() | Clear selection back toward defaults |
Requires CoinbaseProvider.