Skip to content

Commit 18036e2

Browse files
committed
rename
1 parent 253cf8f commit 18036e2

4 files changed

Lines changed: 16 additions & 16 deletions

File tree

fcl-android/src/main/java/io/outblock/fcl/NetworkApi.kt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import io.outblock.fcl.config.Config
66
import io.outblock.fcl.models.response.PollingResponse
77
import io.outblock.fcl.models.response.ResponseStatus
88
import io.outblock.fcl.models.response.Service
9-
import io.outblock.fcl.utils.FCLException
109
import io.outblock.fcl.utils.FclError
10+
import io.outblock.fcl.utils.FclException
1111
import io.outblock.fcl.utils.repeatWhen
1212
import io.outblock.fcl.utils.runBlockDelay
1313
import io.outblock.fcl.webview.FCLWebViewLifecycle
@@ -38,7 +38,7 @@ internal suspend fun execHttpPost(url: String, params: Map<String, String>? = ma
3838
ResponseStatus.APPROVED -> WebViewActivity.close()
3939
ResponseStatus.DECLINED -> {
4040
WebViewActivity.close()
41-
throw FCLException(FclError.declined)
41+
throw FclException(FclError.declined)
4242
}
4343
ResponseStatus.PENDING -> return tryPollService(response)
4444
}
@@ -95,13 +95,13 @@ private suspend fun tryPollService(
9595
response: PollingResponse,
9696
): PollingResponse {
9797
PollServiceState.poll()
98-
val local = response.local() ?: throw FCLException(FclError.generic)
99-
val updates = (response.updates ?: response.authorizationUpdates) ?: throw FCLException(FclError.generic)
98+
val local = response.local() ?: throw FclException(FclError.generic)
99+
val updates = (response.updates ?: response.authorizationUpdates) ?: throw FclException(FclError.generic)
100100

101101
try {
102102
local.openAuthenticationWebView()
103103
} catch (e: Exception) {
104-
throw FCLException(FclError.generic, exception = e)
104+
throw FclException(FclError.generic, exception = e)
105105
}
106106

107107

@@ -120,15 +120,15 @@ private suspend fun poll(service: Service): PollingResponse? {
120120
return null
121121
}
122122

123-
val url = service.endpoint ?: throw FCLException(FclError.invaildURL)
123+
val url = service.endpoint ?: throw FclException(FclError.invaildURL)
124124

125125
val response = retrofitAuthApi().executeGet(url, service.params)
126126

127127
when (response.status) {
128128
ResponseStatus.APPROVED -> WebViewActivity.close()
129129
ResponseStatus.DECLINED -> {
130130
WebViewActivity.close()
131-
throw FCLException(FclError.declined)
131+
throw FclException(FclError.declined)
132132
}
133133
else -> return response
134134
}

fcl-android/src/main/java/io/outblock/fcl/request/SignMessageRequest.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import com.nftco.flow.sdk.bytesToHex
55
import io.outblock.fcl.Fcl
66
import io.outblock.fcl.execHttpPost
77
import io.outblock.fcl.models.response.FCLServiceType
8-
import io.outblock.fcl.utils.FCLException
98
import io.outblock.fcl.utils.FclError
9+
import io.outblock.fcl.utils.FclException
1010

1111
internal class SignMessageSend {
1212

@@ -16,9 +16,9 @@ internal class SignMessageSend {
1616
suspend fun sign(message: String): String {
1717

1818
val service = Fcl.currentUser?.services?.first { it.type == FCLServiceType.userSignature.value }
19-
?: throw FCLException(FclError.invaildService)
19+
?: throw FclException(FclError.invaildService)
2020

21-
val endpoint = service.endpoint ?: throw FCLException(FclError.invaildService)
21+
val endpoint = service.endpoint ?: throw FclException(FclError.invaildService)
2222

2323
val signable = SignableMessage(message.toByteArray().bytesToHex())
2424

fcl-android/src/main/java/io/outblock/fcl/utils/FclError.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package io.outblock.fcl.utils
22

33
import io.outblock.fcl.BuildConfig
44

5-
class FCLException(
5+
class FclException(
66
private val error: FclError,
77
private val exception: Exception? = null,
88
) : Exception(error.value) {

fcl-android/src/main/java/io/outblock/fcl/webview/WebViewUtils.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ import io.outblock.fcl.Fcl
55
import io.outblock.fcl.config.Config
66
import io.outblock.fcl.lifecycle.LifecycleObserver
77
import io.outblock.fcl.models.response.Service
8-
import io.outblock.fcl.utils.FCLException
98
import io.outblock.fcl.utils.FclError
9+
import io.outblock.fcl.utils.FclException
1010

1111

1212
fun Service.openAuthenticationWebView() {
13-
val url = endpoint ?: throw FCLException(FclError.invaildURL)
14-
val context = LifecycleObserver.context() ?: throw FCLException(FclError.invaildContext)
13+
val url = endpoint ?: throw FclException(FclError.invaildURL)
14+
val context = LifecycleObserver.context() ?: throw FclException(FclError.invaildContext)
1515

1616
val uri = Uri.parse(url).buildUpon().apply {
1717
params?.forEach { appendQueryParameter(it.key, it.value) }
@@ -21,7 +21,7 @@ fun Service.openAuthenticationWebView() {
2121
}
2222

2323
fun Service.endpointUri(): Uri {
24-
val url = endpoint ?: throw FCLException(FclError.invaildURL)
24+
val url = endpoint ?: throw FclException(FclError.invaildURL)
2525

2626
return Uri.parse(url).buildUpon().apply {
2727
params?.forEach { appendQueryParameter(it.key, it.value) }
@@ -30,7 +30,7 @@ fun Service.endpointUri(): Uri {
3030
}
3131

3232
fun Uri.openInWebView() {
33-
val context = LifecycleObserver.context() ?: throw FCLException(FclError.invaildContext)
33+
val context = LifecycleObserver.context() ?: throw FclException(FclError.invaildContext)
3434
WebViewActivity.launchUrl(context, this.toString())
3535
}
3636

0 commit comments

Comments
 (0)