Skip to content

Add CashApp as a buy bitcoin provider#765

Merged
erdemyerebasmaz merged 7 commits intomainfrom
feature/cashapp-buy-bitcoin-clean
Mar 26, 2026
Merged

Add CashApp as a buy bitcoin provider#765
erdemyerebasmaz merged 7 commits intomainfrom
feature/cashapp-buy-bitcoin-clean

Conversation

@erdemyerebasmaz
Copy link
Copy Markdown
Collaborator

Summary

  • Add CashApp as a second buy-bitcoin provider alongside MoonPay
  • Refactor BuyBitcoinRequest from a flat struct to a tagged union so each provider carries only its own parameters
  • Remove the BuyBitcoinProviderApi trait (single implementor) and use MoonpayProvider directly
  • CashApp builds a cash.app/launch/lightning/<bolt11> deep link from a Lightning invoice
  • CashApp is restricted to mainnet
  • Document platform-specific navigation guidance (pre-open pattern for PWA/mobile)

Changes

Commit Description
Add CashApp buy-bitcoin provider New cashapp.rs, remove trait, simplify MoonpayProvider
Refactor BuyBitcoinRequest to a tagged union Moonpay { locked_amount_sat, redirect_url } / CashApp { amount_sats }
Update WASM and Flutter bindings Expose tagged union to JS/TS and Flutter
Update Rust CLI Add --provider flag
Document CashApp provider Guide + 9 language snippets
Fix formatting and clippy warnings Lint fixes

CLI language ports are intentionally excluded — the Sync CLI workflow will handle them.

Original branch: feature/cashapp-buy-bitcoin

Introduce a CashApp provider that builds a cash.app/launch/lightning
deep link from a bolt11 invoice.

Remove the BuyBitcoinProviderApi trait (single implementor) and use
MoonpayProvider directly.  The CashApp flow is a plain function since
it has no server-side dependencies.
Replace the flat struct with a tagged enum so each provider carries
only its own parameters:

  BuyBitcoinRequest::Moonpay { locked_amount_sat, redirect_url }
  BuyBitcoinRequest::CashApp  { amount_sats }

Route buy_bitcoin through the selected variant: MoonPay uses an
on-chain deposit address, CashApp generates a bolt11 invoice and
wraps it in a deep link.  CashApp is restricted to mainnet.
Expose the new enum variants to JavaScript/TypeScript (wasm-bindgen)
and Flutter (flutter_rust_bridge).
Add --provider flag (moonpay/cashapp) and construct the matching
enum variant.
Add a CashApp section to the buy-bitcoin guide with platform-specific
navigation guidance (pre-open pattern for PWA/mobile).

Add CashApp code examples across all nine supported languages.
Update CLAUDE.md CLI modification policy to require fixing CI
failures with minimal changes. Fix language CLIs to use the new
tagged union BuyBitcoinRequest.Moonpay constructor.
@erdemyerebasmaz erdemyerebasmaz force-pushed the feature/cashapp-buy-bitcoin-clean branch from b286fdd to a041acc Compare March 26, 2026 19:45
@erdemyerebasmaz erdemyerebasmaz merged commit 2e4f457 into main Mar 26, 2026
22 of 24 checks passed
@erdemyerebasmaz erdemyerebasmaz deleted the feature/cashapp-buy-bitcoin-clean branch March 26, 2026 20:00
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