11
22package com.sbz.web3authdemoapp
33
4+ // IMP START - Quick Start
5+ // IMP END - Quick Start
46import android.content.Intent
57import android.os.Bundle
68import android.util.Log
@@ -12,10 +14,14 @@ import android.widget.Toast
1214import androidx.appcompat.app.AppCompatActivity
1315import com.google.gson.Gson
1416import com.google.gson.JsonArray
15- // IMP START - Quick Start
1617import com.web3auth.core.Web3Auth
17- // IMP END - Quick Start
18- import com.web3auth.core.types.*
18+ import com.web3auth.core.types.AuthConnection
19+ import com.web3auth.core.types.EmailFlowType
20+ import com.web3auth.core.types.ExtraLoginOptions
21+ import com.web3auth.core.types.LoginParams
22+ import com.web3auth.core.types.UserInfo
23+ import com.web3auth.core.types.Web3AuthOptions
24+ import com.web3auth.core.types.Web3AuthResponse
1925import org.torusresearch.fetchnodedetails.types.Web3AuthNetwork
2026import org.web3j.crypto.Credentials
2127import org.web3j.crypto.Hash
@@ -108,6 +114,18 @@ class MainActivity : AppCompatActivity() {
108114 }
109115 getAddressButton.visibility = View .GONE
110116
117+ val enableMFABtn = findViewById<Button >(R .id.enableMFA)
118+ enableMFABtn.setOnClickListener {
119+ val enableMfaCf = web3Auth.enableMFA()
120+ enableMfaCf.whenComplete { _, error ->
121+ if (error == null ) {
122+ Log .d(" MainActivity_Web3Auth" , " MFA setup successfully" )
123+ } else {
124+ Log .d(" MainActivity_Web3Auth" , error.message ? : " Something went wrong" )
125+ }
126+ }
127+ }
128+
111129 val getBalanceButton = findViewById<Button >(R .id.getBalance)
112130 getBalanceButton.setOnClickListener { getBalance() }
113131 getBalanceButton.visibility = View .GONE
@@ -119,6 +137,8 @@ class MainActivity : AppCompatActivity() {
119137 val getTransactionButton = findViewById<Button >(R .id.getTransaction)
120138 getTransactionButton.setOnClickListener { sendTransaction(0.001 , " 0xeaA8Af602b2eDE45922818AE5f9f7FdE50cFa1A8" ) }
121139 getTransactionButton.visibility = View .GONE
140+
141+
122142 }
123143
124144 override fun onNewIntent (intent : Intent ? ) {
0 commit comments