Skip to content

Commit

Permalink
Merge pull request #1496 from WalletConnect/develop
Browse files Browse the repository at this point in the history
BOM_1.35.2
  • Loading branch information
jakubuid authored Sep 23, 2024
2 parents 87179ce + 9f4a963 commit d0485ef
Show file tree
Hide file tree
Showing 55 changed files with 415 additions and 67 deletions.
10 changes: 6 additions & 4 deletions ReadMe.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
![WalletConnect V2](/docs/walletconnect-banner.svg)

# **WalletConnect - Kotlin**

The communications protocol for web3, WalletConnect brings the ecosystem together by enabling hundreds of wallets and apps to securely connect and interact. This repository contains Kotlin implementation of
WalletConnect v2 protocols for Android applications.
# **Deprecated - WalletConnect - Kotlin**
WalletConnect Inc is now Reown. As part of this transition, we are deprecating a number of repositories/packages across our supported platforms, and transitioning to their equivalents published under the Reown organization.

This repository is now considered deprecated and will reach End-of-Life on February 17th 2025. For more details, including migration guides please see: https://docs.reown.com/advanced/walletconnect-deprecations

---
####

## BOM Instructions:
Expand All @@ -23,6 +24,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.2 | 1.35.2 | 2.35.2 | 1.28.10 | 1.0.0.beta37 | 1.3.11 | 1.35.2 | 1.6.6 | 1.5.11 |
| 1.35.1 | 1.35.1 | 2.35.1 | 1.28.9 | 1.0.0.beta36 | 1.3.10 | 1.35.1 | 1.6.5 | 1.5.10 |
| 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 |
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.35.1"
const val FOUNDATION_VERSION = "1.18.3"
const val CORE_VERSION = "1.35.1"
const val SIGN_VERSION = "2.35.1"
const val AUTH_VERSION = "1.28.9"
const val CHAT_VERSION = "1.0.0-beta36"
const val NOTIFY_VERSION = "1.3.10"
const val WEB_3_WALLET_VERSION = "1.35.1"
const val WEB_3_MODAL_VERSION = "1.6.5"
const val WC_MODAL_VERSION = "1.5.10"
const val MODAL_CORE_VERSION = "1.6.5"
const val BOM_VERSION = "1.35.2"
const val FOUNDATION_VERSION = "1.18.4"
const val CORE_VERSION = "1.35.2"
const val SIGN_VERSION = "2.35.2"
const val AUTH_VERSION = "1.28.10"
const val CHAT_VERSION = "1.0.0-beta37"
const val NOTIFY_VERSION = "1.3.11"
const val WEB_3_WALLET_VERSION = "1.35.2"
const val WEB_3_MODAL_VERSION = "1.6.6"
const val WC_MODAL_VERSION = "1.5.11"
const val MODAL_CORE_VERSION = "1.6.6"

//Artifact ids
const val ANDROID_BOM = "android-bom"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package com.walletconnect.android

@Deprecated("com.walletconnect.android.CoreClient has been deprecated. Please use com.reown.android.CoreClient instead from - https://github.com/reown-com/reown-kotlin")
object CoreClient : CoreInterface by CoreProtocol.instance {

@Deprecated("com.walletconnect.android.CoreDelegate has been deprecated. Please use com.reown.android.CoreDelegate instead from - https://github.com/reown-com/reown-kotlin")
interface CoreDelegate : CoreInterface.Delegate

}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import com.walletconnect.android.relay.NetworkClientTimeout
import com.walletconnect.android.relay.RelayConnectionInterface
import com.walletconnect.android.verify.client.VerifyInterface

@Deprecated("com.walletconnect.android.CoreInterface has been deprecated. Please use com.reown.android.CoreInterface instead from - https://github.com/reown-com/reown-kotlin")
interface CoreInterface {
val Pairing: PairingInterface
val PairingController: PairingControllerInterface
Expand All @@ -20,10 +21,13 @@ interface CoreInterface {
val Verify: VerifyInterface
val Explorer: ExplorerInterface

@Deprecated("com.walletconnect.android.CoreInterface has been deprecated. Please use com.reown.android.CoreInterface instead from - https://github.com/reown-com/reown-kotlin")
interface Delegate : PairingInterface.Delegate

@Deprecated("com.walletconnect.android.CoreInterface has been deprecated. Please use com.reown.android.CoreInterface instead from - https://github.com/reown-com/reown-kotlin")
fun setDelegate(delegate: Delegate)

@Deprecated("com.walletconnect.android.CoreClient has been deprecated. Please use com.reown.android.CoreClient instead from - https://github.com/reown-com/reown-kotlin")
fun initialize(
metaData: Core.Model.AppMetaData,
relayServerUrl: String,
Expand All @@ -36,6 +40,7 @@ interface CoreInterface {
onError: (Core.Model.Error) -> Unit,
)

@Deprecated("com.walletconnect.android.CoreClient has been deprecated. Please use com.reown.android.CoreClient instead from - https://github.com/reown-com/reown-kotlin")
fun initialize(
application: Application,
projectId: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ class CoreProtocol(private val koinApp: KoinApplication = wcKoinApp) : CoreInter
plantTimber()
}

@Deprecated("com.walletconnect.android.CoreClient has been deprecated. Please use com.reown.android.CoreClient instead from - https://github.com/reown-com/reown-kotlin")
override fun setDelegate(delegate: CoreInterface.Delegate) {
Pairing.setDelegate(delegate)
}
Expand All @@ -65,6 +66,7 @@ class CoreProtocol(private val koinApp: KoinApplication = wcKoinApp) : CoreInter
val instance = CoreProtocol()
}

@Deprecated("com.walletconnect.android.CoreClient has been deprecated. Please use com.reown.android.CoreClient instead from - https://github.com/reown-com/reown-kotlin")
override fun initialize(
metaData: Core.Model.AppMetaData,
relayServerUrl: String,
Expand Down Expand Up @@ -96,6 +98,7 @@ class CoreProtocol(private val koinApp: KoinApplication = wcKoinApp) : CoreInter
}
}

@Deprecated("com.walletconnect.android.CoreClient has been deprecated. Please use com.reown.android.CoreClient instead from - https://github.com/reown-com/reown-kotlin")
override fun initialize(
application: Application,
projectId: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import kotlinx.coroutines.supervisorScope
import org.koin.core.KoinApplication
import org.koin.core.qualifier.named

@Deprecated("com.walletconnect.android.relay.RelayClient has been deprecated. Please use com.reown.android.relay.RelayClient instead from - https://github.com/reown-com/reown-kotlin")
class RelayClient(private val koinApp: KoinApplication = wcKoinApp) : BaseRelayClient(), RelayConnectionInterface {
private val manualConnection: ManualConnectionLifecycle by lazy { koinApp.koin.get(named(AndroidCommonDITags.MANUAL_CONNECTION_LIFECYCLE)) }
private val networkState: ConnectivityState by lazy { koinApp.koin.get(named(AndroidCommonDITags.CONNECTIVITY_STATE)) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import com.walletconnect.android.Core
import com.walletconnect.foundation.network.RelayInterface
import kotlinx.coroutines.flow.StateFlow

@Deprecated("com.walletconnect.android.relay.RelayConnectionInterface has been deprecated. Please use com.reown.android.relay.RelayConnectionInterface instead from - https://github.com/reown-com/reown-kotlin")
interface RelayConnectionInterface : RelayInterface {
val wssConnectionState: StateFlow<WSSConnectionState>
val isNetworkAvailable: StateFlow<Boolean?>
Expand Down
6 changes: 0 additions & 6 deletions product/walletconnectmodal/ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@

# Installation

:::caution
**The WalletConnectModal SDK is currently in Alpha and is not production-ready**.

It's public API and associated documentation may still see significant and breaking changes.
:::

Kotlin implementation of WalletConnectModal for Android applications.

Android Core ![Maven Central](https://img.shields.io/maven-central/v/com.walletconnect/android-core)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import com.walletconnect.android.CoreInterface
import com.walletconnect.android.cacao.SignatureInterface
import com.walletconnect.android.internal.common.signing.cacao.Issuer

@Deprecated("com.walletconnect.web3.modal.client.Wallet has been deprecated. Please use com.reown.appkit.client.Modal instead from - https://github.com/reown-com/reown-kotlin")
object Modal {

sealed interface Listeners {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import org.jetbrains.annotations.ApiStatus.Experimental
import org.koin.core.qualifier.named
import org.koin.dsl.module

@Deprecated("This package is now considered deprecated and will reach End-of-Life on February 17th 2025. For more details, including migration guides please see: docs.reown.com")
object Web3Modal {

internal var chains: List<Modal.Model.Chain> = listOf()
Expand All @@ -38,6 +39,7 @@ object Web3Modal {

private lateinit var web3ModalEngine: Web3ModalEngine

@Deprecated("Web3Modal has been deprecated. Please use AppKit instead from - https://github.com/reown-com/reown-kotlin", replaceWith = ReplaceWith("AppKit.ModalDelegate"))
interface ModalDelegate {
fun onSessionApproved(approvedSession: Modal.Model.ApprovedSession)
fun onSessionRejected(rejectedSession: Modal.Model.RejectedSession)
Expand All @@ -64,13 +66,15 @@ object Web3Modal {
fun onError(error: Modal.Model.Error)
}

@Deprecated("Web3Modal has been deprecated. Please use AppKit instead from - https://github.com/reown-com/reown-kotlin", replaceWith = ReplaceWith("AppKit.ComponentDelegate"))
interface ComponentDelegate {
fun onModalExpanded()

fun onModalHidden()

}

@Deprecated("Web3Modal has been deprecated. Please use AppKit instead from - https://github.com/reown-com/reown-kotlin", replaceWith = ReplaceWith("AppKit.initialize(init, onSuccess, onError)"))
fun initialize(
init: Modal.Params.Init,
onSuccess: () -> Unit = {},
Expand All @@ -91,12 +95,14 @@ object Web3Modal {
)
}

@Deprecated("Web3Modal has been deprecated. Please use AppKit instead from - https://github.com/reown-com/reown-kotlin", replaceWith = ReplaceWith("AppKit.register(activity)"))
@Experimental
fun register(activity: ComponentActivity) {
checkEngineInitialization()
web3ModalEngine.registerCoinbaseLauncher(activity)
}

@Deprecated("Web3Modal has been deprecated. Please use AppKit instead from - https://github.com/reown-com/reown-kotlin", replaceWith = ReplaceWith("AppKit.unregister()"))
@Experimental
fun unregister() {
checkEngineInitialization()
Expand Down Expand Up @@ -135,18 +141,22 @@ object Web3Modal {
}
}

@Deprecated("Web3Modal has been deprecated. Please use AppKit instead from - https://github.com/reown-com/reown-kotlin", replaceWith = ReplaceWith("AppKit.setChains(chains)"))
fun setChains(chains: List<Modal.Model.Chain>) {
this.chains = chains
}

@Deprecated("Web3Modal has been deprecated. Please use AppKit instead from - https://github.com/reown-com/reown-kotlin", replaceWith = ReplaceWith("AppKit.setAuthRequestParams(authParams)"))
fun setAuthRequestParams(authParams: Modal.Model.AuthPayloadParams) {
authPayloadParams = authParams
}

@Deprecated("Web3Modal has been deprecated. Please use AppKit instead from - https://github.com/reown-com/reown-kotlin", replaceWith = ReplaceWith("AppKit.setSessionProperties(properties)"))
fun setSessionProperties(properties: Map<String, String>) {
sessionProperties = properties
}

@Deprecated("Web3Modal has been deprecated. Please use AppKit instead from - https://github.com/reown-com/reown-kotlin", replaceWith = ReplaceWith("AppKit.setDelegate(delegate)"))
@Throws(IllegalStateException::class)
fun setDelegate(delegate: ModalDelegate) {
Web3ModalDelegate.connectionState.onEach { connectionState ->
Expand Down Expand Up @@ -189,6 +199,7 @@ object Web3Modal {
) { onError(it.toModal()) }
}

@Deprecated("Web3Modal has been deprecated. Please use AppKit instead from - https://github.com/reown-com/reown-kotlin", replaceWith = ReplaceWith("AppKit.connect(connect, onSuccess, onError)"))
fun connect(
connect: Modal.Params.Connect,
onSuccess: (String) -> Unit,
Expand All @@ -201,6 +212,10 @@ object Web3Modal {
)
}

@Deprecated(
"Web3Modal has been deprecated. Please use AppKit instead from - https://github.com/reown-com/reown-kotlin",
replaceWith = ReplaceWith("AppKit.authenticate(authenticate, walletAppLink, onSuccess, onError)")
)
fun authenticate(
authenticate: Modal.Params.Authenticate,
walletAppLink: String? = null,
Expand All @@ -213,15 +228,19 @@ object Web3Modal {
onError = { onError(it.toModal()) })
}

@Deprecated(
"Web3Modal has been deprecated. Please use AppKit instead from - https://github.com/reown-com/reown-kotlin",
replaceWith = ReplaceWith("AppKit.handleDeepLink(url, onError)")
)
fun handleDeepLink(url: String, onError: (Modal.Model.Error) -> Unit) {
SignClient.dispatchEnvelope(url) {
onError(it.toModal())
}
}

@Deprecated(
message = "Modal.Params.Request is deprecated",
replaceWith = ReplaceWith("com.walletconnect.web3.modal.client.models.Request")
"Web3Modal has been deprecated. Please use AppKit instead from - https://github.com/reown-com/reown-kotlin",
replaceWith = ReplaceWith("AppKit.request(request, onSuccess, onError)")
)
fun request(
request: Modal.Params.Request,
Expand All @@ -236,6 +255,10 @@ object Web3Modal {
)
}

@Deprecated(
"Web3Modal has been deprecated. Please use AppKit instead from - https://github.com/reown-com/reown-kotlin",
replaceWith = ReplaceWith("AppKit.request(request, onSuccess, onError)")
)
fun request(
request: Request,
onSuccess: (SentRequestResult) -> Unit = {},
Expand All @@ -250,6 +273,10 @@ object Web3Modal {
is SentRequestResult.WalletConnect -> Modal.Model.SentRequest(requestId, sessionTopic, method, params, chainId)
}

@Deprecated(
"Web3Modal has been deprecated. Please use AppKit instead from - https://github.com/reown-com/reown-kotlin",
replaceWith = ReplaceWith("AppKit.request(request, onSuccess, onError)")
)
fun request(
request: Request,
onSuccess: () -> Unit,
Expand All @@ -259,11 +286,15 @@ object Web3Modal {
web3ModalEngine.request(request, { onSuccess() }, onError)
}

@Deprecated(
"Web3Modal has been deprecated. Please use AppKit instead from - https://github.com/reown-com/reown-kotlin",
replaceWith = ReplaceWith("AppKit.ping(sessionPing)")
)
fun ping(sessionPing: Modal.Listeners.SessionPing? = null) = web3ModalEngine.ping(sessionPing)

@Deprecated(
message = "This has become deprecate in favor of the parameterless disconnect function",
level = DeprecationLevel.WARNING
"Web3Modal has been deprecated. Please use AppKit instead from - https://github.com/reown-com/reown-kotlin",
replaceWith = ReplaceWith("AppKit.disconnect(onSuccess, onError)")
)
fun disconnect(
onSuccess: (Modal.Params.Disconnect) -> Unit = {},
Expand All @@ -281,6 +312,10 @@ object Web3Modal {
)
}

@Deprecated(
"Web3Modal has been deprecated. Please use AppKit instead from - https://github.com/reown-com/reown-kotlin",
replaceWith = ReplaceWith("AppKit.disconnect(onSuccess, onError)")
)
fun disconnect(
onSuccess: () -> Unit,
onError: (Throwable) -> Unit,
Expand All @@ -293,6 +328,10 @@ object Web3Modal {
* Caution: This function is blocking and runs on the current thread.
* It is advised that this function be called from background operation
*/
@Deprecated(
"Web3Modal has been deprecated. Please use AppKit instead from - https://github.com/reown-com/reown-kotlin",
replaceWith = ReplaceWith("AppKit.getSelectedChain()")
)
fun getSelectedChain() = selectedChain
// fun getSelectedChain() = getSelectedChainUseCase()?.toChain()

Expand All @@ -301,9 +340,8 @@ object Web3Modal {
* It is advised that this function be called from background operation
*/
@Deprecated(
message = "Getting active session is replaced with getAccount()",
replaceWith = ReplaceWith("com.walletconnect.web3.modal.client.Web3Modal.getAccount()"),
level = DeprecationLevel.WARNING
"Web3Modal has been deprecated. Please use AppKit instead from - https://github.com/reown-com/reown-kotlin",
replaceWith = ReplaceWith("AppKit.getAccount()")
)
internal fun getActiveSessionByTopic(topic: String) = SignClient.getActiveSessionByTopic(topic)?.toModal()

Expand All @@ -312,9 +350,8 @@ object Web3Modal {
* It is advised that this function be called from background operation
*/
@Deprecated(
message = "Getting active session is replaced with getAccount()",
replaceWith = ReplaceWith("com.walletconnect.web3.modal.client.Web3Modal.getAccount()"),
level = DeprecationLevel.WARNING
"Web3Modal has been deprecated. Please use AppKit instead from - https://github.com/reown-com/reown-kotlin",
replaceWith = ReplaceWith("AppKit.getAccount()")
)
fun getActiveSession(): Modal.Model.Session? {
checkEngineInitialization()
Expand All @@ -325,6 +362,10 @@ object Web3Modal {
* Caution: This function is blocking and runs on the current thread.
* It is advised that this function be called from background operation
*/
@Deprecated(
"Web3Modal has been deprecated. Please use AppKit instead from - https://github.com/reown-com/reown-kotlin",
replaceWith = ReplaceWith("AppKit.getAccount()")
)
fun getAccount(): Account? {
checkEngineInitialization()
return web3ModalEngine.getAccount()
Expand All @@ -334,6 +375,10 @@ object Web3Modal {
* Caution: This function is blocking and runs on the current thread.
* It is advised that this function be called from background operation
*/
@Deprecated(
"Web3Modal has been deprecated. Please use AppKit instead from - https://github.com/reown-com/reown-kotlin",
replaceWith = ReplaceWith("AppKit.getSession()")
)
fun getSession(): Session? {
checkEngineInitialization()
return web3ModalEngine.getSession()
Expand All @@ -343,6 +388,10 @@ object Web3Modal {
* Caution: This function is blocking and runs on the current thread.
* It is advised that this function be called from background operation
*/
@Deprecated(
"Web3Modal has been deprecated. Please use AppKit instead from - https://github.com/reown-com/reown-kotlin",
replaceWith = ReplaceWith("AppKit.getConnectorType()")
)
fun getConnectorType(): Modal.ConnectorType? {
checkEngineInitialization()
return web3ModalEngine.getConnectorType()
Expand Down
Loading

0 comments on commit d0485ef

Please sign in to comment.