Skip to content

feat(graphql): expose cashoutEnabled and bridgeEnabled in globals#429

Merged
islandbitcoin merged 1 commit into
mainfrom
feat/globals-cashout-bridge-flags
Jul 4, 2026
Merged

feat(graphql): expose cashoutEnabled and bridgeEnabled in globals#429
islandbitcoin merged 1 commit into
mainfrom
feat/globals-cashout-bridge-flags

Conversation

@islandbitcoin

Copy link
Copy Markdown
Contributor

Summary

  • Adds cashoutEnabled and bridgeEnabled to the public Globals GraphQL type, alongside the existing topupEnabled.
  • Values come from Cashout.Enabled (cashout.enabled yaml) and BridgeConfig.enabled (bridge.enabled yaml) — same config the server already enforces via checkBridgeEnabled / cashout guards.
  • Regenerated schema.graphql and supergraph.graphql via yarn write-sdl.

Why

The mobile app needs to hide/disable the Transfer entry points (home-screen button, top-up/settle options) when the topup/cashout/bridge flags are off on an instance (e.g. TEST cluster with all flags defaulted off per #425). Today only topupEnabled is queryable; cashout and bridge state are invisible to clients, so buttons show and then fail server-side.

Companion flash-mobile PR consumes these fields (link to follow).

Test plan

  • yarn write-sdl (includes full yarn build) passes; SDL/supergraph diffs are additive only.
  • Query { globals { topupEnabled cashoutEnabled bridgeEnabled } } on TEST after deploy and confirm values track the instance yaml flags.

🤖 Generated with Claude Code

The mobile app needs to know the instance-wide cashout and bridge flag
state to hide/disable transfer entry points, but globals only exposed
topupEnabled. Cashout.Enabled and BridgeConfig.enabled were config-only
and enforced server-side by erroring.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@islandbitcoin

Copy link
Copy Markdown
Contributor Author

Companion mobile PR: lnflash/flash-mobile#664

@islandbitcoin islandbitcoin merged commit a9d2910 into main Jul 4, 2026
14 checks passed
islandbitcoin added a commit to lnflash/flash-mobile that referenced this pull request Jul 4, 2026
…ridge flags (#664)

* feat(transfer): gate transfer entry points on backend topup/cashout/bridge 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>

* fix(test): mock @react-native-firebase/remote-config; reword comment 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>

---------

Co-authored-by: Dread <dread@example.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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.

2 participants