feat: add Cash App as Buy Bitcoin provider#154
Merged
erdemyerebasmaz merged 15 commits intomainfrom Mar 31, 2026
Merged
Conversation
Brand icons for the buy-bitcoin provider UI: MoonPay logo, CashApp dollar sign, Bitcoin symbol, EyeOff for visibility toggles.
Store an ordered list of enabled providers in localStorage. The list drives which providers appear in the buy dialog and in what order. Both MoonPay and CashApp are enabled by default.
Bottom sheet that lists enabled providers with brand icons. Selecting a provider calls the SDK and redirects the user to the provider's purchase page.
The Buy button now routes based on enabled providers: zero opens the providers page, one launches that provider directly (with a loading spinner), and two or more opens the selection dialog.
Dedicated settings page where users can enable, disable, and reorder buy-bitcoin providers. Changes save immediately to localStorage.
Add buyProviders screen to App, reachable from both the wallet (slides up) and settings (slides right). Replace inline provider toggles in SettingsPage with a navigation button under Display.
Add invisible placeholder controls to unselected currency rows so they match the height of selected rows with reorder buttons.
Pre-open a blank tab synchronously during the user gesture before the async SDK call. On mobile/PWA where the tab is blocked, fall back to same-tab navigation via location.href.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
82d8d68 to
a9bdab7
Compare
BuyBitcoinRequest changed from a flat struct to a tagged union (type: 'moonpay' | 'cashApp'). BuyBitcoinProvider is no longer exported by the SDK, so define it locally in settings.ts.
a9bdab7 to
7c563d9
Compare
The MoonPay flow lets users choose their amount in the provider UI — no locked amount is passed from the app side.
The provider list was captured once at mount time and became stale if the user changed settings in BuyProvidersPage. Use useMemo keyed on the dialog open state so settings are re-read each time.
CashApp is mainnet-only in the SDK. Filter it from the provider list in both the dialog and header fast-path so users never see it on regtest. Settings and ordering are unaffected on mainnet.
On non-mainnet networks, CashApp is hidden from the buy dialog but still appears in the provider settings page. Add a subtle note so users understand why it won't appear when buying.
Move filterProvidersByNetwork from BuyBitcoinDialog.tsx to settings.ts to fix fast-refresh warning (non-component export). Drop useMemo with unnecessary deps in WalletPage — the call is a cheap localStorage read, no memoization needed.
- Extract BottomSheetCardContext to its own file so BottomSheet.tsx and ui/index.tsx only export components (fast-refresh) - Add formatPaymentAmountRef to useCallback dependency array
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.
This PR adds support for buying Bitcoin via Cash App using Lightning.
Depends on