Skip to content

Commit

Permalink
Merge pull request #23 from reown-com/develop
Browse files Browse the repository at this point in the history
BOM_1.0.1
  • Loading branch information
jakubuid authored Oct 30, 2024
2 parents 92aaf94 + 26d7d0c commit bd8fdf5
Show file tree
Hide file tree
Showing 13 changed files with 68 additions and 64 deletions.
16 changes: 8 additions & 8 deletions buildSrc/src/main/kotlin/Versions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ const val KEY_PUBLISH_ARTIFACT_ID = "PUBLISH_ARTIFACT_ID"
const val KEY_SDK_NAME = "SDK_NAME"

//Latest versions
const val BOM_VERSION = "1.0.0"
const val FOUNDATION_VERSION = "1.0.0"
const val CORE_VERSION = "1.0.0"
const val SIGN_VERSION = "1.0.0"
const val NOTIFY_VERSION = "1.0.0"
const val WALLETKIT_VERSION = "1.0.0"
const val APPKIT_VERSION = "1.0.0"
const val MODAL_CORE_VERSION = "1.0.0"
const val BOM_VERSION = "1.0.1"
const val FOUNDATION_VERSION = "1.0.1"
const val CORE_VERSION = "1.0.1"
const val SIGN_VERSION = "1.0.1"
const val NOTIFY_VERSION = "1.0.1"
const val WALLETKIT_VERSION = "1.0.1"
const val APPKIT_VERSION = "1.0.1"
const val MODAL_CORE_VERSION = "1.0.1"

//Artifact ids
const val ANDROID_BOM = "android-bom"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ internal class GetSampleWalletsUseCase(
"com.reown.sample.wallet.debug" to SampleWalletDebug,
"com.reown.sample.wallet.internal" to SampleWalletInternal,
"com.reown.sample.wallet" to SampleWalletRelease,
"com.walletconnect.web3wallet.rnsample.internal" to RNSampleWallet,
"com.walletconnect.web3wallet.rnsample.internal" to RNSampleWalletInternal,
"com.walletconnect.web3wallet.rnsample" to RNSampleWallet,
"com.walletconnect.flutterwallet" to FLSampleWallet,
"com.walletconnect.flutterwallet.internal" to FLSampleWalletInternal
)
Expand All @@ -39,7 +40,7 @@ private val SampleWalletDebug = Wallet(
mobileLink = "kotlin-web3wallet://",
playStore = null,
webAppLink = null,
linkMode = "https://dev.lab.web3modal.com/wallet_debug",
linkMode = "https://appkit-lab.reown.com/wallet_debug",
true
)

Expand All @@ -52,7 +53,7 @@ private val SampleWalletInternal = Wallet(
mobileLink = "kotlin-web3wallet://",
playStore = null,
webAppLink = null,
linkMode = "https://dev.lab.web3modal.com/wallet_internal",
linkMode = "https://appkit-lab.reown.com/wallet_internal",
true
)

Expand All @@ -65,11 +66,11 @@ private val SampleWalletRelease = Wallet(
mobileLink = "kotlin-web3wallet://",
playStore = null,
webAppLink = null,
linkMode = "https://dev.lab.web3modal.com/wallet_release",
linkMode = "https://appkit-lab.reown.com/wallet_release",
true
)

private val RNSampleWallet = Wallet(
private val RNSampleWalletInternal = Wallet(
id = "RNSampleWallet",
name = "RN Sample",
homePage = "https://walletconnect.com",
Expand All @@ -78,7 +79,20 @@ private val RNSampleWallet = Wallet(
mobileLink = "rn-web3wallet://",
playStore = null,
webAppLink = null,
linkMode = "https://lab.web3modal.com/rn_walletkit",
linkMode = "https://appkit-lab.reown.com/rn_walletkit_internal",
true
)

private val RNSampleWallet = Wallet(
id = "RNSampleWalletInternal",
name = "RN 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 = "5",
mobileLink = "rn-web3wallet://",
playStore = null,
webAppLink = null,
linkMode = "https://appkit-lab.reown.com/rn_walletkit",
true
)

Expand All @@ -87,11 +101,11 @@ private val FLSampleWallet = Wallet(
name = "FL Sample",
homePage = "https://walletconnect.com",
imageUrl = "https://raw.githubusercontent.com/WalletConnect/WalletConnectKotlinV2/develop/sample/wallet/src/main/res/drawable-xxxhdpi/wc_icon.png",
order = "5",
order = "6",
mobileLink = "wcflutterwallet://",
playStore = null,
webAppLink = null,
linkMode = "https://lab.web3modal.com/flutter_walletkit",
linkMode = "https://appkit-lab.reown.com/flutter_walletkit",
true
)

Expand All @@ -100,10 +114,10 @@ private val FLSampleWalletInternal = Wallet(
name = "FL 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 = "6",
order = "7",
mobileLink = "wcflutterwallet-internal://",
playStore = null,
webAppLink = null,
linkMode = "https://dev.lab.web3modal.com/flutter_walletkit_internal",
linkMode = "https://appkit-lab.reown.com/flutter_walletkit_internal",
true
)
Original file line number Diff line number Diff line change
Expand Up @@ -97,17 +97,13 @@ object WalletKit {
@Throws(IllegalStateException::class)
fun initialize(params: Wallet.Params.Init, onSuccess: () -> Unit = {}, onError: (Wallet.Model.Error) -> Unit) {
coreClient = params.core
var clientInitCounter = 0
val onSuccessfulInitialization: () -> Unit = { clientInitCounter++ }

SignClient.initialize(Sign.Params.Init(params.core), onSuccess = onSuccessfulInitialization) { error ->
SignClient.initialize(Sign.Params.Init(params.core), onSuccess = onSuccess) { error ->
if (error.throwable is SignClientAlreadyInitializedException) {
onSuccessfulInitialization()
onSuccess()
} else {
onError(Wallet.Model.Error(error.throwable))
}
}
validateInitializationCount(clientInitCounter, onSuccess, onError)
}

@Throws(IllegalStateException::class)
Expand Down Expand Up @@ -340,24 +336,4 @@ object WalletKit {
fun getListOfVerifyContexts(): List<Wallet.Model.VerifyContext> {
return SignClient.getListOfVerifyContexts().map { verifyContext -> verifyContext.toWallet() }
}

private fun validateInitializationCount(clientInitCounter: Int, onSuccess: () -> Unit, onError: (Wallet.Model.Error) -> Unit) {
scope.launch {
try {
withTimeout(TIMEOUT) {
while (true) {
if (clientInitCounter == 2) {
onSuccess()
return@withTimeout
}
delay(100)
}
}
} catch (e: Exception) {
onError(Wallet.Model.Error(e))
}
}
}

private const val TIMEOUT: Long = 10000
}
}
6 changes: 3 additions & 3 deletions sample/dapp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,18 @@ android {
buildTypes {
getByName("release") {
manifestPlaceholders["pathPrefix"] = "/dapp_release"
buildConfigField("String", "DAPP_APP_LINK", "\"https://dev.lab.web3modal.com/dapp_release\"")
buildConfigField("String", "DAPP_APP_LINK", "\"https://appkit-lab.reown.com/dapp_release\"")
}

getByName("internal") {
manifestPlaceholders["pathPrefix"] = "/dapp_internal"
buildConfigField("String", "DAPP_APP_LINK", "\"https://dev.lab.web3modal.com/dapp_internal\"")
buildConfigField("String", "DAPP_APP_LINK", "\"https://appkit-lab.reown.com/dapp_internal\"")

}

getByName("debug") {
manifestPlaceholders["pathPrefix"] = "/dapp_debug"
buildConfigField("String", "DAPP_APP_LINK", "\"https://dev.lab.web3modal.com/dapp_debug\"")
buildConfigField("String", "DAPP_APP_LINK", "\"https://appkit-lab.reown.com/dapp_debug\"")
}
}

Expand Down
2 changes: 1 addition & 1 deletion sample/dapp/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<category android:name="android.intent.category.BROWSABLE" />

<data
android:host="dev.lab.web3modal.com"
android:host="appkit-lab.reown.com"
android:scheme="https"
android:pathPrefix="${pathPrefix}"/>
</intent-filter>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class DappSampleApp : Application() {
val appMetaData = Core.Model.AppMetaData(
name = "Kotlin Dapp",
description = "Kotlin Dapp Implementation",
url = "https://dev.lab.web3modal.com",
url = "https://appkit-lab.reown.com",
icons = listOf("https://gblobscdn.gitbook.com/spaces%2F-LJJeCjcLrr53DcT1Ml7%2Favatar.png?alt=media"),
redirect = "kotlin-dapp-wc://request",
appLink = BuildConfig.DAPP_APP_LINK,
Expand All @@ -44,7 +44,7 @@ class DappSampleApp : Application() {
}

AppKit.setChains(AppKitChainsPresets.ethChains.values.toList())
//

// val authParams = Modal.Model.AuthPayloadParams(
// chains = AppKitChainsPresets.ethChains.values.toList().map { it.id },
// domain = "sample.kotlin.modal",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,9 @@ private fun ChainSelectionScreen(
text = "1-CA Link Mode (Kotlin Sample Wallet)",
onClick = {
val applink = when {
context.packageManager.isPackageInstalled(SAMPLE_WALLET_DEBUG_PACKAGE) -> "https://dev.lab.web3modal.com/wallet_debug"
context.packageManager.isPackageInstalled(SAMPLE_WALLET_INTERNAL_PACKAGE) -> "https://dev.lab.web3modal.com/wallet_internal"
context.packageManager.isPackageInstalled(SAMPLE_WALLET_RELEASE_PACKAGE) -> "https://dev.lab.web3modal.com/wallet_release"
context.packageManager.isPackageInstalled(SAMPLE_WALLET_DEBUG_PACKAGE) -> "https://appkit-lab.reown.com/wallet_debug"
context.packageManager.isPackageInstalled(SAMPLE_WALLET_INTERNAL_PACKAGE) -> "https://appkit-lab.reown.com/wallet_internal"
context.packageManager.isPackageInstalled(SAMPLE_WALLET_RELEASE_PACKAGE) -> "https://appkit-lab.reown.com/wallet_release"
else -> ""
}
onAuthenticateLinkMode(applink)
Expand Down
6 changes: 3 additions & 3 deletions sample/modal/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,18 @@ android {
buildTypes {
getByName("release") {
manifestPlaceholders["pathPrefix"] = "/lab_release"
buildConfigField("String", "LAB_APP_LINK", "\"https://dev.lab.web3modal.com/lab_release\"")
buildConfigField("String", "LAB_APP_LINK", "\"https://appkit-lab.reown.com/lab_release\"")
}

getByName("internal") {
manifestPlaceholders["pathPrefix"] = "/lab_internal"
buildConfigField("String", "LAB_APP_LINK", "\"https://dev.lab.web3modal.com/lab_internal\"")
buildConfigField("String", "LAB_APP_LINK", "\"https://appkit-lab.reown.com/lab_internal\"")

}

getByName("debug") {
manifestPlaceholders["pathPrefix"] = "/lab_debug"
buildConfigField("String", "LAB_APP_LINK", "\"https://dev.lab.web3modal.com/lab_debug\"")
buildConfigField("String", "LAB_APP_LINK", "\"https://appkit-lab.reown.com/lab_debug\"")
}
}

Expand Down
3 changes: 2 additions & 1 deletion sample/modal/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
<package android:name="com.reown.sample.wallet.debug"/>
<package android:name="com.reown.sample.wallet.internal"/>
<package android:name="com.walletconnect.web3wallet.rnsample.internal"/>
<package android:name="com.walletconnect.web3wallet.rnsample"/>
<package android:name="com.walletconnect.flutterwallet"/>
<package android:name="com.walletconnect.flutterwallet.internal"/>
</queries>
Expand Down Expand Up @@ -77,7 +78,7 @@
<category android:name="android.intent.category.BROWSABLE" />

<data
android:host="dev.lab.web3modal.com"
android:host="appkit-lab.reown.com"
android:scheme="https"
android:pathPrefix="${pathPrefix}"/>
</intent-filter>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class AppKitApp : Application() {
val appMetaData = Core.Model.AppMetaData(
name = "AppKit Lab Sample",
description = "Kotlin AppKit Lab Sample",
url = "https://dev.lab.web3modal.com",
url = "https://appkit-lab.reown.com",
icons = listOf("https://gblobscdn.gitbook.com/spaces%2F-LJJeCjcLrr53DcT1Ml7%2Favatar.png?alt=media"),
redirect = "kotlin-modal-wc://request",
linkMode = true,
Expand Down
6 changes: 3 additions & 3 deletions sample/wallet/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,18 @@ android {
buildTypes {
getByName("release") {
manifestPlaceholders["pathPrefix"] = "/wallet_release"
buildConfigField("String", "WALLET_APP_LINK", "\"https://dev.lab.web3modal.com/wallet_release\"")
buildConfigField("String", "WALLET_APP_LINK", "\"https://appkit-lab.reown.com/wallet_release\"")
}

getByName("internal") {
manifestPlaceholders["pathPrefix"] = "/wallet_internal"
buildConfigField("String", "WALLET_APP_LINK", "\"https://dev.lab.web3modal.com/wallet_internal\"")
buildConfigField("String", "WALLET_APP_LINK", "\"https://appkit-lab.reown.com/wallet_internal\"")

}

getByName("debug") {
manifestPlaceholders["pathPrefix"] = "/wallet_debug"
buildConfigField("String", "WALLET_APP_LINK", "\"https://dev.lab.web3modal.com/wallet_debug\"")
buildConfigField("String", "WALLET_APP_LINK", "\"https://appkit-lab.reown.com/wallet_debug\"")
}
}

Expand Down
2 changes: 1 addition & 1 deletion sample/wallet/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
<category android:name="android.intent.category.BROWSABLE" />

<data
android:host="dev.lab.web3modal.com"
android:host="appkit-lab.reown.com"
android:pathPrefix="${pathPrefix}"
android:scheme="https" />
</intent-filter>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package com.reown.sample.wallet

import android.app.Application
import com.google.firebase.FirebaseApp
import com.google.firebase.appdistribution.FirebaseAppDistribution
import com.google.firebase.crashlytics.ktx.crashlytics
import com.google.firebase.ktx.Firebase
import com.google.firebase.messaging.FirebaseMessaging
import com.mixpanel.android.mpmetrics.MixpanelAPI
import com.pandulapeter.beagle.Beagle
import com.pandulapeter.beagle.common.configuration.Behavior
Expand Down Expand Up @@ -47,7 +49,7 @@ class WalletKitApplication : Application() {
val appMetaData = Core.Model.AppMetaData(
name = "Kotlin Wallet",
description = "Kotlin Wallet Implementation",
url = "https://dev.lab.web3modal.com",
url = "https://appkit-lab.reown.com",
icons = listOf("https://raw.githubusercontent.com/WalletConnect/walletconnect-assets/master/Icon/Gradient/Icon.png"),
redirect = "kotlin-web3wallet://request",
appLink = BuildConfig.WALLET_APP_LINK,
Expand Down Expand Up @@ -92,6 +94,17 @@ class WalletKitApplication : Application() {

initializeBeagle()

FirebaseMessaging.getInstance().token.addOnSuccessListener { token ->
WalletKit.registerDeviceToken(firebaseAccessToken = token, enableEncrypted = true,
onSuccess = {
println("Successfully registered firebase token for Web3Wallet: $token")
},
onError = {
println("Error while registering firebase token for Web3Wallet: ${it.throwable}")
}
)
}

scope.launch {
supervisorScope {
wcKoinApp.koin.get<Timber.Forest>().plant(object : Timber.Tree() {
Expand Down

0 comments on commit bd8fdf5

Please sign in to comment.