Skip to content

Commit

Permalink
Fix wallet configuration in wallet modal
Browse files Browse the repository at this point in the history
  • Loading branch information
ruixhuang committed Dec 23, 2024
1 parent 41918bf commit 4d01e16
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 33 deletions.
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

0 comments on commit 4d01e16

Please sign in to comment.