Fix MoonPay "Send with Edge" sell link#6056
Open
j0ntz wants to merge 1 commit into
Open
Conversation
Contributor
Author
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 676c146. Configure here.
MoonPay surfaces a "Send with Edge" button for pending sell orders (in their email and order-history page) that reflects back the deposit redirect URL our app hands them. That URL was RETURN_URL_PAYMENT = https://edge.app/redirect/payment/, but the apex edge.app host is NOT claimed as a universal link on iOS or Android (only deep.edge.app, dl, and return are), so the button dead-ended on a static redirect page and the user could not complete the deposit. The buy redirects already use deep.edge.app; only the sell payment redirect used the unclaimed apex. Point RETURN_URL_PAYMENT at the claimed deep.edge.app host (in-app webview interception is host-agnostic via startsWith, so it is unaffected) and parse the redirect/payment deep link into a new paymentRedirect link that opens the Send scene, resolving the wallet from the base currency code and pre-filling the deposit address, amount, and destination tag (needed for chains like XRP). Both the deep.edge.app and legacy edge.app hosts are parsed.
676c146 to
961a3fb
Compare
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.



CHANGELOG
Does this branch warrant an entry to the CHANGELOG?
Dependencies
none
Requirements
If you have made any visual changes to the GUI. Make sure you have:
Description
Asana task
Asana: https://app.asana.com/1/9976422036640/project/1207384676342554/task/1209649066660320
Fixes the MoonPay "Send with Edge" sell link. When a user starts a MoonPay sell order but has not completed the crypto deposit, MoonPay shows a "complete payment" button (in their email and in the
buy.moonpay.com/trade_historypage) that reflects back the deposit redirect URL our app hands MoonPay. That button dead-ended on a static "Redirecting to Payment..." page, so the user could not finish the deposit (the reported lead case is an XRP sell that also needs a destination tag).Root cause (regression analysis). The redirect URL we pass to MoonPay is
RETURN_URL_PAYMENTinsrc/plugins/gui/providers/common.ts. It has beenhttps://edge.app/redirect/payment/since it was introduced (Oct 2023); it was never adeep.edge.appvalue, so this is not a value regression. The apexedge.apphost is not claimed as a universal link on iOS (ios/edge/edge.entitlements) or Android (AndroidManifest.xml) - onlydeep.edge.app,dl.edge.app, andreturn.edge.appare. The constant was designed as an in-app webview interception sentinel (uri.startsWith(RETURN_URL_PAYMENT)), which works in-app but cannot open the app from an external click. The buy redirects already usedeep.edge.app; only the sell payment redirect used the unclaimed apex.Fix.
RETURN_URL_PAYMENTat the claimeddeep.edge.apphost, matching the buy redirects. In-app interception is host-agnostic (prefixstartsWith), so the existing webview flows (MoonPay and Paybis, ramp and legacy) are unaffected.redirect/paymentdeep link into a newpaymentRedirectlink type and route it to the Send scene, resolving the wallet from the base currency code and pre-filling the deposit address, amount, and destination tag/memo (viauniqueIdentifier). Both thedeep.edge.appand legacyedge.apphosts are parsed.No new user-facing strings; reuses the existing Send scene and wallet picker.
Testing.
deep.edge.apphost, and missing-param browser fallback).verify-repo.sh(eslint + jest) passes;tscclean.edge://redirect/payment/?baseCurrencyCode=btc&baseCurrencyAmount=0.001&depositWalletAddress=bc1q...opens the wallet picker (all BTC wallets) and then the Send scene pre-filled with the deposit address and 0.001 BTC. Screenshots below. The slider is not confirmed (no broadcast).Note
Medium Risk
Changes fiat sell completion URLs and deep-link routing into Send with user funds; scope is bounded by reusing existing Send/wallet picker and prefix-based in-app interception.
Overview
Fixes MoonPay "Send with Edge" sell completion links so external taps open Edge instead of a dead-end redirect page.
RETURN_URL_PAYMENTnow useshttps://deep.edge.app/redirect/payment/(claimed universal-link host) instead of the unclaimededge.appapex; in-app WebView interception viastartsWith(RETURN_URL_PAYMENT)is unchanged.Adds a
paymentRedirectdeep-link type:/redirect/payment/URLs (MoonPay query params:baseCurrencyCode,depositWalletAddress, optional amount anddepositWalletAddressTag) parse on bothdeep.edge.appand legacyedge.app. Missing required params degrade to noop (edge scheme) or browser (https apex). Handling resolves matching native/token assets, wallet picker, thenhandleWalletUrisinto Send with deposit address, amount, and memo/tag.Reviewed by Cursor Bugbot for commit 961a3fb. Bugbot is set up for automated code reviews on this repo. Configure here.