Errors, Logging and Troubleshooting

Error shapes per surface, logging, timeouts and the common failures of the React Native SDK.

Before You Start

Read the following guides before proceeding:

GuideWhy
React Native SDKSurfaces, isolation model and flows
SDK SetupConfigure options and the credential provider

Where Errors Arrive

SurfaceDeliveryShape
RevealIn the snapshot — load() never rejects for a request failuresnapshot.error or snapshot.fields[i].error: { code, retryable }
CollecttokenizeTopUp() / tokenizeOctDestination() reject{ code, retryable, reason? }; reason is 'cardAlreadyLinked' or 'cardLimitReached'
3-D SecureIn the outcomeoutcome.error.code: 'originRefused', 'declined', 'unavailable'
WalletexecuteFailed and failed eventsevent.error.reason, event.error.kind
import {
  WirexDeclined, WirexWalletEnvironmentUnavailable, type WirexRevealSnapshot,
} from '@wirexapp/mobile-sdk';

export const revealError = (s: WirexRevealSnapshot) =>
  s.error ?? s.fields.find((f) => f.outcome === 'failed')?.error;
export const isDecline = (e: unknown) => e instanceof WirexDeclined;
export const envReason = (e: unknown) =>
  e instanceof WirexWalletEnvironmentUnavailable ? e.reason : null;
  • WirexDeclined is the one shared error class: the user said no and nothing was sent. It is not a
    failure.
  • WirexWalletEnvironmentUnavailable is thrown for an unknown wallet environment. reason is
    'unknownName', 'notBuilt' or 'malformedEndpoints'. Show the reason; never fall back to another
    environment.

Logging

Logging is off by default. Every logged value passes a redactor.

SurfaceOptionValues
Reveal, Collect, 3-D Securelogging in configure(...)'debug', 'info', 'warn', 'error'. Written to the iOS unified log and Android logcat tag wirex
WalletWirexWalletConfig.logging{ level, sink }. Without a sink nothing is written. Presets: WirexWalletLogging.disabled, WirexWalletLogging.console(level)
import { WirexWalletLogging, type WirexWalletConfig } from '@wirexapp/mobile-sdk';

export const revealConfigExtras = { logging: 'info' as const, timeouts: { requestSeconds: 15, resourceSeconds: 30 } };
export const walletConfig: WirexWalletConfig = { environment: 'test', logging: WirexWalletLogging.console('info') };

Log at debug in development builds and warn in release.


Timeouts

Values are in seconds.

SurfaceOption
Reveal, Collecttimeouts: { requestSeconds, resourceSeconds } in configure(...)
3-D SecurerequestSeconds, resourceSeconds top-level in WirexThreeDS.configure(...)

Troubleshooting

SymptomCauseResolution
The native module is missingExpo Go, or the old architectureBuild a development build with the New Architecture enabled
configure rejects with an environment errorThe build has no endpoints for that environment, or chainId is emptyPass testMode / environment correctly and a non-empty chainId
Reveal or Collect fails with unauthorizedStale bearer. The SDK never retries a 401Check expiry and refresh inside getAccessToken
API answers 400 on every callBoth userEmail and userWallet are setReturn exactly one identity
A revealed field is blankiOS Simulator secure layer, or a row height smaller than onNaturalHeightTest on a device; apply the reported height
Collect cannot tokenizeBilling details missing, or the user is not enrolled at the acquirerSend every required billing field — see Collect a Card
The Pay button is unavailableProbe not mounted, empty provider block, or iOS SimulatorMount WirexWalletAvailabilityProbe with the real block; test on a device
Google Pay unavailable on Android 11+Missing <queries> intentsAdd the Expo plugin or the intents — see SDK Setup
3-D Secure ends in pendingThe payment is not settled yetNot an error. Settle from the top-up status

Did this page help you?