Skip to content

feat(transfer): gate transfer entry points on backend topup/cashout/bridge flags#664

Merged
islandbitcoin merged 2 commits into
mainfrom
feat/transfer-flag-gating
Jul 4, 2026
Merged

feat(transfer): gate transfer entry points on backend topup/cashout/bridge flags#664
islandbitcoin merged 2 commits into
mainfrom
feat/transfer-flag-gating

Conversation

@islandbitcoin

Copy link
Copy Markdown
Contributor

Summary

Depends on lnflash/flash#429 (exposes cashoutEnabled / bridgeEnabled in globals; must be deployed before these flags take effect — until then the fields must exist in the schema for the query to succeed).

  • New useTransferFlags hook — queries globals { topupEnabled cashoutEnabled bridgeEnabled } (cache-and-network). The backend flags are the source of truth; the Firebase remote-config bridgeTopupEnabled flag is kept ANDed in as a client-side kill switch for bridge.
  • Home screen — the Transfer button is now hidden when topup, cashout, and bridge are all off (previously it showed for any non-level-0 account regardless of flags).
  • Transfer screen
    • Top up button shows iff topupEnabled || bridgeEnabled (unchanged behavior, new flag source for bridge)
    • Settle button shows iff cashoutEnabled || bridgeEnabled (previously always shown)
    • JMD bank account option gated on cashoutEnabled (previously ungated)
    • Bridge options, KYC/external-account queries, and checkBridgeKyc gated on backend bridgeEnabled && Firebase kill switch (previously Firebase only)
  • Vendored public-schema.graphql updated with the two new Globals fields; codegen outputs regenerated.

Flag → UI matrix

topup cashout bridge Home Transfer btn Top up btn Settle btn
off off off hidden
on off off shown card + bank hidden
off on off shown hidden JMD only
off off on shown intl only intl only
on on on shown all all

Test plan

  • yarn check-code passes locally (tsc, translations, codegen drift, graphql-inspector).
  • On TEST after flash#429 deploys: toggle each yaml flag combination and verify the matrix above; pull-to-refresh on the Transfer screen re-reads flags.

🤖 Generated with Claude Code

…ridge flags

- New useTransferFlags hook queries globals { topupEnabled cashoutEnabled
  bridgeEnabled }; backend is the source of truth, with the Firebase
  bridgeTopupEnabled remote-config flag kept ANDed in as a client-side
  kill switch for bridge.
- Home screen: Transfer button hidden when all three flags are off.
- Transfer screen: Top up shows iff topup or bridge is enabled; Settle
  shows iff cashout or bridge is enabled; JMD bank option now gated on
  cashoutEnabled; bridge options and KYC/external-account queries gated
  on backend bridgeEnabled instead of Firebase alone.
- Vendored public-schema.graphql updated with the new Globals fields
  (backend PR: lnflash/flash#429); regenerated codegen outputs.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…for typos

use-transfer-flags exports through the @app/hooks barrel and imports
feature-flags-context, which calls getRemoteConfig() at module load —
six jest suites that reach the barrel died with 'Native module
RNFBAppModule not found'. Adds the missing remote-config auto-mock
alongside the existing analytics/crashlytics/messaging mocks.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@islandbitcoin islandbitcoin merged commit fa441c5 into main Jul 4, 2026
7 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