diff --git a/apps/flipcash/features/currency-creator/src/main/kotlin/com/flipcash/app/currencycreator/internal/CurrencyCreatorViewModel.kt b/apps/flipcash/features/currency-creator/src/main/kotlin/com/flipcash/app/currencycreator/internal/CurrencyCreatorViewModel.kt index 2bdb1a0ec..4ebbd93ae 100644 --- a/apps/flipcash/features/currency-creator/src/main/kotlin/com/flipcash/app/currencycreator/internal/CurrencyCreatorViewModel.kt +++ b/apps/flipcash/features/currency-creator/src/main/kotlin/com/flipcash/app/currencycreator/internal/CurrencyCreatorViewModel.kt @@ -421,6 +421,7 @@ internal class CurrencyCreatorViewModel @Inject constructor( purchaseAmount = stateFlow.value.totalCost, feeAmount = stateFlow.value.feeAmount, paymentAction = PaymentAction.Pay, + canUseOtherWallets = false, // can not use external deposit for this flow ) purchaseMethodController.present(metadata) } diff --git a/apps/flipcash/features/tokens/src/main/kotlin/com/flipcash/app/tokens/SwapEntryScreen.kt b/apps/flipcash/features/tokens/src/main/kotlin/com/flipcash/app/tokens/SwapEntryScreen.kt index 87265832f..79de8b9d7 100644 --- a/apps/flipcash/features/tokens/src/main/kotlin/com/flipcash/app/tokens/SwapEntryScreen.kt +++ b/apps/flipcash/features/tokens/src/main/kotlin/com/flipcash/app/tokens/SwapEntryScreen.kt @@ -21,10 +21,8 @@ import com.getcode.navigation.core.LocalCodeNavigator import com.getcode.navigation.flow.flowSharedViewModel import com.getcode.navigation.flow.rememberFlowNavigator import com.getcode.opencode.model.financial.Fiat +import com.getcode.solana.keys.Mint import com.getcode.ui.components.AppBarWithTitle -import com.getcode.ui.core.rememberAnimationScale -import com.getcode.ui.core.scaled -import kotlinx.coroutines.delay import kotlinx.coroutines.flow.filterIsInstance import kotlinx.coroutines.flow.launchIn import kotlinx.coroutines.flow.map @@ -112,16 +110,22 @@ internal fun SwapEntryScreen( }.launchIn(this) } - val animationScale by rememberAnimationScale() LaunchedEffect(viewModel) { viewModel.eventFlow .filterIsInstance() - .onEach { delay(300.scaled(animationScale)) } .onEach { flowNavigator.navigateTo(SwapStep.PhantomConnect) }.launchIn(this) } + LaunchedEffect(viewModel) { + viewModel.eventFlow + .filterIsInstance() + .onEach { + navigator.push(AppRoute.Transfers.Deposit(Mint.usdf)) + }.launchIn(this) + } + LaunchedEffect(Unit) { coinbaseOnRampController.pendingNavigation.collect { route -> if (route is AppRoute.Token.TxProcessing) { diff --git a/apps/flipcash/shared/analytics/src/main/kotlin/com/flipcash/app/analytics/Actions.kt b/apps/flipcash/shared/analytics/src/main/kotlin/com/flipcash/app/analytics/Actions.kt index 27e6f6f4b..8a8580133 100644 --- a/apps/flipcash/shared/analytics/src/main/kotlin/com/flipcash/app/analytics/Actions.kt +++ b/apps/flipcash/shared/analytics/src/main/kotlin/com/flipcash/app/analytics/Actions.kt @@ -45,6 +45,10 @@ sealed interface Button: AppAction { override val value: String = "Button: Buy With Coinbase" } + data object TokenBuyWithOtherWallet : Button { + override val value: String = "Button: Buy With Other Wallet" + } + data object TokenSell : Button { override val value: String = "Button: Sell" } diff --git a/apps/flipcash/shared/tokens/src/main/kotlin/com/flipcash/app/tokens/ui/SwapViewModel.kt b/apps/flipcash/shared/tokens/src/main/kotlin/com/flipcash/app/tokens/ui/SwapViewModel.kt index c10dc51e7..68a7a1bf1 100644 --- a/apps/flipcash/shared/tokens/src/main/kotlin/com/flipcash/app/tokens/ui/SwapViewModel.kt +++ b/apps/flipcash/shared/tokens/src/main/kotlin/com/flipcash/app/tokens/ui/SwapViewModel.kt @@ -218,6 +218,7 @@ class SwapViewModel @Inject constructor( data class OnCurrencyChanged(val currency: Currency) : Event + data object OtherWalletSelected: Event data object CoinbaseSelected : Event data object PhantomSelected : Event data object ConfirmPhantomTransaction : Event @@ -547,6 +548,7 @@ class SwapViewModel @Inject constructor( val metadata = PurchaseMethodMetadata( mint = mint, purchaseAmount = Fiat(data.amountData.amount, rate.currency), + canUseOtherWallets = true, // allow external USDC deposit as a "purchase" option ) val methods = purchaseMethodController.state.value.availableMethods if (methods.size == 1) { @@ -833,7 +835,8 @@ class SwapViewModel @Inject constructor( } PurchaseMethod.OtherWallet -> { - // TODO: + analytics.buttonTapped(Button.TokenBuyWithOtherWallet) + dispatchEvent(Event.OtherWalletSelected) } } }.launchIn(viewModelScope) @@ -1166,6 +1169,7 @@ class SwapViewModel @Inject constructor( } } + Event.OtherWalletSelected, Event.ConfirmPhantomTransaction, Event.StartPhantomCeremony, Event.PhantomConnected,