Skip to main content
Both SDKs return consistent error codes, allowing you to implement the same error handling behavior across platforms. Errors are exposed as 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.\
Multiple errors may share the same code when they require similar handling. For example, 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.
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.
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.
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.
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.
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.