RainError on both platforms: an enum on iOS and a sealed class hierarchy in com.rain.sdk.error on Android.
Errors originating from Rain’s wallet infrastructure or external wallet providers are mapped to Rain error codes before reaching your application.
Handle SDK errors
Each error has a code and an associated error type. Use the error type to determine how your application responds and the error code for consistent logging and support.\RAIN_102 covers configuration and input errors, while RAIN_402 covers insufficient balances.
Use the error type and associated details to provide specific feedback to users.
Configuration errors
Errors related to SDK initialization, provider configuration, invalid inputs, and unsupported networks.Authentication errors
Errors related to authentication, expired sessions, and invalid login credentials.Network errors
Errors related to network connectivity and transaction processing.Transaction errors
Errors related to transaction validation, signing, insufficient balances, and collateral withdrawals.Provider and internal errors
Errors originating from wallet providers or unexpected SDK states.Troubleshooting
Common integration issues and how to resolve them when using Rain’s embedded wallet SDKs.Every SDK call returns RAIN_201 after app launch
Every SDK call returns RAIN_201 after app launch
The SDK may be attempting to resolve the wallet client before the user’s saved session has been restored. Call
awaitSessionRestore() on the provider, then check hasActiveSession() before resolving the client.Sending on Avalanche returns RAIN_104
Sending on Avalanche returns RAIN_104
Avalanche supports balance retrieval and transaction history, but outbound transactions are not currently supported through Rain embedded wallets. Disable sending for unsupported networks. For card funding, use a supported network such as Base or Arbitrum. If your application broadcasts transactions independently,
prepareWithdrawal can still prepare and sign collateral withdrawals without broadcasting them through Rain.Sponsored transactions return RAIN_403 after a delay
Sponsored transactions return RAIN_403 after a delay
Sponsored transactions skip local simulation because wallets without native tokens could otherwise fail the simulation before sponsorship is applied. As a result, transaction failures may surface after signing, when Rain’s wallet infrastructure processes the transaction. Inspect the underlying error to determine why the transaction reverted. Do not automatically retry without identifying the cause.
An incorrect login code logs the user out
An incorrect login code logs the user out
RAIN_203 indicates an invalid, expired, or previously used authentication code. It should not terminate the user’s session or clear the pending authentication challenge. Keep the user on the authentication screen and allow them to retry. Make sure your application handles RAIN_203 separately from authentication errors that require a new login.A previously working wallet returns RAIN_407 during collateral withdrawal
A previously working wallet returns RAIN_407 during collateral withdrawal
The wallet attempting to sign the withdrawal may no longer match an authorized administrator on the collateral contract. This can occur if the user creates a new account with different login credentials or the wallet address associated with their application changes. Compare the address returned by
getWalletAddress() with the contract’s adminAddresses, retrieved using GET /v1/issuing/users/{userId}/contracts.Wallet balances appear without token symbols
Wallet balances appear without token symbols
The token may not be included in Rain’s token registry. On Solana, token mints do not provide symbols directly onchain. Register the token using
registerTokens and supply its metadata, including its address, symbol, decimals, and name. This allows the SDK to display consistent token information across your application.What’s next
Testing
Reproduce these errors safely on testnets.
Sending funds
How sends, fees, and pending states behave.