Skip to content

Cooldown

Client-side wait after startWithdrawal before another start is allowed.

When to use

Drive the Withdraw / Start button. Read state with getCooldown() and subscribe with onCooldownChanged for a live countdown.

What it is

  • Starts when startWithdrawal() is called (even if 2FA is still required)
  • Fixed 30 seconds (SDK-owned, not configurable)
  • While active, another startWithdrawal throws COINBASE_COOLDOWN_ACTIVE
  • Does not block confirmWithdrawal (2FA retries are immediate)
  • Not a Coinbase API concept; not related to Exchange Pay order expiry
  • Clears on disconnect() / reset()

Methods

MethodPurpose
getCooldown(){ isInCooldown, remainingMs } snapshot
onCooldownChanged(handler)Fires when cooldown begins, every second while active, and when it ends. Returns unsubscribe

Example

ts
const { isInCooldown, remainingMs } = client.coinbase.getCooldown();

if (isInCooldown) {
  console.log(`Wait ${Math.ceil(remainingMs / 1000)}s`);
}

const off = client.coinbase.onCooldownChanged(({ isInCooldown, remainingMs }) => {
  // Disable Start; show countdown from remainingMs
});

// later
off();

Errors

CodeWhenWhat to do
COINBASE_COOLDOWN_ACTIVEstartWithdrawal while cooling downWait for remainingMs; disable the button using this API

Prefer preventing the error in UI over catching it after submit.

See Errors.