From e800f351beb948b31c4754bbcca12b92940e73c0 Mon Sep 17 00:00:00 2001 From: Rui Date: Thu, 28 Mar 2024 17:43:40 -0700 Subject: [PATCH] Fix build --- app/build.gradle | 4 ++-- .../providers/WalletConnectV2Provider.kt | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index df9e783..d21f46d 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -51,7 +51,7 @@ dependencies { implementation platform('org.jetbrains.kotlin:kotlin-bom:1.8.0') implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.7.0' implementation 'androidx.activity:activity-compose:1.8.2' - implementation platform('androidx.compose:compose-bom:2024.03.00') + implementation platform('androidx.compose:compose-bom:2022.10.00') implementation 'androidx.compose.ui:ui' implementation 'androidx.compose.ui:ui-graphics' implementation 'androidx.compose.ui:ui-tooling-preview' @@ -60,7 +60,7 @@ dependencies { testImplementation 'junit:junit:4.13.2' androidTestImplementation 'androidx.test.ext:junit:1.1.5' androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' - androidTestImplementation platform('androidx.compose:compose-bom:2024.03.00') + androidTestImplementation platform('androidx.compose:compose-bom:2022.10.00') androidTestImplementation 'androidx.compose.ui:ui-test-junit4' debugImplementation 'androidx.compose.ui:ui-tooling' debugImplementation 'androidx.compose.ui:ui-test-manifest' diff --git a/cartera/src/main/java/exchange/dydx/cartera/walletprovider/providers/WalletConnectV2Provider.kt b/cartera/src/main/java/exchange/dydx/cartera/walletprovider/providers/WalletConnectV2Provider.kt index 4c328ce..4472928 100644 --- a/cartera/src/main/java/exchange/dydx/cartera/walletprovider/providers/WalletConnectV2Provider.kt +++ b/cartera/src/main/java/exchange/dydx/cartera/walletprovider/providers/WalletConnectV2Provider.kt @@ -477,9 +477,9 @@ class WalletConnectV2Provider( val params = requestParams() if (params != null) { - reallyMakeRequest(request, params) { result, error -> + reallyMakeRequest(request, params) { result, requestError -> CoroutineScope(Dispatchers.Main).launch { - completion(result, error) + completion(result, requestError) } } } else { @@ -502,9 +502,9 @@ class WalletConnectV2Provider( ) { SignClient.request( request = requestParams, - onSuccess = { request: Sign.Model.SentRequest -> + onSuccess = { sendRequest: Sign.Model.SentRequest -> Log.d(tag(this@WalletConnectV2Provider), "Wallet request made.") - operationCompletions[request.sessionTopic] = completion + operationCompletions[sendRequest.sessionTopic] = completion }, onError = { error -> Log.e(tag(this@WalletConnectV2Provider), error.throwable.stackTraceToString()) @@ -547,14 +547,14 @@ class WalletConnectV2Provider( Log.d(tag(this@WalletConnectV2Provider), "Wallet is null") return } - if (pairing?.uri == null) { + if (pairing == null) { Log.d(tag(this@WalletConnectV2Provider), "Pairing is null") return } // val deeplinkPairingUri = it.replace("wc:", "wc://") val url = WalletConnectUtils.createUrl( wallet = request.wallet, - deeplink = pairing?.uri, + deeplink = pairing.uri, type = WalletConnectionType.WalletConnectV2, context = request.context, ) @@ -616,7 +616,7 @@ private fun EthereumTransactionRequest.toJsonRequest(): String? { val filtered = request.filterValues { it != null } return try { - JSONObject(filtered as Map<*, *>?).toString() + JSONObject(filtered).toString() } catch (e: JSONException) { null }