Repository navigation
Conversation
MoonPay persists the sell redirect URL and resurfaces it in its "Send with Edge" email and order-history button. The bare payment URL only carried a ticker in the query, which cannot tell Ethereum from Arbitrum or Base. Build a per-order URL with the provider id and the asset as path segments so the deep link identifies the network.
Move the networkCode to pluginId map and the contract lookup out of the ramp plugin into moonpayAssetUtils so other callers resolve a MoonPay currency to an Edge asset the same way. The legacy provider carried an identical copy of the map and now imports the shared one.
A payment redirect link now carries the provider and asset named in its path, plus the provider's transactionId from the query. All three are optional: links from older orders have no path segments, and a segment that is empty or badly percent-encoded is dropped instead of failing the link. Nothing reads the new fields yet.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
j0ntz
force-pushed
the
jon/moonpay-send-with-edge-pin-network
branch
from
October 2, 2026 22:07
a21d986 to
0fed003
Compare
A "Send with Edge" link is a URL anybody can write, and it names the currency by a ticker several networks share. The handler now treats the link as an order id only: it looks the sell order up with the MoonPay ramp plugin's configured API, resolves the one asset the order names, and takes the deposit address, tag and amount from that response. The wallet picker gets exactly that asset, replacing the scan for every wallet matching the ticker. An order that is no longer waiting for a deposit shows a message and opens no Send scene, and so does a lookup that fails or names an asset Edge cannot resolve. Handling the link logs Sell_Payment_Redirect with the provider and order status, and a completed send logs Sell_Success with the provider and order id.
j0ntz
force-pushed
the
jon/moonpay-send-with-edge-pin-network
branch
from
October 2, 2026 23:07
0fed003 to
9e249a3
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.
Description
MoonPay's "Send with Edge" sell link names the currency by a ticker that several networks share, and it carries the deposit address and amount in a URL anybody can write. The handler trusted all of it and offered every wallet with a matching ticker. An ETH-on-Arbitrum order could be paid from an Ethereum or Base wallet.
The link now only identifies the order. Edge looks the order up at MoonPay (
GET /v3/sell_transactions/{transactionId}) and takes the asset, deposit address, tag and amount from that response:networkCodeandcontractAddress. Only wallets on the order's network are listed.waitingForDeposit. A closed order shows "Sell Order Closed". An order that cannot be read (unknown id, network failure, no id on the link, unresolvable asset) shows "Unable to Verify Sell Order". Neither opens Send.New sell orders register a redirect URL that names the provider and asset,
https://deep.edge.app/redirect/payment/moonpay/<pluginId>[_<tokenId>]/, built bymakePaymentReturnUrl. The parser reads the optional provider, asset andtransactionId. Bare legacy links still parse and go through the same lookup.Analytics:
Sell_Payment_Redirectfires on every handled link with the provider, order id and order status.Sell_Successfires withfiatProviderIdandorderIdwhen the send completes.The MoonPay network-to-plugin map lives in
moonpayAssetUtils.ts, shared by the ramp plugin, the legacy provider and the order lookup.The Send scene opens with the wallet, address and amount tiles locked, because the order fixes all three.
The deposit is saved as a MoonPay sell, the same record the in-app sell flow writes:
assetActionsell plus asavedActionwith the order id, the receipt URL, MoonPay's display name and support email, and MoonPay's quote for the order (fiat amount and currency, marked as an estimate). An order with no quote gets no record and the send still goes out. Token sends also save the action on the transaction after broadcast, as the in-app flow does. The display name, support email and receipt URL builder now live inmoonpaySellOrder.tsand the ramp plugin imports them.Not in this PR: Paybis redirect handling.
Testing on the iOS simulator (frames below):
6ae325aa-d930-47cd-9ef0-d26e03b68f3c: "Sell Order Closed", no Send.Sell_Successwent out withfiatProviderId: moonpayand the order id.Unit tests cover the parser (
DeepLink.test.ts), the URL helper (common.test.ts), the lookup with mocked fetch, and the sell record builder including the missing-quote case (moonpaySellOrder.test.ts).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:
Test evidence
9e249a3Verify MoonPay order before opening Send
2026-10-02
🪓 HACK-NOTE: fetchMoonpaySellOrder returns a canned waitingForDeposit ETH-on-Arbitrum order (0.0001 ETH, quote 0.26 USD, or no quote for the -noquote id) paying the account's own Ethereum-wallet address, instead of calling MoonPay; reverted before commit
1. failed order closed no send
2. unknown order unverified no send
3. 🪓 open arbitrum order picker arbitrum only
5. in app sell moonpay widget opens with per order redirect
4. 🪓 open order send uses order address and amount
6. 🪓 open order send tiles locked after taps
7. 🪓 open order funded send ready
8. 🪓 open order send broadcast transaction success
10. 🪓 quoted order send ready
11. 🪓 quoted order details show moonpay sell
12. 🪓 quoted order details order id receipt support
13. 🪓 unquoted order send still opens