> For the complete documentation index, see [llms.txt](/llms.txt).

# Migration guide from v5 to v6 for Embedded Wallets Android SDK

## Overview[​](#overview "Direct link to Overview")

This migration guide provides steps for upgrading from version 5 (v5) to version 6 (v6) of the Embedded Wallets Android SDK. The guide outlines significant changes and enhancements, including the introduction of `enableMFA` method to initiate MFA setup flow, and `launchWalletServices` method for template wallet interface.

## Changes in detail[​](#changes-in-detail "Direct link to Changes in detail")

### `enableMFA` method[​](#enablemfa-method "Direct link to enablemfa-method")

From v6, developers can use the `enableMFA` method to initiate MFA setup flow for already logged in users.

- Default Verifier
- Custom JWT Verifier

Usage

```
import android.widget.Button
import com.web3auth.core.Web3Auth
import android.os.Bundle

class MainActivity : AppCompatActivity() { private lateinit var web3Auth: Web3Auth

     private fun enableMFA() {
       val completableFuture = web3Auth.enableMFA()

        completableFuture.whenComplete{_, error ->
            if (error == null) {
                Log.d("MainActivity_Web3Auth", "Launched successfully")
                // Add your logic
            } else {
                // Add your logic on error
                Log.d("MainActivity_Web3Auth", error.message ?: "Something went wrong")
            }
        }
    }

    override fun onCreate(savedInstanceState: Bundle?) {
        ...
        // Setup UI and event handlers
        val enableMFAButton = findViewById<Button>(R.id.enableMFAButton)
        enableMFAButton.setOnClickListener { enableMFA() }
        ...
    }
    ...

}


```

Usage

```
import android.widget.Button
import com.web3auth.core.Web3Auth
import android.os.Bundle

class MainActivity : AppCompatActivity() { private lateinit var web3Auth: Web3Auth

     private fun enableMFA() {
        val loginParams = LoginParams(
            Provider.JWT,
            extraLoginOptions = ExtraLoginOptions(id_token = "<your_jwt_token>")
        )

        val completableFuture = web3Auth.enableMFA(loginParams)

        completableFuture.whenComplete{_, error ->
            if (error == null) {
                Log.d("MainActivity_Web3Auth", "Launched successfully")
                // Add your logic
            } else {
                // Add your logic on error
                Log.d("MainActivity_Web3Auth", error.message ?: "Something went wrong")
            }
        }
    }

    override fun onCreate(savedInstanceState: Bundle?) {
        ...
        // Setup UI and event handlers
        val enableMFAButton = findViewById<Button>(R.id.enableMFAButton)
        enableMFAButton.setOnClickListener { enableMFA() }
        ...
    }
    ...

}

```

### `launchWalletServices` method[​](#launchwalletservices-method "Direct link to launchwalletservices-method")

From v6, developers can use the `launchWalletServices` to launches a WebView which allows them to use the templated wallet UI services. Developers can pass the `ChainConfig` to open Wallet Services with a specific chain selected.

note

Access to Wallet Services is gated. You can use this feature in `sapphire_devnet` for free. The minimum [pricing plan](https://web3auth.io/pricing.html) to use this feature in a production environment is the **Scale Plan**.

#### ChainConfig arguments[​](#chainconfig-arguments "Direct link to ChainConfig arguments")

| Parameter         | Description                                                                                                               |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------- |
| chainNamespace    | Custom configuration for your preferred blockchain. As of now only EVM supported. Default value is ChainNamespace.EIP155. |
| decimals?         | Number of decimals for the currency ticker. Default value is 18, and accepts Int as value.                                |
| blockExplorerUrl? | Blockchain's explorer URL (for example, https://etherscan.io).                                                            |
| chainId           | The chain ID of the selected blockchain in hex String.                                                                    |
| displayName?      | Display Name for the chain.                                                                                               |
| logo?             | Logo for the selected chainNamespace and chainId.                                                                         |
| rpcTarget         | RPC Target URL for the selected chainNamespace and chainId.                                                               |
| ticker?           | Default currency ticker of the network (for example, ETH).                                                                |
| tickerName?       | Name for currency ticker (for example, Ethereum).                                                                         |

#### Usage[​](#usage "Direct link to Usage")

Usage

```
val launchWalletCompletableFuture = web3Auth.launchWalletServices(
    loginParams = LoginParams(
        selectedLoginProvider,
        extraLoginOptions = null,
        mfaLevel = MFALevel.NONE,
    ),

    chainConfig = ChainConfig(
        chainId = "0x1",
        rpcTarget = "https://mainnet.infura.io/v3/$key",
        ticker = "ETH",
        chainNamespace = ChainNamespace.EIP155
    )
)

launchWalletCompletableFuture.whenComplete { _, error ->
    if (error == null) {
        Log.d("MainActivity_Web3Auth", "Wallet launched successfully")
    } else {
        Log.d("MainActivity_Web3Auth", error.message ?: "Something went wrong")
    }
}

```
