Skip to content

Commit

Permalink
Merge pull request #1336 from WalletConnect/develop
Browse files Browse the repository at this point in the history
BOM_1.23.0
  • Loading branch information
jakubuid authored Feb 29, 2024
2 parents df1cf87 + a5dc8a7 commit a70894c
Show file tree
Hide file tree
Showing 29 changed files with 290 additions and 184 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci_internal_sample.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
- 'protocol/**'
- 'product/**'
- 'sample/**'
workflow_dispatch:

jobs:
release_samples_internal:
Expand Down
1 change: 1 addition & 0 deletions ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ WalletConnect v2 protocols for Android applications.

| BOM | [Core SDK](core/android) | [Sign SDK](protocol/sign) | [Auth SDK](protocol/auth) | [Chat SDK](protocol/chat) | [Notify SDK](protocol/notify) | [web3wallet](product/web3wallet) | [web3modal](product/web3modal) | [WalletConnectModal](product/walletconnectmodal) |
|-----------------------------------------------------------------------------------------|--------------------------|---------------------------|---------------------------|---------------------------|:------------------------------|----------------------------------|--------------------------------|--------------------------------------------------|
| 1.23.0 | 1.28.0 | 2.26.0 | 1.26.0 | 1.0.0.beta25 | 1.1.0 | 1.21.0 | 1.3.0 | 1.3.0 |
| 1.22.2 | 1.27.2 | 2.25.2 | 1.25.2 | 1.0.0.beta25 | 1.0.2 | 1.20.2 | 1.2.2 | 1.2.2 |
| 1.22.1 | 1.27.0 | 2.25.0 | 1.25.0 | 1.0.0.beta23 | 1.0.0 | 1.20.0 | 1.2.1 | 1.2.0 |
| 1.22.0 | 1.27.0 | 2.25.0 | 1.25.0 | 1.0.0.beta23 | 1.0.0 | 1.20.0 | 1.2.0 | 1.2.0 |
Expand Down
3 changes: 3 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ allprojects {
if (requested.group == "androidx.navigation" && requested.name == "navigation-compose") {
useVersion(composeNavigationVersion)
}
if (requested.group == "org.bouncycastle" && requested.name == "bcprov-jdk15on") {
useTarget("org.bouncycastle:bcprov-jdk18on:$bouncyCastleVersion")
}
}
}
}
Expand Down
25 changes: 2 additions & 23 deletions buildSrc/src/main/kotlin/Dependencies.kt
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
import org.gradle.kotlin.dsl.DependencyHandlerScope

fun DependencyHandlerScope.scanner() {
"implementation"("com.google.mlkit:barcode-scanning:$mlKitBarcode")
"implementation"("androidx.camera:camera-camera2:$camera2Version")
"implementation"("androidx.camera:camera-lifecycle:$camera2Version")
"implementation"("androidx.camera:camera-view:1.0.0-alpha21")
}

fun DependencyHandlerScope.lifecycle() {
"implementation"("androidx.lifecycle:lifecycle-livedata-ktx:$lifecycleVersion")
"implementation"("androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycleVersion")
Expand Down Expand Up @@ -63,17 +56,12 @@ fun DependencyHandlerScope.okhttp() {
}

fun DependencyHandlerScope.bouncyCastle() {
"api"("org.bouncycastle:bcprov-jdk15on:$bouncyCastleVersion")
}

fun DependencyHandlerScope.sqlDelightAndroid() {
"api"("com.squareup.sqldelight:android-driver:$sqlDelightVersion")
"api"("com.squareup.sqldelight:coroutines-extensions-jvm:$sqlDelightVersion")

"api"("org.bouncycastle:bcprov-jdk18on:$bouncyCastleVersion")
}

fun DependencyHandlerScope.sqlCipher() {
"api"("net.zetetic:android-database-sqlcipher:$sqlCipherVersion")
"api"("app.cash.sqldelight:async-extensions:2.0.0")
}

fun DependencyHandlerScope.reLinker() {
Expand All @@ -93,15 +81,6 @@ fun DependencyHandlerScope.koinAndroid() {
"api"("io.insert-koin:koin-android:$koinVersion")
}

fun DependencyHandlerScope.koinTest() {
"testImplementation"("io.insert-koin:koin-test-junit5:$koinVersion")
}

fun DependencyHandlerScope.glide_N_kapt() {
"implementation"("com.github.bumptech.glide:glide:4.12.0")
"kapt"("com.github.bumptech.glide:compiler:4.12.0")
}

fun DependencyHandlerScope.multibaseJava() {
"api"("com.github.multiformats:java-multibase:$multibaseVersion") //https://mvnrepository.com/artifact/com.github.multiformats/java-multibase/1.1.0 vulnerability detected with library
}
Expand Down
27 changes: 12 additions & 15 deletions buildSrc/src/main/kotlin/Versions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ const val KEY_PUBLISH_ARTIFACT_ID = "PUBLISH_ARTIFACT_ID"
const val KEY_SDK_NAME = "SDK_NAME"

//Latest versions
const val BOM_VERSION = "1.22.2"
const val FOUNDATION_VERSION = "1.14.2"
const val CORE_VERSION = "1.27.2"
const val SIGN_VERSION = "2.25.2"
const val AUTH_VERSION = "1.25.2"
const val CHAT_VERSION = "1.0.0-beta25"
const val NOTIFY_VERSION = "1.0.2"
const val WEB_3_WALLET_VERSION = "1.20.2"
const val WEB_3_MODAL_VERSION = "1.2.2"
const val WC_MODAL_VERSION = "1.2.2"
const val MODAL_CORE_VERSION = "1.2.2"
const val BOM_VERSION = "1.23.0"
const val FOUNDATION_VERSION = "1.15.0"
const val CORE_VERSION = "1.28.0"
const val SIGN_VERSION = "2.26.0"
const val AUTH_VERSION = "1.26.0"
const val CHAT_VERSION = "1.0.0-beta26"
const val NOTIFY_VERSION = "1.1.0"
const val WEB_3_WALLET_VERSION = "1.21.0"
const val WEB_3_MODAL_VERSION = "1.3.0"
const val WC_MODAL_VERSION = "1.3.0"
const val MODAL_CORE_VERSION = "1.3.0"

val jvmVersion = JavaVersion.VERSION_11
const val MIN_SDK: Int = 23
Expand All @@ -39,13 +39,11 @@ const val composeViewModelVersion = "2.6.1"
const val scarletVersion = "1.0.0"
const val scarletPackage = "com.github.WalletConnect.Scarlet"
const val koinVersion = "3.4.2"
const val mlKitBarcode = "17.0.3"
const val camera2Version = "1.1.0-alpha01"
const val lifecycleVersion = "2.6.1"
const val navVersion = "2.5.3"
const val retrofitVersion = "2.9.0"
const val okhttpVersion = "4.11.0"
const val bouncyCastleVersion = "1.70"
const val bouncyCastleVersion = "1.77"
const val sqlCipherVersion = "4.5.3@aar"
const val multibaseVersion = "1.1.1"
const val jUnit4Version = "4.13.2"
Expand All @@ -59,7 +57,6 @@ const val androidSecurityVersion = "1.1.0-alpha06"
const val web3jVersion = "4.9.5"
const val kethereumVersion = "0.85.7"
const val wsRestJavaVersion = "3.1.0"
const val fcmVersion = "23.1.1"
const val relinkerVersion = "1.4.5"
const val accompanistVersion = "0.31.3-beta"
const val coreKtxVersion = "1.10.1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,16 @@ import com.walletconnect.android.pairing.handler.PairingControllerInterface
import org.koin.dsl.module

fun corePairingModule(pairing: PairingInterface, pairingController: PairingControllerInterface) = module {
single { PairingEngine(get(), get(), get(), get(), get(), get()) }
single {
PairingEngine(
selfMetaData = get(),
crypto = get(),
metadataRepository = get(),
pairingRepository = get(),
jsonRpcInteractor = get(),
logger = get()
)
}
single { pairing }
single { pairingController }
}
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,23 @@ internal class JsonRpcInteractor(
return onFailure(e)
}

if (jsonRpcHistory.setRequest(payload.id, topic, payload.method, requestJson)) {
val encryptedRequest = chaChaPolyCodec.encrypt(topic, requestJson, envelopeType, participants)

relay.publish(topic.value, encryptedRequest, params.toRelay()) { result ->
result.fold(
onSuccess = { onSuccess() },
onFailure = { error -> onFailure(error) }
)
try {
if (jsonRpcHistory.setRequest(payload.id, topic, payload.method, requestJson)) {
val encryptedRequest = chaChaPolyCodec.encrypt(topic, requestJson, envelopeType, participants)

relay.publish(topic.value, encryptedRequest, params.toRelay()) { result ->
result.fold(
onSuccess = { onSuccess() },
onFailure = { error ->
logger.error("JsonRpcInteractor: Cannot send the request, error: $error")
onFailure(error)
}
)
}
}
} catch (e: Exception) {
logger.error("JsonRpcInteractor: Cannot send the request, exception: $e")
return onFailure(e)
}
}

Expand Down Expand Up @@ -131,10 +139,14 @@ internal class JsonRpcInteractor(
jsonRpcHistory.updateRequestWithResponse(response.id, responseJson)
onSuccess()
},
onFailure = { error -> onFailure(error) }
onFailure = { error ->
logger.error("JsonRpcInteractor: Cannot send the response, error: $error")
onFailure(error)
}
)
}
} catch (e: Exception) {
logger.error("JsonRpcInteractor: Cannot send the response, exception: $e")
return onFailure(e)
}
}
Expand All @@ -151,10 +163,7 @@ internal class JsonRpcInteractor(
val result = JsonRpcResponse.JsonRpcResult(id = request.id, result = clientParams)

publishJsonRpcResponse(request.topic, irnParams, result, envelopeType = envelopeType, participants = participants,
onFailure = { error ->
logger.error("Cannot send the response, error: $error")
onFailure(error)
},
onFailure = { error -> onFailure(error) },
onSuccess = { onSuccess() }
)
}
Expand All @@ -172,10 +181,7 @@ internal class JsonRpcInteractor(
val result = JsonRpcResponse.JsonRpcResult(id = requestId, result = clientParams)

publishJsonRpcResponse(topic, irnParams, result, envelopeType = envelopeType, participants = participants,
onFailure = { error ->
logger.error("Cannot send the response, error: $error")
onFailure(error)
},
onFailure = { error -> onFailure(error) },
onSuccess = { onSuccess() }
)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.walletconnect.android.internal.common.storage.pairing

import android.database.sqlite.SQLiteException
import app.cash.sqldelight.async.coroutines.awaitAsList
import com.walletconnect.android.internal.common.model.AppMetaData
import com.walletconnect.android.internal.common.model.Expiry
import com.walletconnect.android.internal.common.model.Pairing
Expand Down Expand Up @@ -35,7 +36,16 @@ class PairingStorageRepository(private val pairingQueries: PairingQueries) : Pai
override fun hasTopic(topic: Topic): Boolean = pairingQueries.hasTopic(topic = topic.value).executeAsOneOrNull() != null

@Throws(SQLiteException::class)
override fun getListOfPairings(): List<Pairing> = pairingQueries.getListOfPairing(mapper = this::toPairing).executeAsList()
override suspend fun getListOfPairings(): List<Pairing> = pairingQueries.getListOfPairing(mapper = this::toPairing).awaitAsList()

@Throws(SQLiteException::class)
override suspend fun getListOfInactivePairings(): List<Pairing> = pairingQueries.getListOfInactivePairings(mapper = this::toPairing).awaitAsList()

@Throws(SQLiteException::class)
override suspend fun getListOfActivePairings(): List<Pairing> = pairingQueries.getListOfActivePairings(mapper = this::toPairing).awaitAsList()

@Throws(SQLiteException::class)
override suspend fun getListOfInactivePairingsWithoutRequestReceived(): List<Pairing> = pairingQueries.getListOfInactivePairingsWithoutRequestReceived(mapper = this::toPairing).awaitAsList()

@Throws(SQLiteException::class)
override fun activatePairing(topic: Topic) = pairingQueries.activatePairing(expiry = activePairing, is_active = true, topic = topic.value)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@ interface PairingStorageRepositoryInterface {

fun hasTopic(topic: Topic): Boolean

fun getListOfPairings(): List<Pairing>
suspend fun getListOfPairings(): List<Pairing>

suspend fun getListOfInactivePairings(): List<Pairing>

suspend fun getListOfActivePairings(): List<Pairing>

suspend fun getListOfInactivePairingsWithoutRequestReceived(): List<Pairing>

fun activatePairing(topic: Topic)

Expand Down
Loading

0 comments on commit a70894c

Please sign in to comment.