Skip to content

Commit 27a6930

Browse files
authored
Merge pull request #1 from ProjectOpenSea/prashan/bump-dependencies
Bump Kotlin, OkHttp, and Moshi dependencies. Also switch to Moshi cod…
2 parents c759af4 + 8c36f41 commit 27a6930

File tree

4 files changed

+24
-7
lines changed

4 files changed

+24
-7
lines changed

build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
buildscript {
22
ext {
33
versions = [
4-
kotlin : "1.4.31",
5-
moshi : '1.8.0',
6-
okhttp : '3.11.0',
4+
kotlin : "1.7.0",
5+
moshi : '1.13.0',
6+
okhttp : '4.10.0',
77
jupiter : '5.7.0',
88

99
'minSdk' : 14,

lib/build.gradle

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
plugins {
2+
id "com.google.devtools.ksp" version "1.7.0-1.0.6"
3+
}
14
apply plugin: "kotlin"
25
apply plugin: 'maven'
36

@@ -13,10 +16,8 @@ dependencies {
1316

1417
implementation "org.bouncycastle:bcprov-jdk15to18:1.68"
1518

16-
implementation 'com.squareup.moshi:moshi:1.8.0'
17-
// TODO: it would be better to use the generated adapter by moshi
18-
// but for that we should move the implementations in different modules
19-
//kapt "com.squareup.moshi:moshi-kotlin-codegen:$versions.moshi"
19+
implementation "com.squareup.moshi:moshi:$versions.moshi"
20+
ksp "com.squareup.moshi:moshi-kotlin-codegen:$versions.moshi"
2021

2122
implementation "com.squareup.okhttp3:okhttp:$versions.okhttp"
2223

lib/src/main/kotlin/org/walletconnect/Session.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package org.walletconnect
22

3+
import com.squareup.moshi.JsonClass
34
import java.net.URLDecoder
45
import java.net.URLEncoder
56

@@ -26,6 +27,7 @@ interface Session {
2627
fun removeCallback(cb: Callback)
2728
fun clearCallbacks()
2829

30+
@JsonClass(generateAdapter = true)
2931
data class FullyQualifiedConfig(
3032
val handshakeTopic: String,
3133
val bridge: String,
@@ -154,7 +156,10 @@ interface Session {
154156
data class Response(val id: Long, val result: Any?, val error: Error? = null) : MethodCall(id)
155157
}
156158

159+
@JsonClass(generateAdapter = true)
157160
data class PeerData(val id: String, val meta: PeerMeta?)
161+
162+
@JsonClass(generateAdapter = true)
158163
data class PeerMeta(
159164
val url: String? = null,
160165
val name: String? = null,

lib/src/main/kotlin/org/walletconnect/impls/WCSession.kt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package org.walletconnect.impls
22

3+
import com.squareup.moshi.JsonClass
34
import org.walletconnect.Session
45
import org.walletconnect.nullOnThrow
56
import org.walletconnect.types.extractSessionParams
@@ -166,6 +167,12 @@ class WCSession(
166167
)
167168
)
168169
}
170+
Session.Transport.Status.Disconnected -> {
171+
// no-op
172+
}
173+
is Session.Transport.Status.Error -> {
174+
// no-op
175+
}
169176
}
170177
propagateToCallbacks {
171178
onStatus(when(status) {
@@ -211,6 +218,9 @@ class WCSession(
211218
val callback = requests[data.id] ?: return
212219
callback(data)
213220
}
221+
is Session.MethodCall.Custom -> {
222+
// no-op
223+
}
214224
}
215225

216226
if (accountToCheck?.let { accountCheck(data.id(), it) } != false) {
@@ -297,6 +307,7 @@ interface WCSessionStore {
297307

298308
fun list(): List<State>
299309

310+
@JsonClass(generateAdapter = true)
300311
data class State(
301312
val config: Session.FullyQualifiedConfig,
302313
val clientData: Session.PeerData,

0 commit comments

Comments
 (0)