Skip to content

Commit a95d00d

Browse files
authored
Merge pull request #17 from dydxprotocol/features/reown_android
Migrate WalletConnect to Reown on Android
2 parents f2467f1 + 9f0e4bd commit a95d00d

File tree

10 files changed

+204
-243
lines changed

10 files changed

+204
-243
lines changed

android/app/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -260,12 +260,12 @@ dependencies {
260260

261261

262262
//
263-
// https://github.com/WalletConnect/WalletConnectKotlinV2
263+
// https://github.com/reown-com/reown-kotlin
264264
//
265265

266-
implementation platform("com.walletconnect:android-bom:$walletConnectVersion")
267-
implementation('com.walletconnect:android-core')
268-
implementation("com.walletconnect:walletconnect-modal")
266+
implementation(platform("com.reown:android-bom:$walletConnectVersion"))
267+
implementation("com.reown:android-core")
268+
implementation("com.reown:appkit")
269269

270270
//
271271
// https://docs.cloud.coinbase.com/wallet-sdk/docs/android-install

android/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
22

33
buildscript {
44
ext.ktlintVersion = '0.48.0'
5-
ext.kotlinVersion = '2.0.21'
5+
ext.kotlinVersion = '2.2.0'
66
ext.androidApplicationVersion = '8.13.0'
77

8-
ext.navigationVersion = '2.9.1'
8+
ext.navigationVersion = '2.8.4'
99
ext.hiltVersion = '2.57.1'
1010
ext.googleServicesVersion = '4.3.12'
1111

@@ -17,7 +17,7 @@ buildscript {
1717
dependencies {
1818
classpath "com.android.tools.build:gradle:$androidApplicationVersion"
1919
classpath "com.squareup:javapoet:1.13.0"
20-
classpath 'com.google.gms:google-services:4.4.3'
20+
classpath 'com.google.gms:google-services:4.4.4'
2121

2222
classpath 'com.facebook.react:react-native-gradle-plugin'
2323

@@ -181,7 +181,7 @@ ext {
181181
flowExtVersion = '0.7.1'
182182
material3Version = '1.2.0-rc01'
183183
web3jVersion = '4.8.8-android'
184-
walletConnectVersion = '1.35.2'
184+
walletConnectVersion = '1.4.11'
185185
amplitudeVersion = '1.21.4'
186186
}
187187

android/v4/core/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,9 @@ dependencies {
139139

140140
implementation "androidx.biometric:biometric-ktx:$biometricVersion"
141141

142-
implementation platform("com.walletconnect:android-bom:$walletConnectVersion")
143-
implementation('com.walletconnect:android-core')
144-
implementation("com.walletconnect:walletconnect-modal")
142+
implementation(platform("com.reown:android-bom:$walletConnectVersion"))
143+
implementation("com.reown:android-core")
144+
implementation("com.reown:appkit")
145145
implementation 'com.google.accompanist:accompanist-navigation-material:0.36.0' // need for modal
146146

147147
implementation("tz.co.asoft:kollections-interoperable:$kollectionsVersion")

android/v4/core/src/main/java/exchange/dydx/trading/core/DydxNavGraph.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import androidx.navigation.compose.rememberNavController
1212
import com.google.accompanist.navigation.material.BottomSheetNavigator
1313
import com.google.accompanist.navigation.material.ExperimentalMaterialNavigationApi
1414
import com.google.accompanist.navigation.material.ModalBottomSheetLayout
15-
import com.walletconnect.wcmodal.ui.walletConnectModalGraph
15+
import com.reown.appkit.ui.appKitGraph
1616
import exchange.dydx.feature.onboarding.loginGraph
1717
import exchange.dydx.newsalerts.newsAlertsGraph
1818
import exchange.dydx.trading.common.navigation.DydxRouter
@@ -60,7 +60,9 @@ fun DydxNavGraph(
6060

6161
InitializeManagers()
6262

63-
ModalBottomSheetLayout(bottomSheetNavigator = bottomSheetNavigator) {
63+
ModalBottomSheetLayout(
64+
bottomSheetNavigator = bottomSheetNavigator,
65+
) {
6466
NavHost(
6567
navController = navController,
6668
startDestination = DEFAULT_START_DESTINATION,
@@ -106,7 +108,7 @@ fun DydxNavGraph(
106108
logger = logger,
107109
)
108110

109-
walletConnectModalGraph(navController)
111+
appKitGraph(navController)
110112
}
111113
}
112114
}

android/v4/feature/portfolio/src/main/java/exchange/dydx/trading/feature/portfolio/components/pendingpositions/DydxPortfolioPendingPositionItemView.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import androidx.compose.foundation.layout.fillMaxWidth
1111
import androidx.compose.foundation.layout.padding
1212
import androidx.compose.foundation.shape.RoundedCornerShape
1313
import androidx.compose.material.Text
14-
import androidx.compose.material.ripple.rememberRipple
14+
import androidx.compose.material.ripple
1515
import androidx.compose.runtime.Composable
1616
import androidx.compose.runtime.remember
1717
import androidx.compose.ui.Alignment
@@ -142,7 +142,7 @@ object DydxPortfolioPendingPositionItemView {
142142
vertical = 12.dp,
143143
)
144144
.clickable(
145-
indication = rememberRipple(color = ThemeColor.SemanticColor.layer_3.color),
145+
indication = ripple(color = ThemeColor.SemanticColor.layer_3.color),
146146
interactionSource = remember { MutableInteractionSource() },
147147
onClick = { state.viewOrderAction() },
148148
),
@@ -161,7 +161,7 @@ object DydxPortfolioPendingPositionItemView {
161161
vertical = 12.dp,
162162
)
163163
.clickable(
164-
indication = rememberRipple(color = ThemeColor.SemanticColor.layer_3.color),
164+
indication = ripple(color = ThemeColor.SemanticColor.layer_3.color),
165165
interactionSource = remember { MutableInteractionSource() },
166166
onClick = { state.cancelOrderAction() },
167167
),

android/v4/integration/dydxCartera/build.gradle

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,12 @@ dependencies {
5151
implementation 'com.solanamobile:rpc-core:0.2.8'
5252

5353
//
54-
// https://github.com/WalletConnect/WalletConnectKotlinV2
54+
// https://github.com/reown-com/reown-kotlin
5555
//
5656

57-
implementation platform('com.walletconnect:android-bom:1.35.2')
58-
implementation("com.walletconnect:android-core")
59-
implementation("com.walletconnect:walletconnect-modal")
60-
implementation 'com.walletconnect:sign'
61-
//implementation 'com.walletconnect:push'
57+
implementation(platform("com.reown:android-bom:$walletConnectVersion"))
58+
implementation("com.reown:android-core")
59+
implementation("com.reown:appkit")
6260

6361
//
6462
// https://docs.cloud.coinbase.com/wallet-sdk/docs/android-install

android/v4/integration/dydxCartera/src/main/java/exchange/dydx/cartera/CarteraConfig.kt

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,7 @@ class CarteraConfig(
7171
registration[WalletConnectionType.WalletConnect] = RegistrationConfig(
7272
provider = WalletConnectV1Provider(),
7373
)
74-
if (walletProvidersConfig.walletConnectV2 != null) {
75-
registration[WalletConnectionType.WalletConnectV2] = RegistrationConfig(
76-
provider = WalletConnectV2Provider(
77-
walletConnectV2Config = walletProvidersConfig.walletConnectV2,
78-
application = application,
79-
),
80-
)
81-
}
74+
8275
if (walletProvidersConfig.walletSegue != null) {
8376
registration[WalletConnectionType.WalletSegue] = RegistrationConfig(
8477
provider = WalletSegueProvider(
@@ -102,10 +95,18 @@ class CarteraConfig(
10295
}
10396

10497
fun updateModalConfig(walletConnectModal: WalletConnectModalConfig) {
98+
if (walletProvidersConfig.walletConnectV2 != null) {
99+
registration[WalletConnectionType.WalletConnectV2] = RegistrationConfig(
100+
provider = WalletConnectV2Provider(
101+
walletConnectV2Config = walletProvidersConfig.walletConnectV2,
102+
modalConfig = walletConnectModal,
103+
application = application,
104+
),
105+
)
106+
}
105107
registration[WalletConnectionType.WalletConnectModal] = RegistrationConfig(
106108
provider = WalletConnectModalProvider(
107109
application = application,
108-
config = walletConnectModal,
109110
),
110111
)
111112
}

android/v4/integration/dydxCartera/src/main/java/exchange/dydx/cartera/entities/ModelExtensions.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import exchange.dydx.dydxCartera.Utils
99
import exchange.dydx.dydxCartera.WalletConnectionType
1010
import exchange.dydx.dydxCartera.toHexString
1111
import exchange.dydx.dydxCartera.walletprovider.EthereumTransactionRequest
12-
import okhttp3.internal.toHexString
1312
import org.json.JSONException
1413
import org.json.JSONObject
1514

0 commit comments

Comments
 (0)