Skip to content

feat(topup): gate card + bank-transfer top-up behind topupEnabled#661

Closed
islandbitcoin wants to merge 1 commit into
feat/fygarofrom
feat/topup-enabled-mobile
Closed

feat(topup): gate card + bank-transfer top-up behind topupEnabled#661
islandbitcoin wants to merge 1 commit into
feat/fygarofrom
feat/topup-enabled-mobile

Conversation

@islandbitcoin

Copy link
Copy Markdown
Contributor

Summary

Consumes the new backend Globals.topupEnabled feature flag (lnflash/flash #421) to show/hide the two top-up entry points the mobile owns:

  • Credit card (Fygaro webview)
  • Bank transfer (handoff to support)

When topupEnabled is false, both are removed from the top-up options menu in TopupCashout. International bank top-up stays in place — it flows through the bridge and is gated server-side by bridge.enabled, so it's controlled independently.

This lets top-up be killed/enabled via backend YAML + rolling restart (the v0.6.0 KILL_MONEY SOP) with no app release.

Changes

File Change
app/screens/topup-cashout-flow/TopupCashout.tsx add query globals { globals { topupEnabled } }, consume via useGlobalsQuery (cache-and-network), conditionally include card + bank-transfer options
app/graphql/public-schema.graphql add Globals.topupEnabled: Boolean! (mirrors backend SDL)
app/graphql/generated.ts, generated.gql regenerated via yarn dev:codegen

Behavior

  • topupEnabled defaults to false client-side (?? false), so if the field/flag is missing or the backend is old, the card + bank entries are hidden (fail-safe).
  • Downstream TopupDetails → CardPayment/BankTransfer is only reachable through the gated menu, so no separate gating is needed there (verified: no other entry points navigate into those screens).

Verification

  • yarn tsc:check
  • yarn graphql-check ✅ (all documents valid)
  • eslint

Dependency / sequencing

Depends on backend #421 (Globals.topupEnabled) being merged + deployed. Until then topupEnabled resolves to false (entries hidden) — which is the intended default-OFF state anyway. Safe to merge in either order; the flag only does something once the backend serves it.

🤖 Generated with Claude Code

Consumes the new backend Globals.topupEnabled feature flag (lnflash/flash
#421) to show/hide the two top-up entry points the mobile owns:
- credit-card (Fygaro webview)
- bank-transfer-to-support

When topupEnabled is false, both are removed from the top-up options menu in
TopupCashout. International bank top-up is intentionally left in place — it
flows through the bridge and is gated server-side by the bridge feature flag.

- add `query globals { globals { topupEnabled } }` and consume via useGlobalsQuery
  (cache-and-network so a flag flip is picked up promptly)
- add Globals.topupEnabled to the committed public-schema.graphql
- regenerated generated.ts / generated.gql

Depends on backend #421 (Globals.topupEnabled) being deployed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Copy link
Copy Markdown
Contributor Author

Folded into #621 as commit baf575036.

#621 now consumes backend Globals.topupEnabled from flash#421, updates schema/codegen, and gates the card webview + local bank-transfer support top-up options. Closing this PR as superseded by #621.

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