Updated on 2026-08-14

This commit is contained in:
Tangem 2022-07-08 21:15:20 +03:00
parent 3715bd590f
commit bf31658f02

View file

@ -87,11 +87,16 @@ private fun handleAction(action: Action, appState: () -> AppState?, dispatch: Di
val config = appState()?.globalState?.configManager?.config
ifNotNull(
config?.mercuryoWidgetId,
config?.mercuryoSecret,
config?.moonPayApiKey,
config?.moonPayApiSecretKey,
) { mercuryoWidgetId, moonPayKey, moonPaySecretKey ->
) { mercuryoWidgetId, mercuryoSecret, moonPayKey, moonPaySecretKey ->
scope.launch {
val buyService = MercuryoService(MercuryoApi.API_VERSION, mercuryoWidgetId, "")
val buyService = MercuryoService(
apiVersion = MercuryoApi.API_VERSION,
mercuryoWidgetId = mercuryoWidgetId,
secret = mercuryoSecret,
)
val sellService = MoonPayService(moonPayKey, moonPaySecretKey)
val exchangeManager = CurrencyExchangeManager(buyService, sellService)
store.dispatchOnMain(GlobalAction.ExchangeManager.Init.Success(exchangeManager))