Skip to content

Commit f9a7369

Browse files
authored
Merge pull request #1485 from WalletConnect/develop
BOM_1.35.0
2 parents 719c032 + c8d5a44 commit f9a7369

File tree

120 files changed

+2203
-958
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+2203
-958
lines changed

.github/workflows/ci_github_release.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
name: Create GitHub Release
22

33
on:
4-
push:
5-
tags:
6-
- 'BOM_*.*.*'
4+
workflow_dispatch:
75

86
jobs:
97
create_release:

.github/workflows/ci_release_articacts.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,4 @@ jobs:
8383
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
8484
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
8585
run: |
86-
./gradlew closeAndReleaseMultipleRepositories
87-
- name: Push Tag
88-
env:
89-
GITHUB_TOKEN: ${{ secrets.PUSH_GITHUB_TOKEN }}
90-
run: |
91-
./gradlew pushTagToMain
86+
./gradlew closeAndReleaseMultipleRepositories

ReadMe.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ dependencies {
2323

2424
| 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) |
2525
|-----------------------------------------------------------------------------------------|--------------------------|---------------------------|---------------------------|---------------------------|:------------------------------|----------------------------------|--------------------------------|--------------------------------------------------|
26+
| 1.35.0 | 1.35.0 | 2.35.0 | 1.28.8 | 1.0.0.beta35 | 1.3.9 | 1.35.0 | 1.6.4 | 1.5.9 |
2627
| 1.34.1 | 1.34.1 | 2.34.1 | 1.28.7 | 1.0.0.beta34 | 1.3.8 | 1.34.1 | 1.6.3 | 1.5.8 |
2728
| 1.34.0 | 1.34.0 | 2.34.0 | 1.28.6 | 1.0.0.beta33 | 1.3.7 | 1.34.0 | 1.6.2 | 1.5.7 |
2829
| 1.33.1 | 1.33.1 | 2.33.1 | 1.28.5 | 1.0.0.beta32 | 1.3.6 | 1.33.1 | 1.6.1 | 1.5.6 |

build.gradle.kts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -327,20 +327,6 @@ fun parseRepositoryState(xmlResponse: String, repositoryId: String): String? {
327327
return null
328328
}
329329

330-
tasks.register<Exec>("createTag") {
331-
val tagName = "BOM_$BOM_VERSION"
332-
commandLine("git", "tag", tagName)
333-
}
334-
335-
tasks.register<Exec>("pushTagToMain") {
336-
val tagName = "BOM_$BOM_VERSION"
337-
val repoUrl = "https://github.com/WalletConnect/WalletConnectKotlinV2.git"
338-
val token = System.getenv("PUSH_GITHUB_TOKEN") ?: throw GradleException("PUSH_GITHUB_TOKEN environment variable is not set")
339-
dependsOn("createTag")
340-
val authenticatedRepoUrl = repoUrl.replace("https://", "https://$token:@")
341-
commandLine("git", "push", authenticatedRepoUrl, tagName, "refs/heads/main")
342-
}
343-
344330
private val repoIdWithVersion = listOf(
345331
Pair(ANDROID_BOM, BOM_VERSION),
346332
Pair(FOUNDATION, FOUNDATION_VERSION),

buildSrc/src/main/kotlin/Versions.kt

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@ const val KEY_PUBLISH_ARTIFACT_ID = "PUBLISH_ARTIFACT_ID"
55
const val KEY_SDK_NAME = "SDK_NAME"
66

77
//Latest versions
8-
const val BOM_VERSION = "1.34.1"
9-
const val FOUNDATION_VERSION = "1.18.1"
10-
const val CORE_VERSION = "1.34.1"
11-
const val SIGN_VERSION = "2.34.1"
12-
const val AUTH_VERSION = "1.28.7"
13-
const val CHAT_VERSION = "1.0.0-beta34"
14-
const val NOTIFY_VERSION = "1.3.8"
15-
const val WEB_3_WALLET_VERSION = "1.34.1"
16-
const val WEB_3_MODAL_VERSION = "1.6.3"
17-
const val WC_MODAL_VERSION = "1.5.8"
18-
const val MODAL_CORE_VERSION = "1.6.3"
8+
const val BOM_VERSION = "1.35.0"
9+
const val FOUNDATION_VERSION = "1.18.2"
10+
const val CORE_VERSION = "1.35.0"
11+
const val SIGN_VERSION = "2.35.0"
12+
const val AUTH_VERSION = "1.28.8"
13+
const val CHAT_VERSION = "1.0.0-beta35"
14+
const val NOTIFY_VERSION = "1.3.9"
15+
const val WEB_3_WALLET_VERSION = "1.35.0"
16+
const val WEB_3_MODAL_VERSION = "1.6.4"
17+
const val WC_MODAL_VERSION = "1.5.9"
18+
const val MODAL_CORE_VERSION = "1.6.4"
1919

2020
//Artifact ids
2121
const val ANDROID_BOM = "android-bom"

core/android/src/main/kotlin/com/walletconnect/android/Core.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ object Core {
3030
val verifyUrl: String? = null
3131
) : Model()
3232

33+
@Deprecated(message = "DeletedPairing has been deprecated. It will be removed soon.")
3334
data class DeletedPairing(val topic: String, val reason: String) : Model()
35+
@Deprecated(message = "ExpiredPairing has been deprecated. It will be removed soon.")
3436
data class ExpiredPairing(val pairing: Pairing) : Model()
3537

3638
data class PairingState(val isPairingState: Boolean) : Model()
@@ -42,6 +44,7 @@ object Core {
4244
val relayProtocol: String,
4345
val relayData: String?,
4446
val uri: String,
47+
@Deprecated("isActive has been deprecated. It will be removed soon.")
4548
val isActive: Boolean,
4649
val registeredMethods: String
4750
) : Model()
@@ -163,12 +166,10 @@ object Core {
163166

164167
data class Disconnect(val topic: String) : Params()
165168

166-
data class Activate(val topic: String) : Params()
169+
data class Delete(val topic: String) : Params()
167170

168171
data class RequestReceived(val topic: String) : Params()
169172

170-
data class UpdateExpiry(val topic: String, val expiry: Expiry) : Params()
171-
172173
data class UpdateMetadata(val topic: String, val metadata: Model.AppMetaData, val metaDataType: AppMetaDataType) : Params()
173174
}
174175
}

core/android/src/main/kotlin/com/walletconnect/android/CoreProtocol.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
package com.walletconnect.android
22

33
import android.app.Application
4+
import android.content.SharedPreferences
45
import com.walletconnect.android.di.coreStorageModule
56
import com.walletconnect.android.internal.common.di.AndroidCommonDITags
7+
import com.walletconnect.android.internal.common.di.KEY_CLIENT_ID
68
import com.walletconnect.android.internal.common.di.coreAndroidNetworkModule
79
import com.walletconnect.android.internal.common.di.coreCommonModule
810
import com.walletconnect.android.internal.common.di.coreCryptoModule
@@ -155,6 +157,7 @@ class CoreProtocol(private val koinApp: KoinApplication = wcKoinApp) : CoreInter
155157

156158
modules(
157159
coreStorageModule(bundleId = bundleId),
160+
module { single(named(AndroidCommonDITags.CLIENT_ID)) { requireNotNull(get<SharedPreferences>().getString(KEY_CLIENT_ID, null)) } },
158161
pushModule(),
159162
module { single { relay ?: Relay } },
160163
module {

core/android/src/main/kotlin/com/walletconnect/android/internal/common/di/CoreNetworkModule.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import java.util.concurrent.TimeUnit
3030

3131
private const val INIT_BACKOFF_MILLIS = 1L
3232
private const val MAX_BACKOFF_SEC = 20L
33+
internal const val KEY_CLIENT_ID = "clientId"
3334

3435
@Suppress("LocalVariableName")
3536
@JvmSynthetic

core/android/src/main/kotlin/com/walletconnect/android/internal/common/di/PulseModule.kt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import com.squareup.moshi.Moshi
44
import com.walletconnect.android.internal.common.model.TelemetryEnabled
55
import com.walletconnect.android.pulse.data.PulseService
66
import com.walletconnect.android.pulse.domain.InsertEventUseCase
7+
import com.walletconnect.android.pulse.domain.InsertTelemetryEventUseCase
78
import com.walletconnect.android.pulse.domain.SendBatchEventUseCase
89
import com.walletconnect.android.pulse.domain.SendEventInterface
910
import com.walletconnect.android.pulse.domain.SendEventUseCase
@@ -45,6 +46,13 @@ fun pulseModule(bundleId: String) = module {
4546
)
4647
}
4748

49+
single {
50+
InsertTelemetryEventUseCase(
51+
logger = get(named(AndroidCommonDITags.LOGGER)),
52+
eventsRepository = get(),
53+
)
54+
}
55+
4856
single {
4957
InsertEventUseCase(
5058
logger = get(named(AndroidCommonDITags.LOGGER)),

core/android/src/main/kotlin/com/walletconnect/android/internal/common/di/PushModule.kt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package com.walletconnect.android.internal.common.di
22

3-
import android.content.SharedPreferences
4-
import com.walletconnect.android.push.PushInterface
53
import com.walletconnect.android.push.network.PushService
64
import com.walletconnect.android.push.notifications.DecryptMessageUseCaseInterface
75
import org.koin.core.qualifier.named
@@ -26,9 +24,5 @@ internal fun pushModule() = module {
2624
get<Retrofit>(named(AndroidCommonDITags.PUSH_RETROFIT)).create(PushService::class.java)
2725
}
2826

29-
single(named(AndroidCommonDITags.CLIENT_ID)) {
30-
requireNotNull(get<SharedPreferences>().getString(PushInterface.KEY_CLIENT_ID, null))
31-
}
32-
3327
single<MutableMap<String, DecryptMessageUseCaseInterface>>(named(AndroidCommonDITags.DECRYPT_USE_CASES)) { mutableMapOf() }
3428
}

core/android/src/main/kotlin/com/walletconnect/android/internal/common/exception/CommonWalletConnectExceptions.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ class GenericException(override val message: String?) : WalletConnectException(m
55
class MalformedWalletConnectUri(override val message: String?) : WalletConnectException(message)
66
class PairWithExistingPairingIsNotAllowed(override val message: String?) : WalletConnectException(message)
77
class ExpiredPairingException(override val message: String?) : WalletConnectException(message)
8+
class ExpiredPairingURIException(override val message: String?) : WalletConnectException(message)
89
class CannotFindSequenceForTopic(override val message: String?) : WalletConnectException(message)
910

1011
class InvalidProjectIdException(override val message: String?) : WalletConnectException(message)

core/android/src/main/kotlin/com/walletconnect/android/internal/common/jwt/clientid/GenerateJwtStoreClientIdUseCase.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ package com.walletconnect.android.internal.common.jwt.clientid
44

55
import android.content.SharedPreferences
66
import androidx.core.content.edit
7-
import com.walletconnect.android.push.PushInterface
7+
import com.walletconnect.android.internal.common.di.KEY_CLIENT_ID
88
import com.walletconnect.android.utils.strippedUrl
99
import com.walletconnect.foundation.crypto.data.repository.ClientIdJwtRepository
1010

@@ -13,7 +13,7 @@ internal class GenerateJwtStoreClientIdUseCase(private val clientIdJwtRepository
1313
operator fun invoke(relayUrl: String): String =
1414
clientIdJwtRepository.generateJWT(relayUrl.strippedUrl()) { clientId ->
1515
sharedPreferences.edit {
16-
putString(PushInterface.KEY_CLIENT_ID, clientId)
16+
putString(KEY_CLIENT_ID, clientId)
1717
}
1818
}
1919
}

core/android/src/main/kotlin/com/walletconnect/android/internal/common/modal/domain/usecase/GetSamplesWalletsUseCaseInterface.kt

Lines changed: 42 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,46 +12,70 @@ internal class GetSampleWalletsUseCase(
1212
private val context: Context
1313
) : GetSampleWalletsUseCaseInterface {
1414
override suspend fun invoke(): List<Wallet> {
15-
val samples = listOf(SampleWallet, RNSampleWallet)
16-
samples.forEach { wallet ->
15+
val samples = mapOf(
16+
"com.walletconnect.sample.wallet.debug" to SampleWalletDebug,
17+
"com.walletconnect.sample.wallet.internal" to SampleWalletInternal,
18+
"com.walletconnect.sample.wallet" to SampleWalletRelease,
19+
"com.walletconnect.web3wallet.rnsample.internal" to RNSampleWallet
20+
)
21+
samples.forEach { (walletPackage, wallet) ->
1722
wallet.apply {
18-
isWalletInstalled = androidSamplePackages.any { samplePackage -> context.packageManager.isWalletInstalled(samplePackage) }
23+
isWalletInstalled = context.packageManager.isWalletInstalled(walletPackage)
1924
}
2025
}
21-
return samples.filter { it.isWalletInstalled }
26+
return samples.map { it.value }.filter { it.isWalletInstalled }
2227
}
2328
}
2429

2530

26-
private val SampleWallet = Wallet(
27-
id = "AndroidSampleWallet",
28-
name = "Android Sample",
31+
private val SampleWalletDebug = Wallet(
32+
id = "SampleWalletDebug",
33+
name = "Android Sample Debug",
2934
homePage = "https://walletconnect.com",
3035
imageUrl = "https://raw.githubusercontent.com/WalletConnect/WalletConnectKotlinV2/develop/sample/wallet/src/main/res/drawable-xxxhdpi/wc_icon.png",
3136
order = "1",
3237
mobileLink = "kotlin-web3wallet://",
3338
playStore = null,
3439
webAppLink = null,
35-
linkMode = "https://web3modal-laboratory-git-chore-kotlin-assetlinks-walletconnect1.vercel.app/wallet",
40+
linkMode = "https://web3modal-laboratory-git-chore-kotlin-assetlinks-walletconnect1.vercel.app/wallet_debug",
3641
true
3742
)
3843

39-
private val RNSampleWallet = Wallet(
40-
id = "RNSampleWallet",
41-
name = "RN Sample",
44+
private val SampleWalletInternal = Wallet(
45+
id = "SampleWalletInternal",
46+
name = "Android Sample Internal",
4247
homePage = "https://walletconnect.com",
4348
imageUrl = "https://raw.githubusercontent.com/WalletConnect/WalletConnectKotlinV2/develop/sample/wallet/src/main/res/drawable-xxxhdpi/wc_icon.png",
4449
order = "2",
45-
mobileLink = "rn-web3wallet://",
50+
mobileLink = "kotlin-web3wallet://",
4651
playStore = null,
4752
webAppLink = null,
48-
linkMode = "https://lab.web3modal.com/walletkit_rn",
53+
linkMode = "https://web3modal-laboratory-git-chore-kotlin-assetlinks-walletconnect1.vercel.app/wallet_internal",
4954
true
5055
)
5156

52-
private val androidSamplePackages = listOf(
53-
"com.walletconnect.sample.wallet",
54-
"com.walletconnect.sample.wallet.debug",
55-
"com.walletconnect.sample.wallet.internal",
56-
"com.walletconnect.web3wallet.rnsample.internal"
57+
private val SampleWalletRelease = Wallet(
58+
id = "SampleWalletRelease",
59+
name = "Android Sample Release",
60+
homePage = "https://walletconnect.com",
61+
imageUrl = "https://raw.githubusercontent.com/WalletConnect/WalletConnectKotlinV2/develop/sample/wallet/src/main/res/drawable-xxxhdpi/wc_icon.png",
62+
order = "3",
63+
mobileLink = "kotlin-web3wallet://",
64+
playStore = null,
65+
webAppLink = null,
66+
linkMode = "https://web3modal-laboratory-git-chore-kotlin-assetlinks-walletconnect1.vercel.app/wallet_release",
67+
true
5768
)
69+
70+
private val RNSampleWallet = Wallet(
71+
id = "RNSampleWallet",
72+
name = "RN Sample",
73+
homePage = "https://walletconnect.com",
74+
imageUrl = "https://raw.githubusercontent.com/WalletConnect/WalletConnectKotlinV2/develop/sample/wallet/src/main/res/drawable-xxxhdpi/wc_icon.png",
75+
order = "4",
76+
mobileLink = "rn-web3wallet://",
77+
playStore = null,
78+
webAppLink = null,
79+
linkMode = "https://lab.web3modal.com/rn_walletkit",
80+
true
81+
)

core/android/src/main/kotlin/com/walletconnect/android/internal/common/model/Pairing.kt

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
package com.walletconnect.android.internal.common.model
22

33
import com.walletconnect.android.internal.common.model.type.Sequence
4-
import com.walletconnect.android.internal.utils.currentTimeInSeconds
5-
import com.walletconnect.android.internal.utils.fiveMinutesInSeconds
6-
import com.walletconnect.android.pairing.model.inactivePairing
4+
import com.walletconnect.android.pairing.model.pairingExpiry
75
import com.walletconnect.foundation.common.model.Topic
86

9-
data class
10-
Pairing(
7+
data class Pairing(
118
override val topic: Topic,
129
override val expiry: Expiry,
1310
val peerAppMetaData: AppMetaData? = null,
@@ -17,8 +14,6 @@ Pairing(
1714
val isProposalReceived: Boolean = false,
1815
val methods: String? = null,
1916
) : Sequence {
20-
val isActive: Boolean
21-
get() = (expiry.seconds - currentTimeInSeconds) > fiveMinutesInSeconds
2217

2318
constructor(topic: Topic, relay: RelayProtocolOptions, symmetricKey: SymmetricKey, expiry: Expiry, methods: String?) : this(
2419
topic = topic,
@@ -31,7 +26,7 @@ Pairing(
3126

3227
constructor(uri: WalletConnectUri) : this(
3328
topic = uri.topic,
34-
expiry = uri.expiry ?: Expiry(inactivePairing),
29+
expiry = uri.expiry ?: Expiry(pairingExpiry),
3530
relayProtocol = uri.relay.protocol,
3631
relayData = uri.relay.data,
3732
uri = uri.toAbsoluteString(),

core/android/src/main/kotlin/com/walletconnect/android/internal/common/model/Tags.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,13 @@ enum class Tags(val id: Int) {
4040
SESSION_AUTHENTICATE_RESPONSE_REJECT(1118),
4141
SESSION_AUTHENTICATE_RESPONSE_AUTO_REJECT(1119),
4242

43+
SESSION_AUTHENTICATE_LINK_MODE(1122),
44+
SESSION_AUTHENTICATE_LINK_MODE_RESPONSE_APPROVE(1123),
45+
SESSION_AUTHENTICATE_LINK_MODE_RESPONSE_REJECT(1124),
46+
47+
SESSION_REQUEST_LINK_MODE(1125),
48+
SESSION_REQUEST_LINK_MODE_RESPONSE(1126),
49+
4350
CHAT_INVITE(2000),
4451
CHAT_INVITE_RESPONSE(2001),
4552

0 commit comments

Comments
 (0)