Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update WalletConnect library to the latest #19

Merged
merged 3 commits into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ plugins {

android {
namespace 'exchange.dydx.carteraexample'
compileSdk 33
compileSdk 34

defaultConfig {
applicationId "exchange.dydx.carteraexample"
minSdk 24
targetSdk 33
targetSdk 34
versionCode 1
versionName "1.0"

Expand Down Expand Up @@ -38,15 +38,19 @@ android {
composeOptions {
kotlinCompilerExtensionVersion "1.4.7"
}

configurations{
all*.exclude module: 'bcprov-jdk15on'
}
}

dependencies {
implementation project(path: ':cartera')

implementation 'androidx.core:core-ktx:1.8.0'
implementation 'androidx.core:core-ktx:1.12.0'
implementation platform('org.jetbrains.kotlin:kotlin-bom:1.8.0')
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.3.1'
implementation 'androidx.activity:activity-compose:1.5.1'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.7.0'
implementation 'androidx.activity:activity-compose:1.8.2'
implementation platform('androidx.compose:compose-bom:2022.10.00')
implementation 'androidx.compose.ui:ui'
implementation 'androidx.compose.ui:ui-graphics'
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ buildscript {

// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id 'com.android.application' version '8.2.1' apply false
id 'com.android.library' version '8.2.1' apply false
id 'com.android.application' version '8.2.2' apply false
id 'com.android.library' version '8.2.2' apply false
id 'org.jetbrains.kotlin.android' version '1.8.21' apply false
id 'com.google.dagger.hilt.android' version '2.41' apply false
id "com.diffplug.spotless" version "6.22.0" // apply false
Expand Down
12 changes: 6 additions & 6 deletions cartera/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ plugins {

android {
namespace 'exchange.dydx.cartera'
compileSdk 33
compileSdk 34

defaultConfig {
minSdk 24
targetSdk 33
targetSdk 34

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
Expand Down Expand Up @@ -47,21 +47,21 @@ android {
}

dependencies {
implementation 'androidx.core:core-ktx:1.8.0'
implementation 'androidx.core:core-ktx:1.12.0'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.9.0'
implementation 'com.google.android.material:material:1.11.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
// implementation 'com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava'

implementation 'com.google.code.gson:gson:2.9.0'
implementation 'com.google.code.gson:gson:2.10.1'

//
// https://github.com/WalletConnect/WalletConnectKotlinV2
//

implementation platform('com.walletconnect:android-bom:1.18.0')
implementation platform('com.walletconnect:android-bom:1.23.0')
implementation('com.walletconnect:android-core')
implementation 'com.walletconnect:sign'
//implementation 'com.walletconnect:push'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,14 @@ class WalletConnectV2Provider(

Log.d(tag(this@WalletConnectV2Provider), "onError: $error")
}

override fun onProposalExpired(proposal: Sign.Model.ExpiredProposal) {
Log.d(tag(this@WalletConnectV2Provider), "onProposalExpired: $proposal")
}

override fun onRequestExpired(request: Sign.Model.ExpiredRequest) {
Log.d(tag(this@WalletConnectV2Provider), "onRequestExpired: $request")
}
}

init {
Expand Down Expand Up @@ -433,11 +441,11 @@ class WalletConnectV2Provider(

SignClient.connect(
connect = connectParams,
onSuccess = {
Log.d(tag(this@WalletConnectV2Provider), "Connected to wallet")
onSuccess = { value ->
Log.d(tag(this@WalletConnectV2Provider), "Connected to wallet: $value")
completion(pairing, null)
},
onError = { error ->
onError = { error: Sign.Model.Error ->
Log.e(tag(this@WalletConnectV2Provider), error.throwable.stackTraceToString())
completion(
null,
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ android.nonTransitiveRClass=true

LIBRARY_GROUP=dydxprotocol
LIBRARY_ARTIFACT_ID=cartera-android
LIBRARY_VERSION_NAME=0.1.12
LIBRARY_VERSION_NAME=0.1.13

android.enableR8.fullMode = false
Loading