File tree Expand file tree Collapse file tree 4 files changed +24
-7
lines changed
src/main/kotlin/org/walletconnect Expand file tree Collapse file tree 4 files changed +24
-7
lines changed Original file line number Diff line number Diff line change 11buildscript {
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 ,
Original file line number Diff line number Diff line change 1+ plugins {
2+ id " com.google.devtools.ksp" version " 1.7.0-1.0.6"
3+ }
14apply plugin : " kotlin"
25apply 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
Original file line number Diff line number Diff line change 11package org.walletconnect
22
3+ import com.squareup.moshi.JsonClass
34import java.net.URLDecoder
45import 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 ,
Original file line number Diff line number Diff line change 11package org.walletconnect.impls
22
3+ import com.squareup.moshi.JsonClass
34import org.walletconnect.Session
45import org.walletconnect.nullOnThrow
56import 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 ,
You can’t perform that action at this time.
0 commit comments