feat: deposit-first "Add Money" UX#1045
Open
bmc08gt wants to merge 13 commits into
Open
Conversation
…icon
Adds a Plain payment action variant rendering a plain Google Pay icon on the
purchase-method sheet, used by the deposit ("Add Money") flow.
Signed-off-by: Brandon McAnsh <git@bmcreations.dev>
… type Replaces AmountEntryStyle.actionLabel: String with a sealed AmountEntryLabel (Plain text, or Annotated for a composable label with inline content such as a wallet icon). Threads it through AmountEntryAction/Screen and updates all callers (cash, withdrawal, chat, swap). The swap buy-via-Phantom label uses the Annotated variant to render the Phantom icon. Signed-off-by: Brandon McAnsh <git@bmcreations.dev>
Renames the DepositFirstUX flag to AddMoneyUX and reframes getting funds into the app around "Add Money" (deposit into USDF reserves). Adds per-context "No Balance Yet" messaging, an "Adding Money" processing title, Phantom add-money copy, and routes Phantom deposits straight to the connect step. Threads the flag through balance/menu/chat/session/token-info and adds the swap-side add-money label + (still-empty) mustAddMoney branch. Signed-off-by: Brandon McAnsh <git@bmcreations.dev>
Adds !isAddingMoney guards so pinned Coinbase/Phantom "add money" purposes (mint = USDF) always take the pinned-method path instead of "buy directly" or the add-money re-route, which only apply to token buys funded from USDF reserves. Signed-off-by: Brandon McAnsh <git@bmcreations.dev>
Adds Event.PresentDepositOptions (presents the add-money/deposit sheet via purchaseMethodController.presentDepositOptions, or the USDC deposit flow when AddMoneyUX is off) and Event.OpenScreen, which SwapEntryScreen observes to navigate. Nothing dispatches PresentDepositOptions from the buy path yet. Signed-off-by: Brandon McAnsh <git@bmcreations.dev>
When a token buy exceeds available USDF reserves and deposit-first UX is on, the mustAddMoney branch now dispatches PresentDepositOptions to send the user to the add-money/deposit flow instead of doing nothing. Signed-off-by: Brandon McAnsh <git@bmcreations.dev>
… to VM Injects FeatureFlagController and adds OnIntroContinue (checks AddMoneyUX + USDF reserves; shows the "No Balance Yet" dialog routing to add-money, else emits AdvanceFromInfo), PresentDepositOptions, and OpenScreen events. Adds the featureflags module dependency. Screen wiring follows in a separate commit. Signed-off-by: Brandon McAnsh <git@bmcreations.dev>
Routes the intro "Get Started" button through the ViewModel: it dispatches OnIntroContinue, which shows the "No Balance Yet" add-money dialog when reserves are missing (deposit-first UX) or advances to name selection otherwise. The screen observes AdvanceFromInfo/OpenScreen to drive navigation. Signed-off-by: Brandon McAnsh <git@bmcreations.dev>
In the deposit-first "Add Money" via Phantom flow, navigate to the amount entry screen after connecting the wallet instead of the transaction confirmation gate. Confirming the entered amount now triggers the Phantom transaction request directly. Signed-off-by: Brandon McAnsh <git@bmcreations.dev>
Show "Add Money"/"Withdraw Money" tile labels when the AddMoneyUX flag is enabled, falling back to "Deposit"/"Withdraw" otherwise. Tighten the Phantom purchase-option button icon padding. Signed-off-by: Brandon McAnsh <git@bmcreations.dev>
hasGiveableBalance() now filters out USDF unless the GiveUsdf flag is enabled, so a USDF-only balance no longer counts as giveable. Re-evaluate the session's giveable state on GiveUsdf toggles, not just balance changes. Signed-off-by: Brandon McAnsh <git@bmcreations.dev>
Default Coinbase add-money purchases to USDC delivered to the owner's ATA, where UsdcDepositSweep converts it to USDF via the DepositSubmitted path. Parameterize purchaseCurrency on the order request and drop the region-based buy-options cache strategy. Signed-off-by: Brandon McAnsh <git@bmcreations.dev>
Email entry is always required for the Coinbase add-money flow, but the requireCoinbaseEmailVerification flag now only controls verification. When it is off, the entered email skips the server round-trip and is persisted locally on the profile as unverified, then used for the Coinbase order; when on, the existing server verification flow runs. The synthetic phone@flipcash.com fallback is removed. To support this, profile phone/email are modeled as VerifiableContactMethod (value + verified) with verifiedPhoneNumber/verifiedEmailAddress kept as derived accessors; ProfileController preserves locally-entered unverified contacts across refreshes; and the user profile screen surfaces unverified contacts with a verified/unverified status badge. Signed-off-by: Brandon McAnsh <git@bmcreations.dev>
3abc328 to
61b4789
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Reworks buying and funding into a deposit-first "Add Money" flow: instead of sending users straight into a token purchase, we gate on USDF reserves and route them to add money first (Phantom, Coinbase, or external USDC), then complete the action. Adds the Coinbase and Phantom rails to make that deposit real, plus supporting UX (menu labels, profile contact states) and a handful of related fixes.
Gated behind the existing
AddMoneyUX(deposit_first_ux_enabled) flag; the pre-flag paths are preserved.What's included
Add Money-first core
Payment rails
UsdcDepositSweep(deposit path).purchaseCurrencyis parameterized and the region buy-options cache strategy is removed.requireCoinbaseEmailVerificationflag controls only verification. When off, the entered email skips the server round-trip and is persisted locally on the profile as unverified; when on, the existing verification flow runs. The synthetic<phone>@flipcash.comfallback is removed.Supporting UX & fixes
AddMoneyUXis on.hasGiveableBalanceexcludes USDF unless theGiveUsdfflag is on (and re-evaluates on flag toggle).VerifiableContactMethod(value + verified), withverifiedPhoneNumber/verifiedEmailAddresskept as derived accessors. The user-profile screen now shows unverified phone/email with a verified/unverified status badge and an icon-only linked-for-payments indicator.Feature flags
AddMoneyUX(deposit_first_ux_enabled) — deposit-first behavior.GiveUsdf(give_usdf_enabled) — USDF counts as giveable.requireCoinbaseEmailVerification— Coinbase email verification (server) vs. local-only entry.Testing
services:flipcash,shared:profile,shared:persistence:{db,sources},shared:onramp:coinbase,shared:tokens, andfeatures:myaccount; app compiles.resolveEmail(flag on/off), local-unverified profile writes, the profile-refresh merge, and the profile-screen badges.Notes
requireCoinbaseEmailVerificationwhen issuing the Coinbase JWT (confirmed): with the flag off it accepts an unverified email.PhoneRegion/CoinbaseApi.getBuyOptionsremain in the tree but are now unused by production.