Skip to content

Commit

Permalink
Merge pull request #1485 from WalletConnect/develop
Browse files Browse the repository at this point in the history
BOM_1.35.0
  • Loading branch information
jakubuid authored Aug 23, 2024
2 parents 719c032 + c8d5a44 commit f9a7369
Show file tree
Hide file tree
Showing 120 changed files with 2,203 additions and 958 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/ci_github_release.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
name: Create GitHub Release

on:
push:
tags:
- 'BOM_*.*.*'
workflow_dispatch:

jobs:
create_release:
Expand Down
7 changes: 1 addition & 6 deletions .github/workflows/ci_release_articacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,4 @@ jobs:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
run: |
./gradlew closeAndReleaseMultipleRepositories
- name: Push Tag
env:
GITHUB_TOKEN: ${{ secrets.PUSH_GITHUB_TOKEN }}
run: |
./gradlew pushTagToMain
./gradlew closeAndReleaseMultipleRepositories
1 change: 1 addition & 0 deletions ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ dependencies {

| 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.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 |
| 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 |
| 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 |
| 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 |
Expand Down
14 changes: 0 additions & 14 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -327,20 +327,6 @@ fun parseRepositoryState(xmlResponse: String, repositoryId: String): String? {
return null
}

tasks.register<Exec>("createTag") {
val tagName = "BOM_$BOM_VERSION"
commandLine("git", "tag", tagName)
}

tasks.register<Exec>("pushTagToMain") {
val tagName = "BOM_$BOM_VERSION"
val repoUrl = "https://github.com/WalletConnect/WalletConnectKotlinV2.git"
val token = System.getenv("PUSH_GITHUB_TOKEN") ?: throw GradleException("PUSH_GITHUB_TOKEN environment variable is not set")
dependsOn("createTag")
val authenticatedRepoUrl = repoUrl.replace("https://", "https://$token:@")
commandLine("git", "push", authenticatedRepoUrl, tagName, "refs/heads/main")
}

private val repoIdWithVersion = listOf(
Pair(ANDROID_BOM, BOM_VERSION),
Pair(FOUNDATION, FOUNDATION_VERSION),
Expand Down
22 changes: 11 additions & 11 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.34.1"
const val FOUNDATION_VERSION = "1.18.1"
const val CORE_VERSION = "1.34.1"
const val SIGN_VERSION = "2.34.1"
const val AUTH_VERSION = "1.28.7"
const val CHAT_VERSION = "1.0.0-beta34"
const val NOTIFY_VERSION = "1.3.8"
const val WEB_3_WALLET_VERSION = "1.34.1"
const val WEB_3_MODAL_VERSION = "1.6.3"
const val WC_MODAL_VERSION = "1.5.8"
const val MODAL_CORE_VERSION = "1.6.3"
const val BOM_VERSION = "1.35.0"
const val FOUNDATION_VERSION = "1.18.2"
const val CORE_VERSION = "1.35.0"
const val SIGN_VERSION = "2.35.0"
const val AUTH_VERSION = "1.28.8"
const val CHAT_VERSION = "1.0.0-beta35"
const val NOTIFY_VERSION = "1.3.9"
const val WEB_3_WALLET_VERSION = "1.35.0"
const val WEB_3_MODAL_VERSION = "1.6.4"
const val WC_MODAL_VERSION = "1.5.9"
const val MODAL_CORE_VERSION = "1.6.4"

//Artifact ids
const val ANDROID_BOM = "android-bom"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ object Core {
val verifyUrl: String? = null
) : Model()

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

data class PairingState(val isPairingState: Boolean) : Model()
Expand All @@ -42,6 +44,7 @@ object Core {
val relayProtocol: String,
val relayData: String?,
val uri: String,
@Deprecated("isActive has been deprecated. It will be removed soon.")
val isActive: Boolean,
val registeredMethods: String
) : Model()
Expand Down Expand Up @@ -163,12 +166,10 @@ object Core {

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

data class Activate(val topic: String) : Params()
data class Delete(val topic: String) : Params()

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

data class UpdateExpiry(val topic: String, val expiry: Expiry) : Params()

data class UpdateMetadata(val topic: String, val metadata: Model.AppMetaData, val metaDataType: AppMetaDataType) : Params()
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package com.walletconnect.android

import android.app.Application
import android.content.SharedPreferences
import com.walletconnect.android.di.coreStorageModule
import com.walletconnect.android.internal.common.di.AndroidCommonDITags
import com.walletconnect.android.internal.common.di.KEY_CLIENT_ID
import com.walletconnect.android.internal.common.di.coreAndroidNetworkModule
import com.walletconnect.android.internal.common.di.coreCommonModule
import com.walletconnect.android.internal.common.di.coreCryptoModule
Expand Down Expand Up @@ -155,6 +157,7 @@ class CoreProtocol(private val koinApp: KoinApplication = wcKoinApp) : CoreInter

modules(
coreStorageModule(bundleId = bundleId),
module { single(named(AndroidCommonDITags.CLIENT_ID)) { requireNotNull(get<SharedPreferences>().getString(KEY_CLIENT_ID, null)) } },
pushModule(),
module { single { relay ?: Relay } },
module {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import java.util.concurrent.TimeUnit

private const val INIT_BACKOFF_MILLIS = 1L
private const val MAX_BACKOFF_SEC = 20L
internal const val KEY_CLIENT_ID = "clientId"

@Suppress("LocalVariableName")
@JvmSynthetic
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import com.squareup.moshi.Moshi
import com.walletconnect.android.internal.common.model.TelemetryEnabled
import com.walletconnect.android.pulse.data.PulseService
import com.walletconnect.android.pulse.domain.InsertEventUseCase
import com.walletconnect.android.pulse.domain.InsertTelemetryEventUseCase
import com.walletconnect.android.pulse.domain.SendBatchEventUseCase
import com.walletconnect.android.pulse.domain.SendEventInterface
import com.walletconnect.android.pulse.domain.SendEventUseCase
Expand Down Expand Up @@ -45,6 +46,13 @@ fun pulseModule(bundleId: String) = module {
)
}

single {
InsertTelemetryEventUseCase(
logger = get(named(AndroidCommonDITags.LOGGER)),
eventsRepository = get(),
)
}

single {
InsertEventUseCase(
logger = get(named(AndroidCommonDITags.LOGGER)),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package com.walletconnect.android.internal.common.di

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

single(named(AndroidCommonDITags.CLIENT_ID)) {
requireNotNull(get<SharedPreferences>().getString(PushInterface.KEY_CLIENT_ID, null))
}

single<MutableMap<String, DecryptMessageUseCaseInterface>>(named(AndroidCommonDITags.DECRYPT_USE_CASES)) { mutableMapOf() }
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ class GenericException(override val message: String?) : WalletConnectException(m
class MalformedWalletConnectUri(override val message: String?) : WalletConnectException(message)
class PairWithExistingPairingIsNotAllowed(override val message: String?) : WalletConnectException(message)
class ExpiredPairingException(override val message: String?) : WalletConnectException(message)
class ExpiredPairingURIException(override val message: String?) : WalletConnectException(message)
class CannotFindSequenceForTopic(override val message: String?) : WalletConnectException(message)

class InvalidProjectIdException(override val message: String?) : WalletConnectException(message)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package com.walletconnect.android.internal.common.jwt.clientid

import android.content.SharedPreferences
import androidx.core.content.edit
import com.walletconnect.android.push.PushInterface
import com.walletconnect.android.internal.common.di.KEY_CLIENT_ID
import com.walletconnect.android.utils.strippedUrl
import com.walletconnect.foundation.crypto.data.repository.ClientIdJwtRepository

Expand All @@ -13,7 +13,7 @@ internal class GenerateJwtStoreClientIdUseCase(private val clientIdJwtRepository
operator fun invoke(relayUrl: String): String =
clientIdJwtRepository.generateJWT(relayUrl.strippedUrl()) { clientId ->
sharedPreferences.edit {
putString(PushInterface.KEY_CLIENT_ID, clientId)
putString(KEY_CLIENT_ID, clientId)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,46 +12,70 @@ internal class GetSampleWalletsUseCase(
private val context: Context
) : GetSampleWalletsUseCaseInterface {
override suspend fun invoke(): List<Wallet> {
val samples = listOf(SampleWallet, RNSampleWallet)
samples.forEach { wallet ->
val samples = mapOf(
"com.walletconnect.sample.wallet.debug" to SampleWalletDebug,
"com.walletconnect.sample.wallet.internal" to SampleWalletInternal,
"com.walletconnect.sample.wallet" to SampleWalletRelease,
"com.walletconnect.web3wallet.rnsample.internal" to RNSampleWallet
)
samples.forEach { (walletPackage, wallet) ->
wallet.apply {
isWalletInstalled = androidSamplePackages.any { samplePackage -> context.packageManager.isWalletInstalled(samplePackage) }
isWalletInstalled = context.packageManager.isWalletInstalled(walletPackage)
}
}
return samples.filter { it.isWalletInstalled }
return samples.map { it.value }.filter { it.isWalletInstalled }
}
}


private val SampleWallet = Wallet(
id = "AndroidSampleWallet",
name = "Android Sample",
private val SampleWalletDebug = Wallet(
id = "SampleWalletDebug",
name = "Android Sample Debug",
homePage = "https://walletconnect.com",
imageUrl = "https://raw.githubusercontent.com/WalletConnect/WalletConnectKotlinV2/develop/sample/wallet/src/main/res/drawable-xxxhdpi/wc_icon.png",
order = "1",
mobileLink = "kotlin-web3wallet://",
playStore = null,
webAppLink = null,
linkMode = "https://web3modal-laboratory-git-chore-kotlin-assetlinks-walletconnect1.vercel.app/wallet",
linkMode = "https://web3modal-laboratory-git-chore-kotlin-assetlinks-walletconnect1.vercel.app/wallet_debug",
true
)

private val RNSampleWallet = Wallet(
id = "RNSampleWallet",
name = "RN Sample",
private val SampleWalletInternal = Wallet(
id = "SampleWalletInternal",
name = "Android Sample Internal",
homePage = "https://walletconnect.com",
imageUrl = "https://raw.githubusercontent.com/WalletConnect/WalletConnectKotlinV2/develop/sample/wallet/src/main/res/drawable-xxxhdpi/wc_icon.png",
order = "2",
mobileLink = "rn-web3wallet://",
mobileLink = "kotlin-web3wallet://",
playStore = null,
webAppLink = null,
linkMode = "https://lab.web3modal.com/walletkit_rn",
linkMode = "https://web3modal-laboratory-git-chore-kotlin-assetlinks-walletconnect1.vercel.app/wallet_internal",
true
)

private val androidSamplePackages = listOf(
"com.walletconnect.sample.wallet",
"com.walletconnect.sample.wallet.debug",
"com.walletconnect.sample.wallet.internal",
"com.walletconnect.web3wallet.rnsample.internal"
private val SampleWalletRelease = Wallet(
id = "SampleWalletRelease",
name = "Android Sample Release",
homePage = "https://walletconnect.com",
imageUrl = "https://raw.githubusercontent.com/WalletConnect/WalletConnectKotlinV2/develop/sample/wallet/src/main/res/drawable-xxxhdpi/wc_icon.png",
order = "3",
mobileLink = "kotlin-web3wallet://",
playStore = null,
webAppLink = null,
linkMode = "https://web3modal-laboratory-git-chore-kotlin-assetlinks-walletconnect1.vercel.app/wallet_release",
true
)

private val RNSampleWallet = Wallet(
id = "RNSampleWallet",
name = "RN Sample",
homePage = "https://walletconnect.com",
imageUrl = "https://raw.githubusercontent.com/WalletConnect/WalletConnectKotlinV2/develop/sample/wallet/src/main/res/drawable-xxxhdpi/wc_icon.png",
order = "4",
mobileLink = "rn-web3wallet://",
playStore = null,
webAppLink = null,
linkMode = "https://lab.web3modal.com/rn_walletkit",
true
)
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
package com.walletconnect.android.internal.common.model

import com.walletconnect.android.internal.common.model.type.Sequence
import com.walletconnect.android.internal.utils.currentTimeInSeconds
import com.walletconnect.android.internal.utils.fiveMinutesInSeconds
import com.walletconnect.android.pairing.model.inactivePairing
import com.walletconnect.android.pairing.model.pairingExpiry
import com.walletconnect.foundation.common.model.Topic

data class
Pairing(
data class Pairing(
override val topic: Topic,
override val expiry: Expiry,
val peerAppMetaData: AppMetaData? = null,
Expand All @@ -17,8 +14,6 @@ Pairing(
val isProposalReceived: Boolean = false,
val methods: String? = null,
) : Sequence {
val isActive: Boolean
get() = (expiry.seconds - currentTimeInSeconds) > fiveMinutesInSeconds

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

constructor(uri: WalletConnectUri) : this(
topic = uri.topic,
expiry = uri.expiry ?: Expiry(inactivePairing),
expiry = uri.expiry ?: Expiry(pairingExpiry),
relayProtocol = uri.relay.protocol,
relayData = uri.relay.data,
uri = uri.toAbsoluteString(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ enum class Tags(val id: Int) {
SESSION_AUTHENTICATE_RESPONSE_REJECT(1118),
SESSION_AUTHENTICATE_RESPONSE_AUTO_REJECT(1119),

SESSION_AUTHENTICATE_LINK_MODE(1122),
SESSION_AUTHENTICATE_LINK_MODE_RESPONSE_APPROVE(1123),
SESSION_AUTHENTICATE_LINK_MODE_RESPONSE_REJECT(1124),

SESSION_REQUEST_LINK_MODE(1125),
SESSION_REQUEST_LINK_MODE_RESPONSE(1126),

CHAT_INVITE(2000),
CHAT_INVITE_RESPONSE(2001),

Expand Down
Loading

0 comments on commit f9a7369

Please sign in to comment.