Skip to content

Errors ​

Wallet verification failures throw ConnectSdkError with a stable code. Branch on code, not on message.

ts
import {
  ConnectSdkError,
  ConnectSdkErrorCode,
} from '@swapped/connect-sdk/wallet-verification'

try {
  await client.wallets.verify({
    network: 'evm',
    customerId: 'user-1234',
    provider,
  })
} catch (error) {
  if (!(error instanceof ConnectSdkError)) {
    throw error
  }

  switch (error.code) {
    case ConnectSdkErrorCode.WALLET_CONNECT_REJECTED:
    case ConnectSdkErrorCode.WALLET_SIGNATURE_REJECTED:
    case ConnectSdkErrorCode.WALLET_VERIFICATION_CANCELLED:
      // user / merchant cancelled - offer retry
      break
    case ConnectSdkErrorCode.WALLET_POPUP_BLOCKED:
      // ask to allow popups; retry from a click
      break
    case ConnectSdkErrorCode.WALLET_VERIFICATION_ADDRESS_MISMATCH:
      // connected account ≠ claimed address - switch account or omit address
      break
    default:
      // show a retry message; keep the user on this step while pending
      break
  }
}

WALLET_CONNECT_REJECTED and WALLET_SIGNATURE_REJECTED are user cancels (wallet declined connect or the sign prompt). WALLET_VERIFICATION_CANCELLED is an SDK / merchant abort (cancelVerification(), deeplink signal, or the Coinbase tab closed after the grace period).

Unmapped HTTP failures surface as API_ERROR. Show a retry message and keep the user on the same step when safe (pending). After failed or expired, start a new verification.

When things fail in the flow ​

StepWhat goes wrongHow you see itWhat to do
Create clientNot in a browser / missing keyBROWSER_REQUIRED, WALLET_VERIFICATION_API_KEY_REQUIREDBrowser-only module; pass apiKey
GatewayHidden iframe blocked or timed outWALLET_GATEWAY_NOT_READYAllow widgetBaseUrl in frame-src - Browser requirements
PickerProvider has no SDK wallet configWALLET_NOT_SUPPORTEDHide it, or only offer getAvailable() rows
InjectedExtension missingWALLET_NOT_INSTALLEDOffer WalletConnect or deeplink
Connect / signUser declinedWALLET_CONNECT_REJECTED, WALLET_SIGNATURE_REJECTEDOffer retry
VerifyClaimed address ≠ connected accountWALLET_VERIFICATION_ADDRESS_MISMATCHAsk the user to switch account, or verify the connected address
Deeplink / prepareNo addressWALLET_VERIFICATION_ADDRESS_REQUIREDCollect the address before prepareVerify() / deeplink verify()
Deeplink / Coinbase waitMerchant abortedWALLET_VERIFICATION_CANCELLEDClose UI; allow start again
WalletConnectSecond QR while one is liveWALLET_PAIRING_IN_PROGRESScancelPairing() or force: true
Popup / Coinbase tabBrowser blocked itWALLET_POPUP_BLOCKEDAsk to allow popups; retry from a click
CoinbaseopenVerificationTab() too earlyWALLET_VERIFICATION_NOT_STARTEDstartVerification() first
Coinbase redirectNo id on the landing pageWALLET_VERIFICATION_NOT_FOUNDPass verificationId or keep persist on
Any verifyAnother run is in flightWALLET_VERIFICATION_IN_PROGRESSWait, or take over with verify({ prepared })
ProofBad signatureThrown error; status stays pendingCall verify() again
Terminalfailed / expiredReturned recordNew verify() / startVerification()

Error code reference ​

Client ​

CodeWhenWhat to do
BROWSER_REQUIREDClient created outside the browserInstantiate in a client component / browser-only module
WALLET_VERIFICATION_API_KEY_REQUIREDapiKey missing or blankPass the public session API key
INVALID_ENVIRONMENTenvironment is not production or stagingUse one of those two values
INVALID_API_BASE_URLapiBaseUrl is not an official hostUse the production or staging API URL, or omit it
INVALID_WIDGET_BASE_URLwidgetBaseUrl is not official and not localhostUse the environment default, or a localhost widget host
CLIENT_DESTROYEDMethod called after destroy()Create a new client

Signature ​

CodeWhenWhat to do
WALLET_NOT_SUPPORTEDProvider has no SDK wallet configUse a wallet from getAvailable()
WALLET_NOT_INSTALLEDInjected path and the extension is not presentWalletConnect or deeplink
WALLET_NOT_CONNECTEDPrivileged action with no connectionverify() connects on its own; or connect() first
WALLET_CONNECT_REJECTEDUser rejected connect / pairingOffer retry
WALLET_SIGNATURE_REJECTEDUser rejected the sign promptOffer retry
WALLET_NAMESPACE_UNSUPPORTEDRequested namespace is not availableUse a wallet that supports network
WALLET_CHAIN_UNSUPPORTEDRequested chain is not availablePass a supported chainId or omit it
WALLET_PAIRING_IN_PROGRESSA WalletConnect pairing is already in flightcancelPairing() or force: true
WALLET_PAIRING_CANCELLEDIn-flight pairing was cancelledExpected after cancelPairing()
WALLET_PAIRING_EXPIREDWalletConnect QR / proposal expiredStart verify() again
WALLET_POPUP_BLOCKEDBrowser blocked the connect / Coinbase tabAllow popups; retry from a click
WALLET_POPUP_CLOSEDPopup closed before connect / sign finishedOffer retry
WALLET_POPUP_IN_PROGRESSAnother popup is already openWait for it to finish
WALLET_POPUP_NO_OPENERPopup could not reach the openerRetry; avoid noopener on your own window.open
WALLET_GATEWAY_NOT_READYHidden /gateway iframe blocked, timed out, or missingAllow widgetBaseUrl in frame-src
WALLET_VERIFICATION_ADDRESS_REQUIREDDeeplink verify() without addressCollect the address first
WALLET_VERIFICATION_ADDRESS_MISMATCHConnected account ≠ claimed addressSwitch account, or omit address
WALLET_VERIFICATION_NO_CHALLENGEPending record had no message / Coinbase URLRetry start; if it persists, treat as a server error

Coinbase and shared ​

CodeWhenWhat to do
WALLET_VERIFICATION_REDIRECT_URL_REQUIREDmode: 'redirect' without redirectUrlPass the landing-page URL
WALLET_VERIFICATION_NOT_STARTEDopenVerificationTab() with nothing pendingstartVerification() first
WALLET_VERIFICATION_NOT_FOUNDLanding page had no verification idPass the id or keep persistVerification
WALLET_VERIFICATION_IN_PROGRESSAnother verify / Coinbase run is already in flightWait, or cancelVerification()
WALLET_VERIFICATION_CANCELLEDWait aborted (cancelVerification(), signal, or Coinbase tab closed)Allow start again
API_ERRORUnmapped HTTP failureRetry the same step while pending