@@ -21,7 +21,6 @@ import com.google.gson.JsonArray
2121import com.web3auth.core.Web3Auth
2222import com.web3auth.core.isEmailValid
2323import com.web3auth.core.isPhoneNumberValid
24- import com.web3auth.core.types.AUTH_CONNECTION
2524import com.web3auth.core.types.AuthConnection
2625import com.web3auth.core.types.AuthConnectionConfig
2726import com.web3auth.core.types.BuildEnv
@@ -45,30 +44,30 @@ class MainActivity : AppCompatActivity(), AdapterView.OnItemClickListener {
4544 private lateinit var web3Auth: Web3Auth
4645
4746 private val authConnectionList: List <AuthConnectionLogin > = listOf (
48- AuthConnectionLogin (" Google" , AUTH_CONNECTION .GOOGLE ),
49- AuthConnectionLogin (" Facebook" , AUTH_CONNECTION .FACEBOOK ),
50- AuthConnectionLogin (" Twitch" , AUTH_CONNECTION .TWITCH ),
51- AuthConnectionLogin (" Discord" , AUTH_CONNECTION .DISCORD ),
52- AuthConnectionLogin (" Reddit" , AUTH_CONNECTION .REDDIT ),
53- AuthConnectionLogin (" Apple" , AUTH_CONNECTION .APPLE ),
54- AuthConnectionLogin (" Github" , AUTH_CONNECTION .GITHUB ),
55- AuthConnectionLogin (" LinkedIn" , AUTH_CONNECTION .LINKEDIN ),
56- AuthConnectionLogin (" Twitter" , AUTH_CONNECTION .TWITTER ),
57- AuthConnectionLogin (" Line" , AUTH_CONNECTION .LINE ),
58- AuthConnectionLogin (" Hosted Email Passwordless" , AUTH_CONNECTION .EMAIL_PASSWORDLESS ),
59- AuthConnectionLogin (" SMS Passwordless" , AUTH_CONNECTION .SMS_PASSWORDLESS ),
60- AuthConnectionLogin (" JWT" , AUTH_CONNECTION .JWT ),
61- AuthConnectionLogin (" Farcaster" , AUTH_CONNECTION .FARCASTER )
47+ AuthConnectionLogin (" Google" , AuthConnection .GOOGLE ),
48+ AuthConnectionLogin (" Facebook" , AuthConnection .FACEBOOK ),
49+ AuthConnectionLogin (" Twitch" , AuthConnection .TWITCH ),
50+ AuthConnectionLogin (" Discord" , AuthConnection .DISCORD ),
51+ AuthConnectionLogin (" Reddit" , AuthConnection .REDDIT ),
52+ AuthConnectionLogin (" Apple" , AuthConnection .APPLE ),
53+ AuthConnectionLogin (" Github" , AuthConnection .GITHUB ),
54+ AuthConnectionLogin (" LinkedIn" , AuthConnection .LINKEDIN ),
55+ AuthConnectionLogin (" Twitter" , AuthConnection .TWITTER ),
56+ AuthConnectionLogin (" Line" , AuthConnection .LINE ),
57+ AuthConnectionLogin (" Hosted Email Passwordless" , AuthConnection .EMAIL_PASSWORDLESS ),
58+ AuthConnectionLogin (" SMS Passwordless" , AuthConnection .SMS_PASSWORDLESS ),
59+ AuthConnectionLogin (" JWT" , AuthConnection .JWT ),
60+ AuthConnectionLogin (" Farcaster" , AuthConnection .FARCASTER )
6261 )
6362
64- private var selectedLoginProvider: AUTH_CONNECTION = AUTH_CONNECTION .GOOGLE
63+ private var selectedLoginProvider: AuthConnection = AuthConnection .GOOGLE
6564
6665 private val gson = Gson ()
6766
6867 private fun signIn () {
6968 val hintEmailEditText = findViewById<EditText >(R .id.etEmailHint)
7069 var extraLoginOptions: ExtraLoginOptions ? = null
71- if (selectedLoginProvider == AUTH_CONNECTION .EMAIL_PASSWORDLESS ) {
70+ if (selectedLoginProvider == AuthConnection .EMAIL_PASSWORDLESS ) {
7271 val hintEmail = hintEmailEditText.text.toString()
7372 if (hintEmail.isBlank() || ! hintEmail.isEmailValid()) {
7473 Toast .makeText(this , " Please enter a valid Email." , Toast .LENGTH_LONG ).show()
@@ -77,7 +76,7 @@ class MainActivity : AppCompatActivity(), AdapterView.OnItemClickListener {
7776 extraLoginOptions = ExtraLoginOptions (login_hint = hintEmail)
7877 }
7978
80- if (selectedLoginProvider == AUTH_CONNECTION .SMS_PASSWORDLESS ) {
79+ if (selectedLoginProvider == AuthConnection .SMS_PASSWORDLESS ) {
8180 val hintPhNo = hintEmailEditText.text.toString()
8281 if (hintPhNo.isBlank() || ! hintPhNo.isPhoneNumberValid()) {
8382 Toast .makeText(this , " Please enter a valid Number." , Toast .LENGTH_LONG ).show()
@@ -224,14 +223,14 @@ class MainActivity : AppCompatActivity(), AdapterView.OnItemClickListener {
224223 val launchWalletButton = findViewById<Button >(R .id.launchWalletButton)
225224 launchWalletButton.setOnClickListener {
226225 val launchWalletCompletableFuture = web3Auth.showWalletUI(
227- chainId = " 0x89" ,
228226 chainConfig = listOf (
229227 ChainsConfig (
230228 chainId = " 0x89" ,
231229 rpcTarget = " https://1rpc.io/matic" ,
232230 chainNamespace = ChainNamespace .EIP155
233231 )
234- )
232+ ),
233+ chainId = " 0x89" ,
235234 )
236235 launchWalletCompletableFuture.whenComplete { _, error ->
237236 if (error == null ) {
@@ -319,13 +318,13 @@ class MainActivity : AppCompatActivity(), AdapterView.OnItemClickListener {
319318
320319 val hintEmailEditText = findViewById<EditText >(R .id.etEmailHint)
321320
322- if (selectedLoginProvider == AUTH_CONNECTION .EMAIL_PASSWORDLESS ) {
321+ if (selectedLoginProvider == AuthConnection .EMAIL_PASSWORDLESS ) {
323322 hintEmailEditText.hint = " Enter Email"
324- } else if (selectedLoginProvider == AUTH_CONNECTION .SMS_PASSWORDLESS ) {
323+ } else if (selectedLoginProvider == AuthConnection .SMS_PASSWORDLESS ) {
325324 hintEmailEditText.hint = " Enter Phone Number"
326325 }
327326
328- if (selectedLoginProvider == AUTH_CONNECTION .EMAIL_PASSWORDLESS || selectedLoginProvider == AUTH_CONNECTION .SMS_PASSWORDLESS ) {
327+ if (selectedLoginProvider == AuthConnection .EMAIL_PASSWORDLESS || selectedLoginProvider == AuthConnection .SMS_PASSWORDLESS ) {
329328 hintEmailEditText.visibility = View .VISIBLE
330329 } else {
331330 hintEmailEditText.visibility = View .GONE
0 commit comments