Skip to content

Commit a8ecccd

Browse files
committed
remove unnecessary libraries
1 parent 48d9a12 commit a8ecccd

File tree

10 files changed

+21
-48
lines changed

10 files changed

+21
-48
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ A **convenience method** that produces the needed authorization details for the
106106
**Note:** The default values for `proposer`, `payer`, and `authorizations` are already `fcl.authz` so there is no need to include these parameters, it is shown only for example purposes. See more on [signing roles](https://docs.onflow.org/concepts/accounts-and-keys/#signing-a-transaction).
107107

108108
```kotlin
109-
val tid = Fcl.send {
110-
script(
109+
val tid = Fcl.mutate {
110+
cadence(
111111
"""
112112
transaction(test: String, testInt: Int) {
113113
prepare(signer: AuthAccount) {
@@ -120,7 +120,7 @@ val tid = Fcl.send {
120120
)
121121
arg { string("Test2") }
122122
arg { int(1) }
123-
gaslimit(1000)
123+
gasLimit(1000)
124124
}
125125
```
126126

example/build.gradle

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ plugins {
44
}
55

66
android {
7-
compileSdk 31
7+
compileSdk 28
88

99
defaultConfig {
1010
applicationId "io.outblock.fcl.example"
1111
minSdk 21
12-
targetSdk 31
12+
targetSdk 28
1313
versionCode 1
1414
versionName "1.0"
1515

@@ -34,15 +34,15 @@ android {
3434
dependencies {
3535
implementation project(path: ':fcl-android')
3636

37-
implementation 'androidx.core:core-ktx:1.7.0'
38-
implementation 'androidx.appcompat:appcompat:1.4.1'
39-
implementation 'com.google.android.material:material:1.6.0'
37+
implementation 'androidx.core:core-ktx:1.6.0'
38+
implementation 'androidx.appcompat:appcompat:1.3.1'
39+
implementation 'com.google.android.material:material:1.3.0'
4040
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
4141
implementation 'com.google.code.gson:gson:2.8.9'
4242

4343
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.2'
4444

45-
// implementation 'com.github.Outblock:fcl-android:0.03'
45+
// implementation 'com.github.Outblock:fcl-android:0.05'
4646

4747
testImplementation 'junit:junit:4.13.2'
4848
androidTestImplementation 'androidx.test.ext:junit:1.1.3'

example/src/main/java/io/outblock/fcl/example/MainActivity.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ class MainActivity : AppCompatActivity() {
9797
Log.d(TAG, "authenticate complete:$auth")
9898
CoroutineScope(Dispatchers.Main).launch {
9999
Toast.makeText(this@MainActivity, "authenticate complete", Toast.LENGTH_SHORT).show()
100-
findViewById<TextView>(R.id.address).text = auth.address
100+
findViewById<TextView>(R.id.address).text = auth.data?.address
101101
}
102102
}
103103
}
@@ -129,7 +129,7 @@ class MainActivity : AppCompatActivity() {
129129
cadence(editText.text.toString())
130130
arg { string("Test2") }
131131
arg { int(1) }
132-
gaslimit(1000)
132+
gasLimit(1000)
133133
}
134134
Log.d(TAG, "tid:$tid")
135135
CoroutineScope(Dispatchers.Main).launch {

fcl-android/build.gradle

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,7 @@ android {
3535
}
3636

3737
dependencies {
38-
implementation 'androidx.core:core-ktx:1.8.0'
39-
implementation 'androidx.appcompat:appcompat:1.4.2'
40-
implementation 'com.google.android.material:material:1.6.1'
41-
implementation 'androidx.browser:browser:1.4.0'
42-
43-
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.2'
38+
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.1'
4439

4540
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
4641
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'

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

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
package io.outblock.fcl
22

33
import android.os.Looper
4-
import androidx.annotation.WorkerThread
54
import com.nftco.flow.sdk.FlowAddress
65
import com.nftco.flow.sdk.simpleFlowScript
76
import io.outblock.fcl.config.Config
8-
import io.outblock.fcl.models.response.AuthnResponse
97
import io.outblock.fcl.models.response.PollingResponse
108
import io.outblock.fcl.models.response.Service
119
import io.outblock.fcl.provider.Provider
@@ -67,16 +65,15 @@ object Fcl {
6765
*
6866
* @param [provider] provider used for authentication
6967
*/
70-
@WorkerThread
71-
fun authenticate(provider: Provider): AuthnResponse {
68+
fun authenticate(provider: Provider): PollingResponse {
7269
assert(Thread.currentThread() != Looper.getMainLooper().thread) { "can't call this method in main thread." }
7370

7471
val resp = AuthnRequest().authenticate(provider)
7572
currentUser = User.fromAuthn(resp)
76-
return AuthnResponse(resp.data?.addr, resp.status, resp.reason)
73+
return resp
7774
}
7875

79-
fun authenticateAsync(provider: Provider, callback: (response: AuthnResponse) -> Unit) {
76+
fun authenticateAsync(provider: Provider, callback: (response: PollingResponse) -> Unit) {
8077
ioScope { callback(authenticate(provider)) }
8178
}
8279

@@ -105,7 +102,6 @@ object Fcl {
105102
*
106103
* @throws FCLException If run into problems
107104
*/
108-
@WorkerThread
109105
fun mutate(builder: FclBuilder.() -> Unit): String {
110106
assert(Thread.currentThread() != Looper.getMainLooper().thread) { "can't call this method in main thread." }
111107
return runBlocking { AuthzSend().send(builder) }
@@ -132,7 +128,6 @@ object Fcl {
132128
*
133129
* @return executed result of cadence
134130
*/
135-
@WorkerThread
136131
fun query(builder: FclBuilder.() -> Unit): String {
137132
assert(Thread.currentThread() != Looper.getMainLooper().thread) { "can't call this method in main thread." }
138133

@@ -150,7 +145,6 @@ object Fcl {
150145
/**
151146
* TODO : not support right now
152147
*/
153-
@WorkerThread
154148
fun signMessage(message: String): String {
155149
assert(Thread.currentThread() != Looper.getMainLooper().thread) { "can't call this method in main thread." }
156150

@@ -181,7 +175,7 @@ class User(
181175
) {
182176
companion object {
183177
fun fromAuthn(authn: PollingResponse): User? {
184-
val address = authn.data?.addr ?: return null
178+
val address = authn.data?.address ?: return null
185179
return User(
186180
address = FlowAddress(address),
187181
services = authn.data.services,

fcl-android/src/main/java/io/outblock/fcl/models/response/AuthnResponse.kt

Lines changed: 0 additions & 14 deletions
This file was deleted.

fcl-android/src/main/java/io/outblock/fcl/models/response/PollingResponse.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ data class PollingResponse(
5050

5151
data class PollingData(
5252
@SerializedName("addr")
53-
val addr: String?,
53+
val address: String?,
5454
@SerializedName("services")
5555
val services: List<Service>?,
5656
@SerializedName("f_type")

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package io.outblock.fcl.request
22

3-
import androidx.annotation.WorkerThread
43
import io.outblock.fcl.FlowApi
54
import io.outblock.fcl.models.Argument
65
import io.outblock.fcl.models.Interaction
@@ -10,7 +9,7 @@ import io.outblock.fcl.request.builder.FclBuilder
109
import io.outblock.fcl.resolve.*
1110

1211
internal class AuthzSend {
13-
@WorkerThread
12+
1413
suspend fun send(builder: FclBuilder.() -> Unit): String {
1514
val ix = prepare(FclBuilder().apply { builder(this) })
1615
listOf(

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class FclBuilder {
2828

2929
fun arg(argument: JsonCadenceBuilder.() -> Field<*>) = arg(argument(JsonCadenceBuilder()))
3030

31-
fun gaslimit(limit: Int) {
31+
fun gasLimit(limit: Int) {
3232
this.limit = limit
3333
}
3434
}

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
package io.outblock.fcl.webview
22

3+
import android.app.Activity
34
import android.app.Application
45
import android.content.Context
56
import android.content.Intent
67
import android.os.Bundle
7-
import androidx.appcompat.app.AppCompatActivity
88
import io.outblock.fcl.utils.logd
99

10-
internal class WebViewActivity : AppCompatActivity() {
10+
internal class WebViewActivity : Activity() {
1111

1212
private val url by lazy { intent.getStringExtra(EXTRA_URL).orEmpty() }
1313

@@ -21,7 +21,6 @@ internal class WebViewActivity : AppCompatActivity() {
2121
FCLWebViewLifecycle.onWebViewOpen(url)
2222

2323
actionBar?.hide()
24-
supportActionBar?.hide()
2524
}
2625

2726
override fun onBackPressed() {

0 commit comments

Comments
 (0)