Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

Error Codes and Diagnostics

1auth exposes structured errors and provider diagnostics across signing and intent flows, with method-specific result shapes described below. Branch on a machine-readable error.code when the method supplies one, and log normalized error.details while integrating.

This page is the reference for the codes themselves. For symptom-first fixes — "the prompt never appears", "the address changed" — see Troubleshooting.

Result-based SDK methods

sendIntent(), grantPermissions(), signMessage(), and signTypedData() return structured failure results. sendBatchIntent() is also result-based, but uses flat top-level errorCode / error fields instead of an error.code object — see below.

const result = await client.sendIntent({
  accountAddress,
  targetChain: 8453,
  calls,
})
 
if (!result.success) {
  console.error('1auth request failed', {
    code: result.error?.code,
    message: result.error?.message,
    providerCode: result.error?.details?.providerCode,
    traceId: result.error?.details?.traceId,
    statusCode: result.error?.details?.statusCode,
    errorType: result.error?.details?.errorType,
    simulationUrls: result.error?.details?.simulationUrls,
  })
}

Sponsorship failures are method-specific:

  • sendIntent() returns MISSING_APP_CREDENTIALS or SPONSORSHIP_FETCH_FAILED in result.error.code.
  • grantPermissions() returns the same two codes in its structured result.
  • sendBatchIntent() reports top-level failures through its own errorCode and error fields rather than a nested error.code. Missing sponsorship configuration sets error; a failed access-token fetch sets neither and reports only through SDK telemetry. See Troubleshooting for the full list.
  • getAssets() rejects with an Error for missing configuration, token callback failures, or portfolio request failures; use try/catch.

Exception-based integrations

The EIP-1193 provider, viem accounts, and the passkey wallet client use exception-based APIs. They throw OneAuthError, which preserves the structured code and diagnostic details.

import { OneAuthError } from '@rhinestone/1auth'
 
try {
  await walletClient.signMessage({ message: 'Approve login' })
} catch (error) {
  if (error instanceof OneAuthError) {
    console.error('1auth request failed', {
      code: error.code,
      message: error.message,
      providerCode: error.details?.providerCode,
      traceId: error.details?.traceId,
      simulationUrls: error.details?.simulationUrls,
    })
  }
}

PayButton converts an unsuccessful structured sendIntent() result into a OneAuthError before calling onError. Other exceptions caught while authenticating or sending are forwarded as ordinary Error objects, so retain a generic fallback:

import { OneAuthError, PayButton } from '@rhinestone/1auth/react'
 
<PayButton
  client={client}
  intent={intent}
  onError={(error) => {
    if (error instanceof OneAuthError) {
      console.error(error.code, error.details)
      return
    }
    console.error('Unexpected payment error', error)
  }}
>
  Pay
</PayButton>

Common error codes

CodeStageApplication behavior
USER_REJECTEDSigning dialogKeep the user on the current screen and allow a new attempt.
USER_CANCELLEDDialog or status waitPreserve current state; the user deliberately closed the flow.
PREPARE_FAILEDQuote or pre-sign simulationInspect the returned details. Correct unsupported calldata, balances, or route constraints before retrying. A No viable route found message usually means an empty balance, not an unsupported route.
INVALID_SIGNATUREExecution simulationStart account recovery. Retrying with the same stale passkey will fail again.
EXECUTE_FAILEDSubmission or execution simulationLog providerCode, traceId, and simulationUrls for investigation.
NETWORK_ERRORSDK transportRetry after connectivity recovers.
SPONSORSHIP_FETCH_FAILEDApp sponsorshipCheck the app's access-token or extension-token endpoint.
HASH_TIMEOUTTransaction confirmationKeep the intent ID and query its status later.
MISSING_APP_CREDENTIALSClient configurationConfigure SDK sponsorship credentials before sponsored operations or asset queries.
INVALID_OPTIONSClient validationCorrect the request before opening another dialog.

Diagnostic fields

FieldPurpose
providerCodeMachine-readable code returned by the Rhinestone provider.
traceIdCorrelation ID to include in logs and support requests.
statusCodeUpstream HTTP status, when available.
errorTypeOrchestrator execution-error category.
simulationUrlsLinks to available transaction simulation traces.

These fields are intended for developer logs and support tooling. Do not render raw simulation URLs or provider diagnostics as user-facing error messages.