Skip to content

feat(wallet): wallet 3.0 cleanup — gating, coming soon, back nav, alias error - #70

Merged
MakelangelOO merged 11 commits into
developfrom
bqe-2713
Sep 25, 2026
Merged

MakelangelOO merged 11 commits into
developfrom
bqe-2713

Conversation

@MakelangelOO

Copy link
Copy Markdown
Collaborator

Why

The wallet exposed flows the backend can't serve yet (US rails, Plaid, USD movements, cards) and flows that fail without a virtual account. The back button on account detail looked dead, and an unknown alias in Bloque Friends surfaced the raw E_ALIAS_NOT_FOUND code.

Linear: https://linear.app/bloque/issue/BQE-2713/cambios-en-la-wallet-30

How it works

  • Account routes carry the navigation origin (from: home/profile/card, plus list), so back returns to where the user came from instead of bouncing through the single-account redirect on /accounts.
  • Layout routes (topup/route.tsx, send/route.tsx, breb-keys/route.tsx) wrap every child in RequireVirtualAccount, which only renders the flow once the user holds an active pocket. Direct URLs are covered.
  • useAccountPicker({ requireVirtualAccount: true }) restricts every product and money-movement picker to active pockets. With one pocket it is used by default; with several the user picks.
  • Coming-soon behavior is driven by flags in src/config/features.ts: US_RAILS_ENABLED, USD_MOVEMENTS_ENABLED, CARDS_ENABLED, all false.
  • API errors are matched by shape (status/code/message) rather than instanceof, and raw E_* codes never reach a toast.

Changes

  • Back button on account detail returns to home, profile or the pockets list.
  • Bloque Friends: readable message for an unknown alias, plus a source pocket picker.
  • US payins/payouts and Plaid marked coming soon (options, direct URLs); US section removed from legal fees.
  • Top-up, send and BRE-B require an active virtual account; home quick actions and add-product disabled until then.
  • New BRE-B keys and Plaid links anchored to a virtual account; a ledgerId from the URL is only honored if it's one of the user's pockets.
  • Money-movement pickers and BRE-B deposit keys limited to active pockets.
  • USD blocked in Bloque Friends (defaults to COP), own-account transfers and card preferred asset.
  • Cards section (tab, details, add-product option) marked coming soon.
  • New Mexico section with SPEI as a coming-soon method in send and top-up.
  • E2E coverage for each item; the card USD test is skipped while CARDS_ENABLED is false.

Dev requirements

  • bun install: the SDK must resolve to 0.13.3 per package.json overrides.
  • routeTree.gen.ts regenerated for the new layout routes.

Risk

  • Users with no active pocket lose access to top-up, send and BRE-B until they create one; a freshly created pocket unlocks them once its status becomes active (the gate polls every 3s while one is pending).
  • Existing cards are hidden behind the coming-soon screen while CARDS_ENABLED is false.
  • /convert is still reachable by direct URL (no UI entry point); left as is on purpose.

Carry origin (home/profile/card) and list flag through account routes;
back no longer bounces through the single-account redirect.
Alias lookup throws a 404 instead of resolving empty, so the not-found
branch never ran and the raw E_ALIAS_NOT_FOUND code reached the toast.
US options in send, top-up and add-product are disabled with a coming
soon badge; the US routes render a coming soon screen when opened
directly, and the US section is dropped from legal fees.
Top-up, send and BRE-B are gated by layout routes (direct URLs included),
home quick actions, card creation and add-product are disabled until the
user holds an active pocket.
Product pickers only offer active pockets; a single pocket is used by
default, several prompt a choice, and a ledgerId from the URL is only
honored when it belongs to one of the user's pockets.
Top-up destinations, send sources, BRE-B payout sources, own-account
transfer destinations and BRE-B deposit keys only consider active
pockets.
A single pocket is selected by default; with several, the user must
choose one before sending.
Bloque Friends defaults to COP with USD disabled, own-account transfers
are disabled while a USD balance is selected, and cards can't switch
their preferred asset to USD.
Card tab and card details render a coming soon screen (direct URLs
included) and the card option in add-product is disabled.
Send and top-up list a Mexico group with SPEI as a disabled, coming soon
method.
@linear

linear Bot commented Sep 25, 2026

Copy link
Copy Markdown

BQE-2713

@MakelangelOO
MakelangelOO merged commit 97a078f into develop Sep 25, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant