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

Fix wallet configuration in wallet modal #28

Merged
merged 1 commit into from
Dec 23, 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
39 changes: 7 additions & 32 deletions cartera/src/main/java/exchange/dydx/cartera/CarteraConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import android.content.Context
import android.content.Intent
import android.net.Uri
import androidx.activity.result.ActivityResultLauncher
import androidx.navigation.NavHostController
import com.google.gson.Gson
import com.google.gson.reflect.TypeToken
import exchange.dydx.cartera.entities.Wallet
Expand Down Expand Up @@ -74,13 +73,6 @@ class CarteraConfig(
application = application,
),
)

registration[WalletConnectionType.WalletConnectModal] = RegistrationConfig(
provider = WalletConnectModalProvider(
application = application,
config = walletProvidersConfig.walletConnectModal,
),
)
}
if (walletProvidersConfig.walletSegue != null) {
registration[WalletConnectionType.WalletSegue] = RegistrationConfig(
Expand All @@ -96,30 +88,13 @@ class CarteraConfig(
)
}

fun updateConfig(walletProvidersConfig: WalletProvidersConfig, nav: NavHostController) {
if (walletProvidersConfig.walletConnectV2 != null) {
registration[WalletConnectionType.WalletConnectV2] = RegistrationConfig(
provider = WalletConnectV2Provider(
walletConnectV2Config = walletProvidersConfig.walletConnectV2,
application = application,
),
)
registration[WalletConnectionType.WalletConnectModal] = RegistrationConfig(
provider = WalletConnectModalProvider(
application = application,
config = walletProvidersConfig.walletConnectModal,
),
)
}
if (walletProvidersConfig.walletSegue != null) {
registration[WalletConnectionType.WalletSegue] = RegistrationConfig(
provider = WalletSegueProvider(
walletSegueConfig = walletProvidersConfig.walletSegue,
application = application,
launcher = launcher,
),
)
}
fun updateModalConfig(walletConnectModal: WalletConnectModalConfig) {
registration[WalletConnectionType.WalletConnectModal] = RegistrationConfig(
provider = WalletConnectModalProvider(
application = application,
config = walletConnectModal,
),
)
}

fun registerProvider(
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.18
LIBRARY_VERSION_NAME=0.1.19

android.enableR8.fullMode = false